]> git.sesse.net Git - stockfish/commitdiff
Fix Potential in TB cutoffs for NMP.
authorperegrineshahin <peregrineshahin@gmail.com>
Mon, 12 Jun 2023 09:57:41 +0000 (12:57 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 22 Jun 2023 08:26:17 +0000 (10:26 +0200)
Removes the second dependency on beta and caps the return value to VALUE_TB_WIN_IN_MAX_PLY - 1

Earlier tests:

STC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 193632 W: 51372 L: 51326 D: 90934
Ptnml(0-2): 447, 20111, 55687, 20091, 480
https://tests.stockfishchess.org/tests/view/6486ee4465ffe077ca125bc1

LTC:
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 331758 W: 89538 L: 89624 D: 152596
Ptnml(0-2): 114, 30121, 105516, 29993, 135
https://tests.stockfishchess.org/tests/view/6489401af42a44347ed7be42

updated constant:
LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 100260 W: 27143 L: 27017 D: 46100
Ptnml(0-2): 34, 8842, 32248, 8976, 30
https://tests.stockfishchess.org/tests/view/6492fcafdc7002ce609c818c

closes: https://github.com/official-stockfish/Stockfish/pull/4632
fixes: https://github.com/official-stockfish/Stockfish/issues/4598

bench: 2370027

src/search.cpp

index 9b686a529744e0be04ba65f7d06821b85d01052f..740ad71efee01461cc40b5992c757f2caa4db81e 100644 (file)
@@ -801,10 +801,9 @@ namespace {
         if (nullValue >= beta)
         {
             // Do not return unproven mate or TB scores
-            if (nullValue >= VALUE_TB_WIN_IN_MAX_PLY)
-                nullValue = beta;
+            nullValue = std::min(nullValue, VALUE_TB_WIN_IN_MAX_PLY-1);
 
-            if (thisThread->nmpMinPly || (abs(beta) < VALUE_KNOWN_WIN && depth < 14))
+            if (thisThread->nmpMinPly || depth < 14)
                 return nullValue;
 
             assert(!thisThread->nmpMinPly); // Recursive verification is not allowed