]> git.sesse.net Git - stockfish/commit
Fix last search info carried over to mate position
authorNiklas Fiekas <niklas.fiekas@backscattering.de>
Fri, 8 Apr 2016 15:20:47 +0000 (17:20 +0200)
committerJoona Kiiski <joona@zoox.com>
Sat, 16 Apr 2016 09:22:36 +0000 (10:22 +0100)
commitee7a68ea5fc07e331df462b10f35dc770e9409c5
tree5a92d5678cfe1120c4bcfd79b6d3833ed0880600
parentd30994ecd54bf96db88016fb6d92ff2c4614bc2e
Fix last search info carried over to mate position

When starting search in a mate or stalemate position, Stockfish does not
even care to reinitialize and start worker threads. However after search
all threads are checked for the best move.

This can lead to bestmove and info beeing carried over from the last
search.

Example session:

    setoption name threads value 7
    go movetime 4000
    position startpos moves f2f3 e7e5 g2g4 d8h4
    go movetime 4000

Actual output is like (almost always):

    [...]
    bestmove e2e4
    info depth 0 score mate 0
    info depth 20 seldepth 29 multipv 1 score cp 28 [...] pv e2e4
    bestmove e2e4

Expected output / output after fix:

    [...]
    bestmove e2e4 ponder e7e6
    info depth 0 score mate 0
    bestmove (none)

Resolves #623
src/search.cpp