Recommendation: Changes Requested
Commit 49d5840 cleanly closes two of Round 2's three Should Fix items and nearly all prior Subtract items: PreparedModel.__init__ (ignition/preparation/model.py:32-43) now enforces packed_token_capacity <= prefill_chunk_size with a regression test (tests/preparation/test_execution.py:440-463), docs/scheduling-runtime-design.md:21-25,455-475 is synchronized with the shipped catalog and batch == 1 stratified cost-model scope, geometry validation is unified in valid_packed_prefill_geometry (helios/src/execution/manifest.rs:452-468), the twin cohort selectors are consolidated in select_packed_prefill_cohort (helios/src/scheduler/policy.rs:1571-1678) with promoted-lane seeding tested at policy_tests.rs:9821-9835, dead packed re-validation in commit is removed, is_non_terminal_prefill_step uses binary_search_by_key, and clean Layer 1 test runs are reported (1,918 lib + 62 integration + 56 pytest passed). Direct verification at 49d5840 confirms no blocking code-correctness or hot-path defects in the packed-prefill implementation. However, both hard governance/verification blockers remain unresolved (no recorded owner approval for the extended PREFILL/TERMINAL_PREFILL operation contract, and incomplete Layer 2 simulator / Layer 3 widened-geometry conformance & mutation coverage), along with the non-equivalent A/B baseline.
Merge Risk
Level: High
- Widens the
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. - Adds
+373lines tohelios/src/scheduler/policy.rswithout Layer 2 simulator coverage or Layer 3 conformance/mutation coverage for the newB >= 2prefill geometry, and shares 8 files (includingpolicy.rs,cost.rs,scheduler.rs, anddocs/scheduling-runtime-design.md) 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,helios/src/execution/manifest.rs:452-468,881-900,936-950,helios/src/model/catalog.rs:266-288,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-alignedPwithin[max(64, B), min(B * W, i32::MAX)], optionalP <= prefill_chunk_size,draft_tokens == 0) while keepingB == 1(P == 0) andScoredPrefillunchanged and droppingB >= 2shapes when--max-concurrency 1. - Input packing (
helios/src/model/packing.rs:113-126,169-179,422-439,helios/src/model/inputs.rs:87-91): forbid vision bindings onB >= 2prefill graphs, sizeInputIndexing::PackedTokenbuffers toP, validate per-lanetokens <= W,image_slot.is_none(), andsum(tokens) <= Pbeforestaging.clear(), and drive per-laneSampleEnabledindependently for finishing vs. continuing lanes. - Scheduler, cost model, checkpoints, and runtime (
helios/src/scheduler/policy.rs:14-22,1311-1401,1560-1778,2073-2104,helios/src/scheduler/cost.rs:581-583,606-607,644-659,969-971,helios/src/scheduler/checkpoints.rs:925-936,helios/src/scheduler.rs:436-463,937-956,2615-2617,helios/src/server/runtime.rs:848-900): registerB >= 2packed prefill shapes separately, scopePrefillCostModeland context-slope refresh tobatch == 1(usingReplayTimesforbatch >= 2), unify cohort selection inselect_packed_prefill_cohortwith promoted-lane seeding for continuation valuation, and classify non-terminal packed steps viabinary_search_by_key. - Ignition and direct mode (
ignition/preparation/execution.py:80-96,ignition/preparation/model.py:32-43,ignition/cli/serve.py:465-469,ignition/direct/scheduler.py:197-202 (not opened),290-291): validate(B >= 2, W, P)text-only prefill signatures, rejectP > prefill_chunk_sizeinPreparedModel.__init__, scope--packed-verificationchecks tospeculativesignatures, and keep direct-modecapacities()isolated toB == 1solo prefill. - Docs and tests (
docs/packed-prefill-design.md,docs/scheduling-runtime-design.md:21-25,455-475,helios/model-contract.md:188-209,helios/manifest.md(not opened),helios/src/scheduler/policy_tests.rs:9580-9836,helios/src/model/tests.rs(not opened),tests/preparation/test_execution.py:409-463): document additive Contract 3 packed prefill and cover geometry, chunk-bound rejection, vision/logprob isolation, multi-lane packing, mixed finishing/continuing lanes, and promoted-lane continuation reservation.
Pre-merge Checks
- [PASS] Security / malicious screen: No prompt-injection or instruction-redirection content in the PR body, comments, or diff; all review and provenance material was 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,scheduler.rs,docs/scheduling-runtime-design.md) plus active scheduling/admission PRs (#621,#693,#718). - [WARN] Tests & verification evidence: Layer 1 Rust/Python unit coverage is clean at
49d5840(1,918lib +62integration +56pytest), and CI covers existing TLC/Kani checks onhelios/**, but Layer 2 simulator coverage, Layer 3B >= 2conformance fixtures /--mutationstesting, and an equivalent A/B baseline remain missing.
Blockers
-
Extended captured-graph operation contract has no recorded owner approval (
docs/design-review.md:22-26,AGENTS.md:376-381).- Verified behavior/impact:
docs/design-review.md:22-26states: "Introducing a captured-graph operation family requires prior explicit approval from project owner Luke Alonso lalonso@gmail.com. Shape and capacity variants are allowed within an unchanged operation contract. A new operation contract requires approval even if it reuses a graph kind or enum value. A design acknowledgment does not grant approval." At49d5840, this PR widens thePREFILL/TERMINAL_PREFILLoperation contract — acceptingbatch_capacity >= 2with explicitpacked_token_capacity(helios/src/execution/manifest.rs:881-900), changingInputIndexing::PackedTokenextent on prefill to aggregateProws (helios/src/model/packing.rs:169-179), defining binding-derived vision exclusion (helios/src/model/packing.rs:113-126), and formalizing per-laneQUERY_LENGTH/SAMPLE_ENABLEDmulti-request completion (helios/model-contract.md:188-209). No maintainer comment, review, or linked approval exists on#715. - Fix: Obtain an explicit approval comment from Luke Alonso on
#715(or link the approval thread) for the extended Contract 3 prefill operation contract. (This is a sign-off gate, not a rejection —@original-el8is a charter-named priority contributor and the design fits the charter.)
- Verified behavior/impact:
-
Testing-hierarchy Layers 2 and 3 remain incomplete for the added cohort algorithm, timing rules, and widened
B >= 2prefill geometry (docs/design-review.md:195-251).- Verified behavior/impact:
- Layer 2 (
docs/design-review.md:195-208): Changes to cohort algorithms (helios/src/scheduler/policy.rs:1311-1401,1571-1678,1711-1778) and timing estimation (helios/src/scheduler/cost.rs:581-583,606-607,644-659,969-971) require evaluation againstscripts/scheduling_sim/and the 64-seedscripts/scheduling_sim/learning.py(not opened) catalog. No simulator run is reported, andscripts/scheduling_sim/scheduler.py:30-35currently models at most one prefill lane per action (for view in [None, *prefills] if graph.prefill_capacity else [None]). - Layer 3 (
docs/design-review.md:226-228,241-246): Although.github/workflows/helios-lifecycle.yml:34 (not opened),49executes existing TLC and Kani suites onhelios/**,:241-246requires extending conformance fixtures/harnesses when supported runtime geometries expand, and:226-228requires mutation testing (check.py --mutations) when adding safety guards. Neitherverification/helios-lifecycle/**norhelios/src/scheduler/lifecycle_tests.rs(not opened) /checkpoint_lifecycle_tests.rs(not opened) is updated to coverB >= 2packed prefill geometry (scheduler.rs:436-463,packing.rs:422-439,is_non_terminal_prefill_step), and no--mutationsrun is reported.:247-251states disclosure does not waive runnable CPU checks.
- Layer 2 (
- Fix: Extend and run
scripts/scheduling_sim/+learning.py(not opened) (or record owner agreement that Layer 2 is inapplicable to packed prefill), add Layer 3 lifecycle conformance coverage for the widenedB >= 2prefill geometry, and runpython3 verification/helios-lifecycle/check.py --mutationsover the added safety guards.
- 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, 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 meet the "equivalent baselines" requirement indocs/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 same binary (or packed prefill off/on on an identical build), including the
C=1control.
- Verified behavior/impact: As disclosed in the PR description, the baseline 151-graph core (
Subtract / Simplify
- Remove the duplicate
valid_packed_prefill_geometrycheck inExecutionManifest::validate(helios/src/execution/manifest.rs:881-894vs.:936-950). Inside the samefor graph in &self.graphsloop,valid_packed_prefill_geometryis called twice with identical arguments (graph.batch_capacity, graph.token_capacity, graph.packed_token_capacity, self.request_capacity(), None). The secondelsebranch at:941-949can simply returntrue(already validated above) or be folded into one check. - Unify the remaining duplicated offer-gathering and finishing-fill loops in
helios/src/scheduler/policy.rs. Whileselect_packed_prefill_cohortwas extracted, the ~50-line offer-gathering loops at:1311-1366and:1718-1761still duplicate duration lookup,is_non_terminal_prefill_step,prefill_slot_state,prefill_work_through,packed_prefill_lane_compatible, andlane_value_for_tokens; similarly, thefinishingcohort fill at:1372-1396duplicates:1140-1160. - Drop derived counters from
PackedCohort(helios/src/scheduler/policy.rs:14-22).selected == mask.count_ones() as usizeandpromoted_count == promoted_mask.count_ones() as usizeby construction; deriving them from the bitmasks removes redundant state that must be kept in sync across seeding (:1616-1623) and fill (:1642-1650). - Consolidate the four manifest filter passes in
helios/src/server/runtime.rs:848-900. A single pass overexecutor.manifest().graphsdispatching by(graph.kind, graph.batch_capacity)avoids repeating&& batch_capacity == 1across three sibling filter chains.
Nits
ignition/preparation/model.py:32-43: thepacked_token_capacity <= prefill_chunk_sizecheck is skipped ifserver_config["prefill_chunk_size"]is omitted, whereashelios/src/runtime_core/selection.rs:281defaults a missing key to0(rejecting allB >= 2packed prefill graphs). Failing closed whenprefill_chunk_sizeis missing for cores declaring packed prefill would match Helios. (Likewise,ignition/preparation/execution.py:80-86checksbatch_capacity <= MAX_CONCURRENCYrather thanrequest_capacity(max_active), matching pre-existingmixed/speculativesignatures.)helios/src/scheduler/policy.rs:1738-1740,2133-2136,2264-2266: packed prefill lanes compute cuts withestimated_checkpoint_cut(quote_storage = false) and skip theavailable_planauthoritativecheckpoint_cutreconciliation (candidate.batch == 1), so under snapshot-storage exhaustion a packed lane may stop slightly early at an un-capturableMessageboundary (safe, slightly conservative).helios/src/scheduler/policy.rs:1628-1654: single-pass forward greedy fill inselect_packed_prefill_cohortcan reject a shape when one oversized high-value/high-density lane blocks a fitting pair (e.g.,P = 128with offers(70, 140), (60, 100), (60, 100)), safely falling back to solo prefill.helios/src/model/packing.rs:436:graph.packed_tokens != 0is always true for validatedB >= 2prefill graphs (packed >= 64); can be simplified toif total_tokens > graph.packed_tokens.- The PR description still lists the stale-base
helios/src/runtime_core/cache_memory.rs(not opened) compilation fix bullet even though that file is not in the 23-file diff at49d5840.
Dropped on verification
- Code Correctness F1 severity escalation (
helios/src/scheduler/policy.rs:2133-2136— claimed "stuck anchor guard / runs past armed anchor"): Dropped as Major; kept as a Nit above. Directly verified athelios/src/scheduler/checkpoints.rs:714-768thatRetentionRole::Anchoris inserted unconditionally before thequote_storagecheck at:865-877, soanchorcannot diverge betweenestimated_checkpoint_cutandcheckpoint_cut. OnlyRetentionRole::Messageboundaries are gated byquote_storage, and becauseMessagecandidates are checked in descending endpoint order (monotonically decreasingRetentionRankwith identicalrowsandprotected_budget = None),quote_storage = trueyields a subset of cuts — at worst causing a safe, slightly conservative early stop without missing any capturable cut or sticking an anchor guard. - Code Correctness F4 (
ignition/cli/serve.py:465-467— "packed_token_capacityalways truthy for speculative signatures"): Dropped as pre-existing onmain. Verified againstmain(ignition/cli/serve.py:463andignition/preparation/execution.py:87,91onmain) that speculative signatures already populatedpacked_token_capacity >= batch_capacityandserve.pyalready checkedsignature.packed_token_capacity; this PR only addedsignature.kind == "speculative" andto stop packed prefill signatures from spoofing--packed-verification. - Code Correctness F3 (
helios/src/scheduler/cost.rs:644-659,947-972— flat 9-sample median for packed prefill): Dropped as an intentional, documented design choice (docs/scheduling-runtime-design.md:473-475), not a correctness defect. - Gates M1 (
docs/core-design.md:420— "One request per chunk, interleaved with decode"): Dropped as false / moving-goalposts. Verified atdocs/core-design.md:415-420that this row sits in a"For Qwen at concurrency four: | Setting | Default |"table where default prefill remains solo; the canonical scheduler doc (docs/scheduling-runtime-design.md) was updated in49d5840. - Discovery Dossier A4 (
helios/src/scheduler/policy.rs:1689-1691—packed_prefill_lane_compatibleshort-circuit onTerminalPrefill): Re-verified and dropped (matching Round 2).helios/src/model/inputs.rs:87-91setsSampleEnabled = 0for mid-prompt lanes,helios/src/scheduler.rs:3078-3079keeps unfinished lanes inRequestPhase::Prefill,helios/model-contract.md:176-180establishes thatTerminalPrefillrebuilds complete continuation state, and mixed finishing + continuing lanes are an explicitly designed and tested feature (policy_tests.rs:9709-9746,model/tests.rs:2762-2804(not opened)). - Discovery Dossier A7 ("undeclared behavior change seeding a promoted lane in
select_packed_prefill_cohort"): Dropped as stale/false. This fix was explicitly requested by Round 2 Subtract #1 and explicitly documented in the author's49d5840comment and unit test (policy_tests.rs:9821-9835). - Subtraction §7 ("four unrelated features bundled in the diff:
preserve_message_anchor,RowRestoreLatency, RoCEgid_indices,pool_vram"): Dropped as false (stale localmainartifact). Verified viapr_filesthat none ofroce.rs(not opened),roce_fabric.rs(not opened),rendezvous.rs(not opened),ignition/cli/config.py(not opened),phase_tests.rs(not opened),boundary_tests.rs(not opened), orcheckpoint_lifecycle_tests.rs(not opened) are in PR #715's 23 changed files, andcheckpoints.rs(+12 -3) /server/runtime.rs(+43 -5) contain only packed-prefill changes. - Upstream Code Correctness discarded sub-agent claims (
pack_stepsum hole,max_batchdropping all packed graphs,promoted_limitcapped at 1): Re-confirmed false (manifest.rs:464,selection.rs:365,policy.rs:1062,1824).