pub struct DFlashLevers {Show 30 fields
pub any_diagnostic_armed: bool,
pub debug_dump: bool,
pub debug_dump_full: bool,
pub log_drafts: bool,
pub block_dump: bool,
pub block_dump_at_pos: usize,
pub option_b_diag: bool,
pub force_pattern: bool,
pub force_noise_pattern: bool,
pub force_no_ctx: bool,
pub force_ctx_used: Option<usize>,
pub precompute: bool,
pub precompute_commit: bool,
pub propose_warmup_n: usize,
pub option_b: bool,
pub option_b_no_ctx: bool,
pub dflash2: bool,
pub batch_propose_width: usize,
pub draft_cap: Option<usize>,
pub verify_trace: bool,
pub precompute_dump: bool,
pub ctx_parity_dump: bool,
pub no_decode_append: bool,
pub full_precompute: bool,
pub ctxlen_probe: bool,
pub dspark_markov: bool,
pub conf_tau: f32,
pub dspark_shift: Option<bool>,
pub dspark_anchor_bias: bool,
pub dspark_conf_trace: bool,
}Expand description
Diagnostic and A/B levers for one loaded DFlash drafter.
Plain Copy data. Every field is a pure function of one ATLAS_*
variable except Self::any_diagnostic_armed, which is a function of
eleven of them.
Fields§
§any_diagnostic_armed: boolAny of the eleven diagnostic variables is SET, at any value.
This is the CUDA-graph kill switch: a diagnostic that dumps or logs from inside the captured region would be captured with it and then replayed silently, so an armed diagnostic forces the eager path.
★ Presence, not truth — ATLAS_DFLASH_BLOCK_DUMP=0 suppresses graph
capture while enabling no dump at all. That is the shipped behaviour
(the chain this replaces tested std::env::var(..).is_err()), and it
is pinned by a test rather than quietly fixed: the variables are
operator-facing A/B switches, and a graph capture that appears only
when a flag is spelled a particular way is a worse surprise than an
over-eager kill switch.
One deliberate divergence from the is_err() chain this replaces: it
tested std::env::var, which reports a NON-UTF-8 value as absent, so
ATLAS_DFLASH_BLOCK_DUMP=<invalid utf-8> used to leave capture ON.
This uses var_os, so such a value now suppresses capture — the same
direction as every other spelling, and the same present idiom
ModelLevers uses.
debug_dump: boolATLAS_DFLASH_DEBUG_DUMP=1 — first 10 BF16 floats of each key
intermediate, for element-wise comparison against a Python reference.
debug_dump_full: boolATLAS_DFLASH_DEBUG_DUMP_FULL=1 — full tensors, not the first 10.
log_drafts: boolATLAS_DFLASH_LOG_DRAFTS=1 — log the γ drafts each propose returns.
block_dump: boolATLAS_DFLASH_BLOCK_DUMP=1 — per-layer .bin dumps of the block
inputs and every layer’s output.
block_dump_at_pos: usizeATLAS_DFLASH_BLOCK_DUMP_AT_POS=<n> — arm the block dump only at
decode position ≥ n, so the dump can be taken in the regime where
absolute positions have diverged from ctx slot indices. Default 0
(dump at the first propose).
option_b_diag: boolATLAS_DFLASH_OPTION_B_DIAG=1 — read back layer 0’s first cached
K/V row from the paged drafter cache.
force_pattern: boolATLAS_DFLASH_DEBUG_FORCE_PATTERN=1 — overwrite the captured target
hidden with a deterministic pattern the PyTorch reference also makes.
force_noise_pattern: boolATLAS_DFLASH_DEBUG_FORCE_NOISE_PATTERN=1 — same, for the noise rows.
force_no_ctx: boolATLAS_DFLASH_DEBUG_CTX_OFF=1 — drop ctx conditioning entirely
(eff_ctx = 0), the A/B for whether the drafter responds to ctx.
force_ctx_used: Option<usize>ATLAS_DFLASH_DEBUG_CTX_USED=<n> — pin eff_ctx to exactly n.
precompute: boolATLAS_DFLASH_PRECOMPUTE=1 — run the ctx K/V precompute chain from
forward_block (the production path runs it from propose).
precompute_commit: boolATLAS_DFLASH_PRECOMPUTE_COMMIT=1 — let that diagnostic run write to
the paged cache. Off by default because forward_block does not
guarantee a valid block table.
propose_warmup_n: usizeATLAS_DFLASH_PROPOSE_WARMUP_N=<n> — eager warm-up passes before
capture. Default 2: two passes warm the PTX→SASS cache, ramp GB10
clocks, and pull hot weight tiles into L2 before capture freezes the
SASS variants the driver picked.
option_b: boolThe Option-B paged drafter cache. Ships ON since the 54.5 record
config (#649); ATLAS_DFLASH_OPTION_B=0 is the kill switch.
The POLARITY has already been flipped by accident once: a merge on
2026-08-30 turned != Some("0") into == Some("1"), and propose went
19.8 -> 618.7 ms (49.9 -> 5.5 tok/s) because the legacy path launches
one dense_gemv per accumulated ctx row over a 262 MB fc weight.
Nothing logged a change. Resolution goes through
super::option_b_from so the predicate keeps its own tests.
Deliberately NOT an intra-doc link: option_b_from is pub(super),
and rustdoc rejects a link from public documentation to a private
item under this crate’s deny(warnings). Widening the function to
pub to satisfy the link would export a predicate the module keeps
internal on purpose — the wrong half of the trade.
option_b_no_ctx: boolATLAS_DFLASH_OPTION_B_NO_CTX=1 — force ctx_count = 0 in the layer
body so paged attention sees only the γ K/V written in-layer. If the
accept rate is bad even here, the bug is in the cache write/read path
rather than in precompute.
dflash2: boolThe DFlash2 conv+selector path. Ships ON when the checkpoint carries
the components; ATLAS_DFLASH2=0 disables.
batch_propose_width: usizeATLAS_DFLASH_BATCH_PROPOSE=<width> caps the cross-sequence batch.
usize::MAX (unset) means “as wide as the scratch bands allow”;
1 or 0 restores the per-sequence loop. Numeric rather than boolean
because bisecting the WIDTH against acceptance is what localises a
banding bug — “correct at 2 bands, wrong at 4” found the lm_head tile
bound, and an on/off flag cannot ask that question.
draft_cap: Option<usize>ATLAS_DFLASH_DRAFT_CAP=<n> — submit at most n drafts per propose.
None means the head’s own γ.
verify_trace: boolATLAS_DFLASH_VERIFY_TRACE=1 — log all γ drafts BEFORE the cap, so
an echo at position 0 can be told from an echo on every noise row.
precompute_dump: boolATLAS_DFLASH_PRECOMPUTE_DUMP=1 — one-shot dump of the fused ctx K/V
GEMM inputs and outputs.
ctx_parity_dump: boolATLAS_DFLASH_CTX_PARITY_DUMP=1 — one-shot dump of the accumulated
ctx hidden rows for a PyTorch parity diff.
no_decode_append: boolATLAS_DFLASH_DEBUG_NO_DECODE_APPEND=1 — skip the post-decode ctx
append entirely.
full_precompute: boolATLAS_DFLASH_DEBUG_FULL_PRECOMPUTE=1 — recompute the whole ctx
prefix each step (committed = 0) instead of the incremental
watermark path, for accept-rate parity A/B. O(ctx_len^2).
ctxlen_probe: boolATLAS_DFLASH_CTXLEN_PROBE=1 — assert ctx_positions is strictly
increasing, and log ctx_len against position every 16 steps. Both
probes are host-side scans, so they stay behind one flag.
dspark_markov: boolThe sequential Markov fixup. Ships ON when the drafter carries the
head; ATLAS_DSPARK_MARKOV=0 degrades to the batched argmax path
bit-for-bit.
conf_tau: f32ATLAS_DSPARK_CONF_TAU=<t> — sigmoid-space acceptance threshold for
the confidence head. 0.0 (unset) disables the head entirely,
matching the reference’s threshold <= 0.0 -> full block.
dspark_shift: Option<bool>ATLAS_DSPARK_SHIFT=1|0 forces the SpecForge shifted-row convention
on or off; unset (None) defers to the drafter config.
dspark_anchor_bias: boolRow 0 carries the Markov anchor bias. Ships ON;
ATLAS_DSPARK_ANCHOR_BIAS=0 exempts it. Confidence truncation reads
this too — rows without the chain never write their confidence slot.
dspark_conf_trace: boolATLAS_DSPARK_CONF_TRACE=1 — log the confidence logits and sigmoids.
Implementations§
Source§impl DFlashLevers
impl DFlashLevers
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Resolve from the environment. Called ONCE, when the head is built.
★ Do not call this from forward_block, propose, or anything they
reach. Take self.levers from the head instead — that is why the
field exists, and dflash_levers_are_resolved_once fails the build if
a raw std::env::var reappears on those paths.
Sourcepub fn defaults() -> Self
pub fn defaults() -> Self
What a head resolves to with no ATLAS_* set: every diagnostic off,
the anchor bias on, two warm-up passes. Tests construct this rather
than mutating the process environment, which set_var makes unsafe
and which would race every other test in the binary.
Sourcepub fn block_dump_armed_at(&self, position: usize) -> bool
pub fn block_dump_armed_at(&self, position: usize) -> bool
The block dump is armed for this decode position.
Three sites asked this question with two env reads each; it is one predicate over already-resolved data.
Trait Implementations§
Source§impl Clone for DFlashLevers
impl Clone for DFlashLevers
Source§fn clone(&self) -> DFlashLevers
fn clone(&self) -> DFlashLevers
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more