mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5271] [Engine] dflash2: draft confidence could adapt to observed acceptance per conversation (scope proposal) #3139
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3139
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yeyeyeason on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5271
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
A scope proposal before any code (per CONTRIBUTING.md): let DFlash2's draft confidence adapt to the observed acceptance during a conversation, instead of one static value per engine run.
Current behavior. The server picks one
--draft-confat start (strata_control/drafting.py:217-237,CONF_STEPSby estimated slots; multi-card with unknown slots falls back to 0.35;apply()atdrafting.py:812-830writes it once). The engine parses it once (src/program/generate.cpp:3590) andchoose_window()(include/strata/spec/window_rule.hpp:64-68) applies the same value to every round.Dflash2Drafter::draft_finish()already returns the selector's per-draft probability (src/core/dflash2.cpp:1061-1073) and the serve loop already counts accepted/offered drafts (generate.cpp:18553) — the information for adaptation exists on both sides; it is just not connected.Why per-conversation rather than per-machine. On this machine (2x RTX 4060 Ti 16 GB, i5-10600KF, 96 GB RAM, Windows 11; SC117 Qwen3.8-Flash-Next IQ3_S, 1M context, YaRN x4, KV int8, frozen expert profile; engine 0.1.56, v0.2.10 checkout
ffa80d73; temperature 0, short prompts, engine-measured decode):The best confidence depends on what the conversation is doing: code wants a low confidence and a wide window (97 tok/s at conf 0.35 spec 8, ~35% over the MTP arm), fiction's acceptance is best at conf 0.70 (52%, matching MTP, up from 33% at 0.35). A fixed value cannot follow that. Related reports of the static choice misfiring per machine: #5129, #5213, #5252, #5178.
Per-round cost, measured with the engine's own
STRATA_DF2_PROFILE/STRATA_DF2_TIMINGswitches on the same arm: drafting costs about 5.6 ms per round, roughly 22-27% of a decode round at 48 tok/s (largest single stage: the draft head matmul, 1.08 ms). So acceptance — not drafting time — is the right quantity to maximize: the code arms wasted 25% of drafts at conf 0.35 and were still the fastest, because a long accepted block amortizes the fixed per-round cost.Proposed shape (opt-in, engine-side). Keep an EWMA of accepted/offered drafts over recent verify windows; when acceptance stays above a high bar, lower the effective confidence one small step (draft longer blocks); after consecutive full-window rejections, raise it one step; clamp to a small range with hysteresis. Start from the
--draft-confthe server already chose;--specstays the hard cap. State on the host, per slot, reset per conversation. Switch likeSTRATA_DF2_ADAPT=on; default off; default path byte-identical; no MTP change. Skip adaptation when free VRAM is below the configured reserve — DFlash2's drafter (625 MiB on the last-stage card) already sits near the #2065 1024 MiB line in this setup, and a policy that lengthens windows must not trade VRAM for speed there.Engine-side is the natural layer: the server writes
--draft-confonce at engine start and cannot change it in a running engine, and it does not see per-window acceptance. The expert cache's--adapt-every/--adapt-swaps/--adapt-decay(generate.cpp:873-880) is the existing precedent for this shape of opt-in runtime adaptation.Validation plan (before any default is discussed). Replay accepted/offered counts from existing logs to test the policy offline first; then a same-machine A/B against the static value on the same model, quantization and prompts; keep every run including failures; report decode tok/s, acceptance, window width, free VRAM and the #2065 warning state; check outputs are unchanged where the verification path is unchanged; build every backend the change touches; offer the full per-request data separately as a community benchmark report. An adaptive loop can lag, oscillate or cost more than it saves — that is exactly what the offline replay and the A/B are for.
What do you do today instead?
Pick one static
--draft-confper machine (or override it by hand withuser_args) and accept the mismatch when the conversation's task type changes. The data above shows what that leaves on the table on both sides: code at a fiction-safe 0.70 loses ~3% decode (94 vs 97), fiction at a code-friendly 0.35 loses acceptance (33% vs 52%) and decode (32-33 vs 34-35).@udqe commented on GitHub (Nov 5, 2026):
From the #5129 ledger thread - your proposal is the first one that attacks the estimator problem from the runtime side instead of asking the start-time table to predict better, and the table you posted is the right evidence for why per-conversation beats per-machine. Three things the season's published data adds to the design, all shape arguments, no data of our own beyond what is already in the tracker:
The reward must be seconds per token; acceptance is the control signal, not the objective. Your own fiction rows show the sign of the acceptance-to-throughput slope flipping with content (at conf 0.35 fiction accepts 32-33 % and is the slowest arm; raising conf to 0.70 buys acceptance AND speed there - while in code the fastest arm, spec 8 at 0.35, wastes 25 % of drafts and you say so yourself). The published cross-box case is #5206 on the same card class as yours (2x 4060 Ti): forcing conf 0.5 -> 0.7 raised acceptance from 63-73 % to 74-84 % and still lost decode, because the windows got shorter. An EWMA that treats acceptance as the thing to maximize can sit happily at the wrong conf whenever the slope is inverted; one that uses acceptance to move and time-per-token to judge the move cannot. Your hysteresis and clamp design already leaves room for this - the ask is to make the reward explicit in the design doc before the replay, so the offline replay scores arms by time and not by the metric the loop is steering on.
Some bands are flat, and an adaptive loop will hunt there. #5129's RTX 3060 windows moved conf 0.8 -> 0.5 and recovered nothing twice - the decode gain sat inside the control drift both times. A policy with EWMA plus step moves needs a deliberately inert band (no move unless the signal clears a declared threshold) and a declared switch budget per conversation; otherwise the flat regions produce oscillation that a tok/s average will happily hide. And since your change makes mid-conversation regime changes legal, the validation stats should be cut at switch boundaries - a window that contains a conf move is not one arm, it is two - the same discipline #5129's A/B/A windows use.
The replay-first plan is the best part and you can harvest a second box for free. The accepted/offered counters you cite are already in the engine log (that is what the replay runs on), which means every boot's log is a replay corpus - ours included: a Windows 2x 4090 pair, MTP-heavy, with thousands of logged windows across 168 boots and a different context regime (no YaRN). If the policy has an offline mode, that is a free second-hardware dataset for it whenever you want one. For the live A/B: your same-model arm design is right; our only additions would be an MTP arm in every window as a drift control (session-to-session decode drift is real even on one box) and keeping the #2065 VRAM-line check in the report, which you already listed.
Scope: design commentary from published numbers only - we ran nothing new for this comment, have not attempted the policy, and our box runs MTP so our live-A/B offer is a promise gated on your PR existing. The precedent you cite (--adapt-every family) is the right one; opt-in, byte-identical default, and per-slot state all match how the season's accepted switches have been shaped.
(ai-assisted; all external figures from #5129/#5206 as published there)
@yeyeyeason commented on GitHub (Nov 5, 2026):
Follow-up from the offline replay (from the reporter)
The validation plan's first step (replay the acceptance data through a candidate policy, offline) is done, and it cuts against the headline of this proposal, so I am posting it before anything else happens with the idea.
Using every request from the same six-arm sweep (weighted by generated tokens; warm rounds and cold start reported separately), a steady-state mixed-workload replay (code:fiction = 1:1, harmonic mean of decode tok/s) gives:
The oracle — switching per task to the best measured confidence — ties the single best static value. The reason: my earlier code numbers favored conf 0.35 because they quoted only the warm round-2 values; with all requests weighted, conf 0.70 is equally fast on code (79.9 vs 73.6-78.6) with the highest acceptance. A per-task adaptive loop has essentially nothing to gain over choosing the right static value once.
What does survive the replay:
Given this, the stronger motivation for touching the confidence machinery at all is not task-switching but fixing the wrong static picks already reported in #5129, #5213, #5252 and #5178 — cases where the machine-level estimate picks a value that a short same-machine A/B would have rejected.
I will not start engine work on the adaptive loop on this evidence. Options I see: (a) drop the adaptive part and keep this issue's value as the measured per-task acceptance data plus the replay method, (b) narrow the proposal to making the start-time value easier to correct (the existing
user_argsoverride already covers part of that, per #5178), or (c) hold the adaptive idea until there is data where the best value genuinely differs within one conversation. Your call which, if any, is worth pursuing — happy to run any of them.@udqe commented on GitHub (Nov 5, 2026):
Time order first, because it matters for reading the thread: the comment above this one was drafted against your headline and posted seconds before your replay landed - it was not written against this evidence, so let me re-anchor it rather than let the two comments sit in contradiction. Our three shape arguments survive your replay in modified form, and your question (a)/(b)/(c) has a clean answer from the ledger side of the tracker:
Option (b), with (a) attached as its validation arm. #5129's position all season has been that the start-time table is a fine table and the estimator feeding it is the bug - three independent boxes keeping MTP is what wrong static picks look like in the wild, and your replay gives that claim its first mechanistic demonstration: a short same-machine A/B, scored correctly, rejected in minutes the value that six arms' worth of warm-round quoting had endorsed. (b) is exactly "let the cheap correct thing reject the expensive wrong thing at boot." And (a) is not a consolation prize: the replay method itself - full-request weighting, warm/cold separated, harmonic-mean mixed workload - is the artifact the season has been missing, and publishing it beside your per-task acceptance data makes (b) testable by anyone. (c) needs "data where the best value genuinely differs within one conversation"; our honest contribution there is an absence: 168 boots of varied single-box traffic produced no within-conversation swing we could see, which is evidence about the workload class, not against the idea.
Your surviving fact 2 is the same lesson our other comment argues, arrived at from the opposite side. Acceptance parity without decode parity (52 vs 64 %, fiction stays ~10 % behind) is the acceptance-as-objective trap on your own machine; the #5206 pair showed the same inversion with conf forced up: +11 points of acceptance, -4 % decode. Two boxes, same inversion, no adaptive loop needed to demonstrate it - which is precisely why it belongs in the (b) design doc: any boot-time auto-selection must be judged by time-per-token against the alternatives, not by predicted or observed acceptance.
The corpus offer restated for the new job. Under (b) the validation question is "does a short A/B correctly reject the estimator's pick, on machines other than the author's" - and that is a replay problem our logs feed directly: the accepted/offered counters your policy idea needed are already printed per window, so a Windows 2x 4090 pair, MTP-heavy, UD-Q4_K_XL, no YaRN, is available as raw log lines for a second-hardware estimator-replay whenever you build one. Nothing here ran new: this is an option vote from published ledgers, and our own engine stays on the MTP arm it has not wanted to leave since the era those #5129 rows came from.
(ai-assisted; external figures from #5206/#5212/#5252/#5178 and this issue as published)
@yeyeyeason commented on GitHub (Nov 5, 2026):
Accepted — (b) with (a) as the validation arm, and thank you for re-anchoring the earlier comment rather than letting the two sit in contradiction; the time-order note was the right way to read them.
Three confirmations and one design consequence from your rulings, then the next steps I will take:
Reward is time-per-token; acceptance is the control signal. Agreed, and our own fiction row is the cleaner confession: acceptance reached parity at conf 0.70 (52% vs MTP's 64%) and decode stayed ~10% behind — acceptance moved, the objective did not. Any estimator-rejection test in (b) will be scored by time-per-token against the alternatives, and the design doc will state that before any policy code exists. The inversion you cite from #5206 (acceptance +11 points, decode -4%) is now in the doc's motivation section as the second-box evidence alongside ours.
Inert band and switch budget. Noted as design constraints, with the validation cut at switch boundaries as you specified — a window containing a conf move counts as two windows, and the mixed-workload score is computed per-segment, never across a move.
The 2x 4090 corpus: yes, please. A second hardware for the estimator-replay is exactly what (b)'s validation question needs ("does a short A/B correctly reject the estimator's pick on machines other than the author's"), and MTP-heavy + no YaRN is a useful contrast to our DFlash2 + YaRN x4 regime. When I get to the replay-for-(b) stage I will take you up on the raw log lines.
Planned order of work, no engine code until the design doc carries your sign-off:
One question for the doc, so it does not block the report: for the boot-time A/B's "cheap" budget — is there a published ceiling on how long a start may spend testing (seconds? a fixed token budget?) that the season's accepted startup work has already established, or is that number still open and part of what (b) should propose?
@yeyeyeason commented on GitHub (Nov 5, 2026):
Design draft: the boot-time rejection test for DFlash2 confidence
Status: DRAFT for review on #5271. Nothing here is implemented. Scope follows
the direction agreed in the thread: option (b) from the option vote — a
start-time check that can reject the estimator's confidence pick — with the
replay method of #5275 as the validation arm. Reward is seconds per token;
acceptance is the control signal, never the objective. Default path stays
byte-identical; the mechanism is opt-in.
Problem being solved
Four independent reports (#5129, #5213, #5252, #5178) show the start-time
confidence estimate picking a value that loses decode on the machine it
measured: 0.8 chosen where 0.5 recovered 11%, 0.35 chosen where 0.5 was
needed, the slot estimate missing by 10x (442 vs 8158), and a person's
explicit --draft-conf silently replaced. The estimator cannot see the
machine's real regime from card and slot counts alone; what it needs is not
a better table but the ability to be wrong cheaply and correct itself before
the first real request.
Mechanism (sketch)
At engine start, when drafting is DFlash2 and no explicit --draft-conf was
pinned by the person, run a fixed, small, self-judged probe:
tokens, deterministic sampling) at C0 and at one alternative C1 (the next
CONF_STEPS neighbor).
accepted/offered counters (the control signal only).
C1 for the session. Exactly one rejection step; no loop at boot.
decision, and the total probe cost in seconds.
The probe must be pure generation on the pack's own tokens — no external
files, no network, nothing the person can perceive as content.
Constraints (each with its source)
a constant — proposal: 2 probes x 128 output tokens each, roughly 4-6 s on
a 40-45 tok/s box and proportionally more on slower ones; a box whose
decode is below a floor (say 10 tok/s) skips the probe and keeps C0.
OPEN for maintainers: is there a published ceiling the season's accepted
startup work already established (seconds, or a token budget), or does (b)
own this number? This is the question already asked in the thread.
runtime side of (b) — if any mid-session moves are ever added — must not
move unless a declared threshold is cleared, and must respect a
per-conversation switch budget. The boot probe is one move, spent once;
no runtime loop is proposed here.
expert cache is sized; if the last-stage card's free VRAM is below the
configured reserve (the 1024 MiB warning line), skip the probe. A probe
that pushes a box into WDDM paging would measure paging, not drafting.
tokenizer; the probe's generated tokens are discarded. Two boots of the
same machine must reach the same decision unless the machine itself is
in a different regime (thermal, background).
(STRATA_DF2_BOOT_PROBE=on), matching the --adapt-every precedent: opt-in,
byte-identical default, per-slot state where state exists. Promotion to a
default is a separate decision with its own measurements.
What the probe is NOT
replay showed per-task switching has no headroom on that machine's data).
never changes sampling, quantization, or verification.
the value and the probe does not run, which also resolves #5178's shape if
the override path is kept first-class.
Validation plan (feeds the artifact (a) method)
estimator's pick on a second machine; the #5275 replay scripts re-cut the
probe's decision rule against the six-arm per-request data (would the
threshold have rejected the wrong pick, kept the right one?).
as drift control per udqe's protocol, stats cut at every switch boundary.
probe cost in seconds, free-VRAM at probe time, and the #2065 warning state.
Implementation surface (for the PR, if approved)
Engine: one function near the serve loop start (generate.cpp), reading the
already-counted accepted/offered and per-round ms the STRATA_DF2_TIMING path
exposes; a C1 source (the CONF_STEPS table mirrored engine-side or passed on
the command line); the env switch. Server: nothing (the probe lives
engine-side so it measures what the engine measures). No new files in the
first cut; expected diff under 200 lines including tests.
Build note: CUDA and HIP at minimum (DFlash2 exists in both); SYCL and Metal
compile checks where the file is shared. Validation on this 2x 4060 Ti box
(CUDA); the 4090 corpus covers the second machine offline.
@udqe commented on GitHub (Nov 5, 2026):
Review of the design draft, from the box whose corpus you accepted. Three gifts and one answered question; the overall shape (cheap rejection before the first real request, one move, no boot loop, explicit pins first-class, VRAM guard after cache sizing) is right and we have no structural objection.
Gift 1 - the probe's own arm order carries the warm artifact your replay just caught. Step 2 runs C0 first, C1 second; on a fresh engine the first probe absorbs the cold tax (JIT paths, KV ramp, first-touch pages) and the second does not. That is the same family as the confounding your replay confession names - the 0.35 preference came from quoting only warm round-2 values - relocated from aggregate to per-boot: the rejection test that exists to correct estimator bias can introduce a fixed bias of its own that rejects C0 for reasons that are not the estimator's. Two bounded fixes, pick by taste: (i) three probes, C0-C1-C0, adopt C1 only when both C0 measurements agree it lost - one extra probe and you get a per-boot noise sample for free; (ii) keep two probes but precede them with one discarded 32-token warm-up on the pack's own tokens, which moves the cold tax out of the comparison instead of into one arm. Whichever you choose, the doc should say explicitly why order matters - the next person's probe will not have our history.
Gift 2 - do not pick the rejection threshold by feel when you already hold its distribution. The season's published bands to beat: our 2x 4090 prompt-read rates vary ~4 % boot to boot (3,154 to 3,647 tok/s, the #5052-era logs), and #5129's RTX 3060 windows twice landed a conf gain inside control drift. So a threshold under ~5 % will reject on noise on exactly the slow boxes where the estimator errs. And you do not need to guess it: the #5275 report publishes per-request JSON for all six arms - re-cut time-per-token between same-config arms and set the threshold at that empirical p95, offline, before any code. Declare the number and its provenance in the doc together.
Gift 3 - the boot budget question you asked twice, answered, with a caveat that changes the shape. Our grep finds no published universal ceiling, so (b) owns the number. But the adjacent public failure is #5177 (open, unanswered): Control 0.1.56 hashes 1.4 GB of engine files at startup and the app's
runtime.pystart() waits 5 seconds, so load already fails on those machines before any probe exists. Which means the budget is not really "how many seconds may the probe spend" but "whose clock does the probe eat": propose (i) the probe runs only after the engine signals ready, so it costs request latency, never app startup; (ii) a declared absolute cap (10 s) plus your existing skip-below-floor rule; (iii) the cost line in the log makes the number auditable per boot rather than assumed once; and cite #5177 in the doc as the proof that hidden startup seconds already bite. On our class of box the probe is noise against a multi-hundred-second load; on the #5177 class it is exactly where it hurts - the asymmetry is the reason to gate on ready-state rather than on seconds alone.Commitments from our side. The corpus offer stands with concrete jobs: offline, the raw per-window accepted/offered lines for the estimator-replay whenever you build it; live, when probe code exists, a determinism check on this split-pair box - five boots, same decision each time or a named regime difference - and the probe on/off A/B/A with the MTP drift arm per your validation plan. Gated on the PR existing; nothing runs here before that.
Scope: review commentary only, nothing executed for this comment; all figures from #5129/#5177/#5271/#5275 and our logs as published.
(ai-assisted; our drift band from our own posted threads)
@yeyeyeason commented on GitHub (Nov 5, 2026):
Design doc revision 2: the boot-time rejection test for DFlash2 confidence
Status: REVISED after udqe's design review (the three gifts). Same direction as
revision 1: option (b) from the #5271 vote — a start-time check that can reject
the estimator's gross confidence errors. Reward is time-per-token; acceptance
stays a control signal. Default path byte-identical; opt-in first. Nothing here
is implemented.
Changes from revision 1, each traceable to the review:
warm-up, and an explicit paragraph on why order matters.
provenance attached (Gift 2) — computed offline from #5275's data, stated
with its honest consequence: the probe targets gross estimator errors,
not fine-grained confidence tuning.
cap and per-boot cost accounting (Gift 3), citing #5177 as the reason.
Problem being solved
Unchanged from revision 1: four independent reports (#5129, #5213, #5252,
#5178) of the start-time confidence estimate picking a value that measurably
loses decode on its own machine — 0.8 where 0.5 recovered 11%, 0.35 where 0.5
was needed, a slot estimate off by 10x, a person's explicit pin replaced.
The estimator cannot see a machine's real regime from card and slot counts;
what it needs is the ability to be wrong cheaply and correct itself before
the first real request.
Mechanism (revised)
At engine start, when drafting is DFlash2, the confidence came from the
estimator (no explicit --draft-conf pin), and the engine is ready:
after weights load, expert-cache sizing, and the #2065 free-VRAM check.
It therefore spends request latency, never app startup. #5177 is the
proof that hidden startup seconds already bite: Control 0.1.56 hashes
1.4 GB at start and the app's runtime.py waits 5 s, so some machines
fail before any probe could exist. On our box (hundreds-of-seconds load)
the probe is noise; on the #5177 class it would be exactly where it
hurts. The gate follows the asymmetry.
greedy, output discarded. This moves the cold tax (JIT paths, KV ramp,
first-touch pages) out of the comparison instead of into one arm. Order
matters and here is why: on a fresh engine the first measured generation
absorbs costs the second does not, so any two-arm comparison that runs
the estimator's value first carries a fixed bias against it — the very
family of confound the probe exists to remove, relocated from aggregate
statistics to a single boot. The warm-up is cheaper than a third probe
and removes the bias at its source.
next CONF_STEPS neighbor toward safer confidence. Adopt C1 only when
BOTH C0 measurements agree it lost. The C0-C1-C0 sandwich makes the
comparison symmetric and yields a free per-boot noise sample: the gap
between the two C0 runs is this boot's own drift band, logged every
time.
tokens on a fixed prompt, greedy, on the pack's tokenizer; tokens are
discarded. Time-per-generated-token is the score. The accepted/offered
counters are read but never scored — acceptance is the control signal.
by more than the declared threshold (below). Exactly one rejection step
at boot; no loop. The decision, both raw values, the C0-C0 drift gap,
and the total probe cost in seconds go on one log line.
wall clock (on top of the per-box skip floor below); if the cap trips,
keep C0 and log the incomplete probe. The cap is declared in the doc
and the realized cost is logged per boot so the number is auditable,
not assumed once.
on a box that slow measures the box, not the drafter. Below the
#2065 free-VRAM line at readiness, keep C0 — a probe in the WDDM
paging regime would measure paging. An explicit --draft-conf pin
(user_args) means no probe at all, which keeps the person first-class
and closes #5178's shape.
The threshold, derived not felt (Gift 2)
Method: pool every request from the two five-round same-config repeats in
#5275 (MTP, DFlash2 conf 0.70; 30 requests), compute each request's relative
deviation from its own task-mean, and read the empirical percentiles:
#5129's RTX 3060 twice landed a conf gain inside control drift.
Declared threshold: C1 must beat both C0 runs by ≥ 8% (the p95 rounded
up, above the 4090's 4% band and above the 3060 drift cases). Provenance:
#5275 repeat5 data, method in the #5275 replay.md, recomputable from the
published per-request JSON.
Honest consequence, stated in the doc: the between-conf deltas measured on
THIS box (1-7% warm-weighted) would not trigger it — and should not, because
on this box the estimator's neighbors are within noise of each other. What
the threshold does catch is the class the probe exists for: the #5129-style
gross error (0.8 picked where 0.5 recovers 11%) where the estimator is
wrong by more than any measured run noise. The probe is a guard against
gross errors, not a fine tuner. If a future machine's drift band is tighter
(the 2x 4090 corpus will tell us offline), the threshold can be revisited
with the same re-cut method — the number and its provenance travel together.
What the probe is NOT
Unchanged from revision 1: not a runtime adaptive loop; not a quality judge;
does not override the person. To which revision 2 adds: not a fine-grained
tuner either — the derived threshold deliberately cannot see the 1-7%
neighbor deltas of a well-estimated box.
Validation plan (revised)
re-cuts the decision rule (would an 8% threshold have kept the right
pick on this box? — yes, by construction above; the 2x 4090 corpus
offered in the thread answers the same question on a second box with a
different regime, no YaRN, MTP-heavy).
on / probe off interleaved, an MTP arm as drift control, five boots with
the same decision each time or a named regime difference, stats cut at
every switch boundary, every report carrying both raw values, the C0-C0
gap, the realized cost, free-VRAM and the #2065 state.
threshold came from — the probe improves its own calibration evidence.
Implementation surface (for the PR, if this revision is agreed)
Unchanged from revision 1: engine-side, one function near the serve loop's
ready point in generate.cpp, reading the already-counted accepted/offered
and per-round ms that the STRATA_DF2_TIMING path exposes; the C1 source
mirrors CONF_STEPS; STRATA_DF2_BOOT_PROBE=on gates the whole thing; expected
diff under 200 lines with tests. CUDA and HIP build at minimum, SYCL and
Metal compile-check the shared file; hardware validation on this 2x 4060 Ti
box, the 4090 corpus covers the second machine offline.
@udqe commented on GitHub (Nov 5, 2026):
Sign-off, per your standing "no engine code until the design doc carries your sign-off": revision 2 is agreed as the basis for the PR. All three gifts are in cleanly - the warm-up plus C0-C1-C0 with the both-C0s-agree rule, the empirically-derived threshold with its provenance attached, the readiness gate citing #5177. One arithmetic tension to settle in the doc (non-blocking, your pick), and then the thing you asked the corpus for: we went and got it.
The cap times the probes. Warm-up 32 + three 128-token probes is 416 generated tokens. At your box's 40-45 tok/s that is 9-10 seconds - your declared 10 s cap exactly at your own machine's speed. On a 25-35 tok/s box the cap trips first: keep C0, log incomplete, probe never runs - on precisely the slower population where the estimator's gross errors bite hardest (#5129's class lives there). Three ways out, take your choice: shrink probes to 96 tokens (320 tokens, ~7-9 s on your box); scale the cap off measured speed at readiness (e.g. max(10 s, 416 / tok_s x 1.5)); or declare the cap as a cost guarantee and let your existing skip-floor own the slow-box case explicitly. Whichever you choose, the doc should carry the multiplication, not just the cap.
The corpus answer, with numbers. To make the offline question answerable we ran DFlash2 on our 2x 4090 box this afternoon - disclosed: the mode change and five restarts were approved by the operator here, all reversible, config restored byte-identical afterwards (F2AB...CDA anchor). First finding for the doc's own file: your
isn't available in this modenote is the pipeline-windows gate (drafting.py's blocked_by: batch/slots/pipeline-windows/parallel) - we proved it both ways live (with --pipeline-windows 2: control silently keeps MTP; removed: DFlash2 boots, drafter 862 MiB, needle 2/2). Second, the sweep you asked about: six fixed prompts x 5 repeats x 256 tokens, temperature 0, pinned conf, server-measured decode time per token, same re-cut method as your repeat5.Two operational FYIs from the D2 boots. Control does not pin --draft-conf on our launch shape, so the probe's no-pin precondition holds for control-launched D2 runs. And the engine itself warns that a restored conversation whose drafter-side log was evicted "drafts poorly for the first rounds" - invisible to the estimator's table and to a self-judged probe; agent-style workloads (like ours) will show low first-round acceptance on session restarts no matter what conf the probe picks. Not your mechanism's problem; worth a limitations line.
Commitments stand: the three sweep JSONs stay here and can be published as a benchmark report or pasted whole if that serves the doc better; the five-boot determinism check and the probe on/off A/B/A with the MTP drift arm stay committed for when the PR exists.
Scope: D2 numbers are our box, pinned boots, n=5 short windows, one run per conf (0.50 and 0.70 on different boots - probe-representative per boot, boot factor included); production restored and re-verified after.
(ai-assisted; sweep protocol declared before data, files pinned on our side)
@yeyeyeason commented on GitHub (Nov 5, 2026):
Signed off received — thank you. Revision 2 stands as the PR basis, and your arithmetic note is accepted as a blocking fix for revision 3 before any code, because it changes a number in the mechanism:
The cap, settled: your option three, with the multiplication in the doc. The 10 s figure was derived as a cost guarantee, and your showing that 416 tokens at 40-45 tok/s already brushes it at the author's own speed makes the intent explicit: the cap is a wall-clock promise to the person, and the skip-floor owns the slow-box case by design, not by accident. So the mechanism reads: warm-up 32 + 3x128 = 416 tokens; a box whose measured decode at readiness gives 416 / tok_s > 10 s (i.e. below ~42 tok/s) reaches the same outcome as the skip-floor — keep C0, log the reason — without spending ten seconds to learn it; the doc carries the multiplication and both routes to the same decision. One line in the log states which route fired. This deliberately chooses your third option over shrinking the probes (a 96-token probe trims the wrong thing — measurement length, where the both-C0s-agree rule needs the samples) and over speed-scaled caps (a moving target that makes the "cost guarantee" mean different things on different boxes).
The threshold, settled per your reframe: a per-box constant, born from the loop. 8% stands as the author-machine floor and is labeled exactly that. The mechanism's decision rule becomes: threshold = max(author floor 8%, this box's C0-C0 drift gap from the boot's own sandwich, rounded up to whole percent). First boot uses the floor; every boot after the first refines the box's own constant from its logged C0-C0 gap; the corpus question closes because no cross-box number is ever load-bearing. Your 4090 data is the reason this is honest: p95 8.3% (an upper bound, as you note, 256-token windows inflate it) means a single 8% everywhere would have been author-machine overreach — the number your rule derives from your own data is 9-10%, and under the per-box scheme that is what your box would converge to, not what the doc hardcodes. We checked what the loop would do on day one on your box: floor 8%, C0-C0 gaps pooled under it, threshold stays 8 until a boot's own gap clears it. Consistent with your numbers either way.
Your third live instance of the inversion is now the doc's motivation triplet — our fiction row (acceptance 52 vs 64%, decode -10%), #5206 (+11 points acceptance, -4% decode), and your 4090 today (+8 points acceptance, +6.2% worse time-per-token, five of six tasks). Three boxes, three content types, one direction. The limitations section also carries your two FYIs: agent-style workloads show low first-round acceptance on session restarts after drafter-log eviction (invisible to the estimator and to the probe — not this mechanism's problem, stated so nobody reads a probe miss there), and the 6.2%-class real error that correctly survives an 8%-threshold box — the guard is for gross errors, and we say so in the same breath as the threshold, not in a footnote.
The both-C0s-agree rule earning its cost (your per-task signature finding: +8.9% on one task, +4.3% on another for the same delta) goes into the design doc as the recorded justification for the third probe — you asked for the doc to say why order matters; it now also says why the sandwich's symmetry matters, with your numbers cited.
The pipeline-windows gate you proved both ways live is a bug we filed already in spirit but not by number: #5178-adjacent, and worth its own line. For this thread the relevant consequence is recorded: a control-launched DFlash2 run that keeps
--pipeline-windows 2silently stays on MTP — the probe's no-pin precondition holds, but the "isn't available in this mode" note deserves a distinct status so a reader cannot mistake a gate for a pin. We will cross-reference this thread in a small bug report for the silent gate unless one exists when we file it — checking #5178's thread for overlap first, per the contribution rules.Revision 3 (the multiplication, the per-box threshold loop, the motivation triplet, the two limitation lines, the sandwich justification) will be posted to this thread as the doc the PR implements. The engine build environment on the author box is being stood up in parallel so the PR can follow quickly once revision 3 is up.
The corpus numbers change nothing about our commitments: they strengthen them. When the PR exists, the five-boot determinism check and the on/off A/B/A with the MTP drift arm run on your side as offered, and the sweep JSONs can be published alongside the author's six-arm data as the second-machine section of the eventual report — your call whether report or paste; either serves.
@yeyeyeason commented on GitHub (Nov 5, 2026):
Design doc revision 3 (final): the boot-time rejection test for DFlash2 confidence
Status: FINAL BASIS FOR THE PR, per the sign-off on revision 2 and the agreed
settlements in this thread. Revision 3 folds in the arithmetic fix, the
per-box threshold, the motivation triplet, the sandwich justification, and
the two limitations lines. After this comment the design is complete; the
next artifact from this side is engine code behind
STRATA_DF2_BOOT_PROBE.Direction unchanged since revision 1: option (b) — a start-time check that
can reject the estimator's GROSS confidence errors before the first real
request. Reward is time-per-token; acceptance stays a control signal. Default
path byte-identical; opt-in first; the person's explicit pin is first-class
and means no probe.
Problem being solved
Unchanged: #5129, #5213, #5252, #5178 — the start-time confidence estimate
picking values that measurably lose decode on their own machines (0.8 where
0.5 recovered 11%, 0.35 where 0.5 was needed, a 10x slot-estimate miss, a
person's pin silently replaced). The estimator cannot see a machine's real
regime from card and slot counts; it needs the ability to be wrong cheaply
and corrected before the first real request.
Why the reward cannot be acceptance — three live instances, three boxes,
three content types, one direction:
An EWMA or probe that steers on acceptance sits happily at the wrong value
whenever the slope is inverted; one that scores time-per-token cannot.
Mechanism (final)
Preconditions: drafting is DFlash2; the confidence came from the estimator
(no
--draft-confpin in user_args — a pin means no probe, which alsocloses #5178's shape); the engine has signaled ready; measured decode at
readiness is at or above the 10 tok/s floor; free VRAM on the last-stage
card is at or above the #2065 warning line.
weights loaded, expert cache sized, VRAM checked — so it spends request
latency, never app startup. #5177 (1.4 GB hashed at start, a 5 s app
timeout) is the proof that hidden startup seconds already fail machines;
the gate follows that asymmetry.
fixed generation is warm-up 32 + 3 x 128 = 416 tokens. At the
author's 40-45 tok/s that is 9-10 s; at 25-35 tok/s it exceeds 10 s
before starting. Two routes to the same decision, both logged:
"keep C0" — the box spends zero seconds learning what the arithmetic
already said;
the floor whose speed estimate was optimistic; a tripped cap keeps
C0 and logs the incomplete probe.
The slow-box population is where the estimator's gross errors bite
hardest (#5129's class); the skip-floor owns it by design, not by
accident. The doc carries the multiplication, not just the cap.
own tokens, output discarded — moves the cold tax (JIT, KV ramp,
first-touch pages) out of the comparison instead of into one arm.
Why order matters, recorded for the next person: on a fresh engine
the first measured generation absorbs costs the second does not; any
two-arm comparison that runs the estimator's value first carries a
fixed bias against the very error it exists to detect. The same family
of confound as quoting only warm round-2 values in aggregate —
relocated from statistics to a single boot.
next CONF_STEPS neighbor toward safer confidence. Adopt C1 only when
BOTH C0 measurements agree it lost. Why the sandwich matters,
recorded with the 4090's numbers: the same 0.70-vs-0.50 delta
measured +8.9% on one task and +4.3% on another — a single-prompt
probe carries its own task signature, and the both-C0s-agree rule is
exactly what absorbs it. The C0-C0 gap between the sandwich's two ends
is this boot's own drift sample, logged every time.
greedy, pack tokenizer, tokens discarded. The accepted/offered
counters are read for the log line, never scored.
machine's derivation (recorded as the floor's provenance): pool of 30
same-config requests from the #5275 repeat5 data — p50 1.5%, p95 6.5%,
max 10.1% — and udqe's 2x 4090 (n=90, six prompts x 5, disclosed as
256-token windows that inflate the band): p50 2.3%, p95 8.3%, max
13.1%. A single cross-box number would be author-machine overreach —
the 4090's own rule derives 9-10%. So: threshold = max(author floor
8%, this box's pooled C0-C0 drift gap, rounded up to a whole
percent). First boot on any box uses the floor; every boot's logged
C0-C0 gap refines that box's own constant. No cross-box number is ever
load-bearing; the corpus question stays closed because the loop
replaces it.
C0 runs by the per-box threshold. Exactly one rejection step at boot;
no loop beyond the threshold's self-calibration. One log line: both
raw C0 values and C1's, the C0-C0 gap, the threshold used and its
source (floor or box constant), the decision, the route that fired
(ran / skipped-slow / skipped-VRAM / capped), and the realized cost
in seconds.
below 10 tok/s at readiness: keep C0, the box measures itself, not
the drafter; (c) free VRAM below the #2065 line: keep C0, a probe in
the WDDM paging regime would measure paging; (d) budget arithmetic or
cap: keep C0 per item 1.
What the probe is NOT
Not a runtime adaptive loop (per-task switching has no headroom on this
data — the #5275 oracle check). Not a quality judge. Not a fine-grained
tuner: on a well-estimated box the 1-7% neighbor deltas sit inside noise
and correctly survive the threshold; the guard exists for the #5129-class
gross error (11%+). Not an override of the person.
Limitations, stated
the guard — by design, and stated here rather than discovered later.
restarts after drafter-log eviction (the engine says so itself); that
is invisible to the estimator and to a boot-time probe and is not this
mechanism's problem — recorded so a probe miss is not misread there.
--pipeline-windowsgate: a control-launched DFlash2 run that keeps--pipeline-windows 2silently stays on MTP ("isn't available in thismode"). The probe's no-pin precondition holds regardless, but the
silent gate deserves its own report — to be filed after checking
#5178's thread for overlap, per the contribution rules.
Validation plan
decision rule on the author box (an 8% floor keeps every right pick
measured there — by construction, the neighbor deltas are below it);
the 4090 sweep JSONs, when shared, answer the same question on the
second box under the same re-cut method.
same decision each time or a named regime difference; probe on/off
A/B/A interleaved with an MTP drift arm; stats cut at every switch
boundary; every report carrying both raw values, the C0-C0 gap, the
threshold and its source, the realized cost, free VRAM, and the #2065
state.
the probe improves its own calibration evidence, and the threshold is
a product of that loop.
Implementation surface
Engine-side, one function at the serve loop's ready point in
src/program/generate.cpp, reading the already-counted per-roundtimings; the C1 source mirrors CONF_STEPS;
STRATA_DF2_BOOT_PROBE=ongates everything (opt-in, default off, default path byte-identical, per
the
--adapt-everyprecedent). Expected diff under 200 lines withtests. CUDA and HIP build at minimum (DFlash2 exists in both); SYCL and
Metal compile-check the shared file. Hardware validation on this
2x 4060 Ti box; the 4090 covers the second machine live, per the standing
commitments.