Recommendation: Changes Requested
Head 975f825 cleanly resolves all Round 1 Subtract / Simplify items (mean_capped, hoisted expected_at, removed dead .max(1.0) and if horizon > 0.0, reused forecast_tokens), the Round 1 nit (n=3 and KV-headroom-clamped subcases), the design-spec wording at docs/scheduling-runtime-design.md:224, and the code side of Round 1 Blocker 2 by adding an end-to-end heterogeneous-budget simulator test (tests/test_scheduling_utility.py:529-593). The core Rust and Python arithmetic is memory-safe, allocation-free, deterministic, and fixes a real rem = 1 horizon-collapse defect from #645. However, Round 1 Blocker 1 remains open: the branch is still based on main (1fbcc3c9, without open #661), its standalone Solo benchmarks regress 2 of 3 workloads (cold-heavy-mix -3.7% tok/s, -9.0 pp SLO, +54.8% TTFT p99; mixed-c32 -1.9 pp SLO), no CI checks have run on 975f825, and the PR description is now stale against 975f825.
Merge Risk
Level: Medium
- Monotonic default-on prefill priority increase on
main:mean_capped(&decoder_rems[..decoder_count], cap)(helios/src/scheduler/policy.rs:599-601, 630, 639, 671) is pointwise>=main's minimum (sincerem >= 1at:550andexpected_at(...) >= 1.0at:586-598, with curve entries clamped to[0.0, 1.0]athelios/src/scheduler/rounds.rs:505andhelios/src/scheduler/speculation.rs:134). Without#661's smaller prefill chunking and draining, this stacks with#663's first-output waiting-age credit (policy.rs:758-784) to pull monolithic 150K–250K cold prefills ahead of active decoders near EOS, reproducing the PR's ownSolocold-heavy-mixregression. - Clean safety, concurrency, and compatibility profile: Single-threaded
RequestSchedulerarithmetic, zerounsafe, zero heap allocation (decoder_rems: [usize; REQUEST_LANES]atpolicy.rs:531), deterministic slot-index iteration, no division-by-zero (decoder_count >= 1at:567,initial_prefill >= 1viahelios/src/scheduler.rs:351-355), and no CLI, Protobuf, core-format, or CUDA-graph contract changes. - Stack dependency and overlap: Positive served results (
On #661andStack) depend on open#661(currently awaitinglukealonso's review fixes onGraphKind::Resumeindecode_floorandnative-servingCI) plus#660/#665, with 4 overlapping files against#661(docs/scheduling-runtime-design.md,helios/src/scheduler/policy.rs,helios/src/scheduler/policy_tests.rs,tests/test_scheduling_utility.py).
Walkthrough
helios/src/scheduler/policy.rs(+16/-18,:530-569, 599-601, 630, 639, 669-679): Replaces scalarpeer_budgetwith per-decoderdecoder_rems: [usize; REQUEST_LANES], drops the unreachablepeer_budget == usize::MAXcheck and deadif horizon > 0.0wrapper, extractsmean_capped, hoistsexpected_at(...)out of per-decoder iteration, removes redundant.max(1.0)clamps, and switches speculativemean_out(:630, :639) andhorizon(:671) to cohort averages.scripts/scheduling_sim/utility.py(+2/-6,:233-235): Removespeer_budgetand updateshorizontosum(min(float(v.output_budget), ph) for v in decoders) / k(mean_outat:215-218was already cohort-averaged pre-PR).helios/src/scheduler/policy_tests.rs(+217/-0,:6866-7079): Adds two isolated unit tests exercising realRequestScheduler::lane_values(0)over[1, 100],[1, 20, 100], KV-headroom-clamped[2, 100, 100], single-decoder, zero-bonus, and speculative/packed cohorts (reusingsuper::rounds::forecast_tokens, with a mean-vs-min discriminator at:7054-7059).tests/test_scheduling_utility.py(+90/-0,:506-593): Addstest_coalescing_horizon_averages_active_decoder_budgets(UtilityScheduler.prepare) andtest_coalescing_heterogeneous_budget_end_to_end_balanced(simulator.runend-to-end withmax_new_tokens=8non-speculative andmax_new_tokens=32speculative cohorts underage_price=0.1).docs/scheduling-runtime-design.md(+6/-3,:224-229): Updates coalescing documentation to describe the bounded cohort-mean decode horizon and per-decoder clamped speculative expected output.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure scheduler arithmetic, isolated tests, and design docs; no
unsafe, I/O, FFI, parsing, privilege, untrusted-input, or prompt-injection surface. - [WARN] Charter & value fit: Right model-agnostic Helios runtime layer with no new flags or ABI changes, but standalone
Solobenchmarks againstmainregress 2 of 3 workloads without unmerged#661(Charter#210/docs/design-review.md:109-115). - [WARN] Related / duplicate / conflict check: Genuinely additive refinement of merged
#645, but operationally depends on open#661(still unmerged) and overlaps 4 files with it. - [WARN] Tests & verification evidence: All new Rust and Python tests are isolated and call real production entry points, and
tests/test_scheduling_utility.py:529-593now exercises heterogeneousoutput_budget < 64cohorts end-to-end; however, no CI checks have run on975f825, served A/B and archive checks cite older commits (df9a8ebd/dbbf65df/38130855/40596880cc64), and the PR body still reports only the inert 84-runworkloads()sweep (max_new_tokens = 4096).
Blockers
- Standalone
mainregressions, dependency on unmerged#661, and unverified head975f825(helios/src/scheduler/policy.rs:599-601, 630, 639, 671,docs/design-review.md:109-115, 247-251, Charter#210)- Head
975f825is still parented onmain(1fbcc3c9), which does not contain open#661. Becausemean_cappedis strictly>=main's minimum, merging ontomainstandalone increases queued-prefill coalescing credit near EOS without#661's chunk shrinking/draining. - In the PR's own attributable
SoloA/B againstmain, 2 of 3 workloads regress:cold-heavy-mix(n=1) drops output541.8 -> 521.8 tok/s(-3.7%), SLO88.1% -> 79.1%(-9.0 pp), TTFT p501,763 -> 1,834 ms, andagentic_multiturnTTFT p993,323 -> 5,144 ms(+54.8%);mixed-c32(n=2) drops SLO93.0% -> 91.1%(-1.9 pp), stalls11.29% -> 11.49%, and output1,281.7 -> 1,276.8 tok/s. - All reported served A/B runs (
df9a8ebd,dbbf65df,38130855) and archive checks (40596880cc64) predate975f825, and no GitHub Actions CI run is reported on975f825. - Fix: Hold merge until
#661lands, rebase onto amaincontaining#661, run green GitHub Actions CI (including.github/workflows/native-serving.yml(not opened) andpytest) on the final head, and confirm served A/B results match the reviewed head (with repeats on the primary target workloads).
- Head
Should Fix
- Refresh the stale PR description, attribution, and simulator evidence (
helios/src/scheduler/policy.rs:630, 639,scripts/scheduling_sim/utility.py:215-218, 234-235,tests/test_scheduling_utility.py:529-593,docs/design-review.md:147-160)- The PR body is stale against
975f825: it still claimspolicy.rsis+11/-10(+1net production LOC) when head is+16/-18(-2net LOC), and still describesmean_outasexpected_at(width).min(rem).max(1.0)after.max(1.0)was deleted atpolicy.rs:599-601, 630, 639. - Round 1's attribution ask remains open: distinguish that
policy.rs:630, 639is a Rust→simulator parity repair (utility.py:215-218was already cohort-averaged pre-PR) whilehorizon(policy.rs:670-671,utility.py:234-235) is the new rule; clearly attribute#660/#661/#665contributions in theOn #661/Stackprose (e.g.,#661stall reduction,#665prefix-cache hit rate); and note theOn #661long-context-mixedSLO drop (89.3% -> 82.1%,-7.2 pp) in the summary prose. - Replace the inert 84-run
scripts/scheduling_simparity claim (scripts/scheduling_sim/workloads.py:25-55uses defaultmax_new_tokens = 4096frommodel.py:103, sooutput_budget = max_new_tokens - generatedatsimulator.py:26stays>> 64for every multi-decoder workload andmin == meanby construction) with the actualmin_i -> mean_imakespan/TTFT/max-output-gap delta from the newtest_coalescing_heterogeneous_budget_end_to_end_balancedscenario (and consider adding a directmean_ivsmin_icheck in that test or its description so the delta is self-documenting).
- The PR body is stale against
Subtract / Simplify
- Delete the unreachable
if horizon > 0:guard in the Python twin (scripts/scheduling_sim/utility.py:236)- Upstream invariants already guarantee
coalescing_horizon_tokens > 0(utility.py:206),view.output_budget > 1(:205, soph > 0),len(decoders) >= 1(:206), andv.output_budget >= 1(scripts/scheduling_sim/model.py:54), sohorizon > 0is always true (and:247already guardslog(value)withif value > 0). Deleting:236and dedenting:237-244mirrors the dead guard just deleted inpolicy.rs:669-679.
- Upstream invariants already guarantee
Nits
None.
Dropped on verification
- Claim that
scripts/scheduling_sim/learning.py64-seed validation is mandatory here (Value Prop, Discovery Dossier, Correctness M2): Dropped —docs/design-review.md:201-205requireslearning.pyspecifically for "Changes to timing estimation or funded refresh", whereas PR #681 only changes known-cost coalescing horizon pricing (governed bydocs/design-review.md:195-200,scripts/scheduling_sim/utility.py/simulator.py). - Demand for a new
scheduler_coalescing_horizon_tokensCLI/config off-switch under Charter#215(Value Prop, Correctness M1): Dropped — contradictsAGENTS.md:188-190("Do not add ... configuration switches without a concrete requirement"), ignores that all siblingPolicyConfigcoefficients (policy.rs:14-45, including#645'scoalescing_horizon_tokens) are preset-internal, and would move Round 1 goalposts. - Claim that KV-headroom clamping at
policy.rs:548-549is a "new declared Rust/simulator divergence" (Discovery Dossier, Correctness M2c, Subtraction S6): Dropped —policy.rs:548-549is pre-existing unchangedmaincode from#645, and the test/comment atpolicy_tests.rs:6929-6932was added directly in compliance with Round 1's Nit. - Assertion that
test_coalescing_heterogeneous_budget_end_to_end_balancedwould still pass ifutility.py:235reverted tomin_i(Discovery Dossier, Correctness M4): Dropped as unverified — delaying four 66 ms 4K prefills untilshort0exits (~168 ms) can breach the test's330.0 msmax-TTFT ceiling; kept only the verified evidence gap that the PR body omits themin_i -> mean_idelta. - Redesign proposal to divide
best_surplus_per_horizonbyqor cap aggregate credit (Correctness M3): Dropped —policy.rs:658already divides surplus byadded(unchanged#645formula), and the real standalonecold-heavy-mixHOL regression without#661is already captured in Blocker 1. - Claim that
mean_cappedshould average overservedstreams rather than all active decoders (Correctness M5): Dropped — averaging over all active decoders is the unbiased cohort mean matchingscripts/scheduling_sim/utility.py:215-218, whereas slicing byservedwould introduce arbitrary slot-order bias and panic wheneverserved > decoder_count. - Proposal to extract
mean_capped(budgets, cap)inscripts/scheduling_sim/utility.py:215-218(Subtraction S2): Dropped — invalid Python (NameError): unlike Rust's averagedmean_curve, Python evaluatesexpected_output(v.acceptance, graph.width)per decoderv, so the cap is not a loop-invariant scalar. - Style/prose preferences on untouched Round 1 test code or Round 1-requested doc edits (Subtraction S3
_d1/surplus closure, S4GraphDescriptorbuilder /parametrize, S5docs/scheduling-runtime-design.md:224-229formula block,helios/README.md:482-483): Dropped as low-signal / Round 2+ moving goalposts.