Skip to content

Commit 7c5d724

Browse files
VoyagerOnemcostalba
authored andcommitted
Tweak check extension condition
There are two concepts with this patch: Limit check extensions by using move count. The idea is to limit search explosion. Always extend check if the first move gives check. The idea is to save expensive SEE calls, since the vast majority of first move will have SEE value >= 0, also first move may still be strong even if the SEE is negative. STC: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 16503 W: 3068 L: 2873 D: 10562 LTC: LLR: 2.97 (-2.94,2.94) [0.00,5.00] Total: 37202 W: 5261 L: 5014 D: 26927 bench: 8543366
1 parent 6fed8ff commit 7c5d724

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/search.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ namespace {
608608
Depth extension, newDepth, predictedDepth;
609609
Value bestValue, value, ttValue, eval, nullValue;
610610
bool ttHit, inCheck, givesCheck, singularExtensionNode, improving;
611-
bool captureOrPromotion, doFullDepthSearch;
611+
bool captureOrPromotion, doFullDepthSearch, moveCountPruning;
612612
Piece moved_piece;
613613
int moveCount, quietCount;
614614

@@ -919,8 +919,13 @@ namespace {
919919
? ci.checkSquares[type_of(pos.piece_on(from_sq(move)))] & to_sq(move)
920920
: pos.gives_check(move, ci);
921921

922+
moveCountPruning = depth < 16 * ONE_PLY
923+
&& moveCount >= FutilityMoveCounts[improving][depth];
924+
922925
// Step 12. Extend checks
923-
if (givesCheck && pos.see_sign(move) >= VALUE_ZERO)
926+
if ( givesCheck
927+
&& ( moveCount == 1
928+
|| (!moveCountPruning && pos.see_sign(move) >= VALUE_ZERO)))
924929
extension = ONE_PLY;
925930

926931
// Singular extension search. If all moves but one fail low on a search of
@@ -956,8 +961,7 @@ namespace {
956961
&& bestValue > VALUE_MATED_IN_MAX_PLY)
957962
{
958963
// Move count based pruning
959-
if ( depth < 16 * ONE_PLY
960-
&& moveCount >= FutilityMoveCounts[improving][depth])
964+
if (moveCountPruning)
961965
continue;
962966

963967
// Countermoves based pruning

0 commit comments

Comments
 (0)