pub struct MtpGate { /* private fields */ }Expand description
2026-09-25: The gate. The scheduler builds one when MTP is on and the gate is not forced off, and records each gated plain-decode or MTP step in it; steps run under a pin are not recorded.
Implementations§
Source§impl MtpGate
impl MtpGate
Sourcepub fn observe(&self) -> (MtpModeSnap, f32)
pub fn observe(&self) -> (MtpModeSnap, f32)
2026-09-25: For the scheduler snapshot: the mode (Probing during a
probe) and the delivered-throughput estimate of the current mode (0.0
until measured).
Sourcepub fn new(num_drafts: usize) -> Self
pub fn new(num_drafts: usize) -> Self
2026-09-25: Starts in Mtp mode. num_drafts is only logged;
arbitration does not model the draft count.
pub fn note_depth(&mut self, depth: usize)
Sourcepub fn maybe_remeasure(&mut self, current_depth: usize) -> bool
pub fn maybe_remeasure(&mut self, current_depth: usize) -> bool
2026-09-25: When the context depth has moved by
REMEASURE_DEPTH_FACTOR since the last measurement (both floored at
REMEASURE_DEPTH_FLOOR), marks both estimates stale, keeps them as
they are, and brings the next probe (one WINDOW_STEPS window)
forward. Returns whether it fired.
Sourcepub fn take_fresh_decision(&mut self) -> Option<GateDecision>
pub fn take_fresh_decision(&mut self) -> Option<GateDecision>
2026-09-25: The last mode switch, returned once.
Sourcepub fn record_decode(&mut self, wall: Duration, width: usize)
pub fn record_decode(&mut self, wall: Duration, width: usize)
2026-09-25: Records one plain decode step over width sequences. Each
emits one token, so the step is charged width tokens (at least 1).
Sourcepub fn record_verify_step(
&mut self,
wall: Duration,
emitted: usize,
width: usize,
)
pub fn record_verify_step( &mut self, wall: Duration, emitted: usize, width: usize, )
2026-09-25: Records one MTP step over width sequences: emitted is
the tokens all of them committed (at least 1 is charged). Bootstrap and
propose time count against Mtp mode.