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 Quadruple Extensions #5211

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
22 changes: 9 additions & 13 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ Value Search::Worker::search(
bestMove = Move::none();
(ss + 2)->killers[0] = (ss + 2)->killers[1] = Move::none();
(ss + 2)->cutoffCnt = 0;
ss->multipleExtensions = (ss - 1)->multipleExtensions;
Square prevSq = ((ss - 1)->currentMove).is_ok() ? ((ss - 1)->currentMove).to_sq() : SQ_NONE;
ss->statScore = 0;

Expand Down Expand Up @@ -1049,17 +1048,15 @@ Value Search::Worker::search(

if (value < singularBeta)
{
extension = 1;

// We make sure to limit the extensions in some way to avoid a search explosion
if (!PvNode && ss->multipleExtensions <= 16)
{
extension = 2 + (value < singularBeta - 11 && !ttCapture);
depth += depth < 14;
}
if (PvNode && !ttCapture && ss->multipleExtensions <= 5
&& value < singularBeta - 38)
extension = 2;
int doubleMargin = 251 * PvNode - 241 * !ttCapture;
int tripleMargin = 135 + 234 * PvNode - 248 * !ttCapture + 124 * (ss->ttPv || !ttCapture);
int quadMargin = 447 + 354 * PvNode - 300 * !ttCapture + 206 * ss->ttPv;

extension = 1 + (value < singularBeta - doubleMargin)
+ (value < singularBeta - tripleMargin)
+ (value < singularBeta - quadMargin);

depth += ((!PvNode) && (depth < 14));
}

// Multi-cut pruning
Expand Down Expand Up @@ -1104,7 +1101,6 @@ Value Search::Worker::search(

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

// Speculative prefetch as early as possible
prefetch(tt.first_entry(pos.key_after(move)));
Expand Down
1 change: 0 additions & 1 deletion src/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ struct Stack {
bool inCheck;
bool ttPv;
bool ttHit;
int multipleExtensions;
int cutoffCnt;
};

Expand Down
Loading