]> git.sesse.net Git - stockfish/commitdiff
Do not return unproven mate scores from null move search
authorJoona Kiiski <joona.kiiski@gmail.com>
Sun, 21 Mar 2010 21:41:50 +0000 (23:41 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 22 Mar 2010 06:27:05 +0000 (07:27 +0100)
Causes very small functional change which is not observable with
our usual set of test positions.

However change is observable fx. with following position:
4k3/3r4/5Q2/6K1/8/8/8/8 w - - 0 1
go depth 24

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index f5552e7887dcd4e03a3a243a747193917e0cbece..67c98709521ae5d63707a56d39a2f63b2a010d41 100644 (file)
@@ -1378,6 +1378,10 @@ namespace {
 
         if (nullValue >= beta)
         {
+            // Do not return unproven mate scores
+            if (nullValue >= value_mate_in(PLY_MAX))
+                nullValue = beta;
+
             if (depth < 6 * OnePly)
                 return nullValue;