]> git.sesse.net Git - stockfish/commitdiff
Better document mate and stalemate detection
authorMarco Costalba <mcostalba@gmail.com>
Tue, 18 Oct 2011 10:24:47 +0000 (12:24 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 18 Oct 2011 19:01:21 +0000 (20:01 +0100)
In particular add that we can have an harmless false positive
in case StopRequest or thread.cutoff_occurred() are set.

Reported by David Lee.

No functional change.

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

index c163e8eac590cade95af87ccab64189b38c0a677..438a01be6c8ed7defbf765430f0404c3a0f37ca1 100644 (file)
@@ -1244,9 +1244,11 @@ split_point_start: // At split points actual search starts from here
     }
 
     // Step 20. Check for mate and stalemate
-    // All legal moves have been searched and if there are
-    // no legal moves, it must be mate or stalemate.
-    // If one move was excluded return fail low score.
+    // All legal moves have been searched and if there are no legal moves, it
+    // must be mate or stalemate. Note that we can have a false positive in
+    // case of StopRequest or thread.cutoff_occurred() are set, but this is
+    // harmless because return value is discarded anyhow in the parent nodes.
+    // If we are in a singular extension search then return a fail low score.
     if (!SpNode && !moveCount)
         return excludedMove ? oldAlpha : inCheck ? value_mated_in(ss->ply) : VALUE_DRAW;