]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Tweak Late Move Reduction at root
[stockfish] / src / thread.cpp
index d360ad318325921e8e76f83f153caf3190c559fc..5165fd90ae949e17ade2e2d8453f552e16fc053c 100644 (file)
@@ -52,6 +52,15 @@ Thread::~Thread() {
   stdThread.join();
 }
 
   stdThread.join();
 }
 
+/// Thread::bestMoveCount(Move move) return best move counter for the given root move
+
+int Thread::best_move_count(Move move) {
+
+  auto rm = std::find(rootMoves.begin() + pvIdx,
+                      rootMoves.begin() + pvLast, move);
+
+  return rm != rootMoves.begin() + pvLast ? rm->bestMoveCount : 0;
+}
 
 /// Thread::clear() reset histories, usually before a new game
 
 
 /// Thread::clear() reset histories, usually before a new game
 
@@ -191,8 +200,8 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states,
 
   for (Thread* th : *this)
   {
 
   for (Thread* th : *this)
   {
-      th->nodes = th->tbHits = th->nmpMinPly = 0;
-      th->completedDepth = DEPTH_ZERO;
+      th->shuffleExts = th->nodes = th->tbHits = th->nmpMinPly = 0;
+      th->rootDepth = th->completedDepth = DEPTH_ZERO;
       th->rootMoves = rootMoves;
       th->rootPos.set(pos.fen(), pos.is_chess960(), &setupStates->back(), th);
   }
       th->rootMoves = rootMoves;
       th->rootPos.set(pos.fen(), pos.is_chess960(), &setupStates->back(), th);
   }