High-performance cache policies and supporting data structures.
Spec maturity: stub
Executable oracle:
tests/abstract_models/exact/two_q.rs(TwoQModel) — mirrorsTwoQCoreuntil an independentreference/model exists.
2Q: two queues (probation A1 and protected Am); new keys enter probation; re-access promotes to protected; evict LRU from probation.
| Variable | Type | Meaning |
|---|---|---|
probation |
Seq<K> |
A1 queue — head = newest, tail = LRU (eviction victim) |
protected |
Seq<K> |
Am queue — head = MRU, tail = LRU |
queues |
Map<K, {Probation, Protected}> |
Per-key queue membership |
probation_cap |
usize |
Max probation size |
protected_cap |
usize |
Max protected size |
a1_frac.| Observable | Definition |
|---|---|
resident |
Keys in either queue |
hit |
MustHit / MustMiss |
Insert(k) (new key)Get(k) / Peek(k)Peek: no promotion.Remove(k)k.EvictingCache on impl — op strategy standard_op_list_no_evict (no EvictOne).