Skip to content

Commit

Permalink
Refactor bestvalue adjustment in qsearch
Browse files Browse the repository at this point in the history
closes #4935

No functional change
  • Loading branch information
FauziAkram authored and Disservin committed Dec 30, 2023
1 parent f388e41 commit bab1cc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Expand Up @@ -72,7 +72,7 @@ Fabian Beuke (madnight)
Fabian Fichter (ianfab)
Fanael Linithien (Fanael)
fanon
Fauzi Akram Dabat (FauziAkram)
Fauzi Akram Dabat (fauzi2)
Felix Wittmann
gamander
Gabriele Lombardo (gabe)
Expand Down
4 changes: 2 additions & 2 deletions src/search.cpp
Expand Up @@ -1616,8 +1616,8 @@ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
return mated_in(ss->ply); // Plies to mate from the root
}

if (std::abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY)
bestValue = bestValue >= beta ? (3 * bestValue + beta) / 4 : bestValue;
if (std::abs(bestValue) < VALUE_TB_WIN_IN_MAX_PLY && bestValue >= beta)
bestValue = (3 * bestValue + beta) / 4;

// Save gathered info in transposition table
tte->save(posKey, value_to_tt(bestValue, ss->ply), pvHit,
Expand Down

0 comments on commit bab1cc3

Please sign in to comment.