From d3860f8d5efa4d9df726fa605b24689d6a829c7e Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Wed, 25 Jan 2023 08:12:40 +0300 Subject: [PATCH] Rebalance usage of history heuristics in pruning This patch has multiple effects: * history heuristics sum in futility pruning now can't exceed some negative value so futility pruning for moves with negative histories should become slightly less aggressive; * history heuristics are now used in SEE pruning for quiet moves; Passed STC: https://tests.stockfishchess.org/tests/view/63cde339c93e8828d0f02e3a LLR: 2.94 (-2.94,2.94) <0.00,2.00> Total: 88424 W: 23681 L: 23303 D: 41440 Ptnml(0-2): 258, 9559, 24219, 9899, 277 Passed LTC: https://tests.stockfishchess.org/tests/view/63ce9009c93e8828d0f04e4f LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 79536 W: 21223 L: 20843 D: 37470 Ptnml(0-2): 22, 7599, 24146, 7979, 22 closes https://github.com/official-stockfish/Stockfish/pull/4355 Bench: 4208265 --- src/search.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index b9ba3811..4b2deadd 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1026,12 +1026,17 @@ moves_loop: // When in check, search starts here history += 2 * thisThread->mainHistory[us][from_to(move)]; + lmrDepth += history / 7208; + lmrDepth = std::max(lmrDepth, -2); + // Futility pruning: parent node (~13 Elo) if ( !ss->inCheck && lmrDepth < 13 - && ss->staticEval + 103 + 136 * lmrDepth + history / 53 <= alpha) + && ss->staticEval + 103 + 136 * lmrDepth <= alpha) continue; + lmrDepth = std::max(lmrDepth, 0); + // Prune moves with negative SEE (~4 Elo) if (!pos.see_ge(move, Value(-25 * lmrDepth * lmrDepth - 16 * lmrDepth))) continue;