Skip to content

Commit

Permalink
Don't allow depth reductions of less than 1
Browse files Browse the repository at this point in the history
Otherwise we might search the same depth indefinitely!
  • Loading branch information
jgilchrist committed Nov 21, 2024
1 parent 6d0fe0e commit b476142
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine/search/negamax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::engine::search::tables::lmr_table::lmr_reduction;
use crate::engine::search::time_control::TimeStrategy;
use crate::engine::search::transposition::{NodeBound, SearchTranspositionTableData};
use crate::engine::tablebases::Wdl;
use std::cmp::max;

pub struct DepthReduction(u8);

Expand All @@ -28,7 +29,7 @@ impl DepthReduction {

#[inline]
pub fn value(&self) -> u8 {
self.0
max(1, self.0)
}
}

Expand Down

0 comments on commit b476142

Please sign in to comment.