mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
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
This commit is contained in:
parent
d30994ecd5
commit
ee7a68ea5f
1 changed files with 2 additions and 1 deletions
|
@ -359,7 +359,8 @@ void MainThread::search() {
|
||||||
Thread* bestThread = this;
|
Thread* bestThread = this;
|
||||||
if ( !this->easyMovePlayed
|
if ( !this->easyMovePlayed
|
||||||
&& Options["MultiPV"] == 1
|
&& Options["MultiPV"] == 1
|
||||||
&& !Skill(Options["Skill Level"]).enabled())
|
&& !Skill(Options["Skill Level"]).enabled()
|
||||||
|
&& rootMoves[0].pv[0] != MOVE_NONE)
|
||||||
{
|
{
|
||||||
for (Thread* th : Threads)
|
for (Thread* th : Threads)
|
||||||
if ( th->completedDepth > bestThread->completedDepth
|
if ( th->completedDepth > bestThread->completedDepth
|
||||||
|
|
Loading…
Add table
Reference in a new issue