[PR #5293] [Engine] dflash2: opt-in boot-time rejection test for the draft confidence (STRATA_DF2_BOOT_PROBE) #5373

Open
opened 2026-11-07 16:34:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5293
Author: @yeyeyeason
Created: 11/5/2026
Status: 🔄 Open

Base: main ← Head: engine/dflash2-boot-probe


📝 Commits (1)

  • 3cf88f6 [Engine] dflash2: opt-in boot-time rejection test for the draft confidence (STRATA_DF2_BOOT_PROBE)

📊 Changes

1 file changed (+159 additions, -7 deletions)

View changed files

📝 src/program/generate.cpp (+159 -7)

📄 Description

Problem and result

Implements the agreed revision-3 design from #5271: an opt-in boot-time rejection test for DFlash2's draft confidence (STRATA_DF2_BOOT_PROBE), the "(b) boot-time rejection test" that the direction vote selected - a start-time check that can reject the estimator's gross --draft-conf errors before the first real request, validated by the replay method of #5275.

Result: on the author's 2x 4060 Ti, five fresh boots produce five complete decisions, all "keep" (the box's estimator value is within noise of its neighbor - exactly the case the design says not to touch), with the C0-C0 drift band measuring 3.9-6.4% per boot.

Related discussion: #5271 (design sign-off on revision 2, revision 3 carries the agreed changes), #5275 (the replay method and the acceptance-inversion evidence the threshold's provenance comes from), #5129 / #5213 / #5252 / #5178 (the wrong-static-pick reports this guards against).

Approach

Four synthetic requests queued through the full serve machinery before the loop takes real lines (the server sends nothing until it saw READY): a discarded 128-token warm-up at the same window width as the measured arms, then a C0-C1-C0 sandwich at the conf in force and its CONF_STEPS neighbor. Each arm runs a different counting prompt (count from 1 / 101 / 201 / 301: same shape, no shared cache warming - same-prompt arms were measured warming monotonically from 51.7 to 112.8 tok/s by position alone, which the sandwich cannot absorb). Probe arms emit no protocol lines (T/PP/RESUME/REUSED/DONE gated by probe_active; the numbers are read at the DONE-side hook instead). The decision: adopt C1 only when it beats both C0 arms on ms/token by more than max(8% floor, this boot's C0-C0 gap); one rejection step, no loop. An arm ending below 48 tokens is invalid (greedy continuations differ per conf and boot) - the probe reports inconclusive and keeps the default. The engine cannot distinguish a person's --draft-conf from the server estimator's, so the env var is the whole opt-in; the pin check stays a server-layer concern (#5178's shape).

Gated entirely behind STRATA_DF2_BOOT_PROBE=on; default off; the default path is byte-identical - every changed line sits behind probe_active or the env check. ~160 lines in one file (src/program/generate.cpp), no new files, per the design's implementation surface.

Validation

Passed:

  • Built locally (CUDA 13, sm_89, MSVC 19.44, CMake+Ninja, self-built from ffa80d73 + this change; the diff compiles and links clean).
  • Five fresh engine boots through the server stack: five complete probe decisions, all "keep"; C0 8.99-9.21, C0b 8.61-8.69, C1 8.85-9.09 ms/token; C0-C0 gaps 3.9-6.4%; threshold at the 8% floor every time. Log: E:\Strata-dev-data\reports\probe-determinism-20261105\ (raw boot lines + results.json on the author box; can be attached).
  • The earlier failure modes were each reproduced, root-caused and fixed before this run: same-prompt position bias (distinct prompts), protocol-stream pollution cancelling arms mid-probe (gated output), prompt-read cold tax (same-width warm-up), conf-pin misclassification (env-as-opt-in). Each fix is commented at its site with the measurement that motivated it.

Failed: none in the final round.

Not run:

  • HIP, SYCL and Metal builds - CUDA only. The change is engine-generic C++ beside the serve loop, but only the CUDA backend was compiled and run.
  • The live A/B/A with the MTP drift arm and the five-boot determinism check on the 2x 4090 box (committed on #5271 when a PR exists - this PR is that trigger).
  • Any second hardware.
  • The server layer does not pass the env var through; the probe is engine-side opt-in only, matching the design's "Server: nothing" for the first step.

Limits

  • One machine, one model/quantization; the counting prompts are English-digit tasks (the design's determinism rationale is recorded at the id-list definition, but the prompts were only validated on this box).
  • The 8% threshold floor is the author-machine value from #5275; the per-box self-calibration (C0-C0 gap accumulating per boot) seeds from this run but only one boot's gap exists per start - the loop's long-run convergence is untested.
  • Arms shorter than 48 tokens make the probe inconclusive rather than retrying; a prompt regime where the model consistently ends early would leave the probe always-inconclusive on that box (not wrong - no decision is made).
  • --pipeline-windows runs keep MTP silently (the gate proved live on #5271's thread); the probe simply does not run there because DFlash2 is not active.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/5293 **Author:** [@yeyeyeason](https://github.com/yeyeyeason) **Created:** 11/5/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `engine/dflash2-boot-probe` --- ### 📝 Commits (1) - [`3cf88f6`](https://github.com/Niko1221/Strata/commit/3cf88f6fa7b8d295372442aed59996c66276f751) [Engine] dflash2: opt-in boot-time rejection test for the draft confidence (STRATA_DF2_BOOT_PROBE) ### 📊 Changes **1 file changed** (+159 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/program/generate.cpp` (+159 -7) </details> ### 📄 Description ## Problem and result Implements the agreed revision-3 design from #5271: an opt-in boot-time rejection test for DFlash2's draft confidence (`STRATA_DF2_BOOT_PROBE`), the "(b) boot-time rejection test" that the direction vote selected - a start-time check that can reject the estimator's gross `--draft-conf` errors before the first real request, validated by the replay method of #5275. Result: on the author's 2x 4060 Ti, five fresh boots produce five complete decisions, all "keep" (the box's estimator value is within noise of its neighbor - exactly the case the design says not to touch), with the C0-C0 drift band measuring 3.9-6.4% per boot. Related discussion: #5271 (design sign-off on revision 2, revision 3 carries the agreed changes), #5275 (the replay method and the acceptance-inversion evidence the threshold's provenance comes from), #5129 / #5213 / #5252 / #5178 (the wrong-static-pick reports this guards against). ## Approach Four synthetic requests queued through the full serve machinery before the loop takes real lines (the server sends nothing until it saw READY): a discarded 128-token warm-up at the same window width as the measured arms, then a C0-C1-C0 sandwich at the conf in force and its CONF_STEPS neighbor. Each arm runs a **different counting prompt** (count from 1 / 101 / 201 / 301: same shape, no shared cache warming - same-prompt arms were measured warming monotonically from 51.7 to 112.8 tok/s by position alone, which the sandwich cannot absorb). Probe arms emit **no protocol lines** (T/PP/RESUME/REUSED/DONE gated by `probe_active`; the numbers are read at the DONE-side hook instead). The decision: adopt C1 only when it beats **both** C0 arms on ms/token by more than `max(8% floor, this boot's C0-C0 gap)`; one rejection step, no loop. An arm ending below 48 tokens is invalid (greedy continuations differ per conf and boot) - the probe reports inconclusive and keeps the default. The engine cannot distinguish a person's `--draft-conf` from the server estimator's, so the env var is the whole opt-in; the pin check stays a server-layer concern (#5178's shape). Gated entirely behind `STRATA_DF2_BOOT_PROBE=on`; default off; the default path is byte-identical - every changed line sits behind `probe_active` or the env check. ~160 lines in one file (`src/program/generate.cpp`), no new files, per the design's implementation surface. ## Validation Passed: - Built locally (CUDA 13, sm_89, MSVC 19.44, CMake+Ninja, self-built from `ffa80d73` + this change; the diff compiles and links clean). - Five fresh engine boots through the server stack: five complete probe decisions, all "keep"; C0 8.99-9.21, C0b 8.61-8.69, C1 8.85-9.09 ms/token; C0-C0 gaps 3.9-6.4%; threshold at the 8% floor every time. Log: `E:\Strata-dev-data\reports\probe-determinism-20261105\` (raw boot lines + results.json on the author box; can be attached). - The earlier failure modes were each reproduced, root-caused and fixed before this run: same-prompt position bias (distinct prompts), protocol-stream pollution cancelling arms mid-probe (gated output), prompt-read cold tax (same-width warm-up), conf-pin misclassification (env-as-opt-in). Each fix is commented at its site with the measurement that motivated it. Failed: none in the final round. Not run: - HIP, SYCL and Metal builds - CUDA only. The change is engine-generic C++ beside the serve loop, but only the CUDA backend was compiled and run. - The live A/B/A with the MTP drift arm and the five-boot determinism check on the 2x 4090 box (committed on #5271 when a PR exists - this PR is that trigger). - Any second hardware. - The server layer does not pass the env var through; the probe is engine-side opt-in only, matching the design's "Server: nothing" for the first step. ## Limits - One machine, one model/quantization; the counting prompts are English-digit tasks (the design's determinism rationale is recorded at the id-list definition, but the prompts were only validated on this box). - The 8% threshold floor is the author-machine value from #5275; the per-box self-calibration (C0-C0 gap accumulating per boot) seeds from this run but only one boot's gap exists per start - the loop's long-run convergence is untested. - Arms shorter than 48 tokens make the probe inconclusive rather than retrying; a prompt regime where the model consistently ends early would leave the probe always-inconclusive on that box (not wrong - no decision is made). - `--pipeline-windows` runs keep MTP silently (the gate proved live on #5271's thread); the probe simply does not run there because DFlash2 is not active. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5373
No description provided.