diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index e1e2469..db7c275 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -270,7 +270,6 @@ impl FutureMoves { fn set_root_idx_raw(&mut self, idx: usize) { self.update_root_idx_raw(idx); - self.prune_bad_children(); self.refocus_tree(); self.extend_layers(); self.compute_values(0..self.arena.len()); @@ -324,9 +323,16 @@ impl FutureMoves { const TOP_K_CHIL: usize = 2; // the lower the value, the more conservative - const UP_TO: usize = 4; + const UP_TO: usize = 5; + + // start pruning at X depth before self.max_depth + const START_PRUNING_AT_MINUS: usize = 2; + if self.max_depth > self.current_depth + START_PRUNING_AT_MINUS { + return; + } for (depth, indexes) in by_depth { + // TODO! maybe update by_depth every iteration or something? if depth > UP_TO { return; }