Skip to content

Commit

Permalink
Bench: 25545602
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Dec 20, 2024
1 parent 1401211 commit f7d52ff
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 @@ -147,8 +147,9 @@ static int Quiescence(Thread *thread, Stack *ss, int alpha, int beta) {
eval = CorrectEval(thread, ss, eval, pos->rule50);

// Use ttScore as eval if it is more informative
if (abs(ttScore) < TBWIN_IN_MAX && TTScoreIsMoreInformative(ttBound, ttScore, eval))
eval = ttScore;
int nonTerminalScore = CLAMP(eval, -TBWIN_IN_MAX + 1, TBWIN_IN_MAX - 1);
if (TTScoreIsMoreInformative(ttBound, nonTerminalScore, eval))
eval = nonTerminalScore;

// If eval beats beta we assume some move will also beat it
if (eval >= beta)
Expand Down Expand Up @@ -337,8 +338,9 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth
ss->staticEval = eval = CorrectEval(thread, ss, eval, pos->rule50);

// Use ttScore as eval if it is more informative
if (abs(ttScore) < TBWIN_IN_MAX && TTScoreIsMoreInformative(ttBound, ttScore, eval))
eval = ttScore;
int nonTerminalScore = CLAMP(eval, -TBWIN_IN_MAX + 1, TBWIN_IN_MAX - 1);
if (TTScoreIsMoreInformative(ttBound, nonTerminalScore, eval))
eval = nonTerminalScore;

// Improving if not in check, and current eval is higher than 2 plies ago
bool improving = !inCheck && eval > (ss-2)->staticEval;
Expand Down

0 comments on commit f7d52ff

Please sign in to comment.