Skip to content

Commit

Permalink
Bench: 23696279
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Feb 16, 2025
1 parent 8f61e65 commit 017480a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,26 +528,26 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth

Depth newDepth = depth - 1 + extension;

// Base reduction
int r = Reductions[quiet][MIN(31, depth)][MIN(31, moveCount)];
// Adjust reduction by move history
r -= ss->histScore / 8870;
// Reduce less in pv nodes
r -= pvNode;
// Reduce less when improving
r -= improving;
// Reduce quiets more if ttMove is a capture
r += moveIsCapture(ttMove);
// Reduce more when opponent has few pieces
r += pos->nonPawnCount[opponent] < 2;
// Reduce more in cut nodes
r += 2 * cutnode;

// Reduced depth zero-window search
if ( depth > 2
&& moveCount > MAX(1, pvNode + !ttMove + root + !quiet)
&& thread->doPruning) {

// Base reduction
int r = Reductions[quiet][MIN(31, depth)][MIN(31, moveCount)];
// Adjust reduction by move history
r -= ss->histScore / 8870;
// Reduce less in pv nodes
r -= pvNode;
// Reduce less when improving
r -= improving;
// Reduce quiets more if ttMove is a capture
r += moveIsCapture(ttMove);
// Reduce more when opponent has few pieces
r += pos->nonPawnCount[opponent] < 2;
// Reduce more in cut nodes
r += 2 * cutnode;

// Depth after reductions, avoiding going straight to quiescence as well as extending
Depth lmrDepth = CLAMP(newDepth - r, 1, newDepth);

Expand All @@ -569,7 +569,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth

// Full depth zero-window search
else if (!pvNode || moveCount > 1)
score = -AlphaBeta(thread, ss+1, -alpha-1, -alpha, newDepth, !cutnode);
score = -AlphaBeta(thread, ss+1, -alpha-1, -alpha, newDepth - (r > 3), !cutnode);

// Full depth alpha-beta window search
if (pvNode && (score > alpha || moveCount == 1))
Expand Down

0 comments on commit 017480a

Please sign in to comment.