High-performance cache policies and supporting data structures.
Many policies need a bounded “last N touches” history per key (LRU-K, some admission filters, scan detection).
Per entry:
history: [u64; K] + len + cursor (ring buffer), orSmallVec<[u64; K]>, orVecDeque<u64> with fixed capacity (simple, but more overhead)Global:
u64) or timestamp sourcerecord_access(now):
now, dropping the oldest if fullaccess_count()k_distance():
< K accesses).