Expand description
2026-09-25: The generic tiered cache: a bounded hot arena over a cold record store, written without CUDA or verbs calls.
SlotArena: the hot tier,num_slotsfixed-size byte slots (VecSlotArenain host RAM, the cache peer’sMmapSlotArena).SwapStore: the cold tier, fixed-size records (DirectSwapFileon disk,MemSwapStorein host RAM).Residency: the page table over both, from au64key to one blob: an LRU of resident slots above an LRU of on-disk records, and read-pins. A put into a full arena spills the coldest unpinned resident to the store; with a disk cap, the coldest on-disk record is dropped and a later get of its key misses.
Owner: storage (tier). Invariants: none beyond the types.
Modules§
- entropy
- 2026-09-25: OS entropy for per-process key salts; its caller is the SSM decode
tier’s client salt (
decode_client_saltin metrale-model-engine). - hash
- 2026-09-25: Hash primitives for cache keys that outlive the process: FNV-1a/64
and the
mix64fold. - pio
- 2026-09-25: Positional file reads and writes at an explicit offset:
FileExt::read_at/write_aton unix,seek_read/seek_writeon Windows. Bounds checks and record layout stay with the callers (backend/posix.rs,expert_pack_fs.rs,expert_tier.rs,ngram_cache_fault.rs).
Structs§
- Direct
Swap File - 2026-09-25: Fixed-stride swap file: record
disk_slotatdisk_slot * record_bytes, withrecord_bytesa non-zero 4 KiB multiple. - MemSwap
Store - 2026-09-25:
SwapStoreover aHashMapof heap records, with no bound of its own. Model-engine’s unified SSM store falls back to it when no swap file can be used. - Residency
- 2026-09-25: The page table from a
u64key to aSlotArenaslot or aSwapStorerecord, evicting the least recently used resident to the store when the arena is full. - Swap
Stats - VecSlot
Arena - 2026-09-25:
SlotArenaover oneVec<u8>ofslot_bytes * num_slotsbytes, allocated and zeroed innew. The hot tier of model-engine’s host-RAM unified SSM stores.
Traits§
- Slot
Arena - 2026-09-25: The hot tier:
num_slotsslots ofslot_byteseach. Implemented byVecSlotArena(host RAM), the cache peer’sMmapSlotArenaand model-engine’sTransportSlotArena. - Swap
Store - 2026-09-25: The cold tier: records of
record_byteseach, addressed by adisk_slotindex thatResidencyallocates and reuses. Implemented byDirectSwapFile(a file) andMemSwapStore(host RAM).