]> git.sesse.net Git - stockfish/commitdiff
Revert "Allowing singular extension in mate positions"
authorMarco Costalba <mcostalba@gmail.com>
Sat, 9 Mar 2019 12:24:26 +0000 (13:24 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 9 Mar 2019 12:28:11 +0000 (13:28 +0100)
It was causing an assert: value > -VALUE_INFINITE
under some conditions.

See https://github.com/official-stockfish/Stockfish/issues/2036

Bench: 3318033

src/search.cpp

index 31ae5377086cda0fa70a2514259e66037dd06303..9165468ae0590e82740f53c7296f7aef9f7ce643 100644 (file)
@@ -914,12 +914,13 @@ moves_loop: // When in check, search starts from here
           &&  move == ttMove
           && !rootNode
           && !excludedMove // Avoid recursive singular search
-          &&  ttValue != VALUE_NONE
+      /*  &&  ttValue != VALUE_NONE Already implicit in the next condition */
+          &&  abs(ttValue) < VALUE_KNOWN_WIN
           && (tte->bound() & BOUND_LOWER)
           &&  tte->depth() >= depth - 3 * ONE_PLY
           &&  pos.legal(move))
       {
-          Value singularBeta = std::max(ttValue - 2 * depth / ONE_PLY, -VALUE_MATE);
+          Value singularBeta = ttValue - 2 * depth / ONE_PLY;
           ss->excludedMove = move;
           value = search<NonPV>(pos, ss, singularBeta - 1, singularBeta, depth / 2, cutNode);
           ss->excludedMove = MOVE_NONE;