fn lmp_can_be_applied<const PV: bool>(
    context: &mut SearchContext,
    depth: i8,
    move_index: usize,
    move_score: i16,
    friendly_king_checked: bool
) -> bool
Expand description

The main idea of the late move pruning is to prune all nodes, which are near the horizon and were scored low by the history table. We assume here that there’s a little chance that move being near the end of the list will improve score, so no point of spending time here.

Conditions:

  • only non-PV nodes
  • depth >= lmp_min_depth
  • depth <= lmp_max_depth
  • move index >= lmp_move_index_margin_multiplier + (depth - 1) * lmp_move_index_margin_multiplier
  • move score <= lmp_max_score
  • friendly king is not checked