]> git.sesse.net Git - stockfish/commitdiff
Revert "Adjust stand pat in qsearch on pv nodes"
authorDisservin <disservin.social@gmail.com>
Fri, 22 Dec 2023 10:46:28 +0000 (11:46 +0100)
committerDisservin <disservin.social@gmail.com>
Fri, 22 Dec 2023 10:48:43 +0000 (11:48 +0100)
This reverts commit d9ec82e7438716671168d78eee26fae327249e8c.

Bench: 1249544

src/search.cpp

index fad43b624dc86009fa8980d24981a6bb9c25c5e0..235b35c19d8dcc8753bb11b0fe6beb6b13082ab9 100644 (file)
@@ -1468,19 +1468,14 @@ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
             ss->staticEval = bestValue =
               (ss - 1)->currentMove != MOVE_NULL ? evaluate(pos) : -(ss - 1)->staticEval;
 
-        // Stand pat. Return immediately if bestValue is at least beta at non-Pv nodes.
-        // At PvNodes set bestValue between alpha and beta instead
+        // Stand pat. Return immediately if static value is at least beta
         if (bestValue >= beta)
         {
-            if (!PvNode || abs(bestValue) >= VALUE_TB_WIN_IN_MAX_PLY)
-            {
-                if (!ss->ttHit)
-                    tte->save(posKey, value_to_tt(bestValue, ss->ply), false, BOUND_LOWER,
-                              DEPTH_NONE, MOVE_NONE, ss->staticEval);
+            if (!ss->ttHit)
+                tte->save(posKey, value_to_tt(bestValue, ss->ply), false, BOUND_LOWER, DEPTH_NONE,
+                          MOVE_NONE, ss->staticEval);
 
-                return bestValue;
-            }
-            bestValue = std::min((alpha + beta) / 2, beta - 1);
+            return bestValue;
         }
 
         if (bestValue > alpha)