Skip to content

Commit

Permalink
Bench: 30658368
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Nov 19, 2023
1 parent b5bb91d commit ad97fb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 9 additions & 1 deletion src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 0 additions & 8 deletions src/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion src/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ad97fb1

Please sign in to comment.