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

refactor prior reduction #5832

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ Value Search::Worker::search(
Value bestValue, value, eval, maxValue, probCutBeta;
bool givesCheck, improving, priorCapture, opponentWorsening;
bool capture, ttCapture;
int priorReduction = ss->reduction;
ss->reduction = 0;
int priorReduction = (ss-1)->reduction;
(ss-1)->reduction = 0;
Piece movedPiece;

ValueList<Move, 32> capturesSearched;
Expand Down Expand Up @@ -1194,10 +1194,10 @@ Value Search::Worker::search(
Depth d = std::max(
1, std::min(newDepth - r / 1024, newDepth + !allNode + (PvNode && !bestMove)));

(ss + 1)->reduction = newDepth - d;
ss->reduction = newDepth - d;

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


// Do a full-depth search when reduced LMR search fails high
Expand Down
Loading