Case file — PR #681: helios/scheduler: use active cohort mean in coalescing horizon
Draft, opened 2026-12-02 by FujitsuPolycom, base main, head e15b836, 5 files, +236/−18, labels area:scheduling, performance, no CI checks on head, no reviews and no comments. Verified against the head tree unless marked "claimed".
Key findings
- Half the change is an undeclared Rust/simulator divergence repair. The Python simulator's speculative
mean_outwas already a per-decoder cohort mean before this PR —scripts/scheduling_sim/utility.py:215-219is untouched by the diff, which only rewrites the horizon block (utility.py:232-236, seepr_diff). The PR presents both the horizon and the expected-output change as one new formula; in factmean_outmoves Rust toward the simulator's existing behaviour.docs/design-review.md:195-208explicitly says "Do not diverge Helios from the simulator's qualified policy", so the repair is welcome but it is undocumented and unmentioned in the description. - The change is strictly monotone: it can only raise queued-prefill credit, never lower it. Old horizon
min(H, post_prefill, min_i rem_i)≤ newmean_i min(rem_i, min(H, post_prefill))for every reachable state, and the per-decodermax(..., 1.0)onmean_out(policy.rs:627,:636) is ≥ the old cohort-wide clamp. Consequently every state where more prefill credit is harmful gets worse — which is exactly where the measured solo regressions land (see §Claims). - No operator knob, no opt-out, default-on everywhere.
coalescing_horizon_tokens(policy.rs:26, default64.0at:42) is not exposed inhelios/src/server/config.rs(onlyscheduler_policy,scheduler_terminal_value,scheduler_terminal_age_priceappear,:305-312) and has noflare-cli/srcflag (no matches).PolicyConfig::throughput()(policy.rs:50-52) zeroesdelivery_fairnessanddecode_age_pricebut notcoalescing_horizon_tokens, so--scheduler-policy throughputdoes not disable the term. The change applies to every prefill-capable core on every deployment with no way to revert short of a rebuild. - The "84 simulator runs matched 84/84" evidence cannot exercise the changed code path.
scripts/scheduling_sim/workloads.py:33-55defines 21 workloads × 4 decode values = 84 runs (__main__.py:42); everydecode()there uses uniformoutput=128, and theprefill_decode_*mixes useoutput=128. No workload pairs a near-EOS decoder with a long prefill, so the oldpeer_budgetmin and the new mean coincide. Parity is expected by construction; the only real coverage of the new formula istests/test_scheduling_utility.py:506-528. - The mandatory simulator gate for cohort algorithms is not reported.
docs/design-review.md:195-208requires cohort-algorithm changes to be "evaluated against the Python simulator and reference solvers", and the 64-seed screening/validation catalog inscripts/scheduling_sim/learning.py(not opened);:234-251makes skipping runnable CPU checks "a blocking design failure" and says "Disclosure does not excuse skipping runnable CPU checks". #681 reports only the 84-runworkloads()parity sweep — the identical gate (#661, #663) were both asked for by prior Autobot review. - The served A/B was not run on the head. Tested trees are
df9a8ebd,dbbf65df,38130855and the archive-check hash is40596880cc64; the head ise15b836and #661's head is3d868f84.policy_tests.rs/utility.pyalso overlap #661's +1,762-line test block, so the merge-order claim cannot be checked from the PR alone. - Two of three solo scenarios regress, and the stack rows are not attributable to #681. Solo
cold-heavy-mix: output 541.8→521.8 (−3.7%), SLO 88.1→79.1%, TTFT p50 1,763→1,834 ms; solomixed-c32: SLO 93.0→91.1%. The "Stack" rows combine #660+#661+#665+#681. The PR discloses the mechanism: near-EOS coalescing "pulls 150K–250K cold prefills ahead of decoders without chunk shrinking, raisingagentic_multiturnTTFT p99 3,323 → 5,144 ms". - It depends on unmerged work. The change is only net-positive in the configuration where #661's chunk shrinking and draining exist; #661, #660 and #665 are all still open (each with an Autobot "Ready To Merge" recommendation) as of 2026-12-02.
- Zero engagement. Draft, no CI, no human review, no comment, no reaction, no cross-reference from any of the four related PRs or from #676.
The change
- Production change, one function.
coalescing_prefill_log_bonus(helios/src/scheduler/policy.rs:525-684) prices theK → K+mdecode-batch surplus unlocked when queued prefills can enter decode, amortized over the prefiller's uncached prompt (policy.rs:677:per_token = best_surplus_per_horizon * horizon / initial_prefill).- Removed:
let mut peer_budget = usize::MAXandpeer_budget = peer_budget.min(rem); addeddecoder_rems = [0usize; REQUEST_LANES](policy.rs:531), filled alongsidedecoder_slotsat:551-553fromrem = (max_new_tokens - generated).min(max_sequence_tokens - scheduled_consumed)(:548-549). - Guard:
decoder_count == 0 || prefiller_count == 0(:567); the previouspeer_budget == usize::MAXarm was unreachable (it required a zerorem, already excluded byrem > 0at:550). - Speculative expected output:
mean_outat:627(packed shapes) and:636(speculative catalog) is nowΣ max(min(expected_at(w), rem), 1.0) / decoder_count. - Horizon:
ph = coalescing_horizon_tokens.min(post_prefill)thenhorizon = Σ min(rem, ph) / decoder_count(:667-672).
- Removed:
- Size: policy.rs +11/−10 (net +1 production LOC, as claimed);
policy_tests.rs+201;scripts/scheduling_sim/utility.py+2/−6;tests/test_scheduling_utility.py+23;docs/scheduling-runtime-design.md+5/−2. - Tests (verified,
policy_tests.rs:6866-6933): helpercoalescing_bonus()re-runslane_values(0)withcoalescing_horizon_tokensforced to 0.0 to isolate the term (:6866-6875);add_active_decoder()forcesphase=Decode,generated=1(:6877-6885).coalescing_horizon_averages_active_decoder_budgets_across_cohort(:6888) asserts the exact32.5horizon bonus for a[1,100]pair (:6909-6913), the single-decodermin(horizon, post_prefill, rem)case (:6922-6926), and zero bonus for no decoders /max_new_tokens == 1(:6929-6932).coalescing_speculative_mean_output_averages_per_decoder_budgets(:6936) covers packed eff-width 6→4, saturation, and slow-B=4 sub-cases. Python mirror:tests/test_scheduling_utility.py:506-526. - Docs: one reworded clause at
docs/scheduling-runtime-design.md:224-229("averaged across active decoders after clamping each decoder's remaining output budget to the prefiller's post-prefill output budget and the configured horizon"). Unchanged: the config table rowdocs/scheduling-runtime-design.md:713(still "64"),helios/README.md, anddocs/scheduling-utility.md(whose:307-308describes the #663 first-output credit as "matching coalescing's fixed-denominator amortization" — the shared denominator this PR leaves untouched). - Undeclared behaviours: (a) monotone credit increase (Key finding 2); (b)
mean_outsim parity repair (Key finding 1); (c) the KV-exhaustion clampmax_sequence_tokens - scheduled_consumedis Rust-only (policy.rs:548-549; the simulator'soutput_budgethas no such clamp,simulator.py:26), so one KV-exhausted decoder now drags only its own1/nterm instead of collapsing the whole cohort's horizon. Nothing in the description lists these.
The why
- The stated defect is real in the code. On
main,horizon = coalescing_horizon_tokens.min(post_prefill).min(peer_budget)andmean_outused the same cohort-widepeer_budget; one active decoder withrem = 1collapses a 64-token horizon to 1 (≈98% loss). Both the Rust andscripts/scheduling_sim/utility.py:232-236(pre-diff) did this. - How long and how widely wanted: no issue, comment or review asks for this. Searching items for the cohort-collapse returns only #681 itself. The mechanism was introduced by merged #645 (2026-11-30, "Decode-batch coalescing continuation value"), so the
peer_budgetmin being replaced is ~2 days old; this is a refinement of fresh code, not a long-standing user request. - Nearby user-reported symptoms: #676 (open, Reederey87, 2026-12-02) reports large prefill chunks causing >1.4 s decode p99 ITL under
balancedon GLM-5.3-Flash TP2 GB10 and asks for either utility-model pricing or an explicit chunk cap; it cross-references #661 only. It is the same symptom class #661/#681 address, but its preferred direction (cap prefill) is the opposite of #681's (price prefill higher near EOS), and #681 is only safe alongside #661's chunk shrinking.
Related work
| Item | State | Relationship |
|---|---|---|
| #645 Overhaul Helios prefill scheduling, cost modeling, and two-frame pipelining | merged 2026-11-30 | Origin: introduced coalescing_prefill_log_bonus, PolicyConfig::coalescing_horizon_tokens, the peer_budget min, the burst workloads (workloads.py:50-54) and the burst test. #681 refines it. Its own review noted the bonus is "enabled by default … affecting prefill durations, admission ordering, and checkpoint pricing for every prefill-capable core". |
| #661 smaller prefill chunks under active age-priced streams | open, same author, head 3d868f84, +2778/−186, 15 files |
Declared stack parent; contains policy.rs +195/−129, policy_tests.rs +1762 and tests/test_scheduling_utility.py +24/−1 — the same test files #681 appends to. Last Autobot review 2026-12-02 15:24: "Ready To Merge", 0 blockers, "Confirm GitHub Actions CI is green on 3d868f8". Earlier rounds were Changes Requested (unrun 64-seed gate; service_rates mispricing). Its own 64-seed learning.py (not opened) --preset validate run (15,872 runs, retained-refresh accepted 35/35) is the gate #681 lacks. |
| #660 budget interior conversation-anchor splits | open, same author, Ready To Merge | Stack member; touches checkpoints.rs (not opened)/docs, not the coalescing code; its mixed-c32 numbers are the stack's base. |
| #665 scan-resistant dual-turnover prefix cache eviction | open, same author, head c5b3923, Ready To Merge |
Stack member; the Stack row's prefix-cache hit-rate delta (48.6→52.5%) is attributable to #665, not #681. |
| #663 price first-output waiting age on incumbent decode rounds | merged 2026-12-01 (8489d504), yatesdr, +1154/−87 |
Landed the day before; default-on under balanced (decode_age_price = 0.1), the same preset benchmarked here. Shares the initial_prefill amortization denominator (docs/scheduling-utility.md:307-308), so relative weight shifts as the horizon grows. Its Autobot review recorded a Should-Fix that "Existing balanced burst-coalescing regression guarantees were dropped"; verified: tests/test_scheduling_utility.py:403,405 now assert absolute ceilings (coal_ttft <= 600.0, coal_sub <= 2) instead of relative guarantees, while policy_tests.rs:6855-6863 still compares coalescing on vs off. #681 adds no such baseline comparison. |
| #676 large prefill chunks → >1.4 s decode p99 ITL | open issue | Same symptom family; argues for capping prefill, names only #661. |
| #654 / #662 competing first-output age-pricing designs | closed | Superseded by #663; context for the churn around this preset, not overlapping in the coalescing term. |
| #655 snapshot cost retention | open, Ready To Merge | Different files (cost.rs (not opened)/checkpoints.rs (not opened)); not in #681's clean-merge claim. |
| #571, #334 | open | Also touch policy.rs but in unrelated functions (wide-round forcing; Engram row prefetch). |
Nothing found that supersedes, reverts or competes with the coalescing-horizon change itself; #681 has no Closes #/Fixes # reference.
Recent activity
helios/src/scheduler/policy.rs history at the head (search_history):
e15b836a2026-12-01 FujitsuPolycom — this PR.8489d5042026-12-01 yatesdr — #663 first-output waiting age (merged; inside base1fbcc3c9).e8a3a7c72026-12-01 Luke Alonso — #656 conditional speculative acceptance / acceptance-probe charging.e85019b92026-11-30 Luke Alonso — #645, which created the function being edited.3e57bdc82026-11-30 Luke Alonso — #644 per-step speculative calibration.
So the edited function is two days old and has had three authors' changes in three days; #681 sits directly on top of #663 and builds on #645. scripts/scheduling_sim/utility.py before this PR had only been touched by #645, #644 and #663. Default-branch committers in helios/src (180 days): Luke Alonso 237, Martin Vit 52, yatesdr 49; in scripts/scheduling_sim: Luke Alonso 6, PCCessna 1, yatesdr 1. #681 reverses nothing semantically (its term is disjoint from #663's), but both add per-prefill-token credit over initial_prefill, so their relative weight moves with the horizon.
People
- Author: FujitsuPolycom, repository association CONTRIBUTOR, Discord "Dooner". 180 days: 15 merged, 11 closed, 4 open. Currently open besides #681: #665, #661, #660, #649 (1-hop closed-ring RoCE prefill proxy opcodes). Merged work in the surrounding area: #538 (restrict cold pure-prefill discovery to natural-fit capacities), #496, #497, #586/#587. Not one of the charter's named priority contributors; a prolific but independent contributor in
helios/srcanddocs. - Area owners: Luke Alonso authored the coalescing code (#645) and dominates
helios/src/docs; yatesdr authored the neighbouring #663 and is the only other recentscripts/scheduling_sim/utility.pyauthor. - Engagement: none —
pr_commentsreturns "No comments"; no reviews, no reactions, and no cross-reference from #661, #660, #665, #663, #655 or #676.
Community
Nothing found. The PR is a draft opened and last updated 2026-12-02 with zero discussion of any kind. Contrast with the rest of the series: #660, #661 and #665 each went through three Autobot review rounds before reaching "Ready To Merge".
Project fit
Aligned:
- Model-agnostic runtime layer (charter line 12; #267/#334): pure scheduler arithmetic in Helios, no per-model branch, no
unsafe, no I/O or ABI surface. - Bring real evidence (charter line on performance PRs needing benchmarks over
mainon a served workload): the body has why / what / result / evidence sections and served A/B rows on 4× RTX PRO 6000 (SM120) and 4× GB10 (SM121), TP4, DeepSeek-V4.1-Flash. - PR description shape: all four expected parts plus a stacking/merge-order section.
Where it lines up less well:
- "Be explicit and pin everything. No magic defaults" (charter line 14): the horizon remains a hidden
PolicyConfigdefault (policy.rs:42) with no config key or flag, and the PR newly makes its value matter far more (the horizon can rise up to 64× for the same prompt, directly scalingper_tokenatpolicy.rs:677). The PR adds no way to pin or disable it. - Supported matrix & compatibility (charter line 42): the body discloses that standalone GB10 and other recipes/GPUs are untested; measurement is SM120 TP4 + GB10 TP4 only, with
long-context-mixedandcold-heavy-mixat n=1. docs/design-review.md:195-208(cohort algorithms / service pricing must be validated against the simulator and thelearning.py(not opened) 64-seed catalog): only an 84-runworkloads()parity sweep is reported, andlearning_scenarios.py:45-46,63-67(prefill-N-decodersscenarios) uses uniformoutput=128decoders, so the changed formula is inert there too.docs/design-review.md:234-251("Leaving an applicable crate test, simulator sweep, TLA+ conformance run, or Kani proof unrun blocks commit and PR acceptance"): the PR reportscheck.pypassing (10/10 TLC configs, 8/8 trace models / 594,065 transitions, 12/12 auxiliary, 13/13 TLA+ mutations, 26/26 Rust mutations) even though no formal model covers prefill-price selection (check.pymutation targets arescheduler.rs(not opened),checkpoints.rs(not opened),cache.rs(not opened),execution/,runtime.rs(not opened)), so the formal layer is arguably N/A rather than satisfied; the "3/3 reachable.min()mutations killed" claim therefore comes from the Python side, notcheck.py.- No formal or Kani scope change is needed;
docs/design-review.md:260-261's docs-only exemption does not apply.
Claims and evidence
Claimed results (author's numbers, not re-verified; SM120 4× RTX PRO 6000 and 4× GB10, DeepSeek-V4.1-Flash, TP4, --scheduler-policy balanced --max-concurrency 32 --mtp-draft-tokens 7 --mtp-adaptive-verification --mtp-max-verification-token-budget 128 --mtp-adaptive-verification-alpha 1.0 --embedding-table-cache-size 84GiB --kv-cache-limit memory --prefix-cache-memory 0, workloads from FujitsuPolycom/tokbench v0.4.0, --seed 42 --temperature 0.0):
| Arm ∥ Scenario (repeats) | Out tok/s | Stalled >250 ms | TTFT p50 ms | SLO |
|---|---|---|---|---|
Solo ∥ mixed-c32 (2) |
1,281.7 → 1,276.8 | 11.29 → 11.49% | 1,425 → 1,390 | 93.0 → 91.1% |
Solo ∥ long-context-mixed (1) |
655.4 → 667.3 (+1.8%) | 28.1 → 26.3% | 1,510 → 1,449 | 89.8 → 92.6% |
Solo ∥ cold-heavy-mix (1) |
541.8 → 521.8 (−3.7%) | 62.5 → 62.2% | 1,763 → 1,834 | 88.1 → 79.1% |
On #661 ∥ mixed-c32 (2) |
1,254 → 1,261 med | 6.65 → 5.95% med | 1,479 → 1,439 | 89.4 → 90.5% med |
On #661 ∥ long-context-mixed (1) |
670.5 → 667.6 | 16.4 → 9.8% | 1,503 → 1,473 | 89.3 → 82.1% |
On #661 ∥ cold-heavy-mix (1) |
545.6 → 547.8 | 56.3 → 55.7% | 1,713 → 1,786 | 81.6 → 79.8% |
Stack (660+661+665) ∥ mixed-c32 (2) |
1,374.6 → 1,394.2 | 4.82 → 4.34% | 1,001 → 922 | 96.5 → 97.1% |
GB10 Stack ∥ mixed-c8 (2) |
128.4 → 129.4 | 41.8 → 38.0% | 1,181 → 1,118 | 79.0 → 81.7% |
GB10 Stack ∥ agentic-coding C=8 (1) |
137.1 → 135.0 | 45.4 → 34.5% | 1,024 → 877 | 81.8 → 85.7% |
Supported by the table: the On #661 and Stack arms generally improve stalls, TTFT and SLO.
Not supported / unsupported by the table: (a) the "Stack" rows cannot be attributed to #681 — they include three other PRs, and the prefix-cache hit-rate gain belongs to #665; (b) the solo arm is the only #681-only evidence, and 2 of 3 rows regress — mixed-c32 SLO −1.9 pp, cold-heavy-mix output −3.7%, SLO −9.0 pp, TTFT +4.0%; (c) On #661 long-context-mixed improves stalls (16.4→9.8%) but loses SLO (89.3→82.1%); (d) the PR's own disclosed trade-off is a mechanism-level cost: agentic_multiturn TTFT p99 3,323 → 5,144 ms, cold 150K–250K prefills jumping ahead of decoders; (e) no repeat counts are given for the single-repeat rows, and no confidence intervals anywhere.
Claimed evidence and what backs it:
- Archive checks (
40596880cc64):cargo check --locked --release/cargo test --locked --releaseacross 6 crates (helios 1,283 / 1,795, flare 246, flare-cli 245); pytest 853;check.py10/10 TLC + 8/8 trace models / 594,065 transitions + 12/12 auxiliary + 13/13 TLA+ mutations + 26/26 Rust mutations. Plausible but on a tree that is not the head and with no CI run one15b836to confirm. scripts/scheduling_sim84 runs matched1fbcc3c984/84, 3/3 reachable.min()mutations killed: the sweep exists (workloads.py:33-55,__main__.py:42), but as shown in Key finding 4 it cannot distinguish old from new behaviour; it is a non-regression check on unrelated workloads, not validation of this change.git merge-treeclean vsmain, #660, #661, #665: consistent with a +1 LOC production change, but #661 rewrites the same test files, so the conflict risk is textual and order-dependent rather than semantic.- Disclosed limits: standalone GB10 and other GPUs/recipes untested;
long-context-mixed/cold-heavy-mixn=1. - Unrun CPU gate: no
learning.py(not opened) 64-seed run, whichdocs/design-review.md:195-208calls for on cohort-algorithm changes and which #661 and #663 were both blocked on until supplied.
Reach
- Users/operators: every deployment running
balanced(the default;PolicyConfig::default()atpolicy.rs:29-44is what a missing key produces,helios/src/server/config.rs:305-310). Affects admission ordering and TTFT/ITL for all requests on a prefill-capable core; visible symptom for cold-prefill-heavy mixes is longer decoder gestures and longeragentic_multiturnTTFT (up to +1.8 s p99 per the PR's own numbers). No new metric surfaces the term. - Configuration and defaults: no new key, no changed default value (
coalescing_horizon_tokensstays 64,policy.rs:42,docs/scheduling-runtime-design.md:713), no CLI flag, and no off-switch — not even--scheduler-policy throughput(policy.rs:50-52). - Affected requests: any prefilling request with
max_new_tokens > 1and noprompt_logprobs(policy.rs:556-564) while at least one decoder is resident withgenerated_tokens > 0and remaining budget > 0 (:543-555). - Documentation: one clause changed (
docs/scheduling-runtime-design.md:224-229);docs/scheduling-utility.md(the #663 amortization it interacts with,:287-320),helios/README.mdand the config table were not updated; the near-EOS/cold-prefill trade-off the body discloses is documented nowhere. - Compatibility/dependencies/deployment: no Protobuf, core-format, CUDA-graph or ABI change and no new dependency; scheduler-only arithmetic, so exported cores and multi-host layouts are unaffected. Effective behaviour, however, depends on unmerged #661 (chunk shrinking/draining) — without it, #681's higher prefill credit is the configuration the PR itself reports as harmful on
cold-heavy-mix.
Process
Draft; opened and last updated 2026-12-02; head e15b836; no GitHub Actions checks on the head (the rest of the series has CI plus three Autobot rounds); zero reviews, zero comments, zero reactions; no linked issue. Its declared merge order puts three unmerged "Ready To Merge" PRs (#661, #660, #665) ahead of it, and its own numbers are meaningful mainly in that stacked configuration.
Open questions / could not be found
- Whether the head
e15b836reproduces the numbers measured ondf9a8ebd/dbbf65df/38130855, and what changed between those trees and the head. - Why the served A/B does not include a workload targeted at the changed path (a near-EOS decoder alongside a long cold prefill) — the only configuration where old and new formulas differ;
mixed-c32/cold-heavy-mixmeasure it only statistically. - Whether the author considers the
mean_outchange a divergence fix or a new rule, and whetherscripts/scheduling_sim/learning.py(not opened) (64-seed catalog) was run or deliberately skipped; nolearning.py(not opened) result is reported. - No issue, comment or maintainer request motivating the change could be found; #676 is the only related user-visible defect report and it names #661, not #681.
- No review, reaction, or cross-reference from any maintainer or from the other open PRs in the series as of 2026-12-02.
- Whether
docs/scheduling-utility.md's first-output credit (:287-320), which shares theinitial_prefilldenominator, needs re-tuning now that the horizon can grow up to 64× — untested and undiscussed.