Skip to content

Commit e1f181e

Browse files
Vizvezdenecsnicolet
authored andcommitted
Do less LMR extensions
This patch restricts LMR extensions (of non-transposition table moves) from being used when the transposition table move was extended by two plies via singular extension. This may serve to limit search explosions in certain positions. This makes a lot of sense because the precondition for the tt-move to have been singular extended by two plies is that the result of the alternate search (with excluded the tt-move) has been a hard fail low: it is natural to later search less for non tt-moves in this situation. The current state of depth/extensions/reductions management is getting quite tricky in our search algo, see #3546 (comment) for some discussion. Suggestions welcome! Passed STC https://tests.stockfishchess.org/tests/view/60c3f293457376eb8bcaac8d LLR: 2.95 (-2.94,2.94) <-0.50,2.50> Total: 117984 W: 9698 L: 9430 D: 98856 Ptnml(0-2): 315, 7708, 42703, 7926, 340 passed LTC https://tests.stockfishchess.org/tests/view/60c46ea5457376eb8bcaacc7 LLR: 2.97 (-2.94,2.94) <0.50,3.50> Total: 11280 W: 401 L: 302 D: 10577 Ptnml(0-2): 2, 271, 4998, 364, 5 closes #3546 Bench: 4709974
1 parent 7819412 commit e1f181e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/search.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,7 @@ namespace {
954954

955955
value = bestValue;
956956
singularQuietLMR = moveCountPruning = false;
957+
bool doubleExtension = false;
957958

958959
// Indicate PvNodes that will probably fail low if the node was searched
959960
// at a depth equal or greater than the current depth, and the result of this search was a fail low.
@@ -1080,7 +1081,10 @@ namespace {
10801081
if ( !PvNode
10811082
&& value < singularBeta - 93
10821083
&& ss->doubleExtensions < 3)
1084+
{
10831085
extension = 2;
1086+
doubleExtension = true;
1087+
}
10841088
}
10851089

10861090
// Multi-cut pruning
@@ -1188,8 +1192,8 @@ namespace {
11881192

11891193
// In general we want to cap the LMR depth search at newDepth. But if
11901194
// reductions are really negative and movecount is low, we allow this move
1191-
// to be searched deeper than the first move.
1192-
Depth d = std::clamp(newDepth - r, 1, newDepth + (r < -1 && moveCount <= 5));
1195+
// to be searched deeper than the first move, unless ttMove was extended by 2.
1196+
Depth d = std::clamp(newDepth - r, 1, newDepth + (r < -1 && moveCount <= 5 && !doubleExtension));
11931197

11941198
value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, d, true);
11951199

0 commit comments

Comments
 (0)