X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=0c6cf8becbea5abd01e4918d2d3e4e60a317e6d4;hp=c63d2ec6d8b51141538bd9dc58d8ec1427f330f2;hb=01ebb3d99688cf4ac3d3b9b4ea95e8b431d0b8c1;hpb=285df57a9ae6e86bc957a4f43d74fb05fc8998d6 diff --git a/src/search.cpp b/src/search.cpp index c63d2ec6..0c6cf8be 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1687,10 +1687,14 @@ namespace { if (bestValue > alpha) alpha = bestValue; + // If we are near beta then try to get a cutoff pushing checks a bit further + bool deepChecks = depth == -OnePly && staticValue >= beta - PawnValueMidgame / 8; + // Initialize a MovePicker object for the current position, and prepare - // to search the moves. Because the depth is <= 0 here, only captures, - // queen promotions and checks (only if depth == 0) will be generated. - MovePicker mp = MovePicker(pos, ttMove, depth, H); + // to search the moves. Because the depth is <= 0 here, only captures, + // queen promotions and checks (only if depth == 0 or depth == -OnePly + // and we are near beta) will be generated. + MovePicker mp = MovePicker(pos, ttMove, deepChecks ? Depth(0) : depth, H); CheckInfo ci(pos); enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMidgame; futilityBase = staticValue + FutilityMarginQS + ei.futilityMargin;