]> git.sesse.net Git - stockfish/commitdiff
Explicitly use alpha+1 for beta in NonPV search (#939)
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 25 Dec 2016 09:34:48 +0000 (10:34 +0100)
committerMarco Costalba <mcostalba@users.noreply.github.com>
Sun, 25 Dec 2016 09:34:48 +0000 (10:34 +0100)
Fixes the only exception, in razoring.

The code already does assert(PvNode || (alpha == beta - 1)), and it can be verified by studying the program flow that this is indeed the case, also for the modified line.

No functional change.

src/search.cpp

index a17a7506856bf82f36d5dbf47f3e55694e6fa22b..8089130e594c153a8f87955fde79f4a05dbff1ab 100644 (file)
@@ -721,7 +721,7 @@ namespace {
         &&  eval + razor_margin[depth / ONE_PLY] <= alpha)
     {
         if (depth <= ONE_PLY)
         &&  eval + razor_margin[depth / ONE_PLY] <= alpha)
     {
         if (depth <= ONE_PLY)
-            return qsearch<NonPV, false>(pos, ss, alpha, beta);
+            return qsearch<NonPV, false>(pos, ss, alpha, alpha+1);
 
         Value ralpha = alpha - razor_margin[depth / ONE_PLY];
         Value v = qsearch<NonPV, false>(pos, ss, ralpha, ralpha+1);
 
         Value ralpha = alpha - razor_margin[depth / ONE_PLY];
         Value v = qsearch<NonPV, false>(pos, ss, ralpha, ralpha+1);