Skip to content

Commit

Permalink
Bench: 2818506
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonnold committed Nov 12, 2024
1 parent 9439b87 commit 863c085
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/history.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ void UpdateHistories(SearchStack* ss,
}
}

void UpdatePawnCorrection(int raw, int real, Board* board, ThreadData* thread) {
void UpdatePawnCorrection(int raw, int real, int depth, Board* board, ThreadData* thread) {
const int16_t correction = Min(30000, Max(-30000, (real - raw) * PAWN_CORRECTION_GRAIN));
const int idx = (board->pawnZobrist & PAWN_CORRECTION_MASK);
const int saveDepth = Min(16, depth);

thread->pawnCorrection[idx] = (thread->pawnCorrection[idx] * 255 + correction) / 256;
thread->pawnCorrection[idx] = (thread->pawnCorrection[idx] * (256 - saveDepth) + correction * saveDepth) / 256;
}
2 changes: 1 addition & 1 deletion src/history.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ void UpdateHistories(SearchStack* ss,
Move captures[],
int nC);

void UpdatePawnCorrection(int raw, int real, Board* board, ThreadData* thread);
void UpdatePawnCorrection(int raw, int real, int depth, Board* board, ThreadData* thread);

#endif
2 changes: 1 addition & 1 deletion src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ int Negamax(int alpha, int beta, int depth, int cutnode, ThreadData* thread, PV*
TTPut(tt, board->zobrist, depth, bestScore, bound, bestMove, ss->ply, rawEval, ttPv);

if (!inCheck && !IsCap(bestMove) && (bound & (bestScore >= rawEval ? BOUND_LOWER : BOUND_UPPER)))
UpdatePawnCorrection(rawEval, bestScore, board, thread);
UpdatePawnCorrection(rawEval, bestScore, depth, board, thread);

return bestScore;
}
Expand Down

0 comments on commit 863c085

Please sign in to comment.