]> git.sesse.net Git - stockfish/commitdiff
Do not exit early even when seeing mate
authorJoona Kiiski <joona.kiiski@gmail.com>
Sat, 23 Jul 2011 21:18:28 +0000 (22:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 24 Jul 2011 05:13:29 +0000 (06:13 +0100)
Fixes the reported KNNK ending problem:

http://talkchess.com/forum/viewtopic.php?t=39347

Joona says:

Now I finally had a time to take a look at on this issue.

I've reproduced the problem starting from this position:
1B6/1B2k3/P7/1P3p2/1K6/8/4b3/4b3 w - - 6 85

I made Stockfish play as white and Fruit as black.
I repeated test ten times and once SF was not able to deliver mate.

But I observed several times that SF had reported on last something like mate in 10.
However next time it played move with score mate in 15.

Easiest way to solve the problem is attached as a patch. I tested it several times and SF always
ended up playing the optimal move. Of course the downside is that now delivering mate
takes a bit longer, but IMO it's better to lose once in a while by time in sudden death
game than not being able to deliver simple mate with long time controls.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

No differences found