X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=5165fd90ae949e17ade2e2d8453f552e16fc053c;hp=d360ad318325921e8e76f83f153caf3190c559fc;hb=8fec8834715a440ac18e24e130888c2c60bab352;hpb=44c320a572188b5875291103edb344c584b91d19 diff --git a/src/thread.cpp b/src/thread.cpp index d360ad31..5165fd90 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -52,6 +52,15 @@ Thread::~Thread() { 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 @@ -191,8 +200,8 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states, 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); }