Skip to main content

Glm5SpecSession

Struct Glm5SpecSession 

Source
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: usize

Verify rounds completed over the session lifetime (the worker’s per-burst rounds-delta receipt, the dspark rounds convention).

Implementations§

Source§

impl Glm5SpecSession

Source

pub fn cache_max_ctx(&self) -> usize

Context capacity of the session’s cache (the server’s ContextFull guard).

Source

pub fn pos(&self) -> usize

Trunk rows currently committed (== committed.len() at burst boundaries).

Source

pub fn finished(&self) -> bool

EOS committed or the context guard tripped: the next burst would emit nothing.

Source

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).

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.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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.