From ffedfa33542a7de7d87fd545ea0a4b2fef8f8c6e Mon Sep 17 00:00:00 2001 From: joergoster Date: Sun, 29 Jun 2014 20:17:40 +0100 Subject: [PATCH 1/1] Fix Singular extension condition to handle mate scores With Eelco's patch "Don't special case for abs(beta) >= VALUE_MATE_IN_MAX_PLY" condition "abs(ttValue) < VALUE_KNOWN_WIN" has been removed from singular extension search, and condition "abs(beta) < VALUE_KNOWN_WIN" was added to the SingularExtensionNode definition. This might lead to problems, especially in positions, where a mate is due. For example, this position 5rk1/4K1pp/8/5PPP/8/8/8/1R6 w - - 12 1 triggers an assert. stockfish: search.cpp:434: Value {anonymous}::search(Position&, Search::Stack*, Value, Value, Depth, bool) [with {anonymous}::NodeType NT = (::NodeType)2u; bool SpNode = false]: Assertion `-VALUE_INFINITE <= alpha && alpha < beta && beta <= VALUE_INFINITE' failed. So let's re-insert the removed condition. First spotted by Uri Blass, fix by me. Bench: 8759675 --- src/search.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 28fecf87..8f9a369a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -700,7 +700,8 @@ moves_loop: // When in check and at SpNode search starts from here && depth >= 8 * ONE_PLY && abs(beta) < VALUE_KNOWN_WIN && ttMove != MOVE_NONE - && ttValue != VALUE_NONE + /* && ttValue != VALUE_NONE Already implicit in the next condition */ + && abs(ttValue) < VALUE_KNOWN_WIN && !excludedMove // Recursive singular search is not allowed && (tte->bound() & BOUND_LOWER) && tte->depth() >= depth - 3 * ONE_PLY; -- 2.39.2