Skip to content

Commit

Permalink
Bench: 29906701
Browse files Browse the repository at this point in the history
  • Loading branch information
TerjeKir committed Feb 9, 2025
1 parent e3bf1e5 commit 54285bb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/movepicker.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,22 @@ static void SortMoves(MoveList *list, int threshold) {
static void ScoreMoves(MovePicker *mp, const int stage) {

const Thread *thread = mp->thread;
const Position *pos = &thread->pos;

MoveList *list = &mp->list;

for (int i = list->next; i < list->count; ++i) {
Move move = list->moves[i].move;
list->moves[i].score =
stage == GEN_QUIET ? GetQuietHistory(thread, mp->ss, move)
: GetCaptureHistory(thread, move) + PieceValue[MG][capturing(move)];
if (stage == GEN_NOISY) {
list->moves[i].score = GetCaptureHistory(thread, move) + PieceValue[MG][capturing(move)];
} else {
list->moves[i].score = GetQuietHistory(thread, mp->ss, move);

Bitboard threatenedByPawn = PawnBBAttackBB(colorPieceBB(!sideToMove, PAWN), !sideToMove);

if (BB(toSq(move)) & threatenedByPawn)
list->moves[i].score -= 10000;
}
}

SortMoves(list, -750 * mp->depth);
Expand Down

0 comments on commit 54285bb

Please sign in to comment.