1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Better document mate and stalemate detection

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>
This commit is contained in:
Marco Costalba 2011-10-18 12:24:47 +02:00
parent e7cfe42d3f
commit 8f7d36a85d

View file

@ -1244,9 +1244,11 @@ split_point_start: // At split points actual search starts from here
} }
// Step 20. Check for mate and stalemate // Step 20. Check for mate and stalemate
// All legal moves have been searched and if there are // All legal moves have been searched and if there are no legal moves, it
// no legal moves, it must be mate or stalemate. // must be mate or stalemate. Note that we can have a false positive in
// If one move was excluded return fail low score. // 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) if (!SpNode && !moveCount)
return excludedMove ? oldAlpha : inCheck ? value_mated_in(ss->ply) : VALUE_DRAW; return excludedMove ? oldAlpha : inCheck ? value_mated_in(ss->ply) : VALUE_DRAW;