]> git.sesse.net Git - stockfish/commitdiff
Increase reduction for captures.
authorVizvezdenec <Vizvezdenec@gmail.com>
Thu, 2 Apr 2020 03:33:53 +0000 (06:33 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 2 Apr 2020 13:11:16 +0000 (15:11 +0200)
The idea behind this patch is that if static eval is really bad so capturing of current piece on spot will still produce a position with an eval much lower than alpha then our best chance is to create some kind of king attack. So captures without check are mostly worse than captures with check and can be reduced more.

passed STC
https://tests.stockfishchess.org/tests/view/5e8514b44411759d9d098543
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 46196 W: 9039 L: 8781 D: 28376
Ptnml(0-2): 750, 5412, 10628, 5446, 862

passed LTC
https://tests.stockfishchess.org/tests/view/5e8530134411759d9d09854c
LLR: 2.94 (-2.94,2.94) {0.25,1.75}
Total: 23462 W: 3228 L: 2988 D: 17246
Ptnml(0-2): 186, 2125, 6849, 2405, 166

close https://github.com/official-stockfish/Stockfish/pull/2612

bench 4742598

src/search.cpp

index ad5b364d41d780db779c6b2ce88fa7524987acad..eb30d9fac8cd50c9cfc72ec1309e30a014579376 100644 (file)
@@ -1189,10 +1189,17 @@ moves_loop: // When in check, search starts from here
               // Decrease/increase reduction for moves with a good/bad history (~30 Elo)
               r -= ss->statScore / 16434;
           }
-
-          // Increase reduction for captures/promotions if late move and at low depth
-          else if (depth < 8 && moveCount > 2)
-              r++;
+          else
+          {
+            // Increase reduction for captures/promotions if late move and at low depth
+            if (depth < 8 && moveCount > 2)
+                r++;
+
+            // Unless giving check, this capture is likely bad
+            if (   !givesCheck
+                && ss->staticEval + PieceValue[EG][pos.captured_piece()] + 200 * depth <= alpha)
+                r++;
+          }
 
           Depth d = Utility::clamp(newDepth - r, 1, newDepth);