Skip to content

Commit

Permalink
Introduce Triple Extensions
Browse files Browse the repository at this point in the history
This replaces singularquietLMR with triple instead of double extending non-capture ttmoves that have value far below singularBeta. This threshold value is initially set to 200, there is scope for more scaling by reducing it as occured with double extensions.

Passed STC:
https://tests.stockfishchess.org/tests/view/65b683b8c865510db0274074
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 222912 W: 58141 L: 57535 D: 107236
Ptnml(0-2): 1063, 26244, 56154, 27014, 981

Passed LTC:
https://tests.stockfishchess.org/tests/view/65bae6d4c865510db0278eb5
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 66306 W: 16825 L: 16440 D: 33041
Ptnml(0-2): 40, 7374, 17952, 7735, 52

closes official-stockfish#5027

bench 1394701
  • Loading branch information
Viren6 committed Feb 12, 2024
1 parent 781873c commit 32e99df
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ Value Search::Worker::search(
Move ttMove, move, excludedMove, bestMove;
Depth extension, newDepth;
Value bestValue, value, ttValue, eval, maxValue, probCutBeta;
bool givesCheck, improving, priorCapture, singularQuietLMR;
bool givesCheck, improving, priorCapture;
bool capture, moveCountPruning, ttCapture;
Piece movedPiece;
int moveCount, captureCount, quietCount;
Expand Down Expand Up @@ -900,7 +900,7 @@ Value Search::Worker::search(
contHist, &thisThread->pawnHistory, countermove, ss->killers);

value = bestValue;
moveCountPruning = singularQuietLMR = false;
moveCountPruning = false;

// Step 13. Loop through all pseudo-legal moves until no moves remain
// or a beta cutoff occurs.
Expand Down Expand Up @@ -1035,13 +1035,12 @@ Value Search::Worker::search(

if (value < singularBeta)
{
extension = 1;
singularQuietLMR = !ttCapture;
extension = 1;

// Avoid search explosion by limiting the number of double extensions
if (!PvNode && value < singularBeta - 2 && ss->doubleExtensions <= 12)
if (!PvNode && value < singularBeta - 2 && ss->doubleExtensions <= 15)
{
extension = 2;
extension = 2 + (value < singularBeta - 200 && !ttCapture);
depth += depth < 15;
}
}
Expand Down Expand Up @@ -1092,7 +1091,7 @@ Value Search::Worker::search(

// Add extension to new depth
newDepth += extension;
ss->doubleExtensions = (ss - 1)->doubleExtensions + (extension == 2);
ss->doubleExtensions = (ss - 1)->doubleExtensions + (extension >= 2);

// Speculative prefetch as early as possible
prefetch(tt.first_entry(pos.key_after(move)));
Expand Down Expand Up @@ -1126,10 +1125,6 @@ Value Search::Worker::search(
if (PvNode && tte->bound() != BOUND_UPPER)
r--;

// Decrease reduction if a quiet ttMove has been singularly extended (~1 Elo)
if (singularQuietLMR)
r--;

// Increase reduction on repetition (~1 Elo)
if (move == (ss - 4)->currentMove && pos.has_repeated())
r += 2;
Expand Down

0 comments on commit 32e99df

Please sign in to comment.