Function inanis::engine::search::assign_quiet_scores
source · fn assign_quiet_scores(
context: &SearchContext,
moves: &[MaybeUninit<Move>; 218],
move_scores: &mut [MaybeUninit<i16>; 218],
start_index: usize,
moves_count: usize,
tt_move: Move,
ply: u16
)
Expand description
Assigns quiet scores for moves
by filling move_scores
array with moves_count
length (starting from start_index
), based on current context
.
If transposition table move is available, it’s passed as tt_move
too. Moves are prioritized as follows (from most important to the less ones):
- for transposition table move, assign MOVE_ORDERING_HASH_MOVE
- for every promotion (excluding these with capture), assign MOVE_ORDERING_QUEEN_PROMOTION, MOVE_ORDERING_ROOK_PROMOTION, MOVE_ORDERING_BISHOP_PROMOTION or MOVE_ORDERING_KNIGHT_PROMOTION
- for every move found in killer table, assign MOVE_ORDERING_KILLER_MOVE_1 or MOVE_ORDERING_KILLER_MOVE_2
- for every castling, assign MOVE_ORDERING_CASTLING
- for every quiet move which didn’t fit in other categories, assign score from history table + MOVE_ORDERING_HISTORY_MOVE_OFFSET + random noise defined by LAZY_SMP_NOISE if Lazy SMP is enabled