EngineSamplerLatch class final

LiteRT-LM builds an engine's sampler at its first generation and keeps it for every later conversation (google-ai-edge/LiteRT-LM#2080), so a later session that asks for another sampler does not get it. This records the first and says what a later generation should report.

A larger topK later is covered too. LiteRT-LM 0.19 refuses a GPU sampler k above the one the sampler was created with (upstream 6b799ae, TopKGpuSampler::CheckTopKWithinMax), but only in UpdateConfig, whose one caller (the MTP drafter's UpdateOrRecreateSampler) creates a new sampler for a larger k first; the main executor never updates its sampler after the first generation (InitializeSampler returns early). So a later session's larger topK meets no native error: it is not applied, and this latch says so.

Constructors

EngineSamplerLatch()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onGeneration(Sampler sampling, {required bool explicit}) → ({String message, bool warn})?
Call on every generation with its conversation's sampling and whether the caller set any of it. Returns null when there is nothing to say; otherwise the message, with warn true for a release warning — once per engine, when the caller chose either sampler — and false for the verbose log, when both are defaults (a Qwen session with thinking on after one with it off).
reset() → void
Forgets the engine's sampler: a new engine builds its own.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited