Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Average out fail highs in QS #544

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ EXE = berserk
SRC = attacks.c bench.c berserk.c bits.c board.c eval.c history.c move.c movegen.c movepick.c perft.c random.c \
search.c see.c tb.c thread.c transposition.c uci.c util.c zobrist.c nn/accumulator.c nn/evaluate.c pyrrhic/tbprobe.c
CC = clang
VERSION = 20240220
VERSION = 20240221
MAIN_NETWORK = berserk-da85741a5582.nn
EVALFILE = $(MAIN_NETWORK)
DEFS = -DVERSION=\"$(VERSION)\" -DEVALFILE=\"$(EVALFILE)\" -DNDEBUG
Expand Down
3 changes: 3 additions & 0 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,9 @@ int Quiesce(int alpha, int beta, int depth, ThreadData* thread, SearchStack* ss)
if (!legalMoves && inCheck)
return -CHECKMATE + ss->ply;

if (bestScore >= beta && abs(bestScore) < TB_WIN_BOUND)
bestScore = (bestScore + beta) / 2;

int bound = bestScore >= beta ? BOUND_LOWER : BOUND_UPPER;
TTPut(tt, board->zobrist, 0, bestScore, bound, bestMove, ss->ply, rawEval, ttPv);

Expand Down
Loading