Skip to content

Commit

Permalink
Bench: 23633596
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Jan 1, 2025
1 parent c9615ab commit ebda315
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool MoveIsLegal(const Position *pos, const Move move) {
Square from = fromSq(move);
Square to = toSq(move);

Square kingSq = PieceTypeOf(pieceOn(from)) == KING ? to : (Square)Lsb(colorPieceBB(color, KING));
Square kingSq = PieceTypeOf(pieceOn(from)) == KING ? to : (Square)kingSq(color);

Bitboard occ = (pieceBB(ALL) ^ BB(from)) | BB(to);
Bitboard exclude = BB(to);
Expand Down
10 changes: 2 additions & 8 deletions src/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth
continue;
}

MakeMove(pos, move);

moveCount++;

// Extension
Expand All @@ -494,9 +492,6 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth
&& ttBound != BOUND_UPPER
&& !isTerminal(ttScore)) {

// ttMove has been made to check legality
TakeMove(pos);

// Search to reduced depth with a zero window a bit lower than ttScore
int singularBeta = ttScore - depth * (2 - pvNode);
ss->excluded = move;
Expand All @@ -514,9 +509,6 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth
// Negative extension - not singular but likely still good enough to beat beta
else if (ttScore >= beta)
extension = -1;

// Replay ttMove
MakeMove(pos, move);
}

// Extend when in check
Expand All @@ -525,6 +517,8 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth

skip_extensions:

MakeMove(pos, move);

ss->move = move;
ss->doubleExtensions = (ss-1)->doubleExtensions + (extension == 2);
ss->continuation = &thread->continuation[inCheck][moveIsCapture(move)][piece(move)][toSq(move)];
Expand Down

0 comments on commit ebda315

Please sign in to comment.