Clear Workers after changing the network

ensures internal state (e.g. accumulator cache) is consistent with network

closes https://github.com/official-stockfish/Stockfish/pull/5204

No functional change
This commit is contained in:
Disservin
2024-05-05 12:30:28 +02:00
committed by Joost VandeVondele
parent be142337d8
commit be026bdcb2
2 changed files with 10 additions and 3 deletions
+3
View File
@@ -161,6 +161,9 @@ void ThreadPool::clear() {
for (Thread* th : threads)
th->worker->clear();
if (threads.size() == 0)
return;
main_manager()->callsCnt = 0;
main_manager()->bestPreviousScore = VALUE_INFINITE;
main_manager()->bestPreviousAverageScore = VALUE_INFINITE;