mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Do not exit early even when seeing mate
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>
This commit is contained in:
parent
a1f9bf19d9
commit
a6fc3d6ee5
1 changed files with 0 additions and 6 deletions
|
@ -633,12 +633,6 @@ namespace {
|
||||||
// Check for some early stop condition
|
// Check for some early stop condition
|
||||||
if (!StopRequest && Limits.useTimeManagement())
|
if (!StopRequest && Limits.useTimeManagement())
|
||||||
{
|
{
|
||||||
// Stop search early when the last two iterations returned a mate score
|
|
||||||
if ( depth >= 5
|
|
||||||
&& abs(bestValues[depth]) >= VALUE_MATE_IN_PLY_MAX
|
|
||||||
&& abs(bestValues[depth - 1]) >= VALUE_MATE_IN_PLY_MAX)
|
|
||||||
StopRequest = true;
|
|
||||||
|
|
||||||
// Stop search early if one move seems to be much better than the
|
// Stop search early if one move seems to be much better than the
|
||||||
// others or if there is only a single legal move. Also in the latter
|
// others or if there is only a single legal move. Also in the latter
|
||||||
// case we search up to some depth anyway to get a proper score.
|
// case we search up to some depth anyway to get a proper score.
|
||||||
|
|
Loading…
Add table
Reference in a new issue