NoPrefixCaching

Struct NoPrefixCaching 

Source
pub struct NoPrefixCaching;
Expand description

No-op prefix cache (zero overhead when disabled).

Trait Implementations§

Source§

impl PrefixCache for NoPrefixCaching

Source§

fn is_active(&self) -> bool

Whether this implementation is active (i.e., a real cache that actually inserts/holds refs). NoPrefixCaching returns false; RadixTree returns true. Callers use this to skip ref-bookkeeping that’s only meaningful when the cache holds refs (e.g., the manual kv_cache.inc_ref in cache_sequence that pairs with eviction’s return_evicted_block).
Source§

fn lookup( &self, _tokens: &[u32], _block_size: usize, _session_hash: u64, _adapter_id: u64, ) -> PrefixMatch

Look up a token sequence and return cached KV blocks for the longest matching prefix (block-aligned). Read more
Source§

fn insert( &self, _tokens: &[u32], _block_table: &[u32], _disk_block_ids: &[u32], _block_size: usize, _matched_tokens: usize, _adapter_id: u64, ) -> InsertAcquired

Insert a completed prefill’s blocks into the cache. Read more
Source§

fn insert_with_snapshot( &self, _tokens: &[u32], _block_table: &[u32], _disk_block_ids: &[u32], _block_size: usize, _snapshot_id: usize, _session_hash: u64, _matched_tokens: usize, _adapter_id: u64, ) -> (Option<usize>, InsertAcquired)

Insert blocks with an SSM state snapshot registered in the snapshot index. Read more
Source§

fn insert_intermediate_snapshot( &self, _tokens: &[u32], _block_table: &[u32], _disk_block_ids: &[u32], _block_size: usize, _snapshot_id: usize, _session_hash: u64, _matched_tokens: usize, _adapter_id: u64, ) -> Option<usize>

Insert an SSM snapshot at an intermediate token boundary. Read more
Source§

fn insert_tail_snapshot( &self, _tokens: &[u32], _snapshot_id: usize, _session_hash: u64, _adapter_id: u64, ) -> Vec<usize>

Register the per-session TAIL snapshot in the index WITHOUT touching the radix tree (the final chunk’s insert covers those blocks). Supersedes this session’s previous tail; returns displaced snapshot ids to free.
Source§

fn insert_tail_sibling_snapshot( &self, _tokens: &[u32], _snapshot_id: usize, _session_hash: u64, _adapter_id: u64, ) -> Option<usize>

Register the tail’s EARLY sibling (tb - bs) in the index. Must be called after insert_tail_snapshot in the same finalize (the tail insert sweeps the session’s previous tail + sibling). Returns a displaced snapshot id to free, if the prefix was already registered.
Source§

fn release(&self, _tokens: &[u32], _block_size: usize, _adapter_id: u64)

Release ref_counts on blocks that were acquired via lookup. Read more
Source§

fn release_matched( &self, _tokens: &[u32], _block_size: usize, _matched_tokens: usize, _adapter_id: u64, )

Release exactly the block-aligned prefix acquired by one lookup. Read more
Source§

fn evict(&self, _num_blocks: usize) -> EvictedBlocks

Evict up to num_blocks cached blocks, returning their physical indices and parallel disk-block IDs (Phase 6.1.e). Read more
Source§

fn evict_snapshot_lru(&self) -> Option<usize>

Evict the least-recently-used SSM snapshot from the snapshot index. Returns the snapshot ID so the caller can free it in SsmSnapshotPool.
Source§

fn snapshot_count(&self) -> usize

Number of SSM snapshots currently stored in the snapshot index.
Source§

fn stats(&self) -> (usize, usize)

(entries, cached_blocks) for logging.
Source§

fn peek_matched_tokens( &self, _tokens: &[u32], _block_size: usize, _adapter_id: u64, ) -> usize

Read-only longest-prefix probe: number of tokens (block-aligned) lookup would match, WITHOUT taking refs, touching LRU state, or counting a hit/miss. Used by the prefill tail-checkpoint split to detect conversation reuse before deciding to pay the extra pass. Task #24: keyed by adapter_id so a cross-adapter peek reports a miss.
Source§

fn evict_snapshot_to_tier(&self, min_tokens: usize) -> Option<TierEvict>

Phase 1b spill tier: pick a spill victim (same policy as evict_snapshot_lru, HBM-resident only) and decide whether it is worth spilling — see TierEvict. A victim shallower than min_tokens cannot repay the spill’s fixed cost, so its entry is dropped outright rather than left findable-but-empty. min_tokens == 0 disables the gate. None when nothing resident remains; default None (no tier).
Source§

fn promote_snapshot(&self, key: u64, new_slot: usize) -> bool

Phase 1b spill tier: after the caller faulted a spilled snapshot’s bytes into new_slot, re-home its index entry to HBM. Returns false if the key is unknown. Default: false.
Source§

fn forget_snapshot_tier_key(&self, key: u64) -> bool

Phase 1b spill tier: the FAILED-fault-in twin of Self::promote_snapshot. The caller’s store.get(key) MISSED, so this entry is findable by lookup_tiered with no bytes behind it. Left in place, every warm turn on this prefix repeats the whole doomed cycle — spill a LIVE 66 MB victim D2H to free a slot, fault in, miss, free the slot — and then recomputes anyway; under ATLAS_SSM_TIER_DISK_GB that doomed spill evicts one MORE tier record, so the cap’s own pressure re-amplifies itself. Dropping the entry degrades the prefix to a plain recompute ONCE. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more