#1 [high] M1 Blocker: standalone main regressions are a default-on global change
SEVERITY: Blocker (architecture/contract: Charter #210 + "no magic defaults" + docs/design-review.md:106-115).
Monotonicity proof at head (verified by reading, not memory):
helios/src/scheduler/policy.rs:679-680removed theif horizon > 0.0guard;:669-671now:let ph = self.policy.coalescing_horizon_tokens.min(post_prefill as f64); let horizon = mean_capped(&decoder_rems[..decoder_count], ph);helios/src/scheduler/policy.rs:599-601fn mean_capped(rems: &[usize], cap: f64) -> f64 { rems.iter().map(|&rem| (rem as f64).min(cap)).sum::<f64>() / rems.len() as f64 }rem >= 1enforced byif rem > 0atpolicy.rs:550;expected_at >= 1.0by:586-589(if eff_width <= 1.0 || mean_curve.is_empty() { return 1.0 }) and:593(sum = 1.0 + ...). => mean_i(min(rem_i,cap)) >= min_i(min(rem_i,cap)) pointwise, for BOTHmean_out(policy.rs:630,:639) andhorizon(:671). Therefore vsmainthe queued-prefiller creditper_token(:675) and its log bonus (:677) are >= main's for every state, config and workload. This is a one-directional, workload-independent relaxation of prefill-vs-decode preference, applied by default.
PR's own Solo (main 1fbcc3c9, no #661/#660/#665) numbers, from the PR body table:
cold-heavy-mix: output 541.8 -> 521.8 (-3.7%), TTFT p50 1,763 -> 1,834 ms, SLO 88.1 -> 79.1% (-9.0 pp); trade-off paragraph admitsagentic_multiturnTTFT p99 3,323 -> 5,144 ms (+54.8%).mixed-c32: SLO 93.0 -> 91.1%, stalls 11.29 -> 11.49%, output 1,281.7 -> 1,276.8.- Only
long-context-mixedimproves (+1.8%). Charter #210 requires a measured speedup overmainon a served workload; here 2 of 3 standalone scenarios regress and the positive rows all depend on unmerged #661/#660/#665 (policy.rsdiff parent ismain1fbcc3c9).
No operator control (verified at head):
helios/src/scheduler/policy.rs:50-52pub fn throughput() -> Self { Self { delivery_fairness: 0.0, decode_age_price: 0.0, ..Self::default() } }— keepscoalescing_horizon_tokens: 64.0.helios/src/server/config.rs:305-325accepts onlyscheduler_policy,scheduler_terminal_value,scheduler_terminal_age_price,scheduler_checkpoint_extra_work_fraction,mtp_adaptive_verification_alpha;grep coalescing_horizon_tokensshows onlypolicy.rs,policy_tests.rs,docs/scheduling-runtime-design.md:225,713,scripts/scheduling_sim/utility.py. Noflare run/ config key.docs/scheduling-runtime-design.md:713table row is still generic: "|coalescing_horizon_tokens| 64 | Output-token horizon for decode-batch coalescing bonus on queued prefills |".helios/README.md:482-483still says "a 64-token decode-batch coalescing horizon" (pre-PR semantics).
FIX: land behind an explicit config key/flag (or keep min semantics under balanced until a served A/B on head shows a net gain); publish standalone numbers on head and separate them from #661.
#2 [high] M2 Blocker: evidence base does not verify the head; 84/84 sweep is inert
SEVERITY: Blocker (claim accuracy + docs/design-review.md:195-206 gate left effectively unrun).
(a) Served A/B trees are not the head. PR body: "Served A/B tests ran on trees df9a8ebd, dbbf65df, and 38130855"; archive checks on 40596880cc64. Head is 975f825 (single squash commit on main 1fbcc3c9). policy.rs is +16/-18 at head (pr_files) vs the body's "+11/-10, +1 net production LOC", so the body measurably describes an older revision. Nothing in the body re-runs A/B on the head.
(b) The 84/84 simulator parity sweep cannot discriminate min vs mean (verified by reading):
scripts/scheduling_sim/workloads.py:25-55: no workload passesmax_new_tokens;Requestdefault ismax_new_tokens: int = 4096(scripts/scheduling_sim/model.py:103).scripts/scheduling_sim/simulator.py:26:return View(r.name, self.remaining_prefill, r.max_new_tokens - self.generated, ...). =>output_budget >= 3840for every multi-decoder workload, andmin(v.output_budget, ph) == ph == 64for all decoders, so mean == min identically.continuous_decode(workloads.py:49) is a single decoder (k=1), where mean == min by definition. The claimed "84/84 matched 1fbcc3c9 with 3/3 reachable.min()mutations killed" is true by construction and proves nothing about the new rule.
(c) The only discriminator added is the Rust unit test helios/src/scheduler/policy_tests.rs:7029-7059, whose comment states the discriminating intent:
"// 2. When B=4 width-1 is slower than cohort-mean B=2 width-8 even at K=3, surplus vanishes;
// clamping mean_out to min_i(rem_i) = 1 would erroneously report a positive bonus."
The Python end-to-end test tests/test_scheduling_utility.py:529-593 only compares coalescing-ON vs OFF plus hard ceilings (7740/330/190 ms, and 1885/440/220 ms), so a revert to min_i would still pass it.
(d) New Rust/simulator divergence of exactly the class the gate forbids (added by this PR's own test comment), helios/src/scheduler/policy_tests.rs:6931-6932:
"// Note: KV-headroom clamping is Rust-specific (scripts/scheduling_sim/simulator.py tracks
// max_new_tokens - generated only)."
Rust policy.rs:548-549 uses .min(max_sequence_tokens.saturating_sub(r.scheduled_consumed)); the simulator has no KV term (simulator.py:26). docs/design-review.md:205-206: "Do not diverge Helios from the simulator's qualified policy without updating and validating the rule across that catalog."
FIX: add simulator workloads with explicit small max_new_tokens (heterogeneous [1,100]-style budgets) and mirror the KV clamp in View/simulator.view(), then run the simulator catalog and the 64-seed learning.py; re-run served A/B on 975f825 (or its rebase).
#3 [high] M3 Major: horizon gain multiplies every queued prefiller's total credit (EOS pull-ahead)
SEVERITY: Major (system-level: queue priority / head-of-line blocking that the PR itself measures but does not gate on).
Mechanism verified in code:
- Amortization
helios/src/scheduler/policy.rs:675:let per_token = (best_surplus_per_horizon * horizon) / initial_prefill as f64;withinitial_prefill = r.initial_prefill_tokens()at:557(= prompt_tokens - reused,helios/src/scheduler.rs:351-355), andbonus_log[slot] = per_token.ln()at:677. - A prefiller's credited value per created candidate is
prefill_token * consumed(helios/src/scheduler/utility.rs:96), so summed over its whole uncached prompt the total coalescing credit per queued prefiller equalsbest_surplus_per_horizon * horizon— independent of prompt length, strictly proportional tohorizon. - Under
mainhorizon = min(64, post_prefill, min_i(rem_i)), so one near-EOS decoder (rem = 1) capped every queued prefiller's total credit at 1/64 of the cap. At headhorizon = mean_i(min(rem_i, ph))(:671), which stays nearphwhile any long decoder is resident. => Aggregate queued-prefill priority = q × surplus × horizon can rise up to 64x near EOS with many decoders resident, and it is exactly the case the PR measured:
PR body, trade-off paragraph verbatim: "Trade-off: on solo cold-heavy-mix, keeping coalescing active near EOS pulls 150K–250K cold prefills ahead of decoders without chunk shrinking, raising agentic_multiturn TTFT p99 3,323 -> 5,144 ms."
and the Solo table row: "| Solo \| cold-heavy-mix (1) | 541.8 -> 521.8 (-3.7%) | 62.5 -> 62.2% | 1,763 -> 1,834 | 88.1 -> 79.1% |"
Impact: 150K-250K cold prefills hold the GPU ahead of live decoders; agentic_multiturn p99 first-token latency +54.8% and SLO -9.0 pp on main with no off-switch (see entry 1). This is head-of-line blocking introduced by a continuation term whose whole purpose is to help the streams being starved. Nothing in the diff bounds per-prefiller total credit, chunk size, or the number of simultaneous beneficiaries (the loop at policy.rs:669 applies the identical bonus to every queued prefiller).
Note also that the credit is not gated on whether the prefiller can actually be absorbed: best_surplus_per_horizon is a single scalar shared by all prefillers (:653-665), so q queued prefills all receive the full surplus, not a 1/q share.
FIX: bound the aggregate (divide the surplus by the number of prefillers that would be admitted, or cap total coalescing credit per unit time), and/or require positive KV/packing headroom before granting credit; at minimum, ship the term behind the off-switch requested above and document the p99 trade-off as a known limit rather than an aside.
#4 [high] M4 Major: test/claim gaps at head
SEVERITY: Major (tests / claim accuracy).
-
Head not tested. No CI on
975f825; the body'scargo check/cargo test/pytest/check.pyclaims are tied to archive hash40596880cc64, not the head (documented in the dossier; nothing in the body claims a head run).docs/design-review.md:247-251: "Disclosure does not excuse skipping runnable CPU checks... Leaving an applicable crate test, simulator sweep, TLA+ conformance run, or Kani proof unrun blocks commit and PR acceptance". -
Warehouse-visible correctness tests do exist and are good (say so plainly):
helios/src/scheduler/policy_tests.rs:6888-6963(mean horizon, n=2/n=3/KV-clamped/single/zero cases),:6966-7079(speculative mean_out incl. a saturation case at:7054-7059where the oldmin_i"would erroneously report a positive bonus"), andtests/test_scheduling_utility.py:506-526. -
But the Python end-to-end coverage for heterogeneous budgets does not discriminate the change.
tests/test_scheduling_utility.py:557-562:assert dec_coal.summary["elapsed_ms"] < dec_off.summary["elapsed_ms"],<= 7740.0,max(dec_coal_ttfts) < max(dec_off_ttfts) and max(dec_coal_ttfts) <= 330.0,max_output_gap_ms <= 190.0. Every comparison is coalescing-ON vs coalescing-OFF with absolute ceilings; none is new-mean vsmain'smin_i. A revert tomin_iinutility.py:235would still satisfy these. Same for the speculative twin at:585-593. -
PR body is stale against its own head (from
pr_filesvs body): body says "helios/src/scheduler/policy.rs::coalescing_prefill_log_bonus(+11/-10,+1net production LOC)" but head is+16/-18(net -2); body saysmean_out"averagesexpected_at(width).min(rem).max(1.0)" but the.max(1.0)clamp does not exist at head (policy.rs:630,:639nowmean_capped(&decoder_rems[..decoder_count], expected_at(...)), andexpected_atalready returns >= 1.0 at:586-589). Body also never mentions the newtests/test_scheduling_utility.py:529-593test or the KV-clamp divergence now documented in its own test comment. Body claim "Single-decoder and homogeneous-remaining cohorts are unchanged" is verified TRUE for bothhorizonandmean_out(all equalrem=> mean == min; single decoder => mean == min).
FIX: update the body to head's diff and semantics, add an assertion (Python or Rust) that the heterogeneous bonus is strictly larger than the min_i value for the same state, and paste a head-SHA test run.
#7 [high] CORRECTION to entry 6: spec text is accurate — claim withdrawn
CORRECTION — supersedes entry 6, whose FIRST claim is WRONG. Do not report "the spec misdescribes the clamp".
Re-read of docs/scheduling-runtime-design.md:225-229 verbatim:
"(coalescing_horizon_tokens, default 64.0, averaged across active decoders
after clamping each decoder's remaining output budget to the prefiller's
post-prefill output budget and the configured horizon, with speculative
per-round expected output similarly clamped per decoder and averaged across the
cohort),"
This is exactly mean_i min(rem_i, min(H, post_prefill)) = code at helios/src/scheduler/policy.rs:670-671 and simulator at scripts/scheduling_sim/utility.py:234-235. The spec is ACCURATE. No finding here.
What survives from entry 6 (minor, and only as support for entry 1 / entry 2d):
helios/README.md:482-483still describes the pre-PR rule: "adaptive-verification exponent 1, and a 64-token decode-batch coalescing horizon." No mention of cohort averaging.docs/scheduling-runtime-design.md:713table row still generic: "|coalescing_horizon_tokens| 64 | Output-token horizon for decode-batch coalescing bonus on queued prefills |".docs/scheduling-utility.md(the math reference paired with the simulator bydocs/design-review.md:195-206) references coalescing only at:308("matching coalescing's fixed-denominator amortization"); it carries no derivation of the horizon/cohort rule, so the changed rule has no reference-math derivation to validate against.- The KV-headroom clamp being Rust-only is already recorded in entry 2(d) via
policy_tests.rs:6931-6932.
Do NOT double count this with entry 1; present as a one-line docs note if at all.
#8 [high] Verified-sound areas (no finding) — bounds, NaN, allocations, contracts
Areas I inspected and found SOUND at head 975f825 (state plainly in the report; do not invent issues):
- Panics / UB / bounds:
decoder_remsis[usize; REQUEST_LANES](policy.rs:531) written at indexdecoder_countonly after the same slot loop that assignsdecoder_slots(:551-553), andself.slotsis aVec<Slot>of lengthrequest_slots(scheduler.rs:642,request_slots: usizeat:52) bounded byREQUEST_LANES = 64(execution/manifest.rs:18).mean_cappedonly ever sees&decoder_rems[..decoder_count]withdecoder_count >= 1guaranteed by the early return at:567. No index can exceed the array. - Div-by-zero / NaN:
mean_cappeddivides byrems.len()which isdecoder_count >= 1;initial_prefillis.max(1)(scheduler.rs:354); theif per_token.is_finite() && per_token > 0.0guard atpolicy.rs:676still gates theln(). Removing the oldif horizon > 0.0wrapper (:669-679) cannot produceln(0)or NaN. Config validation still requires finite, non-negativecoalescing_horizon_tokens(policy.rs:232-244), and<= 0.0returns early (:527). - Allocations / hot path: the change is allocation-free (
mean_cappedis a slice fold;expected_atwas hoisted out of the numeric loops by this PR). Cost is O(K) per scored shape inbest_decode_rate(:602-648, overcosts.batches/packed_round_shapes/speculative_catalog) and O(K) per prefiller (:669-679); this runs once perselect_plan(policy.rs:1647) and once perrounds.rs:541,546. Immaterial; no new lock, no new I/O, no unbounded buffering, no retained state across resets (all locals). - Determinism/reordering:
decoder_remsis filled in slot order anddecoder_slotsorder is unchanged, so the numeric iteration order (and therefore all floating-point sums) is deterministic run to run. - No wire/proto/captured-graph/public-contract change: no
protobuf, noGraphDescriptor, no manifest field touched;PolicyConfigis internal (helios/src/scheduler/policy.rs:15-27) and reachable only through--scheduler-policy balanced|throughput(server/config.rs:305-310). No owner sign-off gate (AGENTS.md graph-op contract) is triggered. - Single-decoder and homogeneous-cohort equivalence (PR claim) is TRUE: for K=1 mean==min, and for equal
remmean==min, at bothmean_out(:630,:639) andhorizon(:671). Verified by reading, and covered bypolicy_tests.rs:6945-6956andtests/test_scheduling_utility.py:521-526. - Interaction with #661: the touched function is self-contained; nothing in
coalescing_prefill_log_bonusreadsfirst_output_wait_nsor the reconciled interior-cutfirst_output_valuethat #661 changes, so there is no code-level conflict beyond the merge-order/parent issue (entry 1/2). - The two Rust unit tests appear well-formed and discriminating (
policy_tests.rs:6888-6963,:6966-7079);coalescing_bonus(:6866-6875) correctly reconstructs the unscaled bonus by togglingcoalescing_horizon_tokensto 0.0 and restorings.policy.
#9 [high] Research summary
Reviewed PR #681 at head 975f825 across correctness/safety/platform parity, system-level consequences, architecture/contracts/charter, and tests/claim accuracy. All five changed files read in full context, plus direct callers (lane_values/select_plan/rounds.rs), LaneValue::prefill_within, cost.rs shape iterators, server/config.rs, and the simulator (utility.py, model.py, simulator.py, workloads.py, learning_run.py).
Two blockers. (1) The cohort mean is provably >= main's minimum pointwise (expected_at >= 1.0 at policy.rs:586-598, rem >= 1 at :550), so queued-prefiller credit rises for every state/workload, default-on and with no operator off-switch (throughput() keeps 64.0; server/config.rs:305-325 has no key). The PR's own standalone numbers regress 2 of 3 scenarios (cold-heavy-mix SLO 88.1→79.1%, agentic_multiturn TTFT p99 +54.8%), which is the opposite of the Charter #210 bar. (2) The evidence never touches the head — all A/B trees pre-date 975f825 — and the 84/84 simulator parity sweep is mathematically inert because workloads.py:25-55 never sets max_new_tokens (default 4096, model.py:103), leaving output_budget >= 3840 >> 64 so mean == min by construction; the PR also introduces a new declared Rust/simulator divergence (KV clamp, admitted in its own test comment at policy_tests.rs:6931-6932).
Major. Near EOS the credit gain is horizon-proportional and aggregates over all queued prefillers (no 1/q share), which is the mechanism behind the measured "cold prefills ahead of decoders" p99 blowup the PR describes but does not bound. Test/claim gaps: the new Python end-to-end test compares coalescing-ON vs OFF with absolute ceilings only, so a revert to min_i would still pass; the PR body still quotes +11/-10 and a .max(1.0) clamp that no longer exists (head is +16/-18).
Minor. The metric span widened from min-over-cohort to mean-over-all-active decoders while the rate still multiplies by served — shared with the simulator, so an approximation not a new divergence.
Verified sound: array bounds/panic safety, div-by-zero and NaN guards, allocation-free hot path, determinism, no wire/captured-graph contract change, single-decoder and homogeneous-cohort equivalence (the PR's claim is true), and no code-level conflict with #661. One draft claim of mine (that the spec sentence misdescribes the clamp) was withdrawn after re-reading docs/scheduling-runtime-design.md:225-229, which matches the code exactly; only README/config-table staleness remains.
#10 [high] PR state at head + body numbers needed for the report's evidence table
STATE: PR #681, author FujitsuPolycom, head 975f825 (single squash commit whose parent is main 1fbcc3c9), draft, no CI checks on head, no human review. Title: "helios/scheduler: use active cohort mean in coalescing horizon".
Diff totals +331/-27 in 5 files (pr_files):
docs/scheduling-runtime-design.md+6/-3helios/src/scheduler/policy.rs+16/-18 <- PR body still says "+11/-10, +1 net production LOC"helios/src/scheduler/policy_tests.rs+217/-0scripts/scheduling_sim/utility.py+2/-6tests/test_scheduling_utility.py+90/-0 <- PR body does not mention this test at all Stacking claim in body: "recommended after#661"; Stack rows include#660(budgeted interior conversation-anchor splits),#661(smaller non-terminal prefill chunks),#665(scan-resistant prefix-cache eviction). #661 (3d868f84) is unmerged and NOT in head's parentmain, so every "On #661" and "Stack" row is on code this PR does not contain.
PR body Standalone ("Solo", measured on main 1fbcc3c9) rows — the only rows attributable to this PR alone:
mixed-c32(2): out 1,281.7 -> 1,276.8; stalled >250 ms 11.29 -> 11.49%; TTFT p50 1,425 -> 1,390; SLO 93.0 -> 91.1%long-context-mixed(1): out 655.4 -> 667.3 (+1.8%); stalled 28.1 -> 26.3%; TTFT p50 1,510 -> 1,449; SLO 89.8 -> 92.6% <- ONLY improving solo rowcold-heavy-mix(1): out 541.8 -> 521.8 (-3.7%); stalled 62.5 -> 62.2%; TTFT p50 1,763 -> 1,834; SLO 88.1 -> 79.1% => 2 of 3 standalone scenarios regress; the SLO losses are the headline.
Positive rows that depend on unmerged work (do NOT credit to this PR):
- "On
#661[1]":mixed-c321,254 -> 1,261 med, stalls 6.65 -> 5.95% med, SLO 89.4 -> 90.5% med;long-context-mixed670.5 -> 667.6, stalls 16.4 -> 9.8%, but SLO 89.3 -> 82.1% (-7.2 pp, a loss the body does not single out);cold-heavy-mix545.6 -> 547.8, SLO 81.6 -> 79.8%. - "Stack [2]" SM120
mixed-c32: 1,374.6 -> 1,394.2 (+1.4%), stalls 4.82 -> 4.34%, TTFT p50 1,001 -> 922 (-7.9%), SLO 96.5 -> 97.1%. - "Stack [2]" GB10
mixed-c8: 128.4 -> 129.4, stalls 41.8 -> 38.0%, TTFT 1,181 -> 1,118, SLO 79.0 -> 81.7%. - "Stack [2]" GB10
agentic-codingC=8: 137.1 -> 135.0, stalls 45.4 -> 34.5%, TTFT 1,024 -> 877 (-14.4%), SLO 81.8 -> 85.7%. Body's own limits: "Served A/B tests ran on treesdf9a8ebd,dbbf65df, and38130855"; "Standalone GB10 and other GPUs or recipes are untested." None of those trees is head.
Report should state plainly: the standalone (main-vs-main) comparison is the only one this PR is accountable for, and on it 2 of 3 scenarios regress with no off-switch.
#11 [high] Findings index M1-M5 for the report (map to scratchpad entries)
Use these five findings, in this order, plus the sound-areas note. Superseded: entries 6 (withdrawn, see 7).
M1 — BLOCKER — default-on, one-directional credit increase; standalone main regressions; no operator off-switch. [entry 1]
Key cites: policy.rs:599-601 (mean_capped), :630/:639 (mean_out), :670-671 (horizon), :550 (rem>0), :586-589 (expected_at>=1.0), :50-52 (throughput() keeps 64.0), server/config.rs:305-325 (no key), docs/scheduling-runtime-design.md:713.
M2 — BLOCKER — evidence does not cover head; 84/84 simulator sweep is inert; new declared Rust/sim divergence. [entry 2]
Key cites: workloads.py:25-55, model.py:103, simulator.py:26, policy.rs:548-549, policy_tests.rs:6931-6932, docs/design-review.md:205-206, policy_tests.rs:7029-7059 (the only mean-vs-min discriminator).
M3 — MAJOR — horizon gain is proportional to total per-prefiller credit and accrues to every queued prefiller (no 1/q share) -> near-EOS cold-prefill pull-ahead / head-of-line blocking on decoders. [entry 3]
Key cites: policy.rs:675 (per_token amortization), :557 + scheduler.rs:351-355 (initial_prefill), utility.rs:96 (prefill_token*consumed), :669 loop applies same bonus to all prefillers, :653-665 single shared surplus scalar. PR trade-off quote: agentic_multiturn TTFT p99 "3,323 -> 5,144 ms".
M4 — MAJOR — head unrun; Python end-to-end test can't distinguish mean from min; PR body stale vs its own diff. [entry 4]
Key cites: tests/test_scheduling_utility.py:557-562, :585-593; policy_tests.rs:6888-6963, :6966-7079; docs/design-review.md:247-251.
M5 — MINOR — metric span widened: mean_capped averages all decoder_count rows while the rate multiplies by served; shared with utility.py:214-218, so an approximation, not a new divergence. [entry 5]
Key cites: policy.rs:622, :630, :638-639; utility.py:208, :214-218.
Verified sound (say so plainly, no findings): bounds/panic safety, div-by-zero/NaN guards, allocation-free hot path, determinism, no wire/captured-graph contract change, single-decoder + homogeneous-cohort equivalence is TRUE, no code-level conflict with #661. [entry 8]
Active plan: all steps completed. No open questions require another turn.
#5 [medium] M5 Minor: horizon/mean_out span widened from min-over-cohort to mean-over-all-active
SEVERITY: Minor (metric/rate span check; parity-neutral, shared with the simulator).
What the sampled span became: main sampled min_i(rem_i) over the active cohort — a worst-case lower bound over streams that could all be served. Head samples mean_i(min(rem_i, cap)) over all active decoders (policy.rs:599-601, always &decoder_rems[..decoder_count]), including streams the scored shape cannot serve in the current wave.
Evidence of the subset mismatch in the same function:
helios/src/scheduler/policy.rs:622:let served = n_streams.min(shape.batch);helios/src/scheduler/policy.rs:630:let mean_out = mean_capped(&decoder_rems[..decoder_count], expected_at(eff_width));helios/src/scheduler/policy.rs:638-639:let served = n_streams.min(batch); let mean_out = mean_capped(&decoder_rems[..decoder_count], expected_at(width as f64));mean_outis later multiplied byserved(:632,:641), so the per-wave rate usesservedrows but adecoder_count-row expectation.
Simulator has the identical shape: scripts/scheduling_sim/utility.py:214 served = min(n_streams, graph.decode_capacity) and :215-218 mean_out = sum(min(v.output_budget, expected_output(...)) for v in decoders) / k with k = len(decoders) (:208). So this is a shared approximation, NOT a new Rust/sim divergence; the old min_i clamp could not be inflated by an unserved long decoder, the new mean can.
Impact: small mispricing for sub-batch graph choices (shape.batch < active decoders); never a correctness/panic issue; bounded because served still multiplies the rate. Downstream consumers are continuous, threshold-free (prefill_token -> candidate ValueRate comparison at policy.rs:795, :1649), so no hard cutoff flips.
FIX (cheap): average over the streams the shape would serve, e.g. the served largest rems, or document explicitly that mean_out is a whole-cohort statistic in both docs/scheduling-runtime-design.md and utility.py.
#6 [medium] M6 Minor: spec sentence misdescribes the clamp; user-facing docs still state the old rule
SEVERITY: Minor (spec/contract accuracy; docs are a changed file in this PR).
Spec text added at docs/scheduling-runtime-design.md:224-229 (verbatim):
"decode-batch throughput surplus over a bounded cohort-mean decode horizon
(coalescing_horizon_tokens, default 64.0, averaged across active decoders
after clamping each decoder's remaining output budget to the prefiller's
post-prefill output budget and the configured horizon, with speculative
per-round expected output similarly clamped per decoder and averaged across the
cohort),"
Code at head does NOT bound the horizon by the prefiller's post-prefill budget for k>=2:
helios/src/scheduler/policy.rs:670-671:
let ph = self.policy.coalescing_horizon_tokens.min(post_prefill as f64);
let horizon = mean_capped(&decoder_rems[..decoder_count], ph);
With post_prefill = 1 (a prefiller with one output token left) and decoders [100, 100], ph = 1 and horizon = mean(min(100,1), min(100,1)) = 1 — ok for that case; but with post_prefill = 10, decoders [1, 100]: ph = 10, horizon = (1 + 10)/2 = 5.5 — the remaining 4.5 tokens of horizon are decode rounds the prefiller itself cannot contribute to (it finishes after 1 token). The paragraph presents the bound as a clamp of the result to the prefiller's budget, which is only true when the prefiller's post_prefill >= horizon or k=1. The formula is mean_i min(rem_i, min(H, post_prefill)), not min(mean_i ..., post_prefill).
Same divergence in the simulator (scripts/scheduling_sim/utility.py:234-235), so Rust and sim agree with each other while the spec sentence misdescribes both.
Also, the two other user-facing descriptions of this knob were not updated and still state the pre-PR minimum rule:
helios/README.md:482-483: "adaptive-verification exponent 1, and a 64-token decode-batch coalescing horizon." (no cohort-mean semantics)docs/scheduling-runtime-design.md:713: "|coalescing_horizon_tokens| 64 | Output-token horizon for decode-batch coalescing bonus on queued prefills |" (generic; doesn't say the term is now cohort-averaged)docs/scheduling-utility.md(math reference, whichdesign-review.md:195-206pairs with the simulator) has no coalescing-horizon section at all, so the new rule has no reference-model derivation.
FIX: state the formula exactly as mean_i min(rem_i, min(H, post_prefill_i)), note the KV-headroom clamp is Rust-only (see the PR's own comment at policy_tests.rs:6931-6932), and update README + the config table row.