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

Enforce a maximum visit limit to avoid numeric overflow #562

Open
wants to merge 10 commits into
base: next
Choose a base branch
from
2 changes: 1 addition & 1 deletion src/UCTSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void UCTSearch::dump_analysis(int64_t elapsed, bool force_output) {
}

bool UCTSearch::is_running() const {
return m_run && m_nodes < MAX_TREE_SIZE;
return m_run && m_nodes < MAX_TREE_SIZE && m_root->get_visits() < MAXINT_DIV2;
}

int UCTSearch::est_playouts_left() const {
Expand Down