Skip to content

Commit

Permalink
fixing issue LeelaChessZero#2003
Browse files Browse the repository at this point in the history
-node_limit is set to 4000000000 in the case that params.nodes is not initialized. 
-node_limit is set to params.nodes if params.nodes is initialized as 0 or another int as value
  • Loading branch information
KarlKfoury authored Aug 29, 2024
1 parent 0c65aa6 commit b4bf17f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mcts/stoppers/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ void PopulateCommonUciStoppers(ChainedSearchStopper* stopper,

// "go nodes" stopper.
int64_t node_limit = 0;
if (params.nodes) {
if (params.nodes.has_value()) {
if (options.Get<bool>(kNodesAsPlayoutsId)) {
stopper->AddStopper(std::make_unique<PlayoutsStopper>(
*params.nodes, options.Get<float>(kSmartPruningFactorId) > 0.0f));
} else {
node_limit = *params.nodes;
node_limit = 4000000000;
}
}
// always limit nodes to avoid exceeding the limit 4000000000. That number is
Expand Down

0 comments on commit b4bf17f

Please sign in to comment.