Skip to content

Commit

Permalink
Bench: 3249278
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonnold committed Oct 21, 2023
1 parent 4b6b69b commit 1b882f9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void InitPruningAndReductionTables() {
LMP[1][depth] = 2.7002 + 0.9448 * depth * depth;

STATIC_PRUNE[0][depth] = -14.9419 * depth * depth; // quiet move cutoff
STATIC_PRUNE[1][depth] = -103.9379 * depth; // capture cutoff
STATIC_PRUNE[1][depth] = -103.9379 * depth; // capture cutoff
}
}

Expand Down Expand Up @@ -279,7 +279,7 @@ void Search(ThreadData* thread) {
if (thread->previousScore == UNKNOWN)
searchScoreDiff *= 2, prevScoreDiff = 0;

double scoreChangeFactor = 0.0995 + //
double scoreChangeFactor = 0.0995 + //
0.0286 * searchScoreDiff * (searchScoreDiff > 0) + //
0.0261 * prevScoreDiff * (prevScoreDiff > 0);
scoreChangeFactor = Max(0.4843, Min(1.4498, scoreChangeFactor));
Expand Down Expand Up @@ -655,13 +655,15 @@ int Negamax(int alpha, int beta, int depth, int cutnode, ThreadData* thread, PV*
// prevent dropping into QS, extending, or reducing all extensions
R = Min(depth - 1, Max(R, 1));

score = -Negamax(-alpha - 1, -alpha, newDepth - R, 1, thread, &childPv, ss + 1);
int lmrDepth = newDepth - R;
score = -Negamax(-alpha - 1, -alpha, lmrDepth, 1, thread, &childPv, ss + 1);

if (score > alpha && R > 1) {
newDepth += (score > bestScore + 76);
newDepth -= (score <= bestScore + 1);

score = -Negamax(-alpha - 1, -alpha, newDepth - 1, !cutnode, thread, &childPv, ss + 1);
if (newDepth - 1 > lmrDepth)
score = -Negamax(-alpha - 1, -alpha, newDepth - 1, !cutnode, thread, &childPv, ss + 1);
}
} else if (!isPV || playedMoves > 1) {
score = -Negamax(-alpha - 1, -alpha, newDepth - 1, !cutnode, thread, &childPv, ss + 1);
Expand Down

0 comments on commit 1b882f9

Please sign in to comment.