fn razoring_can_be_applied<const PV: bool>(
context: &mut SearchContext,
depth: i8,
alpha: i16,
friendly_king_checked: bool
) -> bool
Expand description
The main idea of the razoring is to detect and prune all nodes, which (based on static evaluation) are hopeless compared to the current alpha and the chance to improve the score is too small to spend time here. To make it more safe and not to skip positions where we’re somewhere in the middle of capture sequence, there’s the quiescence search performed to verify if the final score is still below alpha - margin.
Conditions:
- only non-PV nodes
- depth >=
razoring_min_depth
- depth <=
razoring_max_depth
- alpha is not a mate score
- friendly king is not checked