diff --git a/src/search.c b/src/search.c index 02ae0195..7eadc814 100644 --- a/src/search.c +++ b/src/search.c @@ -51,6 +51,14 @@ CONSTR(1) InitReductions() { Reductions[1][depth][moves] = 1.35 + log(depth) * log(moves) / 2.75; // quiet } +// Checks whether a move was already searched in multi-pv mode +static bool AlreadySearchedMultiPV(Thread *thread, Move move) { + for (int i = 0; i < thread->multiPV; ++i) + if (thread->rootMoves[i].move == move) + return true; + return false; +} + // Small positive score with some random variance static int DrawScore(Position *pos) { return 8 - (pos->nodes & 0x7); @@ -640,7 +648,7 @@ static void *IterativeDeepening(void *voidThread) { // Jump here and return if we run out of allocated time mid-search if (setjmp(thread->jumpBuffer)) break; - // Search position, using aspiration windows for higher depths + // Search the position, once for each multi-pv for (thread->multiPV = 0; thread->multiPV < multiPV; ++thread->multiPV) AspirationWindow(thread, ss); diff --git a/src/threads.c b/src/threads.c index aa684ee0..bb301643 100644 --- a/src/threads.c +++ b/src/threads.c @@ -50,14 +50,6 @@ void InitThreads(int count) { threads[i].count = count; } -// Checks whether a move was already searched in multi-pv mode -bool AlreadySearchedMultiPV(Thread *thread, Move move) { - for (int i = 0; i < thread->multiPV; ++i) - if (thread->rootMoves[i].move == move) - return true; - return false; -} - // Sorts all rootmoves searched by multiPV void SortRootMoves(Thread *thread, int multiPV) { for (int i = 0; i < multiPV; ++i) { diff --git a/src/threads.h b/src/threads.h index 26b7395e..62410989 100644 --- a/src/threads.h +++ b/src/threads.h @@ -81,7 +81,6 @@ extern Thread *threads; void InitThreads(int threadCount); -bool AlreadySearchedMultiPV(Thread *thread, Move move); void SortRootMoves(Thread *thread, int multiPV); uint64_t TotalNodes(); uint64_t TotalTBHits();