From 0ac8aca893dd2052f8433e0b4a3d65073266b00f Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Thu, 25 Nov 2021 20:55:52 +0300 Subject: [PATCH] Use fraction of history heuristics in futility pruning This idea is somewhat of a respin of smth we had in futility pruning and that was simplified away - dependence of it not only on static evaluation of position but also on move history heuristics. Instead of aborting it when they are high there we use fraction of their sum to adjust static eval pruning criteria. passed STC https://tests.stockfishchess.org/tests/view/619bd438c0a4ea18ba95a27d LLR: 2.93 (-2.94,2.94) <0.00,2.50> Total: 113704 W: 29284 L: 28870 D: 55550 Ptnml(0-2): 357, 12884, 30044, 13122, 445 passed LTC https://tests.stockfishchess.org/tests/view/619cb8f0c0a4ea18ba95a334 LLR: 2.96 (-2.94,2.94) <0.50,3.00> Total: 147136 W: 37307 L: 36770 D: 73059 Ptnml(0-2): 107, 15279, 42265, 15804, 113 closes https://github.com/official-stockfish/Stockfish/pull/3805 bench 6777918 --- src/search.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 92ec9eca..12c89de4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1054,17 +1054,19 @@ moves_loop: // When in check, search starts here } else { + int history = (*contHist[0])[movedPiece][to_sq(move)] + + (*contHist[1])[movedPiece][to_sq(move)] + + (*contHist[3])[movedPiece][to_sq(move)]; + // Continuation history based pruning (~20 Elo) - if (lmrDepth < 5 - && (*contHist[0])[movedPiece][to_sq(move)] - + (*contHist[1])[movedPiece][to_sq(move)] - + (*contHist[3])[movedPiece][to_sq(move)] < -3000 * depth + 3000) + if ( lmrDepth < 5 + && history < -3000 * depth + 3000) continue; // Futility pruning: parent node (~5 Elo) if ( !ss->inCheck && lmrDepth < 8 - && ss->staticEval + 172 + 145 * lmrDepth <= alpha) + && ss->staticEval + 172 + 145 * lmrDepth + history / 256 <= alpha) continue; // Prune moves with negative SEE (~20 Elo) -- 2.39.2