Skip to content

Commit

Permalink
chore: remove hard rollout bound since we have lru
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Jun 22, 2024
1 parent 0329a65 commit 02d7c6b
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/mcts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub mod value;
mod params;
mod tree;

use std::mem;
use std::time;

pub use self::params::*;
Expand Down Expand Up @@ -87,19 +86,12 @@ impl Searcher {
self.uci_report();
}

if self.rollouts & 127 == 0 {
if self.start.elapsed().as_millis() >= movetime
if self.rollouts & 127 == 0
&& (self.start.elapsed().as_millis() >= movetime
|| self.avgdepth >= maxdepth
|| self.rollouts >= maxnodes
{
break;
}

// Hard memory limit to prevent overuse.
// TODO: Fix this by removing old nodes and stuff.
if self.rollouts > 2_000_000_000 / mem::size_of::<Node>() {
break;
}
|| self.rollouts >= maxnodes)
{
break;
}
}

Expand Down

0 comments on commit 02d7c6b

Please sign in to comment.