From fb7d3ab32ebd7a6514bded459b4aa442276f6cda Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Sun, 19 Dec 2021 02:30:45 +0300 Subject: [PATCH] Reintroduce futility pruning for captures This is a reintroduction of an idea that was simplified away approximately 1 year ago. There are some tweaks to it : a) exclude promotions; b) exclude Pv Nodes from it - Pv Nodes logic for captures is really different from non Pv nodes so it makes a lot of sense; c) use a big grain of capture history - idea is taken from my recent patches in futility pruning. passed STC https://tests.stockfishchess.org/tests/view/61bd90f857a0d0f327c373b7 LLR: 2.96 (-2.94,2.94) <0.00,2.50> Total: 86640 W: 22474 L: 22110 D: 42056 Ptnml(0-2): 268, 9732, 22963, 10082, 275 passed LTC https://tests.stockfishchess.org/tests/view/61be094457a0d0f327c38aa3 LLR: 2.95 (-2.94,2.94) <0.50,3.00> Total: 23240 W: 6079 L: 5838 D: 11323 Ptnml(0-2): 14, 2261, 6824, 2512, 9 https://github.com/official-stockfish/Stockfish/pull/3864 bench 4493723 --- src/search.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index 8a4db351..d2ceee9f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1037,6 +1037,16 @@ moves_loop: // When in check, search starts here && captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] < 0) continue; + // Futility pruning for captures + if ( !pos.empty(to_sq(move)) + && !givesCheck + && !PvNode + && lmrDepth < 6 + && !ss->inCheck + && ss->staticEval + 342 + 238 * lmrDepth + PieceValue[EG][pos.piece_on(to_sq(move))] + + captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] / 8 < alpha) + continue; + // SEE based pruning if (!pos.see_ge(move, Value(-218) * depth)) // (~25 Elo) continue; -- 2.39.2