pub struct Glm5SpecSession {
pub committed: Vec<u32>,
pub rounds: usize,
/* private fields */
}Expand description
glm5_next SERVED speculative session (lane/glm5-spec-routing, 2026-08-30): the state one
request’s spec decoding carries across worker bursts — the dspark/gemma session twins’
shape. The session OWNS its trunk cache (the worker’s s.cache stays None); at every
burst boundary the invariant is cache.pos == committed.len() with each committed row’s
trunk state exactly what a plain prime of that sequence would hold (the accept walk’s
basis, pinned by the tparallel gate), plus ONE emitted-but-uncommitted anchor token
(the next round’s verify row 0 — the dspark last convention).
Fields§
§committed: Vec<u32>Every token whose trunk state the cache holds, in order (prompt + committed
generation). EXCLUDES the live anchor.
rounds: usizeVerify rounds completed over the session lifetime (the worker’s per-burst
rounds-delta receipt, the dspark rounds convention).
Implementations§
Source§impl Glm5SpecSession
impl Glm5SpecSession
Sourcepub fn cache_max_ctx(&self) -> usize
pub fn cache_max_ctx(&self) -> usize
Context capacity of the session’s cache (the server’s ContextFull guard).
Sourcepub fn pos(&self) -> usize
pub fn pos(&self) -> usize
Trunk rows currently committed (== committed.len() at burst boundaries).
Sourcepub fn finished(&self) -> bool
pub fn finished(&self) -> bool
EOS committed or the context guard tripped: the next burst would emit nothing.
Sourcepub fn demote_eligible(&self) -> bool
pub fn demote_eligible(&self) -> bool
True when the session is a legal demotion source (loop-port fold-in, map #8): GREEDY only — a sampled session’s committed stream depends on its session-owned Philox counters, and the plain batched sampler is a different random program mid-request (the exact exclusion the MTP and dspark sweeps carry).