Skip to main content

evict_over_capacity

Function evict_over_capacity 

Source
pub fn evict_over_capacity(
    output_dir: &Path,
    max_blocks: usize,
    protect_min_importance: u8,
) -> Result<u32, String>
Expand description

Evict the lowest-scoring blocks when the index exceeds max_blocks.

Approved policy: eviction score = importance × 10 + recall energy − age penalty, where age is the block position normalized to [0, 1]. Blocks with importance >= protect_min_importance are never evicted; if the cap cannot be reached without touching protected memory, nothing is evicted. The embeddings index is rewritten together with the block index so semantic rows stay aligned.