Skip to content

Commit

Permalink
Bench: 22535939
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Jan 1, 2025
1 parent 63987c2 commit e4f903e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ static int Quiescence(Thread *thread, Stack *ss, int alpha, int beta) {
Move bestMove = NOMOVE;
Move move;
while ((move = NextMove(&mp))) {
if (!MoveIsLegal(pos, move)) continue;

// Avoid pruning until at least one move avoids a terminal loss score
if (isLoss(bestScore)) goto search;
Expand All @@ -201,8 +202,6 @@ static int Quiescence(Thread *thread, Stack *ss, int alpha, int beta) {
ss->continuation = &thread->continuation[inCheck][moveIsCapture(move)][piece(move)][toSq(move)];
ss->contCorr = &thread->contCorrHistory[piece(move)][toSq(move)];

// Recursively search the positions after making the moves, skipping illegal ones
if (!MoveIsLegal(pos, move)) continue;
MakeMove(pos, move);
int score = -Quiescence(thread, ss+1, -beta, -alpha);
TakeMove(pos);
Expand Down Expand Up @@ -447,6 +446,7 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth
if (move == ss->excluded) continue;
if (root && AlreadySearchedMultiPV(thread, move)) continue;
if (root && NotInSearchMoves(Limits.searchmoves, move)) continue;
if (!MoveIsLegal(pos, move)) continue;

bool quiet = moveIsQuiet(move);

Expand Down Expand Up @@ -475,8 +475,6 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth
continue;
}

// Make the move, skipping to the next if illegal
if (!MoveIsLegal(pos, move)) continue;
MakeMove(pos, move);

moveCount++;
Expand Down

0 comments on commit e4f903e

Please sign in to comment.