]> git.sesse.net Git - stockfish/commitdiff
Use TT refined value to stand pat
authorLucas Braesch <lucas.braesch@gmail.com>
Mon, 7 Oct 2013 07:10:48 +0000 (09:10 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 8 Oct 2013 17:51:08 +0000 (19:51 +0200)
Passed both short TC:
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 17811 W: 3520 L: 3366 D: 10925

And long TC:
LLR: 2.95 (-2.94,2.94) [0.00,6.00]
Total: 30255 W: 5070 L: 4825 D: 20360

bench: 8340585

src/search.cpp

index e56b2c7f60e4839843cdd95ff04219e2c86b4d53..4683a006ffe42c93f613a384f83df61b26418bcf 100644 (file)
@@ -1188,6 +1188,11 @@ moves_loop: // When in check and at SpNode search starts from here
             if (  (ss->staticEval = bestValue = tte->eval_value()) == VALUE_NONE
                 ||(ss->evalMargin = tte->eval_margin()) == VALUE_NONE)
                 ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);
+
+            // Can ttValue be used as a better position evaluation?
+            if (ttValue != VALUE_NONE)
+                if (tte->bound() & (ttValue > bestValue ? BOUND_LOWER : BOUND_UPPER))
+                    bestValue = ttValue;
         }
         else
             ss->staticEval = bestValue = evaluate(pos, ss->evalMargin);
@@ -1205,7 +1210,7 @@ moves_loop: // When in check and at SpNode search starts from here
         if (PvNode && bestValue > alpha)
             alpha = bestValue;
 
-        futilityBase = ss->staticEval + ss->evalMargin + Value(128);
+        futilityBase = bestValue + ss->evalMargin + Value(128);
     }
 
     // Initialize a MovePicker object for the current position, and prepare