]> git.sesse.net Git - stockfish/commitdiff
Call TT.new_search() earlier.
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Tue, 6 Jun 2017 07:48:57 +0000 (09:48 +0200)
committerJoona Kiiski <joona@zoox.com>
Sat, 17 Jun 2017 02:20:01 +0000 (19:20 -0700)
TT.new_search() was being called by mainThread in Thread::search(). However, mainThread is the last to start searching, and helper threads could reach a measured rootDepth 10 (on 64 cores) before mainThread increments the TT generation. Fixed by moving the call to MaintThread::search() before helper threads start searching.

No functional change.

Closes #1134

src/search.cpp

index aafbf80f94aef804009883e41bbfc8d28b96c3b6..8f3c4552076e69951b1def82695fa7638ed54951 100644 (file)
@@ -244,6 +244,7 @@ void MainThread::search() {
 
   Color us = rootPos.side_to_move();
   Time.init(Limits, us, rootPos.game_ply());
+  TT.new_search();
 
   int contempt = Options["Contempt"] * PawnValueEg / 100; // From centipawns
   DrawValue[ us] = VALUE_DRAW - Value(contempt);
@@ -347,7 +348,6 @@ void Thread::search() {
       EasyMove.clear();
       mainThread->easyMovePlayed = mainThread->failedLow = false;
       mainThread->bestMoveChanges = 0;
-      TT.new_search();
   }
 
   size_t multiPV = Options["MultiPV"];