From bcddd79056aae804787f84b3ecca87f78b576b7c Mon Sep 17 00:00:00 2001 From: Sam Roelants Date: Thu, 3 Oct 2024 22:44:26 +0200 Subject: [PATCH] SEE prune tacticals bench 6627328 --- simbelmyne/src/search/negamax.rs | 20 ++++++++++++-------- simbelmyne/src/search/params.rs | 3 +++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/simbelmyne/src/search/negamax.rs b/simbelmyne/src/search/negamax.rs index 840924a..c2292b1 100644 --- a/simbelmyne/src/search/negamax.rs +++ b/simbelmyne/src/search/negamax.rs @@ -384,17 +384,21 @@ impl<'a> SearchRunner<'a> { // //////////////////////////////////////////////////////////////////// - let see_margin = -see_quiet_margin() * depth as Score; - if legal_moves.stage() > Stage::GoodTacticals - // FIXME: Make this mv.is_quiet() at some point, but tweak the - // pruning margin - && mv.get_type() == MoveType::Quiet + && (mv.is_tactical() || mv.get_type() == MoveType::Quiet) && move_count > 0 && !in_root - && !best_score.is_mate() - && !pos.board.see(mv, see_margin) { - continue; + && !best_score.is_mate() { + + let margin = if mv.get_type() == MoveType::Quiet { + -see_quiet_margin() * depth as Score + } else { + -see_tactical_margin() * depth as Score + }; + + if !pos.board.see(mv, margin) { + continue; + } } //////////////////////////////////////////////////////////////////// diff --git a/simbelmyne/src/search/params.rs b/simbelmyne/src/search/params.rs index 6f614b7..4e64d60 100644 --- a/simbelmyne/src/search/params.rs +++ b/simbelmyne/src/search/params.rs @@ -143,6 +143,9 @@ pub mod tunable_params { #[uci(min = 0, max = 200, step = 10)] const SEE_QUIET_MARGIN: i32 = 40; + #[uci(min = 0, max = 200, step = 10)] + const SEE_TACTICAL_MARGIN: i32 = 100; + //////////////////////////////////////////////////////////////////////////// // // Singular extensions