]> git.sesse.net Git - stockfish/commitdiff
Refine stat based reductions
authorVizvezdenec <Vizvezdenec@gmail.com>
Sat, 9 Jan 2021 14:42:58 +0000 (17:42 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 11 Jan 2021 18:36:07 +0000 (19:36 +0100)
This patch separates stat based reductions for quiet moves in case of being in check and in case of not being in check.
We will be using sum of first continuation history and main history (similar to movepicker) instead of statScore for the first case.

passed STC
https://tests.stockfishchess.org/tests/view/5ff87b2f6019e097de3ef09b
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 63992 W: 5887 L: 5678 D: 52427
Ptnml(0-2): 201, 4561, 22305, 4686, 243

passed LTC
https://tests.stockfishchess.org/tests/view/5ff8b6206019e097de3ef0b2
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 81216 W: 3127 L: 2880 D: 75209
Ptnml(0-2): 46, 2544, 35176, 2801, 41

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

bench 4395984

src/search.cpp

index 3da3d04ea963e579b7d2c6154015eb7cc1a8ee19..7abffb8779dda1df915c660577a6ebd9330eb559 100644 (file)
@@ -1233,7 +1233,13 @@ moves_loop: // When in check, search starts from here
                   r++;
 
               // Decrease/increase reduction for moves with a good/bad history (~30 Elo)
-              r -= ss->statScore / 14884;
+              // If we are not in check use statScore, if we are in check 
+              // use sum of main history and first continuation history with an offset
+              if (ss->inCheck)
+                  r -= (thisThread->mainHistory[us][from_to(move)] 
+                     + (*contHist[0])[movedPiece][to_sq(move)] - 4333) / 16384;
+              else
+                  r -= ss->statScore / 14884;
           }
 
           Depth d = std::clamp(newDepth - r, 1, newDepth);