Case file — PR #571 "helios: force a wide round after persistent width-one selection"
Author malventano (CONTRIBUTOR) · base main · head aab9295 · opened and last updated 2026-11-28 · 3 files, +78/−3 · no labels, no reviewers, no CI checks, no comments · Discord malventano.
Link: https://github.com/NVIDIA/hyperflare-inference/pull/571
Key findings
- The description says it logs
Forced wide:; the diff does not log anything. Searchingpr/571forForcedmatches onlydocs/logprobs-design.md:19(not opened) anddocs/model-storage.md:42(not opened), both unrelated. The quoted log lines in the description come from the instrumented prototype imageflare-toolstream:v0.3.2-49-gd17efddc-argdiag-20261128, not from this change. There is therefore no operator-visible signal in the code as proposed. (refresh.rs/policy.rsdiff at pr/571;pr_diff.) - An undeclared edit to a shared test helper.
completion_recordschangesoffered_draftsfrom(plan.token_capacity - 1)(policy_tests.rs:206onmain) to(lane.tokens - 1)(policy_tests.rs:239at pr/571). Completion validation rejectsoffered >= lane.tokens("speculative round completion exceeds its frozen lane ceiling",helios/src/scheduler.rs:2539), so the helper only had to change because wide plans whose lanes are frozen at a smaller ceiling now occur inside existing test traces — i.e. evidence the fallback fires beyond the new test. The description never mentions it. (Inference from code; I did not run the suite.) - The author's own live evidence is a cost, not a win. Forced rounds ran 64.9–66.6 ms against about 5.3 ms for normal width-eight plans, and there were 30 forced selections in three seconds — the streak being re-earned immediately, the pathological steady state the description itself warns about under Limits.
- The counter is per-scheduler, not per-request, and natural "tail" width-one rounds feed it.
width1_streaklives onRefreshState(scheduler.rs:769), andspeculative_tokensclamps width to 1 near the end of a request (helios/src/scheduler.rs:2295–2305). Two unrelated requests finishing can therefore arm a forced wide round for whatever cohort ordinary selection was about to serve. Not mentioned in the description. - Nothing in docs, the scheduling simulator, or the formal model was updated, although the repository's own rules ask for it when scheduling policy changes (
AGENTS.md:52–60,AGENTS.md:231).docs/scheduling-runtime-design.md:241–282and:434–490still describe the pre-change rule and the two funded escape paths;scripts/scheduling_simhas no forced-wide policy. - The author states a merge precondition the PR does not meet: "Do not merge before #540 is resolved." #540 is still open (reviewed 2026-11-28 07:34 with "Merge After Should-Fix", 0 blockers, 4 should-fix) and touches the same struct. The branch point is
d17efddc, andmainhas since merged #569 and #568 into the same files, so the rebase is already due. - Charter tension, stated by the author themself. The charter asks for benchmarked speedups or root-cause fixes ("Bring real evidence… Bug fixes need to address the root cause", charter line per
read_charter); this change self-describes as "not a recovery fix", "a bounded fail-safe", with "No A/B against a build without the fallback exists". - The problem is real and measured elsewhere: #306 (measured 17/483/197/70 width-one rounds before the first ordinary drafting round; 37–59 tok/s vs 54–62 tok/s), #414 (52% of single-user rounds at width 2 on GLM-5.3-Flash → 0%), #522 (31.61% → 4.06% plain-W=1 share across a 15-cell matrix), #530 (structured output on DeepSeek-V4.1-Flash-1017: 176 → 55 tok/s because "MTP drops to width one"). This PR cites none of them.
The change
What it does, in plain terms. Two edits to the scheduler:
RefreshState(helios/src/scheduler/refresh.rs:34–39) gainswidth1_streak: AtomicU64, and a newpub(super) fn force_wide_due(&self) -> bool { self.width1_streak.load(Relaxed) >= 2 }(refresh.rs:53–55).commit(refresh.rs:65–74,_steprenamed tostep) increments that counter when the committed plan isPlanOrigin::Ordinaryandstep.kind == GraphKind::Speculative && step.draft_tokens == 0, and resets it to 0 for every other ordinary commit.select_plan(helios/src/scheduler/policy.rs:1281–1309) gains a block after the acceptance-probe loop: ifforce_wide_due(), filtercandidatestokind == Speculative && draft_tokens > 0 && batch == ordinary.batch && mask == ordinary.mask, takemax_by(draft_tokens → capacity → packed_token_capacity →compare), sethost_lengths = None, and plan it asPlanOrigin::Ordinary; fall through to the ordinary plan ifavailable_planreturnsNone.policy_tests.rs: new testtwo_ordinary_width_one_plans_force_a_wide_round(:51–83) plus the shared-helper change described above (:239).
Precedence verified (policy.rs:1207–1311): discovery early-return (ordinary.rate.duration_ns == 0 → PlanOrigin::Discovery, :1237–1239), then funded refresh (:1240–1275), then acceptance probe (:1276–1280), then the forced block (:1281–1309), then ordinary (:1310). So "funded refresh and acceptance probes win first" is true; the description does not mention that a discovery winner also returns before the fallback can run.
Selection ordering is not the documented rule. The ordinary rule (policy.rs:1217–1235, documented at docs/scheduling-runtime-design.md:241–261 as value-rate maximization with domination pruning, including "Timing estimates cannot make redundant padding preferable") reaches compare only as the fourth tiebreak in the forced path, so among equal-draft shapes the forced path prefers the larger (more padded) packed_token_capacity before any price is consulted. It also scans the entire candidate vector, including the dominated tail that prune_padding keeps only for refresh probes (policy.rs:169–202).
Not hardcoded to width 8 — verified. The filter is draft_tokens > 0 with no width constant; speculative candidates come from speculative_catalog (policy.rs:1092–1099) plus packed-round shapes (rounds.rs:717–880). In the new test the widest shape is drafts 7 / capacity 8 because tests::duration_graphs builds drafts 0..=7.
Lane recomputation — verified. candidate.host_lengths = None (policy.rs:1298) makes materialize (policy.rs:1405–1445) call round_lengths_optimistic, bounded by round_ceilings = speculative_tokens(request, width.min(drafts+1)) (rounds.rs:435–441), so recomputation cannot exceed what speculative_tokens permits.
Counter semantics — verified. Only ordinary Speculative plans with draft_tokens == 0 increment; every other ordinary commit (Decode, Mixed, Prefill, Init, Restore, Snapshot, Resume, Vision, or Speculative with drafts) resets. Probe/refresh commits neither increment nor reset. Neither idle() (refresh.rs:102–105) nor abort() (:107–110) touch it. It is never decayed.
Second-order effects a reader will not get from the description:
- The forced plan is
PlanOrigin::Ordinary, so it earns refresh credit, commits as ordinary, and is reported as ordinary service (TimingOrigin::Ordinary,scheduler.rs:2391) feedingflare_scheduler_executions_total{reason="service"}(helios/src/server/metrics/scheduler.rs:174–181(not opened)). With no log line, an operator cannot see a forced round in metrics or logs. - While the streak is ≥ 2 the block runs on every planning pass, and
host_lengths = Noneforces a freshround_lengths_optimisticper lane (rounds.rs:447–490) — planning work on the model-worker thread, the area #547 measures. Ifavailable_planrejects the forced candidate (policy.rs:1349–1354), the scan is paid and the ordinary plan is used anyway. width1_streakisAtomicU64/Relaxedalthoughcommittakes&mut selfand no cross-thread reader exists in the diff.
Description vs code — what the description claims that the change does not do: (a) the Forced wide: log line (absent); (b) implicitly, that operators can observe the fallback — nothing in the diff does that. What the change does that the description does not say: the shared test-helper change; preferring larger packed capacity before price; running only when the ordinary winner is measured; being inert for PlanOrigin::Mixed or Decode ordinary winners.
The why
The problem it addresses. "A width-one episode can still persist… the current policy has no upper bound on how long ordinary width-one selection lasts." Where that state comes from, from the docs and neighbouring work:
- The funded refresh ledger earns
0.002/0.998of measured execution capped at 5 ms (docs/scheduling-runtime-design.md:434–465), so the first refresh needs ~2,495 ms of credited ordinary execution, and "Repeated shorter busy periods separated by idle can leave unused graph estimates stale indefinitely." - Acceptance learning earns
0.01/0.99capped at 5 ms (:467–490); "Fixed-width execution does not probe acceptance." - #306 (open, original-el8) measured 17, 483, 197 and 70 width-one rounds before the first ordinary drafting round, at 37–59 tok/s against 54–62 tok/s with the population prior — independent evidence of long width-one stretches and of the probe-gated mechanism.
- #312 (open, original-el8) documents the probe cadence directly: "one request funds a probe about every 6 s", three of twelve requests spending 12–26 s at 48–51 tok/s.
- #530 (open, devinkuhn) is the production report: structured output on DeepSeek-V4.1-Flash-1017 gb202 TP4 decodes 176 → 55 tok/s with json_schema because "MTP drops to width one"; median 54.8 s vs 21.5 s and 85 of 450 requests hitting a 120 s client timeout. The PR's own evidence is from "the 1017 service" (
flare-toolstream:…-argdiag-20261128), the same package family, but it does not link #530. - Width one is sometimes mandated, not a fault: grammar-constrained MTP and host-evaluated custom stops are pinned to width one (
docs/mtp-design.md:434–436;helios/src/scheduler.rs:2295–2305). The fallback cannot help those lanes (see Reach).
How long and how widely wanted. No earlier item proposes this mechanism. The width-one problem has been worked avoidance-style for weeks: #188 (2026-11-03), #414/#306 (acceptance priors, 2026-11-15/20), #515/#521/#522 (GPU confidence calibration, 2026-11-25), #510 (packed duration zeroing, 2026-11-24), #540 (refresh credit, 2026-11-26). The PR positions itself explicitly as a safety net for what #540 does not cover.
Related work
- #540 (open, FujitsuPolycom) — the stated root cause and merge precondition. Shares
policy_tests.rsandrefresh.rs. At982a9ce3it replacesRefreshState::idlewith credit retention and splitscompleteintoobserved_compute_duration_ns/observed_duration_ns. #571'srefresh.rsis built on main's older shape (stillidle()atrefresh.rs:102–105), so they touch adjacent code in the same struct; the PR's own Merge order section says to rebase. The rebase itself is small: one field, one method, three lines incommit. #540's review record: reviewed 2026-11-28 07:34, "Recommendation: Merge After Should-Fix", 0 blockers, 4 should-fix; 10 discussion entries including a live-GPU verification. - #306 / #414 (acceptance priors) — the same problem attacked at the estimate rather than the selection. #414 merged (52% of single-user rounds at width 2 → 0%); #306 still open. #571 cites neither; together they are alternative answers to the same question.
- #515 / #521 / #522 (GPU confidence calibration, surplus history, merged) — explicit goal of cutting plain-W=1 round share; #522 measured 31.61% → 4.06% over a 15-cell matrix and 47.7% → 2.0% post-32K at HARD C16. Closest published measurement of how much width one survives prevention; not cited.
- #510 (merged, lukealonso) — "Prevent unmeasured packed speculative shapes from zeroing measured round durations"; a zeroed duration is exactly the degenerate estimate that can make a wide shape look useless. Not mentioned.
- #547 (open, shieldstar) — candidate-pricing cost, the same planning-cost area the new per-pass scan and lane recomputation add to.
- #530 (open issue) — the structured-output report whose mechanism is width one; not linked.
- #555 (merged, Martin Vit, 2026-11-27) — added intermediate batch capacities 6, 12, 24, which mechanically enlarges the candidate set the forced
max_bynow ranges over. - #483, #381, #229, #334, #426, #538, #568, #569 touch the same files but not this topic; no overlap found.
- Not found: any other PR or issue proposing a forced wide round, and nothing this PR supersedes or undoes.
Recent activity
Base main at d17efddc (Martin Vit, #561 io_uring Engram disk lanes). Since then main merged 7cd83f32 (#569, Luke Alonso, retiring boundary captures) and 5deacda9 (#568, Endpoint checkpoint eviction), both touching scheduler files, so the PR head is behind main and the PR's own comparison base is already stale.
Last three weeks in the same files, all relevant to how the fallback will behave:
- #555 (
c9693765, 2026-11-27, Martin Vit) added batch capacities 6/12/24 — more speculative candidates now compete in the forcedmax_by. - #522 (
e30d55db) and #515 (1e78f080, 2026-11-25) reworked speculative pricing/calibration — the forced path bypasses all of it:compare(and thereforerate) is only the fourth tiebreak, making this the only place inpolicy.rsthat picks a speculative shape by geometry. - #510 (
fd6c0f3b, 2026-11-24) fixed zeroed packed durations. - The funded-refresh/probe design it extends came from
d7938c98(2026-10-20) and596d64cd(2026-10-21), both Luke Alonso. - No commit on
mainsinced17efddcadds a width-one counter or rewritesRefreshState::commit, so apart from the #540 adjacency this builds on current work rather than reversing it. The one interaction to watch: #555 enlarged the candidate set, and this PR changes how that set is ranked.
People
- Author: malventano, GitHub association CONTRIBUTOR (not among the charter's priority contributors @voipmonitor / @original-el8 / @lukealonso). 180 days: 1 merged (#316 "Accept 16-bit PNG input by stripping samples to 8 bits", 2026-11-17, touching
helios/,helios/src/,tests/frontend), 1 open (#381 qwen38_dense vision tower, 2026-11-19), and this one. A real but small record in the runtime; not a scheduler-area regular. - Who owns these files: over 180 days
helios/srccommits are Luke Alonso (212), Martin Vit (51), yatesdr (47). On scheduler policy specifically: Luke Alonso (funded refresh/acceptance probes, #510, #538, #568, #569), Martin Vit (calibration/surplus line, #515, #522, #555), yatesdr (acceptance priors #414, prefill pricing), FujitsuPolycom (#540 refresh credit, #538 discovery). None has commented on #571. - Engagement: none. No comments, reviews, reactions, labels or CI. The description cedes priority to #540's fix rather than claiming to replace it, and names a Discord handle as the project asks.
- Conventions the author will meet: four-part description (
AGENTS.md:72–140) — present and well done; aDesign-Signed-Off-By: <identity>; design-review=<4 hex>trailer on the final commit (docs/design-review.md:263–314) — presence unconfirmed, since only subject lines were visible in history.
Community
pr_comments for #571 returns "No comments": zero comments, zero reviews, zero inline comments, no reactions, no labels, no CI checks on aab9295. The item is hours old, so this is a fact about age as much as merit. Notably no flare-autobot intake comment or review ran, whereas every recent sibling (#306, #522, #540) got one.
Where engagement came from on siblings, for calibration: #540 has 10 discussion entries including three autobot reviews and a live-GPU verification from voipmonitor across a 9-PR and 12-PR stack; #522 had an A/B table across four hardware cells and still got Changes Requested; #306 has three comments and a CHANGES_REQUESTED review. The bar in this area is live A/B plus disclosed regressions.
Project fit
- Charter: "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210). Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)." This PR self-describes as "not a recovery fix", "a bounded fail-safe", with no A/B and an admitted possible throughput loss. By the charter's own words it is neither a benchmarked speedup nor a root-cause fix, and the author says so. - "Keep the runtime small and model-agnostic" — respected: it keys on
GraphKind::Speculativeand draft count, not on a recipe. - "Be explicit and pin everything. No magic defaults." — the trigger is the literal
2inforce_wide_due(refresh.rs:53–55), with no derivation, no constant, no configuration, no documentation. - Docs obligation:
AGENTS.md:52–60(designed behaviour belongs in the design docs; unrun checks indocs/TODO.txt) andAGENTS.md:231(changes to graph selection / scheduling policy / timing estimates must be checked againstdocs/scheduling-runtime-design.md,docs/scheduling-utility.md,docs/scheduling-theory.mdandscripts/scheduling_sim). None of these were touched;scripts/scheduling_sim/learning_policy.py:528–700(not opened) has ttl/jitter/ema/retained-refresh/targeted policies and no forced-wide one, sodocs/scheduling-theory.md:704–729's claim thatretained-refreshmodels the native rule no longer holds for the deployed rule. - Formal model:
verification/helios-lifecycledoes not modelRefreshState(no matches forRefreshState/credit_ns), so the new counter is outside existing TLA+ coverage; #540's reported 590,327 verified transitions do not extend to it.
Claims and evidence
| Claim | Status |
|---|---|
| Two committed ordinary width-one plans force the widest available speculative candidate | Verified in code (refresh.rs:53–74, policy.rs:1281–1296), with two caveats: a discovery winner returns first (policy.rs:1237–1239), and among equal-draft shapes the larger packed capacity wins before price |
| Covers width 2 or 4 as well as width 8 | Verified — filter is draft_tokens > 0, no width constant |
| Recompute lane lengths instead of reusing packed lengths | Verified — host_lengths = None (policy.rs:1298) → materialize → round_lengths_optimistic |
Log the selection as Forced wide: … |
Not in the diff. grep Forced at pr/571 finds only unrelated docs lines; the quoted log comes from the instrumented prototype build |
| Funded refresh or acceptance probe still wins first | Verified (policy.rs:1240–1280 precede :1281) |
| Does not change core format, prepared graphs, or speculative decoding semantics | Verified for files (no execution/, model/, ignition/ change), but the test-helper change shows wide plans can have lanes narrower than the graph width — a semantics-adjacent consequence left undiscussed |
| Live log: 4-line excerpt ending at an ordinary width-eight plan | The prototype image is a downstream build name, not a repo commit ("argdiag" suggests an instrumented build). The description itself concedes it "does not show that the fallback caused the later ordinary width-eight selection" and gives no control run |
| 30 forced selections in 3 s, forced plans 64.9–66.6 ms vs ~5.3 ms | Author-reported from that image. As evidence of the mechanism it is strong; as evidence of benefit it is the opposite — ~12x slower rounds repeated ~10×/s |
two_ordinary_width_one_plans_force_a_wide_round, 1 passed |
Self-reported; not reproducible here. The test sets Speculative/1/1 = 1 ms and Speculative/1/8 = 100 ms, so ordinary selection prefers width one by 100x and the forced round wins on geometry alone — a fair test of the mechanism |
Suite comparison: clean d17efddc 1645 passed / 8 failed / 43 ignored vs forced-wide 1646/8/43 |
Plausible; the eight baseline failures are consistent with #540's independently reported set (five template-fixture, one root-only cache-clear, model::tests::packed_combined_budget_keeps_width_one_batches_without_a_useful_packed_shape, one template-dependent protocol test). Note the pre-existing failure is itself an adjacent width-one/packed-shape test, and the full-suite command is not given |
| "No A/B against a build without the fallback exists" | Stated; it is the central gap |
Reach
- Who is affected: every adaptive-verification speculative serving setup — any core whose catalog has speculative widths and no fixed width. No flag, env var or config gates it; the threshold is the literal
2. - Inert cases the description does not mention: fixed-width serving (
speculative_fixed_widthkeeps only one width, so no wider candidate exists); ordinary winners that areDecode,Mixed,Prefillor prerequisites (all reset the streak,refresh.rs:65–74); a steady stream of ordinaryDecodeplans never accumulates a streak, so the trigger is narrower than "sitting at width one". - Grammar-constrained and host-stop lanes:
speculative_tokensclamps the proposal to 1 (helios/src/scheduler.rs:2295–2305) regardless of graph width, so for a fully constrained batch the forced round is almost certainly pure cost — exactly #530's workload. In a mixed batch, unconstrained lanes do benefit. - Multi-rank/TP: each rank plans and commits with its own
RefreshState, so the decision is local; not discussed. - Operators: no new metric or log in this diff; forced rounds are accounted as ordinary service, so the 12x-slower round shows up in cost dashboards as ordinary decode.
- Compatibility: no core format, manifest, protobuf or ABI change; exported cores load unchanged but plan differently. One shared test helper changes meaning (
policy_tests.rs:239), which shifts the suite's notion of offered drafts for packed rounds. - Docs debt:
docs/scheduling-runtime-design.md:241–282and:434–490, anddocs/scheduling-theory.md:704–729, still describe the pre-change rule. - Pathological steady state: with two lanes alternating width one / forced round, every third plan is a wide round; at the author's measured ratio that is far worse than plain width one. The description states this under Limits but does not size it.
Process
- Open, "ready for review", unlabelled, unreviewed, no reactions, no CI on
aab9295; same-day open/update, so hours old. - Head is behind
main(branch pointd17efddc; #569 and #568 landed since), and the PR's own Merge order requires rebasing onto the result of #540 — which is still open. - The description separates claimed from unverified well, includes Unrun checks and Limits, and states the causal gap explicitly: above the bar the charter sets for descriptions.
- Repository process items a reviewer will likely raise: no docs update for a scheduling-policy change (
AGENTS.md:231), no simulator policy, no formal-model coverage of the new counter, and theDesign-Signed-Off-Bytrailer whose presence could not be confirmed.
Open questions / what could not be found
- No control run: nobody has measured the same request sequence with the fallback disabled, so the causal claim (that a forced round leads back to ordinary width eight) is untested.
- Whether the fallback still has a role after #540 and #522 are measured on the same workload — the author says the correct default may be to merge #540 first and re-measure; that measurement does not exist yet.
- Whether the forced round is ever cheaper than the width-one plan it replaces on the author's service (the only measured window says it was 12x slower), and how often it would fire in steady state given tail rounds from unrelated requests also arm it.
- Whether the shared-helper change masks any behavioural regression in other simulator/scheduler tests — I did not run the suite, and the PR gives no per-test breakdown for the changed helper.
- No evidence of any maintainer interest: the reviewers who normally own
refresh.rs/policy.rs(Luke Alonso, Martin Vit, yatesdr) and #540's author (FujitsuPolycom) have not engaged, and no autobot intake ran. - Not found: any competing or duplicate proposal for a forced wide round, and any issue that asks for a bounded fail-safe specifically.