Re review report · NVIDIA/hyperflare-inference #715

Raw Markdown for agents: https://autobot.eidonix.com/p/e38ad64a-7791-465a-aca9-3ec148e52325.md

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

Walkthrough

Pre-merge Checks

Blockers

  1. 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-26 requires 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."). At 4e3e2c3, this PR widens PREFILL/TERMINAL_PREFILL to multi-request batch_capacity >= 2 with explicit packed_token_capacity (helios/src/execution/manifest.rs:881-900), aggregate P-row InputIndexing::PackedToken buffers (helios/src/model/packing.rs:169-179), binding-derived vision exclusion (helios/src/model/packing.rs:113-126), and per-lane QUERY_LENGTH/SAMPLE_ENABLED completion (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.

Should Fix

  1. 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 FlashInfer 5a8ceed80, and the C=1 solo control regressed 111.2 ms → 118.7 ms (0.94×). The 1.68×–4.15× TTFT and 1.75×–4.23× throughput headline claims therefore do not yet isolate packed prefill on an equivalent baseline under docs/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=1 solo control.
  2. scripts/scheduling_sim/learning_scenarios.py contains no packed_prefill=True scenario, leaving the new packed-prefill timing-estimation path unexercised by learning.py (not opened) (docs/design-review.md:201-206).

    • Verified behavior/impact: scripts/scheduling_sim/learning_scenarios.py:38 uses catalog() and :67 uses catalog(mixed=True), with zero calls to catalog(packed_prefill=True) anywhere in scenarios() (:37-135). Because the PR changes timing estimation (helios/src/scheduler/cost.rs:581-583 (not opened),606-607,644-659,969-971 and scripts/scheduling_sim/learning_policy.py:189-225,316-325, scripts/scheduling_sim/timing.py:54-55), the reported --preset screen and --preset validate runs validate non-regression of solo/mixed catalogs only and never exercise LearningScheduler discovery, refresh, poisoning, or recovery on a packed prefill graph.
    • Fix: Add packed-prefill scenario(s) using catalog(packed_prefill=True) to scripts/scheduling_sim/learning_scenarios.py and re-run scripts/scheduling_sim/learning.py (not opened) --preset screen and --preset validate (or record owner agreement that flat-ReplayTimes packed prefill timing is outside the learning catalog's scope).

Subtract / Simplify

  1. Trim unreachable duplicate lane-bound checks in Inputs::pack_step (helios/src/model/packing.rs:422-439). pack_inputs() already calls step.validate_mixed()? at helios/src/model/inputs.rs:35, which enforces lane.tokens <= self.token_capacity and sum(lane.tokens) <= self.packed_token_capacity (helios/src/scheduler.rs:447-455) before inputs.pack(&frame) at inputs.rs:93. Keeping only the live 3-line live.image_slot.is_some() guard at packing.rs:429-431 removes ~14 lines of dead duplicate validation (and the existing check.py:763-775 aggregate-cap mutation already targets scheduler.rs, not packing.rs).
  2. Remove dead tuple(reversed(names)) in scripts/scheduling_sim/scheduler.py:55-56. key = (total_val, len(chosen), total_tokens, tuple(reversed(names))) allocates key[3] and never reads it (line 56 compares key[:3] and names < best[3]). Simplify to key = (total_val, len(chosen), total_tokens).
  3. Deduplicate simulator graph validation and rank-weight helpers (scripts/scheduling_sim/model.py:43-51 vs. scripts/scheduling_sim/timing.py:37-45; rank key in scheduler.py:101, learning_policy.py:247,254, utility.py:309). Extract one shared validator helper for Graph.__post_init__ and GraphSpec.__post_init__, and a Graph.cost_weight property for (packed_token_capacity or prefill_capacity) + decode_capacity * width.
  4. Simplify tautological else arm in helios/src/execution/manifest.rs:936-951. Inside if graph.batch_capacity == 1 { ... } else { graph.batch_capacity >= 2 }, the else expression is always true for validated packed prefill graphs (:881-894) and ScoredPrefill duplicates the 3-line token_capacity alignment predicate; folding them removes ~6 lines.

Nits

Dropped on verification