pub struct CarriedDrafter {
pub block_table: Vec<u32>,
pub rows: usize,
pub last_pair_key: Option<usize>,
pub tokens: Vec<u32>,
pub session_hash: u64,
}Expand description
2026-09-25: The drafter KV of a finished turn, held in the model’s single carry slot for the next turn of the same session.
Fields§
§block_table: Vec<u32>2026-09-25: Drafter KV blocks moved out of the finished sequence’s
proposer state (DraftProposer::take_drafter_kv), so freeing that
state does not release them.
rows: usize2026-09-25: Drafter rows resident in those blocks.
last_pair_key: Option<usize>2026-09-25: Sequence-space pair key of the newest resident row.
tokens: Vec<u32>2026-09-25: The finished sequence’s tokens. Self::usable_by keeps
only the rows within their common prefix with a new prompt; a common
prefix does not show that the rows belong to the new request.
session_hash: u642026-09-25: SequenceState::session_hash of the sequence that left
these rows. The slot holds whichever sequence finished last, so
adoption also requires this to match.
Implementations§
Source§impl CarriedDrafter
impl CarriedDrafter
Sourcepub fn common_prefix_len(&self, prompt: &[u32]) -> usize
pub fn common_prefix_len(&self, prompt: &[u32]) -> usize
2026-09-25: Length of the common prefix of self.tokens and prompt.
Sourcepub fn session_matches(&self, session_hash: u64) -> bool
pub fn session_matches(&self, session_hash: u64) -> bool
2026-09-25: Whether these rows belong to session_hash. A zero hash
never matches: an unstamped request has no session to check. The SSM
snapshot pool’s session_matches instead accepts 0.
Sourcepub fn usable_by(
&self,
prompt: &[u32],
session_hash: u64,
) -> Option<(usize, usize)>
pub fn usable_by( &self, prompt: &[u32], session_hash: u64, ) -> Option<(usize, usize)>
2026-09-25: The (rows, last_pair_key) of this entry that prompt may
adopt, or None. None unless Self::session_matches.
Pair key k consumed tokens[0..=k + 1], so keys up to the common
prefix length minus 2 survive. The rows above that key are dropped from
the tail, one row per key. When the tail had key gaps the returned key
can be above the newest surviving row’s real key, which only makes the
append start later.