select_victim_slot

Function select_victim_slot 

Source
pub fn select_victim_slot(
    cache: &[(usize, SlotView)],
) -> Result<usize, VictimError>
Expand description

2026-09-25: Pick the slot a promotion overwrites, from cache, the (slot_index, view) pairs the caller passes (model-engine passes cache_slot_views(), slots [pinned, max_loras)):

  1. the first unfilled slot;
  2. else the ref_count == 0 slot with the smallest last_used;
  3. else Err(PoolFull).