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 (SpecForgespecforge/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
impl DsparkHarvest
Sourcepub fn resolve(cfg: &DflashCfg) -> Self
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.
pub fn resolve_value(v: Option<&str>, strategy_dspark: bool) -> Self
Sourcepub fn from_env_value(v: Option<&str>) -> Self
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.
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
Manifest/serialized name (the oracle geometry manifest’s harvest field).
pub fn from_name(v: &str) -> Option<Self>
Sourcepub fn n_drafts(self, b: usize) -> usize
pub fn n_drafts(self, b: usize) -> usize
Drafted tokens harvested per round from a b-row block.
Sourcepub fn trained_offset_of_row(self, row: usize) -> usize
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
impl Clone for DsparkHarvest
Source§fn clone(&self) -> DsparkHarvest
fn clone(&self) -> DsparkHarvest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more