From cf8b3637a0fe3a026a338cb9215283baffd3ded2 Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Fri, 4 Apr 2025 03:58:02 +0300 Subject: [PATCH] Improve futility pruning Adding a small term to the futility calculation that depends on eval - beta. Refactored to a simpler form. Passed STC: LLR: 2.93 (-2.94,2.94) <0.00,2.00> Total: 74176 W: 19323 L: 18954 D: 35899 Ptnml(0-2): 226, 8576, 19117, 8941, 228 https://tests.stockfishchess.org/tests/view/67e6b0946682f97da2178eaf Passed LTC: LLR: 2.96 (-2.94,2.94) <0.50,2.50> Total: 135090 W: 34499 L: 33983 D: 66608 Ptnml(0-2): 79, 14403, 38040, 14969, 54 https://tests.stockfishchess.org/tests/view/67e757cc6682f97da2178f62 closes https://github.com/official-stockfish/Stockfish/pull/5970 Bench: 1875196 --- src/search.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 1c3622884..7b8fbb144 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -855,7 +855,8 @@ Value Search::Worker::search( // The depth condition is important for mate finding. if (!ss->ttPv && depth < 14 && eval - futility_margin(depth, cutNode && !ss->ttHit, improving, opponentWorsening) - - (ss - 1)->statScore / 301 + 37 - std::abs(correctionValue) / 139878 + - (ss - 1)->statScore / 301 + 37 + ((eval - beta) / 8) + - std::abs(correctionValue) / 139878 >= beta && eval >= beta && (!ttData.move || ttCapture) && !is_loss(beta) && !is_win(eval)) return beta + (eval - beta) / 3;