Skip to main content

DsparkHarvest

Enum DsparkHarvest 

Source
pub enum DsparkHarvest {
    Dflash,
    Dspark,
}
Expand description

Draft-row harvest convention for DFlash-family block drafters (darklanes research/deepseek-flash-20260818/DSPARK-POSTMORTEM-20260820.md).

The DFlash and DSpark SpecForge training strategies supervise DIFFERENT rows of the same [anchor, MASK x b-1] block, so the row -> trunk-position mapping is a property of the CHECKPOINT’s training strategy, not of the loader:

  • Dflash (mask-fill; z-lab dflash / SpecForge OnlineDFlashModel): row k is trained to predict the token AT position anchor+k — “Labels: same-position prediction”, weight_mask *= (pos_in_block > 0) excludes the anchor row (SpecForge specforge/algorithms/common/dflash_family_model.py:453-472). Drafts = rows 1..b-1; the anchor row’s output is untrained.
  • Dspark (shifted; SpecForge OnlineDSparkModel, training.strategy: dspark — the q38 arm-a export): row k is trained to predict the token at anchor+k+1, ALL rows supervised INCLUDING the anchor row (label_offsets = arange(1, block_size+1), dflash_family_model.py:816). sglang’s DSPARK worker — the stack every arm-a bank number was measured on — harvests gamma = block_size drafts with the anchor row’s output as draft 1 (verified on the v0.5.17 eval-pin tag: dspark_components/dspark_draft.py:248,260,318; dspark_config.py:269).

Mismatching the convention verifies every slot against a position the row was never trained for — the q38 accept collapse (2.9 -> 1.43) in the postmortem.

Variants§

§

Dflash

mask-fill: drafts = rows 1..b-1, row k fills position anchor+k.

§

Dspark

shifted: drafts = rows 0..b-1, row k predicts position anchor+k+1.

Implementations§

Source§

impl DsparkHarvest

Source

pub fn resolve(cfg: &DflashCfg) -> Self

The served resolution: explicit MEMRA_DSPARK_HARVEST={dflash|dspark} wins (unknown values REFUSE loudly — a typo silently reverting the convention would re-open the postmortem’s misalignment); UNSET defers to the CHECKPOINT’s own training-strategy census — the owner-ratified default flip (2026-08-20, after B1 confirmed H1 interleaved ×5 on serving-class hardware: accept 1.38→2.41 agentic / 1.53→3.66 math, E2E ALL EXACT both arms). Strategy-keyed, not env-keyed, per the B0 plan: a DSPARK-strategy export harvests shifted (all-rows), a mask-fill export keeps the historical dflash arm byte-identical.

Source

pub fn resolve_value(v: Option<&str>, strategy_dspark: bool) -> Self

Source

pub fn from_env_value(v: Option<&str>) -> Self

ENV-ONLY parser (no checkpoint census): unset = Dflash, the historical arm. Kept for the explicit-value path of Self::resolve_value and the seam tests; round arms resolve through Self::resolve so the default stays strategy-keyed.

Source

pub fn name(self) -> &'static str

Manifest/serialized name (the oracle geometry manifest’s harvest field).

Source

pub fn from_name(v: &str) -> Option<Self>

Source

pub fn first_row(self) -> usize

First drafter OUTPUT row consumed as a draft candidate.

Source

pub fn n_drafts(self, b: usize) -> usize

Drafted tokens harvested per round from a b-row block.

Source

pub fn trained_offset_of_row(self, row: usize) -> usize

The position offset (relative to the round anchor at the block’s row 0) that drafter output row row is TRAINED to predict under this convention.

Trait Implementations§

Source§

impl Clone for DsparkHarvest

Source§

fn clone(&self) -> DsparkHarvest

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 DsparkHarvest

Source§

impl Debug for DsparkHarvest

Source§

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

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

impl Eq for DsparkHarvest

Source§

impl PartialEq for DsparkHarvest

Source§

fn eq(&self, other: &DsparkHarvest) -> 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 DsparkHarvest

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.