-
Notifications
You must be signed in to change notification settings - Fork 514
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
go nodes 0
does infinite search
#2003
Comments
Here seems to be the problem : In the file src/mcts/stoppers/stoppers.h
For some reason when limit = 0, nodes_limit is changed to 4000000000ll which makes |
This 4'000'000'000 was introduced to prevent number of nodes overflowing uint32 (e.g. in // common.cc // "go nodes" stopper.
int64_t node_limit = 0;
if (params.nodes) {
if (options.Get<bool>(kNodesAsPlayoutsId)) {
stopper->AddStopper(std::make_unique<PlayoutsStopper>(
*params.nodes, options.Get<float>(kSmartPruningFactorId) > 0.0f));
} else {
node_limit = *params.nodes;
}
}
// always limit nodes to avoid exceeding the limit 4000000000. That number is
// default when node_limit = 0.
stopper->AddStopper(std::make_unique<VisitsStopper>(
node_limit, options.Get<float>(kSmartPruningFactorId) > 0.0f));
Also I can see that you posted a snippet from |
Indeed i confused // src/mcts/stoppers/stoppers.h // Watches visits (total tree nodes) and predicts remaining visits.
class VisitsStopper : public SearchStopper {
public:
VisitsStopper(int64_t limit, bool populate_remaining_playouts)
: nodes_limit_(limit ? limit : 4000000000ll),
populate_remaining_playouts_(populate_remaining_playouts) {}
int64_t GetVisitsLimit() const { return nodes_limit_; }
bool ShouldStop(const IterationStats&, StoppersHints*) override;
private:
const int64_t nodes_limit_;
const bool populate_remaining_playouts_;
};
But how exactly is this preventing uint32 overflow ? Since a check on 0 doesn't mean it has overflowed for more than 0 ? Or am I missing something |
If the limit is set to 0, the |
It should stop immediately instead (or do one iteration when the tree is empty).
The text was updated successfully, but these errors were encountered: