CacheKit Docs

High-performance cache policies and supporting data structures.

View the Project on GitHub OxidizeLabs/cachekit

SLRU operational spec

Spec maturity: stub

Executable oracle: tests/abstract_models/exact/slru.rs (SlruModel) — mirrors SlruCore until an independent reference/ model exists.

Segmented LRU: probationary and protected segments; evict LRU from probationary; re-access promotes to protected MRU.

State

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

Init

Observables

Observable Definition
resident Keys in either segment
hit MustHit / MustMiss

Operations

Insert(k) (new key)

Get(k) / Peek(k)

Remove(k)

Harness notes

References