Skip to content

Commit 1c2b454

Browse files
committed
Don't update seldepth in qsearch, and added non sufficient material check in search
1 parent 0264086 commit 1c2b454

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/search.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ int qsearch(Bitboard &b, ThreadSearch *th, int depth, int alpha, int beta, int p
155155
#endif
156156

157157
th->nodes++; // update nodes searched
158-
th->seldepth = std::max(ply, th->seldepth); // update seldepth
159158

160159
// stop the search
161160
#ifndef TUNER
@@ -296,6 +295,14 @@ int pvSearch(Bitboard &b, ThreadSearch *th, int depth, int alpha, int beta, bool
296295

297296
th->seldepth = std::max(ply, th->seldepth); // update seldepth
298297

298+
// Check if there are any potential wins that don't require help mate.
299+
if (beta > 0 && b.noPotentialWin()) {
300+
if (alpha >= 0) {
301+
th->nodes++;
302+
return 0;
303+
}
304+
}
305+
299306
// Dive into Quiesence search
300307
if (depth <= 0) {
301308
return qsearch(b, th, depth - 1, alpha, beta, ply);

0 commit comments

Comments
 (0)