Skip to main content

DsparkVtPolicy

Enum DsparkVtPolicy 

Source
pub enum DsparkVtPolicy {
    Ladder,
    Confidence {
        tau: f32,
    },
    ConfidenceSlot {
        tau: f32,
    },
}
Expand description

Verify-window policy for the dspark round (H4, DSPARK-POSTMORTEM-20260820.md §3).

B2 measured the structural fork: the fixed full-block window (vt=8) buys 95–100% of the sglang accept bank but LOSES wall speed to the reactive ladder everywhere except math — at 0.2–0.5 slot rates, full-block verify pays 5–6 empty rows per round. The confidence policy is the mechanism both leading engines schedule with (sglang v0.5.16 dspark_planner.py cumprod survival; vLLM #47808): size EACH round’s window from the drafter’s own trained accept-rate head, so windows open on confident streaks (math/code) and shrink on bursty text without a 4-round ladder climb.

Variants§

§

Ladder

The shipped reactive ladder: vt = (m+2).clamp(3, vt_cap) per round (MEMRA_DFLASH_ADAPT=0 pins vt at vt_cap = the fixed-window arm).

§

Confidence

MEMRA_DSPARK_VT=confidence: per-round window from cumprod survival of the confidence head’s sigmoid scores, thresholded at tau (MEMRA_DSPARK_VT_TAU, default 0.5). Raw sigmoid — no STS sidecar calibration exists for this export; the postmortem names this the starting policy.

Fields

§tau: f32
§

ConfidenceSlot

MEMRA_DSPARK_VT=confidence-slot (owner directive, 2026-08-20: “take only high confidence offers”): submit only the longest draft PREFIX whose every slot clears tau on its own sigmoid — the low-confidence tail never enters verify. Same tau env. vs Confidence: if the head’s per-row score is the MARGINAL accept probability (it already sinks with depth), cumprod survival double-counts the decay and over-truncates; if it is the CONDITIONAL, per-slot under-truncates. Which statistic the q38 head emits is empirical — both arms ride the A/B.

Fields

§tau: f32

Implementations§

Source§

impl DsparkVtPolicy

Source

pub fn resolve(has_confidence_head: bool) -> Self

The served resolution: explicit MEMRA_DSPARK_VT={ladder|confidence| confidence-slot} wins (unknown values REFUSE loudly — a typo silently reverting the window policy would invalidate an A/B without a trace); UNSET defaults to confidence-slot at τ = MEMRA_DSPARK_VT_TAU (default 0.5) — the owner-ratified H4 flip (2026-08-20; cell 2’s 4-arm A/B ×5 + cell 3’s tau ladder put the knee at τ=.5 for the slot arm: 94–98% of the fixed-8 accept bank at wall ≥ the reactive ladder, exactness 11/11 ALL EXACT). Census-keyed per the capacity-keyed-defaults law: a checkpoint WITHOUT an accept-rate head has no signal to schedule with, so unset-env resolves to the ladder there (loudly, at load) instead of panicking on a default; MEMRA_DFLASH_ADAPT=0 (an explicit fixed-window request) also keeps the ladder-family arm.

Source

pub fn resolve_value( vt: Option<&str>, tau: Option<&str>, adapt: Option<&str>, has_confidence_head: bool, ) -> Self

Source

pub fn from_env_value( vt: Option<&str>, tau: Option<&str>, adapt: Option<&str>, ) -> Self

ENV-ONLY parser (no head census): unset = Ladder. Kept for the explicit-value path of Self::resolve_value and the policy-gate tests; round arms resolve through Self::resolve so the default stays head-census-keyed.

Source

pub fn is_confidence(&self) -> bool

True for every head-scheduled arm (the loops gate the head requirement and the embedding stash on this).

Source

pub fn size_window(&self, raws: &[f32], vt_cap: usize) -> Option<usize>

Size this round’s verify window from the head’s pre-sigmoid slot scores. None under the ladder (the caller keeps its carried vt).

Trait Implementations§

Source§

impl Clone for DsparkVtPolicy

Source§

fn clone(&self) -> DsparkVtPolicy

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DsparkVtPolicy

Source§

impl Debug for DsparkVtPolicy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DsparkVtPolicy

Source§

fn eq(&self, other: &DsparkVtPolicy) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DsparkVtPolicy

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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.