Skip to content

Commit

Permalink
Bench: 2774822
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonnold committed Nov 14, 2024
1 parent 525dab9 commit 126a8c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ int Negamax(int alpha, int beta, int depth, int cutnode, ThreadData* thread, PV*
return (eval + beta) / 2;

// Razoring
if (depth <= 5 && eval + 214 * depth <= alpha) {
int razorMargin = 214 * depth;
if ((ss - 1)->move && !IsCap((ss - 1)->move))
razorMargin += Max(-213, HH(board->xstm, (ss - 1)->move, (ss - 1)->threats) / 64);

if (depth <= 5 && eval + razorMargin <= alpha) {
score = Quiesce(alpha, beta, 0, thread, ss);
if (score <= alpha)
return score;
Expand All @@ -536,6 +540,7 @@ int Negamax(int alpha, int beta, int depth, int cutnode, ThreadData* thread, PV*

TTPrefetch(KeyAfter(board, NULL_MOVE));
ss->move = NULL_MOVE;
ss->threats = board->threatened;
ss->ch = &thread->ch[0][WHITE_PAWN][A1];
MakeNullMove(board);

Expand Down Expand Up @@ -574,6 +579,7 @@ int Negamax(int alpha, int beta, int depth, int cutnode, ThreadData* thread, PV*

TTPrefetch(KeyAfter(board, move));
ss->move = move;
ss->threats = board->threatened;
ss->ch = &thread->ch[IsCap(move)][Moving(move)][To(move)];
MakeMove(move, board);

Expand Down Expand Up @@ -695,6 +701,7 @@ int Negamax(int alpha, int beta, int depth, int cutnode, ThreadData* thread, PV*

TTPrefetch(KeyAfter(board, move));
ss->move = move;
ss->threats = board->threatened;
ss->ch = &thread->ch[IsCap(move)][Moving(move)][To(move)];
MakeMove(move, board);

Expand Down Expand Up @@ -937,6 +944,7 @@ int Quiesce(int alpha, int beta, int depth, ThreadData* thread, SearchStack* ss)

TTPrefetch(KeyAfter(board, move));
ss->move = move;
ss->threats = board->threatened;
ss->ch = &thread->ch[IsCap(move)][Moving(move)][To(move)];
MakeMove(move, board);

Expand Down
1 change: 1 addition & 0 deletions src/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ typedef struct {
int ply, staticEval, de;
PieceTo* ch;
Move move, skip;
BitBoard threats;
Move killers[2];
} SearchStack;

Expand Down

0 comments on commit 126a8c7

Please sign in to comment.