]> git.sesse.net Git - stockfish/commitdiff
Update bestValue when futility pruning
authorMarco Costalba <mcostalba@gmail.com>
Mon, 26 Nov 2012 15:13:36 +0000 (16:13 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 26 Nov 2012 15:13:36 +0000 (16:13 +0100)
In qsearch we should update the bestValue as we do
in case of futilityValue < beta, also when pruning
moves with non-positive see.

Spotted by Lucas Braesch

Bench: 5695710

src/search.cpp

index 6d332c5ecc24fd867654679ae070267abf07d899..3116e80e8b6f2b7ba66eebab3282c59b79cd534c 100644 (file)
@@ -1217,9 +1217,7 @@ split_point_start: // At split points actual search starts from here
 
           if (futilityValue < beta)
           {
-              if (futilityValue > bestValue)
-                  bestValue = futilityValue;
-
+              bestValue = std::max(bestValue, futilityValue);
               continue;
           }
 
@@ -1227,7 +1225,10 @@ split_point_start: // At split points actual search starts from here
           if (   futilityBase < beta
               && depth < DEPTH_ZERO
               && pos.see(move) <= 0)
+          {
+              bestValue = std::max(bestValue, futilityBase);
               continue;
+          }
       }
 
       // Detect non-capture evasions that are candidate to be pruned