Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Triple Extensions #5027

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,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 @@ -907,7 +907,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 @@ -1042,12 +1042,11 @@ Value Search::Worker::search(
if (value < singularBeta)
{
extension = 1;
singularQuietLMR = !ttCapture;

// 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 @@ -1098,7 +1097,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 @@ -1132,10 +1131,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
Loading