High-performance cache policies and supporting data structures.
Spec maturity: stub
Executable oracle:
tests/abstract_models/exact/slru.rs(SlruModel) — mirrorsSlruCoreuntil an independentreference/model exists.
Segmented LRU: probationary and protected segments; evict LRU from probationary; re-access promotes to protected MRU.
| Variable | Type | Meaning |
|---|---|---|
probationary |
Seq<K> |
Head = MRU, tail = LRU (eviction victim) |
protected |
Seq<K> |
Head = MRU, tail = LRU |
segments |
Map<K, {Probationary, Protected}> |
Per-key segment |
probationary_cap |
usize |
Max probationary size |
capacity |
usize |
Total capacity |
probationary_cap = floor(capacity * probationary_frac).| Observable | Definition |
|---|---|
resident |
Keys in either segment |
hit |
MustHit / MustMiss |
Insert(k) (new key)Get(k) / Peek(k)Peek: no promotion.Remove(k)EvictingCache — op strategy standard_op_list_no_evict.