Recommendation: Changes Requested
Commit 4e3e2c3 cleanly closes the Layer 3 conformance/mutation gap and all Round 3 Subtract/Simplify and Nit items: helios/src/scheduler/lifecycle_tests.rs:64-192,849-946 adds packed_prefill_scheduler_matches_lifecycle_model wired into Lifecycle.tla via verification/helios-lifecycle/check.py:18,185,255 alongside three packed-prefill safety-guard mutations (check.py:748-801), scripts/scheduling_sim/ now models two-order greedy packed prefill selection (model.py, timing.py, scheduler.py, simulator.py, utility.py, learning_policy.py, workloads.py, tests/test_scheduling_sim.py), ignition/preparation/model.py:32-39 fails closed when prefill_chunk_size is missing or exceeded, and the manifest.rs / policy.rs / runtime.rs / packing.rs cleanups are in place. Direct verification at 4e3e2c3 confirms no blocking code-correctness or hot-path defects in the packed-prefill implementation. However, one hard governance blocker remains open (and author-conceded) — explicit project-owner approval from Luke Alonso for widening the Contract 3 PREFILL/TERMINAL_PREFILL operation contract — alongside two verified should-fix items: an equivalent same-FlashInfer-revision A/B baseline (also author-conceded) and adding packed-prefill scenarios to scripts/scheduling_sim/learning_scenarios.py so learning.py (not opened) --preset screen/--preset validate actually exercise the changed timing-estimation path.
Merge Risk
Level: High
- Widens the Contract 3
PREFILL/TERMINAL_PREFILLcaptured-graph operation contract (batch_capacity >= 2, aggregateP-rowPACKED_TOKENlayout, per-laneSAMPLE_ENABLEDcompletion, binding-derived vision exclusion) without recorded project-owner approval underdocs/design-review.md:22-26. - Modifies
+415/-39lines inhelios/src/scheduler/policy.rsand changes timing-estimation rules (cost.rs(not opened) +learning_policy.py) whilescripts/scheduling_sim/learning_scenarios.pyhas zeropacked_prefill=Truescenarios, and overlaps 8 shared files (includingpolicy.rs,cost.rs(not opened),scheduler.rs,docs/scheduling-runtime-design.md(not opened)) with maintainer PR#729. - The headline
1.68×–4.15×TTFT and1.75×–4.23×throughput A/B compares two different signed cores exported across different FlashInfer revisions (C=1solo control0.94×), so the speedup is not yet isolated on an equivalent baseline.
Walkthrough
- Shared geometry, manifest, catalog, and selection (
helios/src/execution.rs:10(not opened),helios/src/execution/manifest.rs:452-468,881-900,936-951,helios/src/model/catalog.rs:266-288(not opened),helios/src/runtime_core/selection.rs:280-303,366-375,helios/src/scheduler.rs:889-918): enforcevalid_packed_prefill_geometry(2 <= B <= max_batch,1 <= W <= P, 64-alignedPin[max(64, B), min(B * W, i32::MAX)], optionalP <= prefill_chunk_size,draft_tokens == 0), keepB == 1(P == 0) andScoredPrefilluntouched, and dropB >= 2shapes when--max-concurrency 1. - Input packing and runtime dispatch (
helios/src/model/packing.rs:113-126,169-179,422-439,helios/src/model/inputs.rs:87-91,helios/src/server/runtime.rs:849-874): forbid vision bindings onB >= 2prefill graphs, sizeInputIndexing::PackedTokenbuffers toP, reject image-conditioned lanes beforestaging.clear(), drive per-laneSampleEnabledindependently, and register solo vs. packed prefill catalogs in a single manifest pass. - Scheduler, cost model, and checkpoints (
helios/src/scheduler/policy.rs:14-30,1306-1348,1518-1798,2093-2120,helios/src/scheduler/cost.rs:581-583 (not opened),606-607,644-659,969-971,helios/src/scheduler/checkpoints.rs:925-936,helios/src/scheduler.rs:436-463,937-956,2615-2617): unify offer gathering (packed_prefill_offers), finishing-lane fill (fill_finishing_lanes), and cohort selection (select_packed_prefill_cohortwith derivedPackedCohortbitmask counts and promoted-lane seeding), scopePrefillCostModeland context-slope borrowing tobatch == 1(ReplayTimesforbatch >= 2), and validate packed lane geometry inScheduledStep::validate_mixed. - Ignition and direct mode (
ignition/preparation/execution.py:80-96,ignition/preparation/model.py:32-39,ignition/cli/serve.py:465-469(not opened),ignition/direct/scheduler.py:197-202,290-291): validate(B >= 2, W, P)text-only prefill signatures, fail closed inPreparedModel.__init__whenprefill_chunk_sizeis missing or exceeded, scope--packed-verificationtospeculativesignatures, and isolate direct-modeB == 1prefill catalogs. - Verification layers and docs (
helios/src/scheduler/lifecycle_tests.rs:64-192,849-946,verification/helios-lifecycle/check.py:18,185,255,748-801,scripts/scheduling_sim/{model,timing,scheduler,simulator,utility,learning_policy,workloads}.py,tests/test_scheduling_sim.py:324-352,docs/packed-prefill-design.md(not opened),docs/scheduling-runtime-design.md:21-25 (not opened),455-475,helios/model-contract.md:188-209(not opened)): addLifecycle.tlaconformance coverage and three packed-prefill mutation guards, extend the Python scheduling simulator to multi-lane packed prefill, and synchronize Contract 3 and scheduler design docs.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt-injection or instruction-redirection content in the PR body, comments, or diff; all review requests and provenance notes were treated strictly as content.
- [PASS] Charter & value fit: Model-agnostic Helios runtime (capacities read from core metadata via
packed_prefill_graphs(), no per-model branches or hardcoded bucket lists), backward-compatible with pre-change cores (887785ad), and authored by priority contributor@original-el8. - [WARN] Related / duplicate / conflict check: Genuinely additive with no duplication, but overlaps 8 files with maintainer PR
#729(includingpolicy.rs,cost.rs(not opened),scheduler.rs,docs/scheduling-runtime-design.md(not opened)) plus active scheduling/admission PRs (#621,#693,#718). - [WARN] Tests & verification evidence: Layer 1 (
1,919lib +62integration +894pytest) and Layer 3 (Lifecycle.tlapacked conformance + 3 mutation guards) are now solid, but Layer 2'slearning_scenarios.pycatalog does not yet exercisepacked_prefill=Trueand the live A/B baseline crosses FlashInfer revisions.
Blockers
- Extended captured-graph operation contract has no recorded owner approval (
docs/design-review.md:22-26,AGENTS.md:376-381(not opened)).- Verified behavior/impact:
docs/design-review.md:22-26requires prior explicit approval from project owner Luke Alonso for a new captured-graph operation contract even when reusing an existing graph kind ("A new operation contract requires approval even if it reuses a graph kind or enum value. A design acknowledgment does not grant approval."). At4e3e2c3, this PR widensPREFILL/TERMINAL_PREFILLto multi-requestbatch_capacity >= 2with explicitpacked_token_capacity(helios/src/execution/manifest.rs:881-900), aggregateP-rowInputIndexing::PackedTokenbuffers (helios/src/model/packing.rs:169-179), binding-derived vision exclusion (helios/src/model/packing.rs:113-126), and per-laneQUERY_LENGTH/SAMPLE_ENABLEDcompletion (helios/model-contract.md:188-209(not opened)). No maintainer comment, review, or linked approval exists on#715, and the author's latest comment explicitly concedes this gate remains outstanding. - Fix: Obtain an explicit approval comment from Luke Alonso on
#715(or link the approval thread) granting the widened Contract 3 multi-request prefill contract.
- Verified behavior/impact:
Should Fix
-
Headline performance A/B does not use an equivalent baseline (
docs/design-review.md:109-115).- Verified behavior/impact: As disclosed in the PR description and conceded as remaining in the latest comment, the baseline 151-graph core (
887785ad) was exported from an earlier FlashInfer revision while the packed 157-graph core (4aea5c54) was exported against FlashInfer5a8ceed80, and theC=1solo control regressed111.2 ms → 118.7 ms(0.94×). The1.68×–4.15×TTFT and1.75×–4.23×throughput headline claims therefore do not yet isolate packed prefill on an equivalent baseline underdocs/design-review.md:109-111. - Fix: Run and report an equivalent A/B using cores exported from the same FlashInfer revision and served by the identical binary (or packed prefill off/on on an identical build), including the
C=1solo control.
- Verified behavior/impact: As disclosed in the PR description and conceded as remaining in the latest comment, the baseline 151-graph core (
-
scripts/scheduling_sim/learning_scenarios.pycontains nopacked_prefill=Truescenario, leaving the new packed-prefill timing-estimation path unexercised bylearning.py(not opened) (docs/design-review.md:201-206).- Verified behavior/impact:
scripts/scheduling_sim/learning_scenarios.py:38usescatalog()and:67usescatalog(mixed=True), with zero calls tocatalog(packed_prefill=True)anywhere inscenarios()(:37-135). Because the PR changes timing estimation (helios/src/scheduler/cost.rs:581-583 (not opened),606-607,644-659,969-971andscripts/scheduling_sim/learning_policy.py:189-225,316-325,scripts/scheduling_sim/timing.py:54-55), the reported--preset screenand--preset validateruns validate non-regression of solo/mixed catalogs only and never exerciseLearningSchedulerdiscovery, refresh, poisoning, or recovery on a packed prefill graph. - Fix: Add packed-prefill scenario(s) using
catalog(packed_prefill=True)toscripts/scheduling_sim/learning_scenarios.pyand re-runscripts/scheduling_sim/learning.py (not opened) --preset screenand--preset validate(or record owner agreement that flat-ReplayTimespacked prefill timing is outside the learning catalog's scope).
- Verified behavior/impact:
Subtract / Simplify
- Trim unreachable duplicate lane-bound checks in
Inputs::pack_step(helios/src/model/packing.rs:422-439).pack_inputs()already callsstep.validate_mixed()?athelios/src/model/inputs.rs:35, which enforceslane.tokens <= self.token_capacityandsum(lane.tokens) <= self.packed_token_capacity(helios/src/scheduler.rs:447-455) beforeinputs.pack(&frame)atinputs.rs:93. Keeping only the live 3-linelive.image_slot.is_some()guard atpacking.rs:429-431removes ~14 lines of dead duplicate validation (and the existingcheck.py:763-775aggregate-cap mutation already targetsscheduler.rs, notpacking.rs). - Remove dead
tuple(reversed(names))inscripts/scheduling_sim/scheduler.py:55-56.key = (total_val, len(chosen), total_tokens, tuple(reversed(names)))allocateskey[3]and never reads it (line 56compareskey[:3]andnames < best[3]). Simplify tokey = (total_val, len(chosen), total_tokens). - Deduplicate simulator graph validation and rank-weight helpers (
scripts/scheduling_sim/model.py:43-51vs.scripts/scheduling_sim/timing.py:37-45; rank key inscheduler.py:101,learning_policy.py:247,254,utility.py:309). Extract one shared validator helper forGraph.__post_init__andGraphSpec.__post_init__, and aGraph.cost_weightproperty for(packed_token_capacity or prefill_capacity) + decode_capacity * width. - Simplify tautological
elsearm inhelios/src/execution/manifest.rs:936-951. Insideif graph.batch_capacity == 1 { ... } else { graph.batch_capacity >= 2 }, theelseexpression is always true for validated packed prefill graphs (:881-894) andScoredPrefillduplicates the 3-linetoken_capacityalignment predicate; folding them removes ~6 lines.
Nits
helios/src/model/tests.rs:2710-2720: the"Reject P > prefill_chunk_size in catalog::validate"sub-test setspacked_token_capacity = 576on a(B=4, W=128)graph whereB * W = 512, sopacked <= batch * widthrejects it before themax_chunkclause is isolated; using e.g.(B=8, W=128, P=1024)againstprefill_chunk_size = 512would isolatemax_chunk.scripts/scheduling_sim/model.py:43-49andscripts/scheduling_sim/timing.py:37-43: the simulator validatesmax(B, W) <= P <= B * Wwithout Helios'sP >= 64 and P % 64 == 0alignment constraint (helios/src/execution/manifest.rs:464-465).verification/helios-lifecycle/check.py:18,22,95-103:TEST = "scheduler::lifecycle_tests::"mirrors the existingCheckpointReservationprefix pattern (:33-34) and executes bothLifecycletests, failing if either test's assertions fail; optionally asserting thePACKED_PREFILL_LIFECYCLE_COVERAGEmarker incheck.pywould additionally guard against the packed test ever being#[ignore]d or moved out ofscheduler::lifecycle_tests.
Dropped on verification
- Code Correctness Finding 1 (
verification/helios-lifecycle/check.py:18,22,95-103— Major "vacuous-verification hole" with counterexample "rename test topacked_prefill_lifecycle_model"): Dropped as Major (kept as an optional Nit). Directly verified thatTEST = "scheduler::lifecycle_tests::"follows the exact pre-existingCheckpointReservationconvention (check.py:33-34), runs all tests inscheduler::lifecycle_tests(failing the run ifpacked_prefill_scheduler_matches_lifecycle_model's non-vacuity assertions atlifecycle_tests.rs:934-937fail), and the claimed rename counterexample is false because renaming a test withinscheduler::lifecycle_testsstill matches the module prefix. - Code Correctness Finding 2 (
helios/src/model/tests.rs:2834-2853— claimed "test asserts the wrong error"): Reframed under Subtract #1 rather than a test defect.model/tests.rs:2847-2853accurately testspack_inputs's end-to-end aggregate-cap rejection (scheduler.rs:462), andcheck.py:763-775mutatesscheduler.rsaccordingly; only the redundant check inpacking.rs:425-427,432-438is dead behindinputs.rs:35. - Code Correctness Finding 5 (
ignition/preparation/execution.py:80-92omittingprefill_chunk_size) & Finding 6 (ignition/direct/scheduler.pynot rejecting packed-only cores atLayout.of): Dropped as low-signal.PreparedModel.__init__(ignition/preparation/model.py:32-39) ownsserver_configand already fails closed whenprefill_chunk_sizeis missing or exceeded (tests/preparation/test_execution.py:440-473); direct mode never unpackslayout.graphskeys as 3-tuples (directly verified acrossignition/direct/policy.py:51-79,200-218andignition/direct/scheduler.py) and already fails cleanly withAdmissionErrorif soloB == 1prefill is absent. - Code Correctness Audit Limitation (
helios/src/scheduler.rs:3050-3052— clearingdeferred_prefillon partial packedTerminalPrefill): Verified clean and dropped.helios/model-contract.md:176-180(not opened) establishes thatTerminalPrefillcomputes full continuation state,inputs.rs:87-91setsSampleEnabled = 0for mid-prompt lanes,scheduler.rs:3078-3079,3103-3105returns unfinished lanes toRequestPhase::Prefill, andcheckpoints.rs:935-936/policy.rs:512handleTerminalPrefillconsistently. - Discovery Dossier A6 (
policy.rs:1732-1734—packed_prefill_lane_compatibleshort-circuit onTerminalPrefill): Re-verified and dropped (consistent with Rounds 2–3); mixed finishing + continuing lanes on packedTerminalPrefillare an explicitly designed and tested feature (policy_tests.rs:9709-9746(not opened),model/tests.rs:2780-2827). - Discovery Dossier GAP (a) (
helios-lifecycle.yml(not opened) runningcheck.pywithout--mutations) & GAP (b) (Kani not extended tovalid_packed_prefill_geometry): Dropped as non-blocking perdocs/design-review.md:221-228,241-246:--mutationsis an opt-in idle-worktree guard (check.py:299) verified locally across all three new guards,validate_completion(kani_proofs.rs:145-182) is unchanged, and:241-246's widened-geometry requirement is a disjunction satisfied by the newLifecycle.tlaconformance fixture. - Subtraction S2 (
policy.rs:1306-1348vs:1754-1798), S3 (selection.rs:285-298usize::try_fromchain), S8/S9: Dropped as low-value style churn —packed_prefill_offersandfill_finishing_lanesalready factor out the shared logic cleanly, andusize::try_fromavoids silentu64 -> usizetruncation before geometry validation.