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

Break from aspiration window loop when Signals.stop is true only after outputting pv info dump #20

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/search.cpp
Expand Up @@ -416,17 +416,17 @@ namespace {
for (size_t i = 0; i <= PVIdx; i++) for (size_t i = 0; i <= PVIdx; i++)
RootMoves[i].insert_pv_in_tt(pos); RootMoves[i].insert_pv_in_tt(pos);


// Send full PV info to GUI if we are going to leave the loop or
// if we have a fail high/low and we are deep in the search.
if ((bestValue > alpha && bestValue < beta) || SearchTime.elapsed() > 2000)
cout << uci_pv(pos, depth, alpha, beta) << endl;

// If search has been stopped exit the aspiration window loop. // If search has been stopped exit the aspiration window loop.
// Sorting and writing PV back to TT is safe becuase RootMoves // Sorting and writing PV back to TT is safe becuase RootMoves
// is still valid, although refers to previous iteration. // is still valid, although refers to previous iteration.
if (Signals.stop) if (Signals.stop)
break; break;


// Send full PV info to GUI if we are going to leave the loop or
// if we have a fail high/low and we are deep in the search.
if ((bestValue > alpha && bestValue < beta) || SearchTime.elapsed() > 2000)
cout << uci_pv(pos, depth, alpha, beta) << endl;

// In case of failing high/low increase aspiration window and // In case of failing high/low increase aspiration window and
// research, otherwise exit the fail high/low loop. // research, otherwise exit the fail high/low loop.
if (bestValue >= beta) if (bestValue >= beta)
Expand Down