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

Agressive increasing of lower bound. #3997

Closed
wants to merge 1 commit 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
10 changes: 8 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ namespace {
Key posKey;
Move ttMove, move, excludedMove, bestMove;
Depth extension, newDepth;
Value bestValue, value, ttValue, eval, maxValue, probCutBeta;
Value bestValue, value, ttValue, eval, maxValue, probCutBeta, initialAlpha;
bool givesCheck, improving, didLMR, priorCapture;
bool capture, doFullDepthSearch, moveCountPruning, ttCapture;
Piece movedPiece;
Expand All @@ -567,6 +567,7 @@ namespace {
moveCount = captureCount = quietCount = ss->moveCount = 0;
bestValue = -VALUE_INFINITE;
maxValue = VALUE_INFINITE;
initialAlpha = alpha;

// Check for the available remaining time
if (thisThread == Threads.main())
Expand Down Expand Up @@ -1296,7 +1297,12 @@ namespace {
update_pv(ss->pv, move, (ss+1)->pv);

if (PvNode && value < beta) // Update alpha! Always alpha < beta
alpha = value;
{
if (beta < VALUE_INFINITE && initialAlpha > -VALUE_INFINITE)
alpha = std::max(value, (beta - 1 + initialAlpha) / 2);
else
alpha = value;
}
else
{
assert(value >= beta); // Fail high
Expand Down