From 02d7c6b08eec4e7dbf95360f7b0cca7a9cece445 Mon Sep 17 00:00:00 2001 From: Rak Laptudirm Date: Sun, 23 Jun 2024 01:00:45 +0530 Subject: [PATCH] chore: remove hard rollout bound since we have lru --- src/mcts/mod.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/mcts/mod.rs b/src/mcts/mod.rs index 1343eb0..be4c2dd 100644 --- a/src/mcts/mod.rs +++ b/src/mcts/mod.rs @@ -4,7 +4,6 @@ pub mod value; mod params; mod tree; -use std::mem; use std::time; pub use self::params::*; @@ -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::() { - break; - } + || self.rollouts >= maxnodes) + { + break; } }