From b476142d52a54238a44bd5cad7b8c86641b087c3 Mon Sep 17 00:00:00 2001 From: Jonathan Gilchrist Date: Thu, 21 Nov 2024 10:13:57 +0000 Subject: [PATCH] Don't allow depth reductions of less than 1 Otherwise we might search the same depth indefinitely! --- src/engine/search/negamax.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/search/negamax.rs b/src/engine/search/negamax.rs index 0bf687f..99ce8e5 100644 --- a/src/engine/search/negamax.rs +++ b/src/engine/search/negamax.rs @@ -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); @@ -28,7 +29,7 @@ impl DepthReduction { #[inline] pub fn value(&self) -> u8 { - self.0 + max(1, self.0) } }