Recommendation: Ready To Merge
Head 3d868f8 resolves every Round 2 blocker and should-fix item cleanly: interpolated unmeasured pure-prefill discovery is now modeled and validated across the mandatory 64-seed scripts/scheduling_sim/learning.py --preset validate catalog, RequestScheduler::service_rates derives terminal_only in a single pass aligned with candidate selection, the throughput drain wording is corrected, and fresh SM120 TP4 flare run A/B and archive test/TLA+/mutation runs are reported on the submitted tree. Direct verification of the core scheduler changes—including the two new balanced single-graph wait/credit fixes—confirms sound single-threaded state transitions, memory safety, and contract compliance with no new regressions. Confirm GitHub Actions CI is green on 3d868f8 before merging.
Merge Risk
Level: Medium
- Default-on
balancedhot-path behavior change: Activates implicitly under--scheduler-policy balanced(decode_age_price = 0.1), allowing unmeasured pure-prefill capacities<= nat_fitto compete via GPU-interpolated durations (helios/src/scheduler/cost.rs:695-776,policy.rs:531-542), unblocking non-terminalPrefillchunks belowmax_terminal, and draining non-terminalPrefillsteps whenever an active age-priced stream is resident (helios/src/scheduler.rs:1187-1190). - Measured workload trade-offs & benchmark limits: On SM120 TP4 (
3d868f8vsmain1fbcc3c9),>250 msdecode stalls drop substantially (-32.2%onmixed-c32,-41.7%onlong-context-mixed,-8.6%oncold-heavy-mix), but overall SLO dips across all three mixes (91.1% -> 89.4%,94.8% -> 89.3%,89.0% -> 81.6%, with4 -> 7client-side 45 s drain cutoffs under KV saturation oncold-heavy-mix), the two heavier mixes aren=1, and GB10 was not re-measured on3d868f8. - Clean concurrency, safety, and artifact compatibility: Single-threaded scheduler logic, zero
unsafe, zero new CLI flags/ABI/graph ops, sounddeferred_prefillstate guard (helios/src/scheduler.rs:901-907), overflow-safeu128interpolation with non-monotonic clamping (cost.rs:769-775), and verified lifecycle mutations (verification/helios-lifecycle/check.py:527-535).
Walkthrough
helios/src/scheduler/cost.rs(:688-776,:1269-1499): AddsActionCosts::interpolated_prefill_duration(same-capacityPrefill/TerminalPrefillsibling lookup, elseu128linear interpolation between measured smaller peer or fastest measured decode/speculative/resume floor and strictly larger peer, clamping non-monotonic timings and isolatingScoredPrefill), plus 3 isolated unit tests.helios/src/scheduler.rs(:662, 757, 808, 843, 847-866, 901-907, 964-1022, 1187-1190): Cachesterminal_prefill_windowacross catalog updates; tightensresolve_prefill_kind_fromsorequest.deferred_prefillexcludes non-terminal-catalogPrefillshapes even when!needs_terminal; addsprefill_must_complete_terminally_from,has_active_age_priced_stream, andprefill_requires_terminal_completion_for_age; drains non-terminalPrefillsteps inprefill_step_requires_feedbackwhile an age-priced stream is active.helios/src/scheduler/policy.rs(:89-96, 371-374, 409-548, 875-895, 1066-1121, 1388-1458, 1537-1575, 1722-1853, 1985-2006): Consolidates prefill candidate generation intoadd_prefill_candidateandprefill_candidate_nswith per-slotPrefillSlotPlan; prices unmeasured pure-prefill candidates<= nat_fitvia interpolation underage_price > 0.0while preservingPlanOrigin::Discoveryviais_unmeasured_candidate; caps age-pricedresize_prefillgrowth atcandidate.capacityand restrictsdeferred_prefillresizes toterminal_prefill_catalog; retainsfirst_output_wait_nsacross capture-free non-terminal chunks on single-graph prompts (preserves_first_output_wait); credits reconciled segment wait(end - prefix_tokens) / initial_prefillinlane_value_for_tokens_withinfor deferredTerminalPrefillsteps landing on interior checkpoint cuts.helios/src/scheduler/service.rs(:297-319): Computesterminal_onlyonce per prefill request usingprefill_must_complete_terminally_fromwhenhas_active_age_priced_stream()is true, aligningservice_ratesfeasible capacities with candidate selection.scripts/scheduling_sim/{learning.py,learning_policy.py,workloads.py}&tests/test_scheduling_*.py: Modelsinitial_discovery = "interpolated"in the simulator (_natural_fit_prefill_capacity,_interpolated_prefill_duration, bootstrap accounting matchingnativewhenage_price == 0or solo), adds the synthetic GB10 prefill-storm workload, and adds isolated Python unit/CLI tests.helios/src/scheduler/policy_tests.rs,verification/helios-lifecycle/check.py,docs/{scheduling-runtime-design.md,scheduling-theory.md},helios/README.md: Adds isolated Rust unit/policy tests covering all new paths, updates thecheck.py:527-535mutation target, and updates runtime, theory, and README documentation.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure single-threaded scheduler arithmetic, simulator code, tests, and docs; no
unsafe, I/O, FFI, parsing, or untrusted-input surface introduced. - [PASS] Charter & value fit: Model-agnostic change in the right Helios scheduler layer with zero new CLI flags,
PolicyConfigfields, or ABI/graph-op changes; addresses a realbalancedstall issue (independently reproduced in #676) with honest served A/B evidence and disclosed trade-offs. - [PASS] Related / duplicate / conflict check: Cleanly rebased on
main1fbcc3c9(post-#663/#667), additive over #645, and cleanly sequenced ahead of stacked draft #681 (only minor rebase overlap with open #655/#660). - [WARN] Tests & verification evidence: All new Rust/Python tests are isolated and exercise real entry points; author reports passing
cargo test --locked --release(7/7 crates),check.py --jobs 16 --mutations,pytest(839/839),ruff, 64-seedlearning.py --preset validate(ACCEPTED), and SM120 A/B on3d868f8, but GitHub Actions CI status on3d868f8could not be inspected directly and GB10 was not re-measured on this head.
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Drop the caller-owned
last_interpmemo (helios/src/scheduler/policy.rs:517-543, 1092, 1118, 1429, 1437):last_interp: Option<(usize, u64, Option<u64>)>is declared inside each(kind, capacity)loop, so it only hits when two distinct active prefill slots happen to share the exact same(work, scheduled_consumed)for the same unmeasured capacity. Removing it eliminates the repeated opaque 3-tuple,&mutthreading, and#[allow(clippy::too_many_arguments)]onprefill_candidate_ns(dropping it from 8 to 7 non-selfarguments). - Unify age-priced terminal completion dispatch and hoist
has_active_age_priced_stream()(helios/src/scheduler.rs:1007-1022,helios/src/scheduler/service.rs:297-301,helios/src/scheduler/policy.rs:750-757):service_ratesre-spellsprefill_requires_terminal_completion_for_agewithstart = consumed_tokensand scans all active slots viahas_active_age_priced_stream()once per request insidelane_values's slot array construction (O(slots^2)). Parameterizing the helper over(request, start, cut, active_age_priced)and computinghas_active_age_priced_stream()once inlane_valuesremoves both the duplicated predicate and the repeated slot scans.
Nits
- Sync
docs/scheduling-utility.md:306-320: The "First-output waiting age against active decoders" section still describesfrac = work / initial_prefilland anchor-split wait preservation without mentioning the two newbalancedsingle-graph rules (preserves_first_output_waitacross capture-free non-terminal chunks and reconciled-cutfirst_output_valuecredit), which are currently documented only indocs/scheduling-runtime-design.md:281-289. - Clarify the PR body's
Opt-out: --scheduler-policy throughputshorthand: As already noted in What,throughputstill drains non-terminalPrefillwhen aterminal_cleanupstream is resident (terminal_age_price > 0.0), and thedeferred_prefillnon-terminal-catalog exclusion (scheduler.rs:901-907) is policy-independent.
Dropped on verification
- Correctness Finding 1 (
resolve_prefill_kind_fromwidening athelios/src/scheduler.rs:901-907breaksmodel-contract.md,service_rates, andignition/direct/scheduler.pyparity): Dropped as a false positive that inverted the safety invariant. Verified inscheduler.rs:251-253, 860-862, 2489-2499, 2859-2861,helios/model-contract.md:176-186, andpolicy_tests.rs:4998-5069, 7950-8045:deferred_prefillis set only after a non-terminalPrefillskips trailing continuation layers, and smallerPrefillshapes absent fromterminal_prefill_catalogexecute complete continuation layers without rebuilding skipped state. Restoring&& needs_terminalwould allow full-statePrefill(128)to run over skipped continuation state once smaller age-priced chunks are enabled. Non-deferred prompts (!deferred_prefill) still fall back toPrefill, excluding illegalPrefill(128)fromservice_rateswhile deferred is correct, andignition/direct/scheduler.py:300-312is the greedy single-request debug executor without age-priced shrinking ordeferred_prefilltracking. - Correctness Finding 2 (Interpolation evaluated before
(plan.nat_fit == Some(capacity)).then_some(0)athelios/src/scheduler/policy.rs:531-542breaks discovery / causes starvation): Dropped as a false positive misreading the core design. Verified inpolicy.rs:531-542,docs/scheduling-runtime-design.md:501-507,scripts/scheduling_sim/learning_policy.py:314-329,tests/test_scheduling_learning_policy.py:1603-1637, andutility.rs:50-73: givingcapacity == natzero-duration precedence underage_price > 0would immediately preempt active decoders with monolithic unmeasured4K/8Kstalls, defeating the PR. Unserved prompts growServicePriceexponentially andfirst_output_valuelinearly, so they cannot starve, andage_price == 0or absence of a larger peer still falls through toSome(0). - Correctness Minor (
docs/scheduling-theory.md:74-76, 121-122contradict the PR): Dropped as false. Line 74-76 states prefill has no externally visible per-chunk cadence (still true—chunks shrink to protect decode cadence), and line 121-122 states two long prefills do not need smaller chunks merely to alternate (still true—with no active decoders,age_price == 0). - Subtraction supporting note (Cross-kind
PrefillSlotPlan::nat_fitreuse hazard atpolicy.rs:526-530, 1537-1575): Verified harmless.ScoredPrefillslots are disjoint fromPrefill/TerminalPrefillslots incandidates()(policy.rs:1549-1565), andprefill_catalog_for_terminal(kind, plan.terminal_only)returns the same catalog for bothPrefillandTerminalPrefill. - Subtraction Items 2, 4, and 5 (Collapsing three distinct prefill-catalog loops into one closure helper; deleting
prefill_catalog_for_terminal/is_unmeasured_candidate; trimmingdocs/scheduling-theory.md:562-573andpolicy.rs:462-478doc prose): Dropped as low-signal or over-abstraction. The three catalog loops have distinct termination/aggregation shapes (limitearly-exit vs argmax fold vs existentialwork == remaining),is_unmeasured_candidatewas explicitly requested in Round 2,prefill_catalog_for_terminaldeduplicates a 3-way branch across 3 callers, and the theory/doc-comment text documents subtle user-facing and maintainer invariants in place.