From ab26c61971c2f73d312b003e6d024373fbacf8e6 Mon Sep 17 00:00:00 2001 From: VoyagerOne Date: Mon, 3 Oct 2016 09:36:40 -0400 Subject: [PATCH] Allow inCheck pruning This is a bit tricky because we don't want to prune the only legal evasions, even if with negative SEE. So add an assert to avoid this subtle bug to slip in later. STC: LLR: 2.96 (-2.94,2.94) [0.00,4.00] Total: 14140 W: 2625 L: 2421 D: 9094 LTC: LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 11558 W: 1555 L: 1379 D: 8624 bench: 5256717 --- src/search.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 1d8139c4..64cdb325 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -919,7 +919,6 @@ moves_loop: // When in check search starts from here // Step 13. Pruning at shallow depth if ( !rootNode - && !inCheck && bestValue > VALUE_MATED_IN_MAX_PLY) { if ( !captureOrPromotion @@ -1121,6 +1120,9 @@ moves_loop: // When in check search starts from here // All legal moves have been searched and if there are no legal moves, it // must be a mate or a stalemate. If we are in a singular extension search then // return a fail low score. + + assert(moveCount || !inCheck || excludedMove || !MoveList(pos).size()); + if (!moveCount) bestValue = excludedMove ? alpha : inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()]; -- 2.39.2