X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=53811de04701c4705053dc0d3ed1e52049db0aed;hp=719fc0eac47fc9ac3ccbcf7dc75071670f9fa10b;hb=c1ea5ed6f7204afd6cb03a80ca8d124bd82cc40d;hpb=5a5dc6fa109990920560ca9bed8cf7be34f2eba1 diff --git a/src/search.cpp b/src/search.cpp index 719fc0ea..53811de0 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1048,7 +1048,7 @@ namespace { EvalInfo ei; if (ply >= PLY_MAX - 1) - return evaluate(pos, ei, threadID); + return pos.is_check() ? quick_evaluate(pos) : evaluate(pos, ei, threadID); // Mate distance pruning Value oldAlpha = alpha; @@ -1238,7 +1238,7 @@ namespace { EvalInfo ei; if (ply >= PLY_MAX - 1) - return evaluate(pos, ei, threadID); + return pos.is_check() ? quick_evaluate(pos) : evaluate(pos, ei, threadID); // Mate distance pruning if (value_mated_in(ply) >= beta) @@ -1369,7 +1369,8 @@ namespace { { // History pruning. See ok_to_prune() definition if ( moveCount >= 2 + int(depth) - && ok_to_prune(pos, move, ss[ply].threatMove, depth)) + && ok_to_prune(pos, move, ss[ply].threatMove, depth) + && bestValue > value_mated_in(PLY_MAX)) continue; // Value based pruning @@ -1529,8 +1530,8 @@ namespace { else staticValue = evaluate(pos, ei, threadID); - if (ply == PLY_MAX - 1) - return evaluate(pos, ei, threadID); + if (ply >= PLY_MAX - 1) + return pos.is_check() ? quick_evaluate(pos) : evaluate(pos, ei, threadID); // Initialize "stand pat score", and return it immediately if it is // at least beta.