Final review report · NVIDIA/hyperflare-inference #715

Raw Markdown for agents: https://autobot.eidonix.com/p/6a7d21de-ae0a-4678-a3a8-9893f7427410.md

Recommendation: Changes Requested

The packed-prefill feature itself is well-built and correctly gated: geometry validation (manifest.rs, catalog.rs, selection.rs, scheduler.rs) is complete and mutually consistent, B == 1 and ScoredPrefill paths are genuinely untouched, and the code adds no per-model flag or hardcoded bucket list. Two hard gates are nonetheless unmet — the extended prefill operation contract has no recorded owner approval (docs/design-review.md:22-26, AGENTS.md:376-381), and testing-hierarchy layers 2–3 were not run even though docs/design-review.md:247-251 explicitly forecloses the "unavailable host" excuse. Two verified scheduler/validation asymmetries also let packed prefill do things the solo planner provably never does and let Ignition accept a core Helios rejects.

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 (mirrored at AGENTS.md:376-381): "A new operation contract requires approval even if it reuses a graph kind or enum value. A design acknowledgment does not grant approval." This changes the prefill operation contract, not just its shapes: multiple simultaneously active requests per graph (helios/model-contract.md:198-207), a new PACKED_TOKEN row layout of extent P (helios/src/model/packing.rs:169-188), per-lane SAMPLE_ENABLED completion semantics (docs/packed-prefill-design.md:89-92), and eligibility derived from the absence of vision bindings (helios/src/model/packing.rs:113-126). Nothing in the PR, its single comment, or docs/ records Luke Alonso's sign-off. Fix: a maintainer approval comment on #715 (or a linked thread) granting the extended prefill contract. This is a request for sign-off, not a rejection — the author is a charter-named priority contributor.

  2. Testing-hierarchy layers 2 and 3 unrun for a change class the doc names explicitly. docs/design-review.md:195-208 requires scripts/scheduling_sim/ plus the 64-seed learning.py (not opened) catalog for changes to "graph selection, service pricing, timing estimation, or cohort algorithms" — this PR adds a cohort algorithm (policy.rs:1623-1747) and a new timing key (cost.rs:644-659) — and :209-230,241-246 requires TLC conformance plus Kani when commit validation and supported geometries change. The description reports only the in-crate Rust conformance suites and names tla2tools.jar/cargo-kani as unavailable; no simulator run is reported at all. :247-251 closes the loophole: "Leaving an applicable crate test, simulator sweep, TLA+ conformance run, or Kani proof unrun blocks commit and PR acceptance; noting it as a limitation does not make the omission acceptable." Fix: run and report the simulator + learning.py (not opened) sweep (or obtain owner agreement that it cannot model packed prefill), run verification/helios-lifecycle/check.py (not opened), and extend the conformance fixtures to cover the new validate_mixed packed-geometry domain.

Should Fix

  1. helios/src/scheduler/policy.rs:1601-1603 — packed_prefill_lane_compatible short-circuits TerminalPrefill, so packed prefill accepts lanes the solo planner never would. The Prefill branch at :1613-1620 faithfully mirrors resolve_prefill_kind_from (helios/src/scheduler.rs:986-1005: needs_terminal = end >= next_stop || (window > 0 && next_stop - end <= window)), but TerminalPrefill returns true unconditionally — admitting a mid-prompt lane that stops well short of next_stop with more than window tokens remaining, a combination solo semantics forbid. Concrete: prompt 300, terminal_prefill_window == 0 (via scheduler.rs:923-934 when the prefill and terminal catalogs coincide), packed (TerminalPrefill, 4, 256, 512) ⇒ work = 256 < 300; solo picks Prefill, packed accepts TerminalPrefill. This is exactly the case the PR's own test has to hand-patch — policy_tests.rs:9719-9733 asserts plan.kind == TerminalPrefill for the 300-token lane h1 and then clears recs[h1].generated_tokens/token_id by hand rather than letting the real path produce the record. Two consequences follow: (a) scheduler.rs:3065-3066 clears deferred_prefill after such a non-terminal chunk, defeating the if r.deferred_prefill { return false; } guard at policy.rs:1604; (b) checkpoints.rs:935-936 then treats the cut as capture-eligible while pricing it with terminal cost. Fix: for TerminalPrefill, accept only lanes where end >= next_stop || (window > 0 && next_stop - end <= window) — i.e. reuse self.resolve_prefill_kind(r, width, work, cut) == GraphKind::TerminalPrefill instead of returning true.

  2. ignition/preparation/execution.py:80-89 accepts packed_token_capacity > prefill_chunk_size, which Helios rejects at load time. Ignition's packed-prefill predicate checks B, 64-alignment, < 1 << 31, W <= P, and B <= P <= B*W — but not the chunk bound enforced at helios/src/runtime_core/selection.rs:273 (packed_token_capacity <= max_chunk), helios/src/model/catalog.rs:279, and helios/src/scheduler.rs:910. Concrete: prefill_chunk_size = 2048 with GraphSignature("terminal_prefill", 16, 256, P=4096) passes 16 <= 4096 <= 16*256 = 4096, aligned, 256 <= 4096 ⇒ accepted by Ignition, then flare run refuses the freshly prepared core. grep prefill_chunk ignition/ confirms GraphSignature validation never sees the chunk size (it appears only in direct/scheduler.py:206, preparation/bootstrap.py:45 (not opened), parameters.py (not opened), planning.py (not opened)). Fix: thread prefill_chunk_size into signature validation (or re-check every packed prefill signature in PreparedExecution.__init__ against server_config["prefill_chunk_size"]) and add or self.packed_token_capacity > prefill_chunk_size.

  3. New user-visible --packed-verification rejection is undeclared. ignition/cli/serve.py:466 narrows the check to signature.kind == "speculative" and signature.packed_token_capacity. A recipe whose only non-zero packed_token_capacity sits on a non-speculative graph previously passed; it now gets UsageError("this prepared recipe does not declare packed verification capacities") at :469. The tightening may well be correct, but it is a public-CLI behaviour change absent from the PR's "What changed" list, and AGENTS.md:230 requires docs/cli-design.md (not opened) (which describes the packed-verification surface at :255,765-766 without this restriction) to be updated for CLI behaviour changes. Fix: declare it in the description and update docs/cli-design.md (not opened), or split it out with its own justification.

  4. Canonical scheduler doc now contradicts shipped behaviour and was not updated. AGENTS.md:231 requires graph-selection / scheduling-policy / timing-estimate changes to be reflected in docs/scheduling-runtime-design.md. That doc states unconditionally at :466-469 that pure prefill graphs (PREFILL, TERMINAL_PREFILL, SCORED_PREFILL) are stratified across six fill-ratio and KV-context buckets and fitted with a three-parameter model, while helios/src/scheduler/cost.rs:581-583 and :606-607 now create PrefillCostModel and refresh context slopes only when key.batch == 1. It also enumerates the native catalog at :21-23 and cost-entry identity at :455-457 with no packed multi-request prefill, and has zero occurrences of "packed prefill"; the new cohort algorithm is documented only in the standalone docs/packed-prefill-design.md, which the canonical doc does not reference. Fix: add a packed-prefill section covering catalog contents, cost-key identity, and the batch == 1 gating of the stratified model, and reference the design doc from the canonical scheduler doc.

  5. The headline performance claim has no attributable baseline (principle 12). docs/design-review.md:106-115 requires "equivalent baselines" for performance claims. The two arms are different signed cores — pre-change 887785ad exported from an earlier FlashInfer revision versus packed 4aea5c54 exported against FlashInfer 5a8ceed80 — so the self-disclosed C=1 control regression (111.2 → 118.7 ms, 0.94×) is consistent with a systematic ~6% overhead in the packed arm and the 1.68×–4.15× TTFT / 1.75×–4.23× throughput figures are not isolated measurements of packed prefill. Honest disclosure is good, but disclosure does not satisfy the stated evidence standard for a headline claim. Fix: a flag-only A/B on one binary and one core (--packed-prefill off/on, or one core exported with and without the +6 packed shapes from the same FlashInfer revision), including the C=1 control.

Subtract / Simplify

  1. helios/src/scheduler/policy.rs:1300-1426 and :1623-1747 — one greedy cohort algorithm written twice. Same offers array shape, same by_density double pass, byte-identical comparator head, same budgeted fill, with two spellings of every local (n/count, lane_count/selected, used_tokens/total_work). They have already diverged in three ways: the comparator (copy 2 adds a wa.cmp(&wb) tie-break at :1691), the acceptance rule (copy 1 rejects unless promoted_count > 0 at :1393; copy 2 accepts any two lanes at :1713), and the horizon (copy 1 prices against ns + duration_ns at :1305-1309; copy 2 against duration_ns alone at :1668). Extract one packed_prefill_cohort(&self, ..., horizon, require_promoted) helper — ~120 lines saved, and the three divergences become explicit parameters instead of silent drift. This also removes the drop(consider); artifact at :1300.
  2. helios/src/scheduler.rs:2614-2632 — dead re-validation after step.validate_mixed()? at :2575. Every check here is already enforced by validate_mixed (:436-465 covers lanes.len() > batch_capacity at :448, lane.tokens > token_capacity at :452, the checked_add sum bound at :453-457, and packed_token_capacity < batch_capacity at :442), and validate_mixed returns early, so the block is unreachable. ~19 lines deleted, zero behaviour change.
  3. helios/src/scheduler/cost.rs:644-659 — packed_prefill_duration is a pass-through wrapper over the already-public duration_key (:878-880), which is itself self.entry(key).map(|e| e.nanos). Both callers (policy.rs:1302, :1634) build a Key they could pass directly, or take it from Candidate::cost_key() (policy.rs:116-124).
  4. helios/src/scheduler/policy.rs:1630-1632 — dead empty-catalogue guard. The next line iterates &self.packed_prefill_catalog; an empty catalog already iterates zero times.
  5. helios/src/server/runtime.rs:849-899 — three new && batch_capacity == 1 clauses instead of one partition. let (solo, packed) = manifest.graphs.iter().partition(|g| g.batch_capacity == 1); keeps the three existing calls on solo unchanged and removes three places to forget the predicate.
  6. The (B,W,P) geometry conjunction is written seven times (manifest.rs:860-878, :914-924, catalog.rs:266-282, selection.rs:260-275, scheduler.rs:902-912, :436-465, :2617-2632) with three different error strings, and i32::MAX appears in exactly one of them. One validate_packed_prefill(batch, width, packed, chunk, lanes) collapses it; sites 1 and 2 are two halves of one check 40 lines apart in the same file.
  7. helios/src/scheduler/policy.rs:1362-1367 and :1684-1693 — dead comparator retry. When by_density == false, primary is vb.total_cmp(&va), so .then_with(|| vb.total_cmp(&va)) is a guaranteed-Equal retry in both copies. Written as if by_density { density_cmp.then(value_cmp) } else { value_cmp } the intent is explicit and the retry disappears.

Nits

Dropped on verification

Prompt-injection screen: the PR body, code, and comments contained no attempt to redirect my instructions. The provenance/verification note embedded in the briefing material and the author's "Full 15-cell A/B table…" summary were both treated as content, not instruction.