Introduce futility pruning for captures
authorVizvezdenec <Vizvezdenec@gmail.com>
Tue, 28 Apr 2020 23:40:16 +0000 (02:40 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 29 Apr 2020 15:35:48 +0000 (17:35 +0200)
The idea is somewhat similar to futility pruning for quiet moves -
if a late enough capture doesn't give check and the static eval is
much lower than alpha we can almost safely assume that this capture
wouldn't be a good move.

passed STC
https://tests.stockfishchess.org/tests/view/5ea8544b53a4548a0348ee5b
LLR: 2.95 (-2.94,2.94) {-0.50,1.50}
Total: 236040 W: 44420 L: 43894 D: 147726
Ptnml(0-2): 3830, 27202, 55496, 27596, 3896

passed LTC
https://tests.stockfishchess.org/tests/view/5ea87c842141237a731f0c7d
LLR: 2.95 (-2.94,2.94) {0.25,1.75}
Total: 81336 W: 10429 L: 10028 D: 60879
Ptnml(0-2): 589, 7356, 24404, 7703, 616

closes https://github.com/official-stockfish/Stockfish/pull/2651

bench 4405247

src/search.cpp

index a3d4a329a1f7c4075f68e7e5261104d679cbbffc..55c520a4b0fcb65db715dbd65beea3fcedc6c08e 100644 (file)
@@ -1049,6 +1049,13 @@ moves_loop: // When in check, search starts from here
                   && captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] < 0)
                   continue;
 
+              // Futility pruning for captures
+              if (   !givesCheck
+                  && lmrDepth < 6
+                  && !ss->inCheck
+                  && ss->staticEval + 270 + 384 * lmrDepth + PieceValue[MG][type_of(pos.piece_on(to_sq(move)))] <= alpha)
+                  continue;
+
               // See based pruning
               if (!pos.see_ge(move, Value(-194) * depth)) // (~25 Elo)
                   continue;