Skip to content

Commit

Permalink
bench 1283457
Browse files Browse the repository at this point in the history
  • Loading branch information
Vizvezdenec committed Oct 21, 2024
1 parent 9766db8 commit 7b7c76d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1795,35 +1795,35 @@ void update_all_stats(const Position& pos,
Piece moved_piece = pos.moved_piece(bestMove);
PieceType captured;

int quietMoveBonus = stat_bonus(depth);
int quietMoveMalus = stat_malus(depth);
int bonus = stat_bonus(depth);
int malus = stat_malus(depth);

if (!pos.capture_stage(bestMove))
{
update_quiet_histories(pos, ss, workerThread, bestMove, quietMoveBonus);
update_quiet_histories(pos, ss, workerThread, bestMove, bonus);

// Decrease stats for all non-best quiet moves
for (Move move : quietsSearched)
update_quiet_histories(pos, ss, workerThread, move, -quietMoveMalus);
update_quiet_histories(pos, ss, workerThread, move, -malus);
}
else
{
// Increase stats for the best move in case it was a capture move
captured = type_of(pos.piece_on(bestMove.to_sq()));
captureHistory[moved_piece][bestMove.to_sq()][captured] << quietMoveBonus;
captureHistory[moved_piece][bestMove.to_sq()][captured] << bonus;
}

// Extra penalty for a quiet early move that was not a TT move in
// previous ply when it gets refuted.
if (prevSq != SQ_NONE && ((ss - 1)->moveCount == 1 + (ss - 1)->ttHit) && !pos.captured_piece())
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq, -quietMoveMalus);
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq, -malus);

// Decrease stats for all non-best capture moves
for (Move move : capturesSearched)
{
moved_piece = pos.moved_piece(move);
captured = type_of(pos.piece_on(move.to_sq()));
captureHistory[moved_piece][move.to_sq()][captured] << -quietMoveMalus;
captureHistory[moved_piece][move.to_sq()][captured] << -malus;
}
}

Expand Down

0 comments on commit 7b7c76d

Please sign in to comment.