pub fn select_victim_slot(
cache: &[(usize, SlotView)],
) -> Result<usize, VictimError>Expand description
Task #27 pure victim-selection policy over the CACHE region only (the caller
passes (slot_index, view) for slots [pinned, max_loras) — pinned startup
adapters are never candidates, so the resident set and its position-based
resolver can never desync). Tiers:
- FREE-FIRST: the first
!filled(never-promoted) placeholder slot. - LRU-IDLE: else the
ref_count == 0slot with the smallestlast_used. - POOL-FULL: else every cache slot is busy →
Err(PoolFull)(retryable); aref_count > 0slot is NEVER returned.