X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=96b8442343ca7f484459d452f3fdba9d56d5e860;hp=7ba64c44337dbe3de43276342f89670d03ed64ba;hb=81cfd81366cf06dc403476a4782ef34703346c61;hpb=d844a75d2c12e4888443e47cb7b0effd78d81bb8 diff --git a/src/search.cpp b/src/search.cpp index 7ba64c44..96b84423 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1643,7 +1643,7 @@ namespace { StateInfo st; Move ttMove, move; Value staticValue, bestValue, value, futilityBase, futilityValue; - bool isCheck, enoughMaterial, moveIsCheck; + bool isCheck, enoughMaterial, moveIsCheck, evasionPrunable; const TTEntry* tte = NULL; int moveCount = 0; bool pvNode = (beta - alpha != 1); @@ -1744,8 +1744,15 @@ namespace { } } - // Don't search captures and checks with negative SEE values - if ( !isCheck + // Detect blocking evasions that are candidate to be pruned + evasionPrunable = isCheck + && bestValue != -VALUE_INFINITE + && !pos.move_is_capture(move) + && pos.type_of_piece_on(move_from(move)) != KING + && !pos.can_castle(pos.side_to_move()); + + // Don't search moves with negative SEE values + if ( (!isCheck || evasionPrunable) && move != ttMove && !move_is_promotion(move) && pos.see_sign(move) < 0)