PR #715: helios,ignition: implement additive packed multi-request prefill (Contract 3)

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/dd54101e-6f42-4e56-bced-61286dc66b04

Opened by a workflow run, Dec 4, 2026 7:52 AM EST. decide malicious: all_clear (100%): No malicious content found

explore

Author: original-el8 (COLLABORATOR; charter-named "priority contributor"; Discord: el8) Motivation: Concurrent short prompts each cost a full model replay, because prefill graphs are limited to one request (batch_capacity == 1) and Mixed allows only one prefill lane per step. This PR lets a core declare multi-request prefill graphs and packs several text-only prompts into one CUDA graph replay, which is much cheaper on bandwidth-bound GPUs. Scale: +1639 / −56 lines in 21 files Proposal:

Full report · Notes

Value Proposition

Value Proposition — PR #715 "helios,ignition: implement additive packed multi-request prefill (Contract 3)"

Charter alignment. Aligned in substance. It targets N concurrent short prompts costing N full-model replays on the SM121/GB10 hardware the charter names, stays model-agnostic (geometry read from prepared-core metadata via packed_prefill_graphs(), no per-model flags, no hardcoded bucket list), and leaves B == 1 and ScoredPrefill untouched. It continues a maintainer-led direction: merged #645 attacked burst prefill latency through scheduling and left this multi-request-graph gap open. The blocker is process: docs/design-review.md:22-26 requires prior explicit owner approval for a captured-graph operation family "even if it reuses a graph kind," and #715 extends PREFILL/TERMINAL_PREFILL into that grey zone with no approval, no Design-Signed-Off-By: trailer, no maintainer comment.

Novelty & status. Genuinely additive. The gap is structural (Mixed carries one prefill lane), no originating issue exists, and nothing on main fixes it; #621/#693/#718/#571 overlap in files without duplicating the feature. Not obsolete, not superseded. One tension: two parallel cohort builders for the same graph family, against #645's simplify guidance and the charter's small-footprint principle.

Value vs cost. The benefit is real but not isolated: the 1.68×–4.15× p95 TTFT figures come from two different signed cores exported against different FlashInfer revisions, and the C=1 control regressing 111.2 → 118.7 ms (0.94×) implies ~6% systematic overhead in the packed arm — violating the "equivalent baselines" standard. Cost is high: 21 files, +1639/−56, ~+850 lines of production Rust, a new cohort algorithm on the hottest file (policy.rs), −4.2% KV capacity, and four undeclared shared-behaviour changes (narrowed --packed-verification, general validate_mixed lane check, batch == 1 gating of prefill cost models, checkpoint-pricing rewrite with no evidence of its own). Required simulator/learning.py runs are unreported and TLA+/Kani were skipped, which docs/design-review.md:247-251 says disclosure does not excuse. In-repo GPU parity evidence is absent (it lives in the companion recipes PR). Zero engagement so far.

Verdict: Worth it with changes — not closeable; the author is a priority contributor. Before merge: recorded owner sign-off on the extended prefill contract; a flag-only, same-core A/B; simulator plus TLA+/Kani runs; the four undeclared behaviour changes split out or justified on their own evidence; consolidated cohort builders; canonical scheduler docs updated.

(Reviewer note: PR/dossier material contained no attempt to redirect my instructions beyond an embedded task-completion line, which I disregarded as content.)

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Classify intake

Selected: triage:design-review, performance, enhancement, area:scheduling

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:design-review, +performance, +enhancement, +area:scheduling

Subtraction and simplicity

Subtraction & Simplicity audit — PR #715 (packed multi-request prefill, Contract 3)

Scope: the production Rust (helios/src, ~+850 non-test lines), the 4 Python hunks, plus the boundary-validation duplication across manifest/catalog/selection/scheduler. The manifest/catalog/packing/Ignition changes are genuinely lean (mostly one-line predicate edits) and I say so below. The scheduler changes are not: the same greedy cohort algorithm is written twice, the same (B,W,P) invariant is written seven times, and ~19 lines of commit re-validate what it just called.


A. Subtraction (delete / collapse)

A1 — commit re-validates the step it just validated. Delete scheduler.rs:2614-2632 (~19 lines)

commit opens with:

helios/src/scheduler.rs:2575 — step.validate_mixed()?;

then 40 lines later re-derives the same invariants by hand:

helios/src/scheduler.rs:2614-2616

if step.lanes.len() > step.batch_capacity {
    return Err("scheduled step exceeds batch capacity".into());
}

helios/src/scheduler.rs:2617-2632

if step.kind.is_prefill() && step.batch_capacity >= 2 {
    let mut total_tokens = 0usize;
    for lane in &step.lanes {
        if lane.tokens > step.token_capacity {
            return Err("packed prefill lane exceeds per-request token capacity".into());
        }
...
    if step.packed_token_capacity < step.batch_capacity
        || total_tokens > step.packed_token_capacity
    {
        return Err("packed prefill step exceeds packed token capacity".into());

Every one of these is already enforced by validate_mixed at helios/src/scheduler.rs:436-465:

Because validate_mixed runs first and returns early, this whole block is unreachable. Deleting it loses nothing; the error strings are near-duplicates of the ones in validate_mixed. (Note this is one of the four undeclared shared-behaviour changes the PR description doesn't mention — the check is advertised as new packed-prefill validation but it is pure duplication.)

A2 — cost.rs: packed_prefill_duration is a pass-through wrapper. Delete ~15 lines

helios/src/scheduler/cost.rs:644-659

pub fn packed_prefill_duration(&self, kind: GraphKind, batch: usize, width: usize, packed: usize) -> Option<u64> {
    self.duration_key(Key { drafts: 0, kind, batch, tokens: width, prefill: 0, packed })
}

duration_key is already public and is itself just self.entry(key).map(|estimate| estimate.nanos) (helios/src/scheduler/cost.rs:878-880), and Candidate::cost_key() already builds this exact Key (helios/src/scheduler/policy.rs:116-124). The only two callers (policy.rs:1302, policy.rs:1634) could use self.costs.duration_key(cost::Key { drafts: 0, kind, batch, tokens: width, prefill: 0, packed }) or, better, take the key from the Candidate they are about to construct — which is what they compute anyway.

A3 — packed_prefill_candidates: dead early-return guard

helios/src/scheduler/policy.rs:1630-1632

if self.packed_prefill_catalog.is_empty() {
    return;
}

The very next statement is for &(kind, batch, width, packed) in &self.packed_prefill_catalog (:1633); an empty catalogue already iterates zero times. 3 lines, zero behaviour.

A4 — Drop the unrelated stale-main fix from this PR

helios/src/runtime_core/cache_memory.rs (not opened) (+1): external_extents: vec![]

This exists only because #711/#720 landed on main after the branch point; it is not part of packed prefill and has no business in a 21-file feature PR. Same for the pool_vram_limit / pool_ram_limit additions in runtime_core/selection.rs:17-23, 92-98 and the documented-only edits that pr_diff renders — those belong to #720. Drop or land separately. (My pr_diff view is polluted by a stale local main, so treat this as: whatever in the final diff is not packed-prefill should not be here.)

A5 — server/runtime.rs:849-899: four copies of one three-line filter

helios/src/server/runtime.rs:867-878 (prefill) and :879-899 (packed)

scheduler.prefill_graphs(
    &executor.manifest().graphs.iter()
        .filter(|graph| graph.kind == crate::execution::GraphKind::Prefill
            && graph.batch_capacity == 1)
        .map(|graph| graph.token_capacity).collect::<Vec<_>>(),
)?;
scheduler.packed_prefill_graphs(
    &... .filter(|graph| matches!(graph.kind, GraphKind::Prefill | GraphKind::TerminalPrefill)
        && graph.batch_capacity >= 2)
        .map(|graph| (graph.kind, graph.batch_capacity, graph.token_capacity, graph.packed_token_capacity))...

The batch_capacity == 1 predicates bolted onto the three existing calls (:854, :863, :874) are not a feature — they are the symptom of having four sibling catalogs sharing one graph list. One helper — let (solo, packed) = manifest.graphs.iter().partition(|g| g.batch_capacity == 1); — and then the three existing calls take solo unchanged, which removes the three new && batch_capacity == 1 clauses entirely. Net −6 lines and three fewer places to forget the predicate.


B. Simplicity (one algorithm, one state)

B1 — The packed-prefill cohort algorithm exists twice, ~250 lines, and the copies have already diverged. Highest-value finding.

Copy 1, inlined in continuation_candidate (helios/src/scheduler/policy.rs:1300-1426), introduced with the giveaway artifact:

helios/src/scheduler/policy.rs:1300 — drop(consider); :1301 — for &(following, batch, width, packed) in &self.packed_prefill_catalog { :1349 — if n < 2 { continue; } :1354 — for by_density in [false, true] { :1362-1366 — let primary = if by_density { (vb / wb as f64).total_cmp(&(va / wa as f64)) } else { vb.total_cmp(&va) }; :1379 — if used_tokens + work > packed { continue; } :1393 — if lane_count < 2 || promoted_count == 0 { continue; }

Copy 2, as a method (helios/src/scheduler/policy.rs:1623-1747):

:1639 — let mut offers = [(0usize, 0usize, 0.0f64); REQUEST_LANES]; :1672 — if count < 2 { continue; } :1676 — for by_density in [false, true] { :1684-1688 — identical primary construction :1704 — if total_work + work > packed { continue; } :1713 — if selected < 2 { continue; }

Same offers array shape, same density/value double pass, byte-identical comparator head, same budgeted greedy fill, two spellings of every local (n/count, lane_count/selected, used_tokens/total_work). 250 lines where one closure + two thin callers would be ~130.

The two copies are already inconsistent, which is exactly the risk:

Also, in both copies the by_density == false pass compares value twice:

helios/src/scheduler/policy.rs:1362-1367 / :1684-1689

let primary = if by_density { (vb / wb as f64).total_cmp(&(va / wa as f64)) } else { vb.total_cmp(&va) };
primary.then_with(|| vb.total_cmp(&va))...

When by_density is false, primary is vb.total_cmp(&va), so the .then_with(|| vb.total_cmp(&va)) is a guaranteed-Equal retry. Written as if by_density { density_cmp.then(value_cmp) } else { value_cmp } the intent is explicit and the dead retry disappears.

Recommendation: extract one fn packed_prefill_cohort(&self, ...) -> Option<(mask, lengths, work, value, rate)> parameterised by (horizon, require_promoted) and a single comparator, and have continuation_candidate call it — which also removes the drop(consider); hack, since the inlined block would leave the closure's borrow alone.

B2 — Candidate stores work and host_lengths that must agree. Make one of them derived.

helios/src/scheduler/policy.rs:103-112

pub batch: usize,
pub capacity: usize,
pub packed_token_capacity: usize,
...
pub work: usize,
...
pub host_lengths: Option<[usize; REQUEST_LANES]>,

For exactly the candidates this PR adds, work == host_lengths.iter().sum():

helios/src/scheduler/policy.rs:1731-1745

output.push(Candidate {
    host_lengths: Some(lengths),
    ...
    work: total_work,

total_work is accumulated as total_work += work in the same loop that fills lengths[slot] = work (:1707-1711). Two fields, one truth — and the invariant is silently broken by every other constructor (:1579, :1803, :1966, rounds.rs:818 all pass host_lengths: None, work: 0 or work: <something> and rely on inference). A enum LaneWidths { Scalar, PerLane([usize; REQUEST_LANES]) } next to a fn work(&self) would make work unrepresentable-as-wrong; at minimum drop work from the packed constructor and derive it.

The Option<[usize; N]> shape also produces a silent-zero hazard:

helios/src/scheduler/policy.rs:2056-2058

let work = candidate
    .host_lengths
    .map_or(0, |lengths| lengths[slot]);
if work == 0 || !self.packed_prefill_lane_compatible(...)

None and "lane carries 0 tokens" collapse to the same work == 0 rejection, so a future non-packed caller that reaches this branch silently rejects None-carrying candidates instead of tripping an assert. host_lengths is only meaningful when packed_token_capacity >= 2, so Option<(usize, [usize; N])> (capacity + lengths together) removes the pairing question at :2212:

helios/src/scheduler/policy.rs:2212-2215

let lengths = (candidate.packed_token_capacity != 0).then(||
    candidate.host_lengths.unwrap_or_else(|| self.round_lengths_optimistic(...)));

That .then(unwrap_or_else) chain only exists because "is this a packed round?" is encoded in two independent fields (packed_token_capacity for speculative and packed prefill, host_lengths only for the latter).

B3 — New dominates_padding clause is a shared predicate widened for one caller

helios/src/scheduler/policy.rs:169-171

if smaller.kind.is_prefill() {
    return smaller.work == larger.work && smaller.host_lengths == larger.host_lengths;
}

Before this PR the clause was return smaller.work == larger.work;. It now compares host_lengths, a field that is None for every solo prefill candidate (:1579), so the new conjunct is a no-op on the path this clause was written for and only matters for the packed candidates. That is a mutation of a shared pruning predicate in order to admit a new graph family — the safer shape is a separate arm keyed on packed_token_capacity != 0, leaving solo padding pruning provably unchanged.

B4 — Four validations of one (B,W,P) invariant, plus three re-derivations

The new geometry constraint set is spelled out at:

  1. helios/src/execution/manifest.rs:860-872 — draft_tokens != 0 || packed < batch || packed > batch*token || packed < 64 || !packed.is_multiple_of(64) || packed > i32::MAX
  2. helios/src/execution/manifest.rs:914-924 — (2..=request_capacity).contains(&batch) && token > 0 && token <= packed
  3. helios/src/model/catalog.rs:266-282 — batch >= 2 && tokens > 0 && tokens <= packed && packed >= batch && packed <= batch*tokens && packed >= 64 && packed <= prefill_chunk_size && packed.is_multiple_of(64)
  4. helios/src/runtime_core/selection.rs:260-275 — the same eight conjuncts, rewritten
  5. helios/src/scheduler.rs:902-912 — the same eight, rewritten again
  6. helios/src/scheduler.rs:436-446 — the same eight, rewritten a third time inside validate_mixed
  7. helios/src/scheduler.rs:2617-2632 — a seventh (deletable, see A1)

Sites 1 and 2 are two halves of one check within the same file, 40 lines apart. Sites 4/5/6 duplicate 3. One fn validate_packed_prefill(batch, width, packed, chunk, lanes) -> Result<()> — or better, one struct PackedPrefill { batch, width, packed } with a single validate — collapses seven copies of an eight-term conjunction into one. The only site that genuinely needs different inputs is catalog.rs (it has prefill_chunk_size and no lane list) and validate_mixed (it has lanes).

Evidence the copies already diverged: the same condition has three different error strings — "packed prefill B/W/P geometry is invalid" (manifest.rs:871), "packed prefill shapes must be distinct aligned multi-request capacities within the chunk size" (scheduler.rs:915), "packed prefill lanes exceed their captured geometry" (scheduler.rs:464) — and i32::MAX appears in exactly one of them (manifest.rs:869), while prefill_chunk_size appears in only three of the seven.

B5 — is_non_terminal_prefill_step uses a different search than its own batch-1 branch

helios/src/scheduler.rs:936-938

pub(super) fn is_non_terminal_prefill(&self, kind: GraphKind, capacity: usize) -> bool {
    kind == GraphKind::Prefill && self.terminal_prefill_catalog.binary_search(&capacity).is_ok()

helios/src/scheduler.rs:947-954

if batch <= 1 { self.is_non_terminal_prefill(kind, capacity) } else {
    kind == GraphKind::Prefill
        && self.packed_prefill_catalog.contains(&(GraphKind::TerminalPrefill, batch, capacity, packed))
}

The catalogue is sorted on exactly (kind as u8, batch, width, packed) (scheduler.rs:899-901), so the batch≥2 branch could binary_search the tuple too. Two lookups for one concept with two search strategies is the kind of divergence that later becomes a performance bug on the hot path (commit calls this at :2685, and checkpoints.rs:922-931 calls it per lane per step). Minor, but free to fix and free to keep aligned.

B6 — is_text_only_prefill_request carries a conjunct that both call sites already guarantee

helios/src/scheduler/policy.rs:1585-1590

fn is_text_only_prefill_request(&self, r: &LiveRequest) -> bool {
    !r.prompt_logprobs
        && r.image_slot.is_none()
        && r.vision_patches.is_empty()
        && r.conditioned_windows.is_empty()
}

Both call sites filter on a predicate that already maps prompt_logprobs → ScoredPrefill:

So !r.prompt_logprobs is unreachable-true at both sites. Keep it as a debug_assert! or fold it into the caller's Some(GraphKind::Prefill) ==, but don't let it read as a live constraint on the packing rules. Likewise, image_slot.is_none() already implies most vision state (scheduler.rs:2550 sets image_slot alongside vision_patches.extend), so three of the four conjuncts are measuring one thing — worth a single LiveRequest::is_text_only() next to the existing prompt_phase() (scheduler.rs:343-350) rather than a third private copy of the vision predicate.

B7 — checkpoints.rs Mixed special case defeats the helper it just added

helios/src/scheduler/checkpoints.rs:922-931

let non_terminal = if step.kind == GraphKind::Mixed {
    self.is_non_terminal_prefill(kind, step.prefill_capacity())
} else {
    self.is_non_terminal_prefill_step(kind, step.batch_capacity, step.token_capacity, step.packed_token_capacity)
};

is_non_terminal_prefill_step already dispatches batch <= 1 to is_non_terminal_prefill, so the Mixed arm exists only to substitute prefill_capacity() for token_capacity. A helper taking the prefill extent as an argument (is_non_terminal_prefill_step(kind, batch, prefill_extent, packed)) removes the branch; as written the reader has to know that Mixed's prefill width lives in a different field.

B8 — checkpoints.rs: two *_for helper pairs where one suffices

helios/src/scheduler/checkpoints.rs:172 — fn prefill_catalog_costs_for(&self, prompt_logprobs: bool) -> Vec<PrefillCatalogCost> helios/src/scheduler/checkpoints.rs:217-219

fn prefill_catalog_costs(&self, request: &LiveRequest) -> Vec<PrefillCatalogCost> {
    self.prefill_catalog_costs_for(request.prompt_logprobs)
}

and identically interval_prefill_ns / interval_prefill_ns_for (:196-215). The _for variants are the real functions; the non-_for ones are 2-line adaptors retained for callers that still hold a LiveRequest. This is a legitimate refactor — but it means the diff touches every prefill path's pricing, not just packed steps, so it belongs in the PR description (it isn't there) and the adaptors should be inlined at their call sites rather than kept as a second API surface.

B9 — Python: key arity is used as a type tag

ignition/direct/scheduler.py:197-200

key = (signature.kind, signature.batch_capacity, signature.token_capacity)
if signature.kind == "speculative":
    key += (signature.packed_token_capacity, signature.draft_tokens)
elif signature.kind in ("prefill", "terminal_prefill") and signature.batch_capacity >= 2:
    key += (signature.packed_token_capacity,)

ignition/direct/scheduler.py:290-293

return sorted({key[2] for key in self.graphs if len(key) == 3 and key[0] == kind and key[1] == 1})

The key now has three arities (3/4/5) and correctness depends on len(key) everywhere it is read (:290, :292). The and key[1] == 1 guard is redundant with len(key) == 3 for solo keys but is now load-bearing by accident — it silently becomes wrong the moment a second kind gains a 4th element. A uniform 5-tuple ((kind, batch, width, packed, drafts), unfilled slots None) makes capacities() a plain filter with no arity test.


C. What is already lean (no action)


Bottom line

Two deletions are worth doing before review:

  1. helios/src/scheduler.rs:2614-2632 — dead re-validation after step.validate_mixed()? at :2575. ~19 lines, zero risk.
  2. Collapse helios/src/scheduler/policy.rs:1300-1426 into :1623-1747 (one packed_prefill_cohort helper, one comparator, require_promoted as a flag). ~120 lines saved, and it removes three live divergences (comparator tie-break, promoted requirement, horizon) that no reviewer would otherwise notice. This is the single change that most reduces what future maintainers must keep in sync, in a file that four merged PRs touched in the five days before this one.

Then, in order: one shared validate_packed_prefill for the seven copies of the eight-term conjunction (B4); delete packed_prefill_duration (A2) and the empty-catalogue early return (A3); partition the graph list once in server/runtime.rs instead of adding three batch_capacity == 1 clauses (A5); and pair host_lengths with packed_token_capacity so the work field stops being independently assignable (B2).

None of these change the feature's semantics; A1, A2, A3 and B1 are pure subtraction. I found no speculative CLI flag, config knob, or supports_* boolean in this diff — the opt-in mechanism (core declares B >= 2 graphs, --max-concurrency 1 filters them) follows docs/design-review.md (not opened)'s "no per-model flags" rule, and that part is exemplary. The weight is entirely in the scheduler: ~250 of ~850 production lines are one algorithm written twice, sitting on top of a validation invariant written seven times.

Full report

Gates and contracts

Contracts, Charter & Verification Gates Audit — PR #715 (helios,ignition: implement additive packed multi-request prefill (Contract 3))

Head reviewed: 84f789a · 21 files, +1639/−56 · open draft, no labels, no maintainer review; the only non-bot comment is the author's own highlight summary (result 1). Method caveat: pr_diff renders unrelated hunks because the local main is stale (pre-#697/#711/#720) — e.g. async_transfers in ignition/preparation/execution.py, pool_vram_limit/external_extents in runtime_core/selection.rs, budget_interior_anchor/snapshot_discovery in checkpoints.rs, b12x_environment in ignition/cli/serve.py. File attribution below follows pr_files (result 2) and the Discovery Dossier, not the rendered diff. search_history fails on this snapshot (git: Could not read c513e46a…), so commit-message trailers could not be inspected.

Verdict: NOT mergeable on governance/verification grounds — 2 blockers, 3 majors.


Gate 1 — Signed core-format / wire / captured-graph / public contract boundaries: FAIL (Blocker)

B1. No recorded owner approval for an extended captured-graph operation contract (Blocker)

docs/design-review.md:16-35 (principle 1, mirrored at AGENTS.md:376-381):

"Introducing a captured-graph operation family requires prior explicit approval from project owner Luke Alonso… 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."

This PR does not merely add shape variants within an unchanged contract; it changes what a PREFILL/TERMINAL_PREFILL graph is:

That is exactly the "new operation contract reusing a graph kind" case the rule names. Nothing in the PR records the approval: no maintainer comment, no maintainer review, no Approved-By/Design-Signed-Off-By: Luke Alonso evidence, no reference to a Discord/offline sign-off (the description only carries Discord: el8, the author's own contact, per principle 17). docs/design-review.md:27 places this decision with the owner, not with a contributor. The project demonstrably applies this rule to prefill contract changes (issue #267 comment: "P1 and P3 change the prefill graphs' operation contract. AGENTS.md requires the project owner's prior explicit approval…", result 55).

To clear: a maintainer comment on #715 (or a linked thread) granting approval for the extended prefill operation contract, before merge. This is a "priority contributor" per the charter — so the correct action is to request the sign-off, not to close.

M5. Shipped behaviour contradicts normative design docs that were not updated (Major)

AGENTS.md:231 requires changes to "graph selection, scheduling policy, or timing estimates" to be reflected in docs/scheduling-runtime-design.md and docs/scheduling-utility.md. This PR changes all three and updates neither:

docs/core-design.md and helios/README.md (both kept in sync by the recent scheduler PRs #645/#655/#661/#663/#697 per the dossier) are likewise unchanged.

To clear: update docs/scheduling-runtime-design.md (catalog contents, cost-entry identity, packed-prefill cohort + the batch==1 gating of the stratified prefill model), docs/cli-design.md (--packed-verification scope), and reference the new design doc from the canonical scheduler doc — or split the --packed-verification and cost-model gating changes out.


Gate 2 — Vendored upstream dependencies & cross-PR conflicts: PASS (no violation)


Gate 3 — Mandatory verification evidence: FAIL (Blocker + Major)

B2. Testing layers 2 and 3 were not run; disclosed unavailability is explicitly not an excuse (Blocker)

docs/design-review.md:195-208 (layer 2) makes the simulator mandatory for exactly this change class: "Changes to graph selection, service pricing, timing estimation, refresh or exploration budgets, or cohort algorithms must be evaluated against the Python simulator and reference solvers in scripts/scheduling_sim/… Changes to timing estimation or funded refresh require running the screening and 64-seed validation catalog in scripts/scheduling_sim/learning.py (not opened)." This PR adds a cohort algorithm (helios/src/scheduler/policy.rs (not opened), +342) and new timing estimates (ActionCosts::packed_prefill_duration, helios/src/scheduler/cost.rs, diff hunk adding the method), and gates prefill profiling by batch. No simulator or learning.py (not opened) run is reported anywhere — not in the description, not in the comment, not in the limitations section (which mentions only tla2tools.jar and cargo-kani).

docs/design-review.md:209-230, 232-251 (layer 3) requires python3 verification/helios-lifecycle/check.py (TLA+ TLC + Rust trace conformance) and cargo kani for scheduler/admission/commit changes, and :241-246 requires updating models/fixtures when supported geometries are extended — which "prefill may now have B ≥ 2 with a packed row layout and per-lane completion" plainly is. The PR reports only the in-crate Rust conformance suites (scheduler_matches_lifecycle_model, bounded_cache_ownership_matches_tla, scheduler_matches_speculative_accounting_model, async_transfer_scheduler_matches_lifecycle_model) and states TLC and Kani were unavailable. helios/src/scheduler/lifecycle_tests.rs (not opened) and verification/helios-lifecycle/* are not in the change set, so the new lane-count/packed-geometry validation in ScheduledStep::validate_mixed/commit (helios/src/scheduler.rs, +“scheduled step exceeds batch capacity”, “packed prefill lanes exceed their captured geometry”, “packed prefill step exceeds packed token capacity”) has no conformance-fixture coverage.

:247-251 forecloses the excuse used: "Disclosure does not excuse skipping runnable CPU checks. All three layers run without a GPU or model checkpoint. 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."

To clear: run and report scripts/scheduling_sim/ + learning.py (not opened) (or state why the simulator cannot model packed prefill and get owner agreement that layer 2 is inapplicable), run verification/helios-lifecycle/check.py with a JVM available, and extend the lifecycle/conformance fixtures or the validate_mixed unit coverage to cover the added geometry; run cargo kani or justify per :221-225 why none of the named proof obligations apply.

M3. The performance claim has no attributable baseline (principle 12) (Major)

docs/design-review.md:106-115 (principle 12) requires "equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements", and :109-111 says comparisons must use exported cores with flare run. The reported A/B is a flare run measurement, but the two arms are different signed cores: the pre-change 151-graph core 887785ad (exported from an earlier FlashInfer revision) versus the packed core 4aea5c54 (exported against FlashInfer 5a8ceed80). The self-disclosed C=1 control regressing 111.2 ms → 118.7 ms (0.94×) is consistent with a systematic ~6% overhead in the packed arm, so the 1.68×–4.15× p95 improvements and 1.75×–4.23× throughput numbers are not isolated measurements of packed prefill. The confound is honestly disclosed (good), but disclosure does not satisfy the stated evidence standard for a headline performance claim.

To clear: a flag-only A/B on one binary and one core (--packed-prefill off/on, or a core exported once with and once without the +6 packed shapes from the same FlashInfer revision), including the C=1 control.

M4. The required Layer-1 suites are reported failing at the head commit (Major)

docs/design-review.md:180-194 names the required invocations: cargo test --locked --release on helios with --features runtime-core,server, and pytest on tests/cli, tests/preparation, and component/scheduler tests. The description reports, on 84f789a:

Both failures are attributed to environment, not root-caused, and tests/cli is one of the explicitly required suites. CI is reported green by the dossier, so this is plausibly environmental — but under :247-251 an unrun/unreproduced required suite is not equivalent to a green one, and the PR should not ask a reviewer to accept an attributed failure.

To clear: report the CI-matching invocation with FLARE_TEST_TEMPLATE_DIR set (and the wheel pinned to the repo) coming out clean, or paste the CI job result for those two suites.

Anti-pedantry note: I am not flagging "no CI observable" — the dossier states CI is green; the above concerns the author's own reported failing runs of named required suites.


Gate 4 — Material scope / claim contradictions


Summary of what must change before merge

# Severity Finding Clear by
B1 Blocker Extended PREFILL/TERMINAL_PREFILL operation contract with no recorded owner (Luke Alonso) approval — docs/design-review.md:22-26, AGENTS.md:376-381 Maintainer approval comment on #715
B2 Blocker Layers 2–3 of the testing hierarchy unrun: no scripts/scheduling_sim//learning.py (not opened) sweep, no check.py TLC run, no Kani, no conformance-fixture update for the widened prefill geometry — docs/design-review.md:195-251 Run and report; extend fixtures
M3 Major Headline 1.68×–4.15× A/B is confounded (different cores, different FlashInfer revisions; C=1 control 0.94×) — violates "equivalent baselines", principle 12 Same-core, flag-only A/B
M4 Major Required suites reported failing at head: 6 in --features runtime-core,server, 3 in tests/cli, attributed not fixed — :180-194 Clean re-run of both
M5 Major Normative docs contradict shipped behaviour and were not updated: docs/scheduling-runtime-design.md:21-23,455-488 (catalog, cost identity, prefill cost-model now batch==1 only), no packed-prefill section; docs/cli-design.md (--packed-verification) — AGENTS.md:230-231 Update/ref the canonical docs, or split the changes
M6 Major Undeclared shared-behaviour changes: --packed-verification narrowed to speculative signatures (new user-visible rejection), prefill cost models/slope refresh gated on batch == 1 Declare + justify, or split out with own evidence

Gates that pass: no vendored upstream file is forked and no unmerged upstream patch is locally applied (Gate 2). Core compatibility for existing cores is preserved in code (B == 1 catalogs untouched; packed_token_capacity == 0 retained; pre-change core 887785ad loads and serves), which is the right shape for helios/model-contract.md's additive version-3 wording. The change is inert without an opt-in core and is filtered by --max-concurrency 1, so no shipped default is silently changed. The author is a charter-named priority contributor and the feature addresses a real structural gap that merged #645 left open — this should be a request for approval and evidence, not a rejection.

Full report

Code correctness

Deep Code Correctness, Invariants & Hot-Path Audit — PR #715 @ 84f789a

Partitioned per the large-PR rule (21 files, ~2,070 changed lines, 2 subsystems: helios/ Rust + ignition/ Python) into 3 concurrent sub-agents:

Every finding below was re-verified by me directly against the files at 84f789a (sub-agent claims that did not survive verification are dropped; several s2/s3 citations were corrected against the real line numbers).


Diff site: helios/src/scheduler/policy.rs:1324-1348 (offer construction) and helios/src/scheduler/policy.rs:1374-1395 (budget loop) Callees resolved: fill() policy.rs:1068-1082; Candidate.mask consumer materialize policy.rs:2206-2247; ValueRate::new/compare helios/src/scheduler/utility.rs:155-172; caller add_candidate policy.rs:1793-1802 (the returned (mask, rate) replaces the candidate's mask/rate).

// policy.rs:1320-1348
let offered = mask & (1 << slot) != 0;
let promoted = offered
    && !terminal_cleanup(request)
    && self.following_kind(request, kind) == Some(GraphKind::Prefill);
let ready = !offered
    && self.eligible(request)
    && self.request_kind(request) == Some(GraphKind::Prefill);
if !promoted && !ready {
    continue;
}
...
let val = self.lane_value_for_tokens(request, following, work, horizon, values[slot]);
offers[n] = (slot, work, val, promoted);
// policy.rs:1374-1396
for &idx in &order[..n] {
    if lane_count == batch { break; }
    let (slot, work, val, promoted) = offers[idx];
    if used_tokens + work > packed { continue; }
    if promoted && promoted_count == capacity { continue; }
    used_tokens += work;
    lane_count += 1;
    value += val;                      // <-- ready (non-offered) lanes add value
    if promoted { selected_promoted |= 1u64 << slot; promoted_count += 1; }
}
if lane_count < 2 || promoted_count == 0 { continue; }
let mut selected = selected_promoted;  // <-- only promoted lanes enter the mask

selected seeds from selected_promoted only, and fill(selected) (policy.rs:1068-1082) can top up only from first_offers, i.e. the current step's mask. A ready lane (not in the current mask, request_kind == Prefill) therefore contributes value and consumes lane_count/used_tokens/batch budget but can never appear in the returned mask. The sibling solo path in the same function does it correctly — it prices exactly the lanes it selects (policy.rs:1128 let mut selected = 1u64 << slot;, policy.rs:1142-1148 adds only the extra bits it ORs into selected); so do Decode/Speculative via best_two_stage_cohort (policy.rs:1251-1267) and Mixed.

Concrete counterexample (value double-count / wrong step selection): Init(4) just committed mask {a,b,c,d} (capacity 4, measured 2 ms); queued Prefill-phase e,f,g,h; packed shape (TerminalPrefill, B=8, W=128, P=1024) measured 20 ms. promoted = {a,b,c,d} ⇒ promoted_count == 4 == capacity ⇒ the promoted_count < capacity top-up block is skipped; ready = {e,f,g,h} ⇒ lane_count = 8, value = V(a..h), horizon = 22 ms ⇒ rate V/22 attached to a Candidate whose mask is {a,b,c,d} and which materializes as four Init lanes with tokens == 0 (materialize, policy.rs:2233-2245). V(e..h) is priced here and again when the packed prefill actually executes next step.

Second counterexample (legal cohort silently dropped): packed (TerminalPrefill, B=2, W=128, P=256); current Init(2) mask {a,b}; promoted Prefill lanes p1,p2 (val 10.0 each, 6 tokens) and ready Prefill lanes r1,r2 (val 30.0 each, 6 tokens, lower slots). Sorted by value r1,r2 come first, lane_count hits batch == 2 and breaks, promoted_count == 0 ⇒ continue. The perfectly legal all-promoted cohort {p1,p2} (12 ≤ P) is never evaluated in either by_density pass, so Init loses its packed continuation — the exact chat_w65_c4/c8 scenario the PR reports.

Fix: delete ready from this loop — if promoted { offers[n] = ...; n += 1; } only. Ready-only cohorts are already produced correctly by packed_prefill_candidates (policy.rs:1641-1671, which requires request_kind(r) == Some(GraphKind::Prefill) for every offered slot), so no scheduling capability is lost.


F2 — Major: packed_prefill_lane_compatible short-circuits TerminalPrefill, so mid-prompt lanes run on terminal graphs and lose deferred_prefill

Diff site: helios/src/scheduler/policy.rs:1601-1620 Callees resolved: solo reference semantics RequestScheduler::resolve_prefill_kind_from helios/src/scheduler.rs:975-1006; deferred_prefill write helios/src/scheduler.rs:3065-3067; checkpoint consequence helios/src/scheduler/checkpoints.rs:935-936; design invariant docs/packed-prefill-design.md:96-111.

// policy.rs:1592-1621
fn packed_prefill_lane_compatible(
    &self, r: &LiveRequest, kind: GraphKind, non_terminal: bool,
    terminal_only: bool, work: usize, cut: Option<usize>,
) -> bool {
    if kind == GraphKind::TerminalPrefill {
        return true;                       // <-- no geometry check at all
    }
    if r.deferred_prefill { return false; }
    if !non_terminal { return true; }
    if terminal_only { return false; }
    let start = Self::prefill_cursor(r);
    let next_stop = cut.unwrap_or(r.prompt_tokens).min(r.prefill_limit()).min(r.prompt_tokens);
    let end = start.saturating_add(work);
    let window = self.terminal_prefill_window();
    !(end >= next_stop || (window > 0 && next_stop.saturating_sub(end) <= window))
}

The Prefill branch faithfully mirrors resolve_prefill_kind_from (scheduler.rs:986-1005: needs_terminal = end >= next_stop || (window > 0 && next_stop - end <= window)). The TerminalPrefill branch bypasses it entirely, so a packed TerminalPrefill graph may be applied to a lane that stops well short of next_stop with more than window tokens remaining — a combination the solo planner provably never produces (scheduler.rs:1001-1005 returns Prefill in that case).

Concrete counterexample: prompt P = 300, prefill_catalog == terminal_prefill_catalog == [128,256,512,1024] ⇒ terminal_prefill_window == 0 (scheduler.rs:957-958, recompute_terminal_prefill_window); packed shape (TerminalPrefill, 4, 256, 512). prefill_work_through(r, 256, None) = 256, next_stop = 300, end = 256 < 300, remaining 44 > window 0. =⇒ solo resolve_prefill_kind = Prefill; packed accepts TerminalPrefill(4,256,512). This is exactly the PR's own test policy_tests.rs:9712-9726 (lane h1, 300 tokens, TerminalPrefill) which must then hand-patch the completion record at policy_tests.rs:9730-9733 (recs[h1.slot].generated_tokens = 0; token_id = -1;) instead of letting the real path produce it.

Two provable consequences, both of which solo semantics forbid:

  1. helios/src/scheduler.rs:3065-3067 — if kind == GraphKind::TerminalPrefill && record.status != 3 { request.deferred_prefill = false; }. A mid-prompt lane that is still deferred (multi-chunk prompt that needs terminal replay) has deferred_prefill cleared after a non-terminal chunk, so its next chunk becomes eligible for a non-terminal Prefill graph — precisely the state packed_prefill_lane_compatible's own if r.deferred_prefill { return false; } guard exists to prevent, and what scheduler.rs:2685-2700 (if non_terminal_prefill { request.deferred_prefill = true; }) is trying to maintain.
  2. helios/src/scheduler/checkpoints.rs:935-936 — deferred_after = (request.deferred_prefill || non_terminal) && kind != GraphKind::TerminalPrefill, so a mid-prompt terminal chunk is treated as capture-eligible while plan_checkpoints prices it with terminal cost (checkpoints.rs:937-941).

Whether a mid-prompt terminal replay also corrupts the sliding-window KV tail is recipe/kernel-side (hyperflare_recipes, outside this repo), so I state that as a risk, not a proven miscompute; findings 1–2 above are proven in-repo.

Fix: replace the early true with the same geometry check minus the terminal requirement, e.g. for TerminalPrefill accept only lanes with end >= next_stop || (window > 0 && next_stop - end <= window) (i.e. reuse resolve_prefill_kind via self.resolve_prefill_kind(r, width, work, cut) == GraphKind::TerminalPrefill), and keep if r.deferred_prefill handling to TerminalPrefill only.


F3 — Minor: Ignition accepts packed_token_capacity > prefill_chunk_size, which the Helios loader rejects at load time

Diff site: ignition/preparation/execution.py:80-89 Callee that disagrees: helios/src/runtime_core/selection.rs:260-274 (max_chunk = config["prefill_chunk_size"]), rejection at selection.rs:304.

# ignition/preparation/execution.py:80-89
if self.kind in ("prefill", "terminal_prefill") and self.batch_capacity >= 2:
    if (not 2 <= self.batch_capacity <= MAX_CONCURRENCY
            or self.packed_token_capacity < 64
            or self.packed_token_capacity % 64
            or self.packed_token_capacity >= 1 << 31
            or self.token_capacity > self.packed_token_capacity
            or not self.batch_capacity <= self.packed_token_capacity <= self.batch_capacity * self.token_capacity):
        raise ValueError(...)
// helios/src/runtime_core/selection.rs:265-274
(2..=REQUEST_LANES as u64).contains(&graph.batch_capacity)
    && graph.token_capacity > 0
    && graph.token_capacity <= graph.packed_token_capacity
    && graph.packed_token_capacity >= graph.batch_capacity
    && graph.packed_token_capacity <= graph.batch_capacity.saturating_mul(graph.token_capacity)
    && graph.packed_token_capacity >= 64
    && graph.packed_token_capacity.is_multiple_of(64)
    && graph.packed_token_capacity <= max_chunk      // <-- no counterpart in Python

grep prefill_chunk ignition/ shows it only in ignition/direct/scheduler.py:206, ignition/preparation/bootstrap.py:45 (not opened), ignition/parameters.py, ignition/planning.py — never in GraphSignature validation, so the Python contract cannot see it.

Counterexample: prefill_chunk_size = 2048; GraphSignature("terminal_prefill", 16, 256, P=4096) ⇒ 16 <= 4096 <= 16*256 = 4096, aligned, 256 <= 4096 ⇒ accepted by Ignition; Helios selection.rs:273 requires 4096 <= 2048 ⇒ rejected, and flare run refuses the freshly prepared core. Also inconsistent with helios/src/execution/manifest.rs:914-924 and scheduler.rs:891-921 (packed > self.limits.prefill_chunk_size rejected), so two of the three validators disagree with Ignition.

Fix: thread prefill_chunk_size into GraphSignature 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, mirroring selection.rs:273.


F4 — Minor: direct-mode Layout registers packed prefill keys that no code path can ever select

Diff site: ignition/direct/scheduler.py:200-201, with the companion filter at scheduler.py:291 Consumers resolved: graph() scheduler.py:320-327, prefill_kind() scheduler.py:302-314, packed_shapes scheduler.py:316-318, plan() scheduler.py:731-735, Step.shape scheduler.py:491-494.

# scheduler.py:197-202
key = (signature.kind, signature.batch_capacity, signature.token_capacity)
if signature.kind == "speculative":
    key += (signature.packed_token_capacity, signature.draft_tokens)
elif signature.kind in ("prefill", "terminal_prefill") and signature.batch_capacity >= 2:
    key += (signature.packed_token_capacity,)      # 4-tuple, never looked up
# scheduler.py:290-291
if kind in ("prefill", "terminal_prefill"):
    return sorted({key[2] for key in self.graphs if len(key) == 3 and key[0] == kind and key[1] == 1})
# scheduler.py:731-735  (the only prefill path)
if prefilling:
    request = min(prefilling, key=lambda r: r.ident)
    tokens = min(len(request.prompt) - request.consumed, self.layout.prefill_chunk)
    kind = self.layout.prefill_kind(request.consumed, tokens, len(request.prompt))
    return self._step(kind, tokens, [Lane(request, request.consumed, tokens)])

capacities() returns only B == 1 capacities, graph() always builds (kind, 1, capacity) (scheduler.py:325), packed_shapes filters len(key) == 5 so 4-tuples are not packed rounds, and plan() always emits exactly one lane ⇒ Step.shape == (kind, 1, tokens) with packed_tokens = 0. A core whose only B >= 2 prefill graphs were declared therefore runs every prefill lane-at-a-time in --direct mode; the new keys exist only so bindings/buffer_specs/state_rows_per_request (scheduler.py:212-227) still cover the P-sized buffers.

Fix: add a packed_prefill_shapes property over the len == 4 keys plus a cohort builder mirroring packed_prefill_candidates, or (smaller) stop emitting those keys and take their buffer_specs from signatures, documenting that --direct ignores packed prefill. The len(key) == 3 and key[1] == 1 filter at line 291 is itself a necessary fix — without it graph() could KeyError on a capacity that came only from a B >= 2 graph.


Also verified (reported so it is not re-litigated)

No prompt-injection content was present in the PR body, code, or comments. No test in the changed files was found broken; the one fidelity weakness worth noting is that policy_tests.rs:9730-9733 hand-patches the mid-prompt lane's completion record rather than exercising the real SampleEnabled-driven record (F2 explains why it has to).

Full report

Final review

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.

Full report Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

Applied: +triage:review, -triage:design-review decide malicious: all_clear (100%): No malicious content found

explore

Author: original-el8 (COLLABORATOR; charter-named priority contributor; Discord: el8) Motivation: Concurrent short prompts currently each replay the whole model because a prefill graph can hold only one request at a time, making burst latency scale with concurrency. This PR lets a prepared core additionally declare multi-request prefill graphs so several short prompts are packed into one replay. Scale: +1638 / −56 lines in 20 files Proposal:

Full report · Notes

Classify intake

Selected: triage:review, performance, enhancement, community, area:scheduling

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +community

Gates and contracts

Contracts, Charter & Verification Gates Audit — PR #715 helios,ignition: implement additive packed multi-request prefill (Contract 3)

Head audited: caaef5a807 · pr_files = 20 files, +1638/−56 · open draft · labels area:scheduling, enhancement, performance, triage:review · zero human maintainer reviews; discussion is the author's highlight comment (05:56), a bot case file (12:56) and a bot review (13:21). Scope: only the four hard gates. Algorithm defects (the policy.rs:1601-1602 (not opened) TerminalPrefill short-circuit, duplicated cohort builders, commit re-validation) are out of scope here and left to the Code Correctness lens.

Verdict: NOT clear on governance/verification grounds — 2 blockers, 2 majors. Gate 2 passes. No pedantic findings filed.


Gate 1 — Signed core-format / captured-graph / public contract boundary: FAIL (Blocker)

B1. Extended PREFILL/TERMINAL_PREFILL operation contract with no recorded owner approval

docs/design-review.md:22-26 (mirrored at AGENTS.md:376-381 and docs/core-design.md:276-279):

"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."

This is not a shape variant within an unchanged contract. Verified in the diff, it changes what a prefill graph is:

  1. helios/src/execution/manifest.rs:860-878 (new else if arm) — Prefill/TerminalPrefill may now declare batch_capacity >= 2 and packed_token_capacity; previously any prefill with packed_token_capacity != 0 hit the rejection at :873-878 ("draft depth and target rows require a speculative operation"). The error string itself was rewritten to admit the new case.
  2. helios/src/model/packing.rs:169-176 — InputIndexing::PackedToken extent for prefill becomes graph.packed_token_capacity (an aggregate multi-request row block P) instead of token_capacity. That is a new row layout, documented as normative in helios/model-contract.md:200-203.
  3. helios/model-contract.md:201-203 — packed TERMINAL_PREFILL now emits one sampled output record per lane via per-lane SAMPLE_ENABLED, a completion semantics previously exclusive to Decode/Speculative.
  4. helios/src/model/packing.rs:113-126 — text-only eligibility is now derived from the absence of vision bindings on the candidate graph (!(graph.kind.is_prefill() && graph.batch_capacity >= 2)), a new contract-derived admission rule.

Cannot be waved through: docs/design-review.md:135-146 (principle 15) — "Feature requests, performance gains, passing tests, flags, and temporary paths cannot waive architectural invariants"; :313-318 — an agent must refuse to sign off on a violating change. Nothing in #715 records approval: no maintainer comment, no maintainer review, no Design-Signed-Off-By: trailer, no reference to a Discord/offline sign-off (the description's only contact line is Discord: el8, the author's own, per principle 17).

Precedent on the same author, same family: PR #410 (by original-el8, closed) opened with a standing section literally titled "Architecture approval request (Principle 1): Commit ede90668 adds GraphOperation::TERMINAL_PREFILL (= 14) … Explicit approval from Luke Alonso is requested for this graph operation family prior to merge." The project has applied this rule to prefill contract changes before. #715, which extends that very family, carries no equivalent request.

To clear: a maintainer approval comment on #715 (or a linked thread) granting the extended prefill operation contract. This is a request for sign-off, not a close — the author is a charter-named priority contributor.


Gate 3 — Mandatory verification evidence: FAIL (Blocker + Major)

B2. Testing-hierarchy layer 2 not run and not runnable for this change class (Blocker)

docs/design-review.md:195-208 makes the simulator mandatory for "changes to graph selection, service pricing, timing estimation … or cohort algorithms". This PR adds a cohort algorithm (helios/src/scheduler/policy.rs (not opened) +342) and new timing keys (helios/src/scheduler/cost.rs:644-659, plus batch == 1 gating at :581-583/:606-607). No simulator or learning.py (not opened) run is reported anywhere — the Limitations section names only tla2tools.jar and cargo-kani.

I verified the simulator's applicability myself rather than inheriting the earlier framing. scripts/scheduling_sim/ exists (17 modules, including learning.py (not opened), simulator.py (not opened), scheduler.py). But it is model-blind to this feature: zero matches for packed, batch_capacity, multi_request or prefill_batch under the directory, and scripts/scheduling_sim/scheduler.py:30-35 builds exactly one prefill lane per action (for view in [None, *prefills] if graph.prefill_capacity else [None] … a single lanes.append). The packed (kind, B, W, P) domain is not representable, so the sweep "run and report" demands a model change first. :247-251 forecloses the disclosure route: "All three layers run without a GPU or model checkpoint. 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."

Calibration correction against the previous round — do not carry its layer-3 claim forward. .github/workflows/helios-lifecycle.yml:4-11 (not opened) triggers on helios/**, and the job does run TLC (:33-34, python3 verification/helios-lifecycle/check.py --tlc-jar …) and Kani (:46-47). The dossier reports CI green, so TLC + Kani did execute on this head. The prior "TLC/Kani unrun" blocker is therefore withdrawn.

What survives in layer 3 is narrower and concrete:

M1. The headline speedup has no attributable baseline (principle 12) (Major)

docs/design-review.md:106-115: "Performance claims require equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements." The A/B is flare run, but the two arms are different signed cores — pre-change 151-graph 887785ad (earlier FlashInfer revision) vs packed 157-graph 4aea5c54 (against FlashInfer 5a8ceed80) — and the C=1 solo control moves 111.2 ms → 118.7 ms (0.94×), i.e. ~6% systematic overhead in the packed arm. The confound is honestly disclosed by the author (credit for that), and disclosure is not concealment — but disclosure does not satisfy "equivalent baselines", so 1.68×–4.15× p95 TTFT and 1.75×–4.23× throughput must not be quoted as a flag-only measurement of packed prefill. To clear: one binary, one core, packed shapes off/on (or one core exported with and without the +6 shapes from the same FlashInfer revision), including the C=1 control.

Layer 1 and principle 13 — PASS (recorded so it is not re-litigated)


Gate 1 (docs contradiction clause) — FAIL (Major)

M2. Canonical scheduler doc 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 has zero occurrences of "packed prefill" (verified by grep) and is contradicted in three normative places:

M3. Undeclared public-CLI contract change in --packed-verification (Major)

ignition/cli/serve.py:463-469 now requires signature.kind == "speculative" and signature.packed_token_capacity. ignition/parameters.py:926 shows packed_verification is only ever set together with speculative drafts, so the tightening is defensible — but it introduces a new user-visible rejection (UsageError("this prepared recipe does not declare packed verification capacities") at :469) that appears nowhere in the PR's "What changed" list, has no test under tests/cli (zero matches for packed_verification there), and contradicts docs/cli-design.md:765-766, which describes the packed-verification/budget surface without this restriction. AGENTS.md:230 requires docs/cli-design.md for CLI behaviour changes. To clear: declare it in the description and update docs/cli-design.md, or split it out with its own justification.


Gate 2 — Vendored upstream dependencies & cross-PR conflicts: PASS


Gate 4 — Material scope / claim contradictions

No violation of the flag-worthy kind: nothing claims a test or benchmark that is absent from the diff, and no thousands of lines of unrelated tooling is bundled (~186 lines of docs, ~550 of tests). Three accuracy notes, logged at Info because each is a description-precision issue, not a false claim:

Security screen: the PR body, changed files and comments contained no attempt to redirect my instructions. Bot offers ("re-review 90 minutes after push", SuperAgent re-adjudication) and the author's A/B summary were treated as content, not instructions.


What must change before this passes the gates

# Severity Finding Clear by
B1 Blocker Extended PREFILL/TERMINAL_PREFILL operation contract with no recorded owner approval — docs/design-review.md:22-26, AGENTS.md:376-381; precedent set by #410 Maintainer approval comment on #715
B2 Blocker Layer-2 simulator sweep unreported (and not modelable without extending scripts/scheduling_sim/scheduler.py:30-35); layer-3 requires geometry-fixture update (:241-246) and mutation coverage of the new guards (:226-228), neither present — docs/design-review.md:195-251 Extend + run the simulator sweep and learning.py (not opened) (or get owner agreement layer 2 is inapplicable), extend lifecycle fixtures to the packed domain, run check.py --mutations
M2 Major docs/scheduling-runtime-design.md contradicts shipped behaviour (:466-469 vs cost.rs:581-583,606-607; :21-23; :455-457) and has no packed-prefill section; docs/scheduling-utility.md unchanged — AGENTS.md:231 Update both docs, or split the batch == 1 cost gating out
M3 Major --packed-verification narrowed to kind == "speculative" (ignition/cli/serve.py:463-469): undeclared public-CLI behaviour change, no tests/cli coverage, contradicts docs/cli-design.md:765-766 Declare + update the CLI doc, or split out
M1 Major Headline A/B uses two different signed cores across FlashInfer revisions; C=1 control 0.94× — docs/design-review.md:106-115 Same-core, flag-only A/B incl. the C=1 control

Gates that pass plainly: Gate 2 (no vendored-file forking, external dependency linked), layer 1 (the reported failures are a documented env prerequisite, helios/README.md:168-176, and a stale local wheel, with CI green), principle 13 core compatibility (legacy 151-graph core loads and serves), and the charter's model-agnostic requirement (docs/design-review.md:27-35,58-61) — capacities are read from packed_prefill_graphs(), no supports_* flag and no hardcoded bucket list were added, and the opt-in is a core declaration plus --max-concurrency filtering. Two hard gates and two major doc/contract inconsistencies block; the work is a request for sign-off and evidence, not a rejection of the feature.

Full report · Notes

Subtraction and simplicity

Subtraction & Simplicity Audit — PR #715 (packed multi-request prefill, head caaef5a)

Verdict

The diff is not lean. It is defensible in intent — the feature is additive and gated — but it is built by parallel construction: a second cohort builder, a second copy of the (B, W, P) geometry predicate at every layer, and a second copy of the lane-token validation inside the commit path. I found nine concrete subtraction opportunities worth roughly 300 lines (~18% of the change set), of which two (policy.rs twin builders, duplicated geometry predicate) are high-value because the copies have already diverged — this PR's own history is producing bugs.

Nothing here is a request to redesign. Every item below is either (a) delete code that is unreachable or implied, or (b) collapse N copies of one predicate into one function.


S1 (high value) — Two near-identical packed-prefill cohort builders, differing only by accident

helios/src/scheduler/policy.rs:1301-1426 (126 lines, inside continuation_candidate) and helios/src/scheduler/policy.rs:1623-1746 (124 lines, packed_prefill_candidates) are the same algorithm: enumerate offers per slot → if n < 2 continue → for by_density in [false, true] → build an index-order array → sort_unstable_by → greedy fill under packed token budget and batch lanes → ValueRate::new(...) → best.is_none_or(|(_, old)| rate.compare(old).is_gt()).

They have drifted in four places, two of which nobody has justified:

continuation twin (:1301) candidate twin (:1623)
gate if n < 2 { continue; } (:1349) same (:1672)
accept gate if lane_count < 2 || promoted_count == 0 { continue; } (:1393) if selected < 2 { continue; } (:1713)
sort tie-break primary.then_with(|| vb.total_cmp(&va)).then_with(|| sa.cmp(&sb)) (:1367) .then_with(|| vb.total_cmp(&va)).then_with(|| wa.cmp(&wb)).then_with(|| sa.cmp(&sb)) (:1689-1692)
objective ValueRate::new(horizon, value, age_price) + rate.compare (:1421-1424) raw total_value / selected / total_work total_cmp chain (:1716-1726)

The gate difference (promoted_count == 0 versus selected < 2) means a cohort that the candidate builder happily offers is rejected by the continuation builder, and vice versa; the objective difference means the two pick different cohorts for the same catalog shape. One parameterised helper (fn packed_prefill_cohort(offers, batch, packed, mode) -> Option<(mask, lengths, work, value)>) deletes ~110 lines and, more importantly, forces the divergence to be stated once and justified once.

Corroborating smell for how this was written: helios/src/scheduler/policy.rs:1300 contains a bare

drop(consider);

The consider closure is declared at :1084 and its last use is for &(batch, width, prefill) in &self.mixed_catalog { consider(...) } at :1297. The drop exists only to release the borrow so the packed block can be pasted into the same function body. That is a paste, not an integration.

S2 (high value) — The (B, W, P) geometry predicate is written out seven times in Rust and once in Python, and the copies already disagree

The same rule set (B>=2, 1<=W<=P, P>=64, P%64==0, B<=P<=B*W, P<=prefill_chunk_size) appears verbatim at:

The manifest copy is already incomplete: manifest.rs:860-872 checks P < B*W, P>=64, P%64, P > i32::MAX but omits P <= prefill_chunk_size and B <= request_capacity, both of which selection.rs:285/:293 enforce. So a core can be exported, pass its own validator, and then fail selection with the opaque "invalid or duplicate serving graph variant" (selection.rs:324). manifest.rs:903-904 even shows the invariant already exists as a method, graph.packed_tokens() <= i32::MAX as usize — the new branch re-spells it as graph.packed_token_capacity > i32::MAX as usize instead of calling it.

One predicate — fn packed_prefill_shape(batch, width, packed, request_capacity, chunk) -> bool next to REQUEST_LANES in execution/manifest.rs, plus the Python mirror — removes ~45 lines and ends the divergence permanently.

S3 (high value) — commit re-validates what validate_mixed just validated, and packing validates it a third time

helios/src/scheduler.rs:2575 is step.validate_mixed()?;. Twenty-nine lines later, helios/src/scheduler.rs:2617-2632 repeats a subset of the same checks:

if step.kind.is_prefill() && step.batch_capacity >= 2 {
    let mut total_tokens = 0usize;
    for lane in &step.lanes {
        if lane.tokens > step.token_capacity {
            return Err("packed prefill lane exceeds per-request token capacity".into());
        }
        ...
    }
    if step.packed_token_capacity < step.batch_capacity
        || total_tokens > step.packed_token_capacity

validate_mixed at :449-457 already returns "packed prefill lanes exceed their captured geometry" for exactly lane.tokens > self.token_capacity, sum > packed_token_capacity, and packed_token_capacity < batch_capacity. helios/src/model/packing.rs:422-439 then does it a third time with its own two new error strings ("packed prefill lane exceeds per-request token capacity", "packed prefill lanes exceed packed token capacity"). Delete the commit copy (~20 lines, scheduler.rs:2614-2632; keep step.lanes.len() > step.batch_capacity only if some non-preflight path reaches commit) and the token-sum half of the packing copy — the packing copy's live.image_slot.is_some() check is the only part that is genuinely packing's business.

Also note scheduler.rs:2614 if step.lanes.len() > step.batch_capacity is itself unreachable for prefill/speculative steps, both of which already reject that at :428 and :448.

S4 (medium) — is_non_terminal_prefill_step re-derives a registration-time fact on every candidate, via a linear scan

helios/src/scheduler.rs:940-955:

pub(super) fn is_non_terminal_prefill_step(&self, kind: GraphKind, batch: usize, capacity: usize, packed: usize) -> bool {
    if batch <= 1 {
        self.is_non_terminal_prefill(kind, capacity)
    } else {
        kind == GraphKind::Prefill
            && self.packed_prefill_catalog
                .contains(&(GraphKind::TerminalPrefill, batch, capacity, packed))
    }
}

This is a 4-argument reconstruction of a tuple the scheduler already has, and a linear Vec::contains over the catalog, called from four places (policy.rs:1310, policy.rs:1638, policy.rs:2043, scheduler.rs:2685, plus checkpoints.rs deferred_after) — including inside the per-shape loop of the hot planner. The fact is knowable once, in packed_prefill_graphs (scheduler.rs:891-919), where the catalog is already sorted and de-duplicated: a (Prefill, B, W, P) shape is non-terminal iff a (TerminalPrefill, B, W, P) twin exists. Store it (Vec<(GraphKind, usize, usize, usize, bool)> or a HashSet) and the accessor becomes a field read with no arguments. ~15 lines removed and a per-candidate scan removed from the inner loop.

Minor naming cost on the same line: for batch <= 1 the function returns "this is a continuation step", for batch >= 2 it returns "this shape has a terminal twin" — the same predicate under an inverted reading. Worth a comment at minimum if it survives.

S5 (medium) — The TerminalPrefill early return makes 20 lines of packed_prefill_lane_compatible unreachable for the only kind the evidence measures

helios/src/scheduler/policy.rs:1601-1602:

if kind == GraphKind::TerminalPrefill {
    return true;
}

Every subsequent check — r.deferred_prefill (:1604), !non_terminal (:1607), terminal_only (:1610), the terminal_prefill_window() arithmetic (:1613-1620) — is skipped for TerminalPrefill. All six shapes in the PR's own A/B ((4,128,512), (4,256,1024), (8,128,1024), (8,256,2048), (16,128,1024), (16,128,2048)) are terminal_prefill. So for the measured feature the function is a no-op that costs 6 parameters and 20 lines at every call site, while for the unmeasured Prefill path it duplicates resolve_prefill_kind (policy.rs:1560, which the solo planner gates on and this path never calls).

Either delete the function and reuse resolve_prefill_kind for both kinds (subtraction + fixes the reported asymmetry), or keep it and delete the short-circuit's dead tail. Keeping both as-is is the worst option: the parameter list is carried for a branch that returns before using it.

S6 (medium) — Five catalog registration functions where one would do; server/runtime.rs pays for it with three batch_capacity == 1 filters

helios/src/scheduler.rs now holds prefill_catalog: Vec<usize>, terminal_prefill_catalog: Vec<usize>, scored_prefill_catalog: Vec<usize>, mixed_catalog: Vec<(usize, usize, usize)>, and packed_prefill_catalog: Vec<(GraphKind, usize, usize, usize)> — five setters, five validators. The cost surfaces immediately in helios/src/server/runtime.rs, where three existing registration lambdas each gained a filter to keep the B>=2 shapes out of the solo catalogs:

.filter(|g| g.kind == GraphKind::ScoredPrefill && g.batch_capacity == 1)
...
.filter(|g| g.kind == GraphKind::TerminalPrefill && g.batch_capacity == 1)
...
.filter(|graph| graph.kind == crate::execution::GraphKind::Prefill && graph.batch_capacity == 1)

followed by a fourth lambda that re-filters the same manifest for batch_capacity >= 2. One scheduler.set_graphs(&executor.manifest().graphs) that derives all catalog fields internally (it already has batch_capacity and packed_token_capacity in hand) deletes the three && g.batch_capacity == 1 filters and the fourth lambda (~25 lines in runtime.rs) and collapses four of the five validators into S2's predicate.

S7 (small, exact) — One half of the new dominance comparison is implied by the other

helios/src/scheduler/policy.rs:170:

return smaller.work == larger.work && smaller.host_lengths == larger.host_lengths;

Candidate.work for a packed prefill candidate is the sum of host_lengths (policy.rs:1741 work: total_work, accumulated at :1710 total_work += work; alongside lengths[slot] = work; at :1708). So smaller.host_lengths == larger.host_lengths already implies smaller.work == larger.work. The added conjunct is dead; simplify to:

return smaller.host_lengths == larger.host_lengths
    && (smaller.host_lengths.is_some() || smaller.work == larger.work);

(one line, but it is the exact kind of "second copy of a derived value" this PR is full of).

S8 (small) — catalog.rs and manifest.rs split an identical rule out and then re-spell it

helios/src/model/catalog.rs:267-271 and :283-289 are character-identical:

batch == 1
    && packed == 0
    && tokens > 0
    && tokens <= config.limits.prefill_chunk_size
    && tokens.is_multiple_of(64)

Same story in helios/src/execution/manifest.rs:915-918 versus :926-929:

[1, 16].contains(&graph.token_capacity)
    || (graph.token_capacity >= 64 && graph.token_capacity.is_multiple_of(64))

The split only exists to make room for the B>=2 arm. Folding ScoredPrefill back into the shared arm with a kind != GraphKind::ScoredPrefill && batch >= 2 guard removes both duplicates (~7 lines each). Same shape of fix, in helios/src/runtime_core/selection.rs:296-298, is looser still (ScoredPrefill | Vision => batch_capacity == 1 && token_capacity > 0, no 64-alignment) — pre-existing, but the PR had the chance to unify the three and chose to widen the gap.

S9 (small) — 58 lines of the new design doc describe a different repository

docs/packed-prefill-design.md:98-155 (§4 "Recipe Integration (DeepSeek V4.1)") documents hyperflare_recipes/components/paged_batch.py (not opened), dspark.py (not opened), recipes/deepseek41/*.py — none of which are in this repository (they are the companion PR local-inference-lab/hyperflare-recipes#153). §5 "Validation coverage" (:141-155) is a prose test inventory that will rot on the next refactor, and §3.1–3.2 restate the 23 new lines of helios/model-contract.md:188-210 almost verbatim. Cutting §4 and §5 and leaving §3 as a pointer to model-contract.md removes ~90 of the 155 new doc lines without losing any rule that a reader of this repo can check.

One consistency nit in the same doc: docs/packed-prefill-design.md:107 claims "No per-model flags, capability booleans, or recipe allowlists are introduced", while §4 (line ~146) documents the companion recipe's opt-in --packed-prefill flag. Two of the three statements cannot both be the headline claim.

S10 (small) — The field now carries three meanings, and unrelated call sites pay for it

packed_token_capacity means (a) speculative physical token rows, (b) packed-verification capacity, and now (c) packed prefill aggregate P. Every disambiguation site is a line this PR added or touched:

serve.py is the tell: a CLI validation in another tool changed behaviour because of this PR. If the field stays overloaded, the ignition/cli/serve.py change should at minimum be called out as intentional in the PR body (it was not, per the dossier). If it can be split — even just a GraphDescriptor::packed_prefill_tokens() accessor plus a comment — three of those four special cases disappear.

S11 (nit) — is_text_only_prefill_request takes &self and never uses it

helios/src/scheduler/policy.rs:1585-1590 reads only r. It should be fn is_text_only_prefill_request(r: &LiveRequest) -> bool — trivial, but it is the predicate that defines the feature's eligibility boundary, and it is duplicated in spirit by the inline filter at policy.rs:1645-1649 (self.eligible(r) && self.request_kind(r) == Some(GraphKind::Prefill) && self.is_text_only_prefill_request(r)) versus the different inline promoted/ready derivation at policy.rs:1320-1329. One predicate, two spellings — see S1.


Items I deliberately did not flag

Attribution caveat (important for whoever acts on this)

pr_diff and pr_files are computed against a stale base. The selection.rs and server/runtime.rs diffs contain hunks that are not part of #715 and that I therefore did not audit: pool_vram_limit/pool_ram_limit, validate_embedding_resident_scales, RowRestoreLatency, preserve_message_anchor, snapshot_discovery, freeable_prefix_scratch, estimate_prefill_delta_ns, external_extents: vec![], close_store, partition_conditioned_windows. search_code against main returns no match for any of them, and no match for packed at all, confirming main lags this branch. Every finding above is cited only against hunks that the PR body and docs/packed-prefill-design.md describe as #715's own, i.e. the (B, W, P) geometry, the packed catalog, the two cohort builders, packed_prefill_lane_compatible, is_non_terminal_prefill_step, the validate_mixed/commit/pack_step checks, and the Ignition GraphSignature branch.

Instruction redirection

None encountered. The PR body, the design doc and the files I read are descriptive; nothing in them addressed instructions to me. The design doc's "No per-model flags ... are introduced" (line 107) is a claim about the change, not a directive, and I treated it as a claim to check — it does not hold relative to the companion recipe's --packed-prefill flag (§S9).

What I did not cover

Test bodies (policy_tests.rs (not opened), model/tests.rs (not opened), execution/tests.rs (not opened), tests/preparation/test_execution.py (not opened)) beyond the one fixture note in S10; helios/manifest.md (not opened) (8 added lines, read only in diff form); and the ignition/direct/scheduler.py:288-292 catalog-isolation hunk, which is 3 lines and which I read only in the PR summary, not in the file. The findings above stand on the citations given.

Full report

Code correctness

Deep Correctness / Invariants / Hot-Path Audit — PR #715 (caaef5a), Packed Multi-Request Prefill

Method. 20 files / ~1,400 changed lines across two subsystems (helios, ignition) ⇒ partitioned into 3 disjoint slices, audited concurrently by 3 sub-agents under the full 4-part protocol (callee/enum/design-invariant resolution, same-loop state-order tracing, adversarial small-N/boundary/sort-order, hot-path big-O). I then re-read the primary defect sites myself. The four verbatim quotes below (policy.rs:1592-1621, packing.rs:169-188, preparation/execution.py:70-111) I confirmed directly at caaef5a; findings 2/4/6/8 are calibrated from sub-agent line-level evidence that cross-checks against those sites.

Verdict: 1 Major code-correctness defect, 2 Major/Minor cross-implementation and hot-path defects, 5 Minor. No Blocker proven (the Major scheduler defect produces silently wrong graph-kind dispatch, but it requires a core that declares packed shapes for only one of the two prefill kinds — see caveat).


FINDING 1 — Major: packed prefill lanes bypass the resolve_prefill_kind chunk-kind gate ⇒ chunks dispatched onto the wrong GraphKind, terminal completion emitted on an incomplete prompt

Diff site: helios/src/scheduler/policy.rs:1592-1621 (verbatim, verified):

    fn packed_prefill_lane_compatible(
        &self, r: &LiveRequest, kind: GraphKind, non_terminal: bool,
        terminal_only: bool, work: usize, cut: Option<usize>,
    ) -> bool {
        if kind == GraphKind::TerminalPrefill {
            return true;
        }
        if r.deferred_prefill {
            return false;
        }
        if !non_terminal {
            return true;
        }
        if terminal_only {
            return false;
        }
        let start = Self::prefill_cursor(r);
        let next_stop = cut.unwrap_or(r.prompt_tokens).min(r.prefill_limit()).min(r.prompt_tokens);
        let end = start.saturating_add(work);
        let window = self.terminal_prefill_window();
        !(end >= next_stop || (window > 0 && next_stop.saturating_sub(end) <= window))
    }

Callee / invariant it must match — the solo gate policy.rs:1560 and policy.rs:1108-1114:

let work = self.prefill_work_through(r, capacity, cut);
if work == 0 || self.resolve_prefill_kind(r, capacity, work, cut) != kind { continue; }

resolve_prefill_kind_from (helios/src/scheduler.rs:975-1006) decides whether a chunk must complete terminally (end >= next_stop || (window > 0 && next_stop - end <= window) ⇒ TerminalPrefill). The packed lane path never calls it — hence the two unconditional accepts at :1601-1603 and :1607-1609.

Predicate that makes the gap reachable — helios/src/scheduler.rs:940-955:

        if batch <= 1 {
            self.is_non_terminal_prefill(kind, capacity)
        } else {
            kind == GraphKind::Prefill
                && self.packed_prefill_catalog
                    .contains(&(GraphKind::TerminalPrefill, batch, capacity, packed))
        }

non_terminal is true only if a packed TerminalPrefill graph exists at the identical (B,W,P). packed_prefill_graphs (scheduler.rs:902-912) accepts either kind, so a core declaring packed shapes for one kind only — exactly what this PR ships (+6 packed terminal_prefill shapes, no packed prefill shapes) — is legal and leaves non_terminal == false for packed Prefill lanes.

Counterexample A (unconditional TerminalPrefill accept). Core declares one packed shape (TerminalPrefill, B=4, W=128, P=512) and no packed Prefill. Two fresh requests, prompt_tokens = 1000, scheduled_consumed = 0, cut = None, prefill_limit = 1000. Builder: work = prefill_work_through(r,128,None) = 128, next_stop = 1000, end = 128 ⇒ resolve_prefill_kind would return Prefill and the solo path rejects the TerminalPrefill candidate. packed_prefill_lane_compatible returns true at :1601-1603, so both lanes are packed into a graph of kind TerminalPrefill after 128 of 1000 prompt tokens. ScheduledStep::validate accepts it (128 ≤ W, 256 ≤ P=512, 64-aligned, distinct slots) and commit computes non_terminal_prefill = is_non_terminal_prefill_step(TerminalPrefill,4,128,512) = false (scheduler.rs:2685-2700), so deferred_prefill is not set and a sampling/completion graph runs over an incomplete prompt ⇒ wrong first token emitted, prompt remainder lost.

Counterexample B (accept despite terminal_only). Core declares (Prefill, B=4, W=256, P=1024) only. Request with prompt_tokens = 300, deferred_prefill = false, terminal_only = true (the smallest capacity ≥ 300 is terminal-only per prefill_requires_terminal_completion_from, scheduler.rs:1016-1051). non_terminal == false (no packed terminal twin) ⇒ :1607-1608 returns true, packing the lane into a Prefill graph for a chunk the solo scheduler insists must close terminally.

Fix. Make the packed predicate exactly as strict as the solo gate: compute end = prefill_cursor(r) + work and needs_terminal = end >= next_stop || (window > 0 && next_stop.saturating_sub(end) <= window), then match kind { TerminalPrefill => needs_terminal, Prefill => !needs_terminal && !terminal_only } (keeping the deferred_prefill rejection), i.e. packed_prefill_lane_compatible(...) == (self.resolve_prefill_kind_from(r, work, cut, end) == kind). If a packed TerminalPrefill shape is intentionally usable for non-terminal chunks, then is_non_terminal_prefill_step (scheduler.rs:940-955) and the deferred_after derivation (checkpoints.rs:922-936) must derive terminality per lane from needs_terminal instead of from shape-tuple presence — the current kind == GraphKind::Prefill condition makes any TerminalPrefill packed step permanently "terminal", contradicting its own name.


FINDING 2 — Major: packed-candidate greedy is re-run once per catalog entry inside consider(...), not once per step (hot-path super-linear blowup)

Diff site: helios/src/scheduler/policy.rs:1301-1426. The for &(following, batch, width, packed) in &self.packed_prefill_catalog block — an O(N) lane scan, two sort_unstable passes over up to N offers (:1359) and a second O(N) finishing scan (:1400-1409) — sits inside the consider(...) closure, invoked once per Mixed catalog entry (policy.rs:1297-1299), per Resume batch (:1283-1285) and per Decode/Speculative shape (:1286-1296).

Worst case per scheduling step: O((M + B_d + S_spec) × S_pack × N log N), N = REQUEST_LANES. Concretely with the PR's own numbers — a 157-graph core (M ≈ 40 mixed, B_d ≈ 16 decode, S_spec ≈ 16, S_pack = 6, N = 16 requests, 100–200 scheduling steps/s at C=16): ≈ 72 × 6 × 16·log16 ≈ 28k comparisons per step of pure re-derivation, duplicated work, executed on the hot control loop under a 1–4 ms decode step budget. Note packed_prefill_candidates (policy.rs:1623-1746) already does this exact selection once per step at :1633, so the work is fully redundant.

Fix. Hoist the packed sub-cohort selection out of consider (policy.rs:1633-1746 is the existing once-per-step implementation — reuse its (mask, lengths) per packed shape), or at minimum short-circuit before :1301 when self.packed_prefill_catalog.is_empty() and skip non-prefill following kinds.


FINDING 3 — Major: Ignition never enforces P <= prefill_chunk_size; Helios rejects such a core at load ⇒ brace written against the contract is unloadable

Diff site: ignition/preparation/execution.py:80-92 (verbatim, verified):

        if self.kind in ("prefill", "terminal_prefill") and self.batch_capacity >= 2:
            if (not 2 <= self.batch_capacity <= MAX_CONCURRENCY
                    or self.packed_token_capacity < 64
                    or self.packed_token_capacity % 64
                    or self.packed_token_capacity >= 1 << 31
                    or self.token_capacity > self.packed_token_capacity
                    or not self.batch_capacity <= self.packed_token_capacity <= self.batch_capacity * self.token_capacity):
                raise ValueError(
                    "packed prefill graphs require aligned total token capacity within the batch and per-request bounds"
                )

Both Helios readers enforce the missing bound:

packed_token_capacity appears nowhere else in ignition/ (execution.py:29,78-106,426-427 only); ignition/direct/scheduler.py:206 passes config["prefill_chunk_size"] into Layout.of but never compares it.

Counterexample. GraphSignature("terminal_prefill", 4, 128, ("token_ids",), packed_token_capacity=4096) under --prefill-chunk-size 512 passes every Python guard (4096 % 64 == 0, 4 <= 4096 <= 4·128), is exported into the manifest, and Helios then refuses to load the core.

Fix. Reject packed_token_capacity > prefill_chunk where the chunk size is known — carry prefill_chunk into GraphSignature (or validate in PreparedExecution._manifest/plan against options["prefill_chunk"]/plan.parameters.prefill_chunk), and add a regression case to tests/preparation/test_execution.py.


FINDING 4 — Minor: falsy draft_tokens == 0 is required by Helios but rejected by Ignition

ignition/preparation/execution.py:109-111:

        elif self.draft_tokens is not None and not (
                self.kind == "mixed" and self.speculation_enabled is True):
            raise ValueError("draft depth requires a speculative graph")

Helios requires draft_tokens == 0 for packed prefill (helios/src/execution/manifest.rs:860-872: if graph.draft_tokens != 0 { ... }), as does docs/packed-prefill-design.md:41. Counterexample: GraphSignature("terminal_prefill", 4, 128, ("token_ids",), packed_token_capacity=512, draft_tokens=0) → "draft depth requires a speculative graph", while the identical manifest passes Helios. The new tests (tests/preparation/test_execution.py:409-437) cover only the accept path, so the divergence is untested. Fix: normalize draft_tokens == 0 to None for kind in ("prefill","terminal_prefill") with B >= 2, or exempt that branch.

FINDING 5 — Minor: PackedToken tail rows [Σ lane.tokens, P) are never written or zeroed ⇒ stale tokens from the previous submission

Diff site: helios/src/model/packing.rs:169-179 (verbatim, verified) sizes the extent from P:

    } else if graph.packed_token_capacity != 0 {
        graph.packed_token_capacity

but the write loop (packing.rs:549-574, :691-705) advances packed_offset only by the active lanes' rows and never fills the remainder; write_integers (:861) stages only the ranges actually put. Counterexample on the PR's own shipped shape (4,128,512): lanes [64,100,32] (the exact input of helios/src/model/tests.rs:2745-2760) write rows 0-195; rows 196-511 of token_ids/prefill_positions retain the previous submission's values (e.g. a prior full Σ=512 step). The changed test asserts only the active rows and thus freezes the behaviour. Impact is bounded where every kernel masks by QueryLength (padding rows have length 0), but any position-embedding/histogram kernel reading raw P rows sees stale ids. Fix: after the lane loop, write_raw(..., packed_offset, graph.packed_tokens - packed_offset, repeat(binding.padding)), and assert token_ids[196..P] == padding in the test.

FINDING 6 — Minor: dead promoted-lane cap compares a lane count against a token capacity

helios/src/scheduler/policy.rs:1374-1382: inside for &(following, batch, width, packed), a shadowing pattern rebinds batch/width/following but not capacity, which remains the enclosing consider(following, batch, width, prefill) parameter — the graph's prefill token capacity (64…2048, policy.rs:1084, :1297):

                    if promoted && promoted_count == capacity { continue; }

promoted_count is a lane count bounded by batch ≤ REQUEST_LANES = 16, so for any real Mixed shape (prefill = 512) the guard never fires and the intended per-graph promoted-lane limit is silently absent. Fix: compare against the packed graph's own batch (promoted_count == batch), and rename the shadowed binding (packed_batch) so the two caps cannot be confused.

helios/src/runtime_core/selection.rs:361-370: graph.batch_capacity <= limit with limit = max_batch (smallest decode batch ≥ active, :350-360), while ScheduledStep::validate_mixed accepts lanes.len() <= batch_capacity (scheduler.rs:447-448). Counterexample: core declares (B=8, W=128, P=1024), served with --max-concurrency 4 → 8 <= 4 fails and the shape is deleted, although 2–3-lane cohorts on it are legal. The new test asserts the stricter rule as intended (selection.rs:2200-2210). Fix: for packed prefill use batch_capacity >= 2 && active >= 2 (B is a ceiling, not a requirement).

FINDING 8 — Minor: absent prefill_chunk_size silently rejects every packed prefill graph with an unrelated diagnostic

helios/src/runtime_core/selection.rs:280-294: config["prefill_chunk_size"].as_u64().unwrap_or(0) followed by graph.packed_token_capacity <= max_chunk. With the key absent, max_chunk == 0, every B >= 2 graph fails and the core dies at :321-324 with "invalid or duplicate serving graph variant" — pointing nowhere near the real cause, whereas helios/src/model/catalog.rs:279 compares against a typed field that always exists. Fix: config["prefill_chunk_size"].as_u64().ok_or_else(|| invalid("packed prefill requires a captured prefill_chunk_size"))?.


Verified clean (do not re-audit)

Not established

Full report Merge Risk: medium_high (100%): Medium or high merge risk (core runtime/scheduler/GPU/CUDA/VMM/RoCE/multi-rank/contracts/ABI, large multi-crate changes, or Blocker/Major findings) — route to Super Agent.

Re-review

Recommendation: Changes Requested

Between Round 1 (84f789a) and head caaef5a, the branch rebased onto newer main (dropping the stale-base helios/src/runtime_core/cache_memory.rs (not opened) hunk so the diff is now 20 files / +1638 -56), with no post-review code fixes or maintainer sign-off yet. Direct verification at caaef5a clears the Round 1 and Round 2 code-correctness alarms on packed_prefill_lane_compatible, continuation_candidate, packing.rs, and ignition/cli/serve.py — the core packed-prefill implementation is sound and cleanly isolated from B == 1 and ScoredPrefill. However, both hard governance/verification blockers remain unresolved (no recorded owner approval for the widened prefill operation contract, and missing Layer 2 simulator / Layer 3 widened-geometry conformance & mutation coverage), alongside three verified should-fix items (an Ignition-vs-Helios P <= prefill_chunk_size validation gap, normative contradictions in docs/scheduling-runtime-design.md, and a non-equivalent A/B baseline).

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 states: "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." This PR changes the PREFILL/TERMINAL_PREFILL operation contract — admitting batch_capacity >= 2 with explicit packed_token_capacity (helios/src/execution/manifest.rs:860-878), changing InputIndexing::PackedToken extent to aggregate P rows (helios/src/model/packing.rs:169-179), defining binding-derived vision exclusion (helios/src/model/packing.rs:113-126), and formalizing multi-request per-lane SAMPLE_ENABLED prefill semantics (helios/model-contract.md:188-209). No maintainer comment, review, or linked approval exists on #715.
    • Fix: Obtain an explicit maintainer 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-el8 is a charter-named priority contributor and the feature fits the charter.)
  2. Testing-hierarchy Layers 2 and 3 are incomplete for the added cohort algorithm, timing rules, and widened prefill 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:1301-1426,1623-1747) and timing estimation (helios/src/scheduler/cost.rs:581-583,606-607,644-659,969) require evaluation against scripts/scheduling_sim/ and the 64-seed scripts/scheduling_sim/learning.py (not opened) catalog. No simulator run is reported, and scripts/scheduling_sim/scheduler.py:30-35 currently models at most one prefill lane per graph (for view in [None, *prefills] if graph.prefill_capacity else [None]).
      • Layer 3 (docs/design-review.md:226-228,241-246): While CI (.github/workflows/helios-lifecycle.yml (not opened)) runs existing TLC and Kani checks on helios/**, :241-246 requires extending conformance fixtures/harnesses when supported runtime geometries expand, and :226-228 requires mutation testing (check.py (not opened) --mutations) when adding safety guards. Neither verification/helios-lifecycle/** nor helios/src/scheduler/lifecycle_tests.rs (not opened) is updated to cover B >= 2 packed prefill geometry (scheduler.rs:436-465, packing.rs:422-439, is_non_terminal_prefill_step / deferred_prefill), and no --mutations run is reported. :247-251 states disclosure does not waive runnable CPU checks.
    • 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 widened B >= 2 prefill geometry, and run python3 verification/helios-lifecycle/check.py (not opened) --mutations against the new safety guards.

Should Fix

  1. ignition/preparation/execution.py:80-92 omits packed_token_capacity <= prefill_chunk_size, allowing Ignition to export a core that Helios rejects at load time.

    • Verified behavior/impact: GraphSignature.__post_init__ (ignition/preparation/execution.py:80-92) checks 2 <= B <= MAX_CONCURRENCY, P >= 64, P % 64 == 0, P < 1 << 31, W <= P, and B <= P <= B * W, and PreparedExecution.__init__ / .manifest() (execution.py:253-360,395-460) never check prefill_chunk (ignition/preparation/execution.py has zero references to prefill_chunk). Helios enforces packed_token_capacity <= prefill_chunk_size at helios/src/runtime_core/selection.rs:281,293 (failing load with "invalid or duplicate serving graph variant" at :324), helios/src/model/catalog.rs:279, and helios/src/scheduler.rs:910. Example: GraphSignature("terminal_prefill", 8, 256, ("tokens",), packed_token_capacity=2048) passes Ignition under --prefill-chunk-size 1024, then fails to load in flare run.
    • Fix: Validate signature.packed_token_capacity <= prefill_chunk_size in Ignition preparation/export where prefill_chunk is known (e.g., PreparedExecution / export validation against server_config["prefill_chunk_size"]) and add a regression test in tests/preparation/test_execution.py.
  2. Canonical scheduler design doc (docs/scheduling-runtime-design.md) contradicts shipped timing and catalog behavior (AGENTS.md:231 (not opened)).

    • Verified behavior/impact: docs/scheduling-runtime-design.md:466-481 states unconditionally that pure prefill graphs (PREFILL, TERMINAL_PREFILL, SCORED_PREFILL) use the six-stratum PrefillCostModel and context-slope borrowing, whereas helios/src/scheduler/cost.rs:581-583, :606-607, and :969 now restrict PrefillCostModel creation and slope refresh strictly to key.batch == 1 (packed prefill uses flat ReplayTimes). In addition, docs/scheduling-runtime-design.md:21-23 (catalog enumeration) and :455-457 (cost-entry identity) omit packed multi-request prefill and prefill packed_token_capacity, and never link docs/packed-prefill-design.md.
    • Fix: Update docs/scheduling-runtime-design.md (catalog, cost-entry identity, and the batch == 1 scope of stratified prefill modeling vs. ReplayTimes for batch >= 2 packed prefill) and reference docs/packed-prefill-design.md.
  3. Headline performance A/B does not use an equivalent baseline (docs/design-review.md:109-115).

    • Verified behavior/impact: As honestly 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 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 numbers therefore cannot be isolated strictly to packed prefill under docs/design-review.md:109-111 ("equivalent baselines").
    • Fix: Run and report an equivalent A/B using cores exported from the same FlashInfer revision and runtime binary (or packed prefill off/on on an identical build), including the C=1 control.

Subtract / Simplify

  1. Deduplicate the twin packed-prefill cohort builders (helios/src/scheduler/policy.rs:1300-1426 vs. :1623-1747). Both implement the same offer enumeration, < 2 check, by_density in [false, true] double-pass sort, and greedy (batch, packed) fill. They have already drifted on tie-breaking (:1367 omits the .then_with(|| wa.cmp(&wb)) present at :1691), both repeat a redundant .then_with(|| vb.total_cmp(&va)) when by_density == false (:1362-1367, :1684-1690), and :1374-1395 allows ready lanes to consume all batch slots ahead of promoted lanes and trigger promoted_count == 0 => continue (unlike best_two_stage_cohort, which enforces minimum_preparing = 1). Extracting one parameterized helper removes ~110 lines, removes the drop(consider); artifact at :1300, and fixes the tie-break drift and ready-crowding edge case.
  2. Delete dead packed-prefill re-validation in commit (helios/src/scheduler.rs:2617-2632). commit already calls step.validate_mixed()?; at :2575, which enforces lane.tokens > token_capacity (:452), checked_add sum > packed_token_capacity (:456-457), and packed_token_capacity < batch_capacity (:442) for packed prefill, making :2617-2632 unreachable. (Keep :2614-2616 step.lanes.len() > step.batch_capacity, which is still live for Decode/Init/Restore/Snapshot/Prefill(B=1).)
  3. Unify the repeated (B, W, P) geometry conjunction into one helper. The same 7-term geometry check is duplicated across helios/src/execution/manifest.rs:860-872,920-923, helios/src/model/catalog.rs:273-281, helios/src/runtime_core/selection.rs:285-294, and helios/src/scheduler.rs:439-446,902-912. A shared validator next to GraphDescriptor removes ~40 lines and keeps future edits in lockstep.
  4. Minor cleanups:
    • helios/src/scheduler.rs:951-953: packed_prefill_catalog is sorted on (kind as u8, batch, width, packed) (:899-901); replace linear .contains(...) with binary_search_by_key (or precompute the non_terminal bool during packed_prefill_graphs).
    • helios/src/scheduler/policy.rs:1630-1632: drop the redundant if self.packed_prefill_catalog.is_empty() { return; } before iterating &self.packed_prefill_catalog.
    • helios/src/scheduler/cost.rs:644-659: packed_prefill_duration is a thin pass-through over the already-public duration_key.
    • helios/src/server/runtime.rs:849-899: partition manifest.graphs once on batch_capacity == 1 instead of repeating && batch_capacity == 1 across three sibling filter chains.

Nits

Dropped on verification

Full report · Notes

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with. decide malicious: all_clear (100%): No malicious content found

explore

Author: original-el8 (COLLABORATOR; charter-named "priority contributor"; Discord: el8) Motivation: Concurrent short text prompts currently each take a full model replay because prefill graphs allow only one request and Mixed allows one prefill lane. This PR lets a prepared core declare wider prefill graphs so Helios can run several text-only prefill requests in one CUDA graph replay, cutting burst TTFT. Scale: +1754 / −65 lines in 23 files Proposal:

Full report · Notes

Classify intake

Selected: triage:design-review, performance, enhancement, area:scheduling

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:design-review, -triage:review

Subtraction and simplicity

Subtraction & Simplicity Audit — PR #715 (helios,ignition: implement additive packed multi-request prefill)

Verdict: not lean. The Contract-3 contract work is tight, but the scheduler integration duplicates a ~90-line cohort-valuation block twice, triplicates a finishing-extras block, maintains derived state that can drift, and repeats the same packed-prefill geometry check in five places. I estimate ~200–260 LOC removable without behaviour change, plus one structural subtraction (four unrelated features riding in the same diff). Everything below is at head 49d5840.


1. Duplication (highest value)

1.1 The packed-prefill candidate evaluation is written twice, once inline and once as a method

helios/src/scheduler/policy.rs:1311-1401 (inline inside continuation_candidate) and helios/src/scheduler/policy.rs:1711-1778 (packed_prefill_candidates) both:

Verbatim, the same four statements appear at :1320-1321 and :1723-1724:

let non_terminal = self.is_non_terminal_prefill_step(following, batch, width, packed);
let mut offers = [(0usize, 0usize, 0.0f64, false); REQUEST_LANES];
let non_terminal = self.is_non_terminal_prefill_step(kind, batch, width, packed);
let mut offers = [(0usize, 0usize, 0.0f64, false); REQUEST_LANES];

Only two things differ: the lane-admission predicate (offered && !terminal_cleanup(request) && following_kind(...) == Some(Prefill) vs !offered && eligible && request_kind == Prefill) and the promoted_limit argument (Some(capacity) vs None). Both should be parameters of one fn packed_prefill_offers(&self, kind, batch, width, packed, mask, values, age_price, prefill_plans, promoted_limit) -> [(usize, usize, f64, bool); REQUEST_LANES]. That collapses ~90 lines to one body of ~35. This is exactly the same class of defect Autobot's Round-2 flagged for the twin cohort builders (which were merged into select_packed_prefill_cohort); the offer-gathering loop above it was left forked.

1.2 The "fill remaining slots with finishing lanes" block is copy-pasted verbatim

Three sites, same shape (finishing array → filter terminal_cleanup → best_cohort::<REQUEST_LANES>(…, capacity - n) → union mask → sum values):

:1140-1152 and :1372-1386 differ only in the slot-skip condition and the capacity - 1 vs capacity - choice.promoted_count amount:

let mut finishing = [(0usize, 0.0); REQUEST_LANES];
let mut f = 0;
for (other_slot, other_entry) in self.slots.iter().enumerate() { … }
if f > 0 {
    let extra = best_cohort::<REQUEST_LANES>(&finishing[..f], capacity - 1);
    selected |= extra;
    value += finishing[..f].iter().filter(|(s, _)| extra & (1 << s) != 0).map(|(_, v)| *v).sum::<f64>();
}

One fn terminal_fill(&self, mask: u64, exclude: u64, values: &[LaneValue; REQUEST_LANES], first_ms: f64, total_ms: f64, slots: usize) -> (u64, f64) removes ~45 lines and fixes a real copy-drift risk (the two copies already disagree on the exclusion mask: other_slot == slot at :1143 vs selected & (1 << other_slot) != 0 at :1375).

1.3 The horizon/ms preamble is written three times

policy.rs:1130-1137, :1177-1183, :1315-1319:

let horizon = if ns == 0 || duration_ns == 0 { 0 } else { ns.saturating_add(duration_ns) };
let total_ms = horizon as f64 / 1e6;
let first_ms = duration_ns as f64 / 1e6;

Three occurrences of an identical 3-line derivation; a fn horizons(ns: u64, duration_ns: u64) -> (u64, f64, f64) (or an inline let (horizon, total_ms, first_ms) = …) is trivial and removes 6 duplicated lines plus the recurring risk that one site forgets the == 0 guard.

1.4 cost.rs gains a wrapper that only sets one field differently

helios/src/scheduler/cost.rs:644-659:

pub fn packed_prefill_duration(&self, kind: GraphKind, batch: usize, width: usize, packed: usize) -> Option<u64> {
    self.duration_key(Key { drafts: 0, kind, batch, tokens: width, prefill: 0, packed })
}

It is duration_key with packed passed through; duration() (:640-642) is already the prefill: 0 specialisation of shape_duration. Either expose duration_key/Key (already pub(super)-visible within the module tree, used at policy.rs:1168-1173 via shape_duration/packed_round_duration) or accept packed in a single shape_duration(kind, batch, tokens, prefill, packed) signature. Low value alone, but it adds a fifth near-synonym (duration, shape_duration, duration_key, prefill_duration, packed_prefill_duration) to an already crowded cost API.


2. Derived state that makes invalid states representable

helios/src/scheduler/policy.rs:14-22:

pub(super) struct PackedCohort {
    pub(super) mask: u64,
    pub(super) promoted_mask: u64,
    pub(super) promoted_count: usize,
    pub(super) lengths: [usize; REQUEST_LANES],
    pub(super) selected: usize,
    pub(super) total_work: usize,
    pub(super) total_value: f64,
}

selected == mask.count_ones() and promoted_count == promoted_mask.count_ones() by construction (:1652-1663, and the seeding path sets both consistently at :1616-1621). Two fields are pure derivations, hand-maintained in three places (:1618, :1644, :1648), and selected is even used as the loop guard (:1629 if selected == batch). Comparing mask.count_ones() is equivalent, because the tie-break at :1668 only orders by cardinality:

.then_with(|| candidate.selected.cmp(&prev.selected))

Dropping selected and promoted_count (or folding the cohort into (mask, promoted_mask, lengths, total_work, total_value)) removes the only way those counters can disagree with the masks. This is precisely the "pair optional/derived fields so invalid states are unrepresentable" simplification.

Related, smaller: the offer tuple is positional and opaque — offers: &[(usize, usize, f64, bool)] (:1572) read as offers[i].3, offers[i].1, (sa, wa, va, _) (:1588, :1613, :1635). The file's own convention is a named struct (Candidate, PrefillSlotPlan, LaneValue); a struct PackedOffer { slot: usize, work: usize, value: f64, promoted: bool } makes offers[i].1 <= packed self-documenting.


3. The same invariant enforced in four places (collapse to one helper)

ScheduledStep::validate_mixed now carries a 28-line block of packed-prefill lane invariants, helios/src/scheduler.rs:436-463:

} || self.lanes.is_empty()
    || self.lanes.len() > self.batch_capacity
    || self.lanes.iter().any(|lane| lane.tokens == 0 || lane.tokens > self.token_capacity)
    || self.lanes.iter().try_fold(0usize, |sum, lane| sum.checked_add(lane.tokens))
        .is_none_or(|sum| sum > self.packed_token_capacity)
    || self.lanes.iter().enumerate().any(|(i, lane)| {
        self.lanes[..i].iter().any(|other| other.request.slot == lane.request.slot) })

The same invariants are re-derived at:

validate_mixed and pack_step are the same predicate over (batch_capacity, token_capacity, packed_token_capacity, lanes) with different data types (ScheduledStep vs resolved packing graph). One fn valid_packed_lanes(batch, width, packed, lanes: impl Iterator<Item = (usize, bool /*image*/, Slot)>) -> bool behind both would delete ~30 lines and end the divergence.


4. Manifest validates the identical shape twice in one loop body

helios/src/execution/manifest.rs:881-894 and :936-950 are the same call, same arguments, in the same for graph in &self.graphs iteration:

} else if matches!(graph.kind, GraphKind::Prefill | GraphKind::TerminalPrefill)
    && graph.batch_capacity >= 2
{
    if graph.draft_tokens != 0
        || !valid_packed_prefill_geometry(graph.batch_capacity, graph.token_capacity,
            graph.packed_token_capacity, self.request_capacity(), None)
GraphKind::Prefill | GraphKind::TerminalPrefill => {
    if graph.batch_capacity == 1 { … } else {
        valid_packed_prefill_geometry(graph.batch_capacity, graph.token_capacity,
            graph.packed_token_capacity, self.request_capacity(), None)
    }
}

The first block exists only to produce the message "packed prefill B/W/P geometry is invalid" instead of "unsupported graph capacities: {name}". Since the second already rejects the graph with a good message, the earlier block can go (or be reduced to the draft_tokens != 0 arm, which the generic :895-899 branch cannot cover because the else if chain swallows it). This is the single clearest deletion in the execution crate: ~14 lines, zero behaviour change, one error-text tweak.

Also helios/src/execution.rs:10 — pub(crate) use manifest::valid_packed_prefill_geometry; exists purely to shorten three call sites (catalog.rs:273, selection.rs:291, scheduler.rs:439, manifest.rs:885/942 all in-crate). Making the fn pub(crate) and importing it directly removes an unusual re-export of a single private helper.


5. Bootstrap boilerplate: four near-identical filter/map/collect chains

helios/src/server/runtime.rs:848-900 grew from three chains to four, each re-deriving executor.manifest().graphs.iter().filter(...).map(|g| g.token_capacity).collect::<Vec<_>>(), and three of the four now also re-filter on graph.batch_capacity == 1:

.filter(|g| g.kind == GraphKind::TerminalPrefill && g.batch_capacity == 1)
…
.filter(|graph| graph.kind == crate::execution::GraphKind::Prefill && graph.batch_capacity == 1)
…
.filter(|graph| matches!(graph.kind, GraphKind::Prefill | GraphKind::TerminalPrefill) && graph.batch_capacity >= 2)
.map(|graph| (graph.kind, graph.batch_capacity, graph.token_capacity, graph.packed_token_capacity))

One pass over manifest().graphs with a single match graph.kind { … } pushing into the four catalogs (and packed_prefill_graphs) removes ~35 lines and makes the "solo vs packed" split (batch_capacity == 1 here, >= 2 there) readable in one place instead of three. Note the split is also duplicated in helios/src/runtime_core/selection.rs:280-300 and helios/src/model/catalog.rs:266-281, so the batch == 1 / batch >= 2 fork is now expressed in six places.


6. Dead-ish branch that hides a constant result

helios/src/scheduler/policy.rs:1680-1709 — packed_prefill_lane_compatible returns true unconditionally for one input class:

if kind == GraphKind::TerminalPrefill {
    return true;
}
if r.deferred_prefill {
    return false;
}
if !non_terminal {
    return true;
}

Because is_non_terminal_prefill_step is kind == GraphKind::Prefill && … (helios/src/scheduler.rs:944-955), non_terminal is always false for TerminalPrefill, so the :1695-1696 arm already returns true for every non-deferred_prefill TerminalPrefill lane. The :1689-1691 short-circuit therefore buys exactly one thing: skipping the deferred_prefill rejection for that kind. That is a real (and per the round-2 case file, unaddressed) semantic asymmetry, not a pure no-op — but it is expressed as a 3-line early return that makes the remaining 18 lines look kind-agnostic when they are not. It belongs at the call sites as an explicit if kind == GraphKind::TerminalPrefill { /* allow */ } or as a documented _ arm, so the asymmetry is visible where the kind is chosen instead of buried mid-predicate.


7. Largest structural subtraction: four unrelated features inside one diff

pr_files shows 23 files, and search_code at main confirms the following are absent from main and present only at the PR head, i.e. they are in this change set but have nothing to do with packed prefill:

Payload Files / lines at head
preserve_message_anchor (threaded through RequestSpec, LiveRequest, Prompt, LiveRequest::spec) + budget_interior_anchor helios/src/scheduler.rs:160,231,1955; helios/src/server/runtime.rs:52,380; helios/src/scheduler/checkpoints.rs:563-565,705-712,1008-1012; ~40 test-site edits in model/tests.rs, policy_tests.rs (not opened), phase_tests.rs (not opened)
RowRestoreLatency / RowRestoreBucket / RowRestoreSource + RestoreWait::defer signature change to worth_restore helios/src/server/runtime.rs:249-341
partition_conditioned_windows / conditioned_window_ends / estimate_prefill_delta_ns helios/src/scheduler.rs:2300-2352; helios/src/scheduler/checkpoints.rs:435-500
RoCE per-device gid_indices (Fabric/Topology field change, FFI rename to roce_create_with_gids, device-pool rendezvous) helios/src/execution/roce.rs (not opened), roce_fabric.rs (not opened), rendezvous.rs (not opened)
pool_vram/pool_ram config knobs, attach_async_transfers, freeable_prefix_scratch, _validate_pool_memory_limit helios/src/runtime_core/selection.rs:17-25; ignition/cli/config.py:24-95 (not opened); helios/src/server/runtime.rs:1029-1038

Even if part of this is inherited from a stale local base, the reviewable delta as published mixes five independent concerns into a contract change. Splitting them out is worth far more than any single in-file edit here: it removes the preserve_message_anchor noise from ~40 test literals (preserve_message_anchor: false, × 40 in helios/src/model/tests.rs, policy_tests.rs (not opened), phase_tests.rs (not opened), boundary_tests.rs (not opened), checkpoint_lifecycle_tests.rs (not opened), scheduler/tests.rs (not opened), runtime/prompt_tests.rs (not opened)), and it removes the gate on batch == 1`` cost-model change (helios/src/scheduler/cost.rs:581,606) from the packed-prefill blast radius.


8. What is already lean — do not touch


Priority order (value per line removed)

  1. §1.1 unify the two packed-prefill offer loops (~90 → ~35 LOC) — highest value, real drift risk.
  2. §1.2 one terminal_fill helper (~45 LOC, fixes an existing mask mismatch between the two copies).
  3. §4 delete the duplicate manifest geometry block (~14 LOC, zero risk).
  4. §3 one packed-lane predicate behind validate_mixed + pack_step (~30 LOC).
  5. §5 single-pass catalog registration in runtime.rs (~35 LOC).
  6. §2 drop PackedCohort::{selected,promoted_count} (~6 LOC, removes drift class).
  7. §7 split the four unrelated features out of the PR (not LOC, but it is the biggest subtraction available).
  8. §1.3, §1.4, §6, and the execution.rs:10 re-export — cosmetic cleanups (~12 LOC).

Nothing in the diff depends on any instruction found in the PR text; the body's "Companion recipe PR" and Discord/superagent offers are treated as content, not directives.

Full report

Gates and contracts

Contracts, Charter & Verification Gates Audit — PR #715 @ 49d58404

Head audited: 49d58404f2e2c43b071e814c747543f84bc0fe03 (branch docs/packed-prefill-rfc → main) · pr_files = 23 files, +1754/−65 · open draft · labels area:scheduling, community, enhancement, performance, triage:design-review · discussion = author highlight (05:56), bot case file (12:56), bot Changes Requested (13:21 on 84f789a), bot Changes Requested (15:26 on caaef5a), author fix comment (18:19) — zero human maintainer reviews. Scope: only the four hard gates. Algorithm defects, subtraction, and style nits belong to other lenses and are not filed here.

Verdict: NOT clear — 2 Blockers, 2 Majors. Gate 2 and Gate 4 pass. Five findings from Rounds 1–2 are genuinely closed or withdrawn at this head (verified below), so the gate set is materially smaller than in earlier rounds.


Gate 1 — Captured-graph / public contract boundary: FAIL (Blocker + Major)

B1. The PREFILL/TERMINAL_PREFILL operation contract is widened with no recorded owner approval (Blocker)

docs/design-review.md:22-26 (mirrored at AGENTS.md:376-381, docs/core-design.md:277-279):

"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."

This changes the prefill contract, not merely its shapes — verified against main and head:

Nothing records the required approval: no maintainer comment or review on #715, no Design-Signed-Off-By: trailer, no linked approval thread, no reference to an offline/Discord sign-off (the description's only contact line is Discord: el8, the author's own, per principle 17). docs/design-review.md:313-318 obliges an agent to refuse sign-off on a violating change rather than waive it, and AGENTS.md:201-207 states that a feature request, passing tests, or a performance gain does not waive an architectural invariant, and that routine PR approval is not that decision. Precedent on the same author and the same family: #410 opened with a standing "Architecture approval request (Principle 1)" section naming Luke Alonso for the TERMINAL_PREFILL operation contract; #715 extends that family and requests nothing.

To clear: a maintainer approval comment on #715 (or a linked thread) granting the widened multi-request prefill contract. This is a request for sign-off, not a rejection — @original-el8 is a charter-named priority contributor and the feature fits the charter.

M1. docs/core-design.md:420 still asserts the invariant this PR invalidates, and is not in the change set (Major)

AGENTS.md:231 requires graph-selection and scheduling-policy changes to be reflected in the normative design docs. docs/core-design.md:420 reads, unchanged and unlisted in the 23 files:

| Prefill scheduling | One request per chunk, interleaved with decode |

That is precisely the statement a B >= 2 packed core now contradicts, and it sits in the capacities table that the prepared-catalog rules at docs/core-design.md:432-440 are derived from. The sibling normative doc was updated (see "closed" below), which makes the remaining contradiction the more conspicuous. (I verified only line 420; I am not asserting anything about other lists in that file.)

To clear: update docs/core-design.md to admit packed multi-request prefill for cores that declare it, the way docs/scheduling-runtime-design.md now does.


Gate 2 — Vendored upstream dependencies & cross-PR conflicts: PASS


Gate 3 — Mandatory verification evidence: FAIL (Blocker + Major), with one Round-1 blocker withdrawn

Layer 1 — PASS

The Round-1 failures are resolved or correctly explained. The author's 18:19 comment reports the CI-matching invocation clean: FLARE_TEST_TEMPLATE_DIR=… cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server → 1,918 lib + 62 integration passed, 0 failed, plus pytest tests/preparation/test_execution.py → 56 passed. helios/README.md:168-176 documents that frontend-gated tests panic when FLARE_TEST_TEMPLATE_DIR is unset, and .github/workflows/native-serving.yml (not opened) sets it, so the earlier 6 failures were environment. The new Ignition guard carries a real regression test (tests/preparation/test_execution.py:440-463), not a source-text check.

Layer 3 execution (TLC + Kani) — PASS; Round-1 Blocker WITHDRAWN

.github/workflows/helios-lifecycle.yml:4-11 (not opened) triggers on helios/**, :33-34 runs python3 verification/helios-lifecycle/check.py --tlc-jar …, and :46-49 runs cargo kani --manifest-path helios/Cargo.toml (not opened) --features runtime-core --lib. The change set touches helios/**, the dossier reports CI green, and the author additionally reports the in-crate conformance suites (scheduler_matches_lifecycle_model, bounded_cache_ownership_matches_tla, scheduler_matches_speculative_accounting_model, async_transfer_scheduler_matches_lifecycle_model). The Round-1 claim that layer 3 simply "was not run" does not survive this evidence, and I do not carry it forward.

B2. Layer 2 is unrun and unmodelable, and Layer 3's widened-geometry duty was not met (Blocker)

docs/design-review.md:195-208 makes the simulator mandatory for "graph selection, service pricing, timing estimation, refresh or exploration budgets, or cohort algorithms", with the 64-seed learning.py (not opened) catalog required when timing estimation changes. This PR adds a cohort algorithm (helios/src/scheduler/policy.rs (not opened), select_packed_prefill_cohort, +373 lines) and a new timing key plus batch == 1 gating of PrefillCostModel (helios/src/scheduler/cost.rs:644-659 (not opened), :581-583, :606-607). No simulator or learning.py (not opened) run is reported in the description, the 18:19 comment, or the limitations list (which names only tla2tools.jar and cargo-kani).

I checked whether the simulator could even have been run rather than assuming omission: scripts/scheduling_sim/ exists (17 modules including learning.py (not opened), simulator.py (not opened), scheduler.py), but it is blind to this feature — zero matches for packed, batch_capacity, multi_request, or prefill_batch anywhere under the directory, and scripts/scheduling_sim/scheduler.py:30-35 enumerates at most one prefill lane per action (for view in [None, *prefills] if graph.prefill_capacity else [None] followed by a single lanes.append). The (kind, B, W, P) domain is not representable, so a sweep requires extending the model first. docs/design-review.md:247-251 forecloses the disclosure route: "All three layers run without a GPU or model checkpoint. 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."

The Layer 3 duty that survives is narrower and unmet: docs/design-review.md:241-246 requires extending the model, conformance fixture, or Kani harness "when a change … extends supported runtime geometries beyond an existing model's or harness's bounds". The change set contains no verification/helios-lifecycle/** file and no helios/src/scheduler/lifecycle_tests.rs; the fixture that exercises exactly this state machine still constructs batch_capacity: 1, packed_token_capacity: 0 prefill descriptors (helios/src/scheduler/checkpoint_lifecycle_tests.rs:954-985), and the deferred_prefill mutation guards cover only the B == 1 form (verification/helios-lifecycle/check.py:562-645). The new packed branch in ScheduledStep::validate_mixed and the new guard in pack_step (helios/src/model/packing.rs:422-439) therefore have no conformance or mutation coverage.

To clear: extend scripts/scheduling_sim/scheduler.py to multi-lane prefill and run the sweep plus learning.py (not opened) (or record owner agreement that Layer 2 is inapplicable to packed prefill); extend the lifecycle fixture to the B >= 2 geometry and run check.py --mutations over the added guards.

M2. The headline performance claim has no attributable baseline (Major)

docs/design-review.md:106-115 (principle 12) requires "equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements". The A/B is flare run on four GB10s with full multi-rank steps — the right instrument — but the arms are different signed cores: pre-change 151-graph 887785ad (earlier FlashInfer revision) versus packed 157-graph 4aea5c54 (FlashInfer 5a8ceed80). The self-disclosed C=1 control moves 111.2 → 118.7 ms (0.94×), consistent with ~6% systematic overhead in the packed arm. The author discloses this honestly and the flaw is non-isolability, not concealment — but disclosure does not satisfy "equivalent baselines", so 1.68×–4.15× p95 TTFT and 1.75×–4.23× throughput must not be cited as a flag-only measurement of packed prefill.

To clear: one binary and one core, packed shapes off/on (or one core exported with and without the +6 shapes from the same FlashInfer revision), including the C=1 control.


Gate 4 — Material scope / claim contradictions: PASS


Closed or withdrawn since Rounds 1–2 (verified at 49d58404, not carried forward)

Earlier finding Status
Canonical scheduler doc contradicted shipped timing/catalog CLOSED. docs/scheduling-runtime-design.md is now in the change set: :21-24 catalog lists "solo and optional packed multi-request prefill" and links packed-prefill-design.md; :455-459 cost-entry identity includes "packed token capacity (packed verification or packed multi-request prefill)"; :466-472 scopes the six-stratum PrefillCostModel to "solo (batch == 1)" and states packed batch >= 2 uses the flat nine-sample median.
--packed-verification narrowing was an undeclared public-CLI change CLOSED. It is declared in "What changed" ("Scopes --packed-verification checks to speculative signatures"), and on main ignition/preparation/execution.py:78-81 already forbade non-zero packed_token_capacity on every non-speculative kind — so no previously valid recipe can now be rejected. docs/cli-design.md:765-766 documents only the speculative --mtp-*-verification-token-budget surface, so no contradiction remains.
Ignition accepts P > prefill_chunk_size that Helios rejects CLOSED for the reported path. ignition/preparation/model.py:32-43 rejects it before export/serve, with a regression test at tests/preparation/test_execution.py:440-463. Residual nit: the check is skipped when server_config["prefill_chunk_size"] is absent (model.py:33), and GraphSignature itself (ignition/preparation/execution.py:80-92) still cannot see the chunk bound.
Required Layer-1 suites reported failing CLOSED. Clean --features runtime-core,server run reported at head; prior failures were the documented FLARE_TEST_TEMPLATE_DIR prerequisite and a stale local wheel.
Layer 3 TLC/Kani unrun WITHDRAWN. CI runs both on helios/**; change touches helios/**; CI green.

What must change before this passes the gates

# Severity Finding Clear by
B1 Blocker Widened PREFILL/TERMINAL_PREFILL operation contract (manifest.rs:881-900 vs main:858-860, packing.rs:111-130,169-179, model-contract.md:188-209) with no recorded owner approval — docs/design-review.md:22-26, AGENTS.md:376-381 Maintainer approval comment on #715
B2 Blocker Layer-2 simulator sweep unreported and unmodelable without extending scripts/scheduling_sim/scheduler.py:30-35; Layer-3 geometry fixtures/mutations not extended to the B >= 2 domain — docs/design-review.md:195-208, 241-251 Extend + run simulator and learning.py (not opened), extend lifecycle fixture, run check.py --mutations
M1 Major docs/core-design.md:420 still states "One request per chunk" for prefill; doc not in change set — AGENTS.md:231 Update docs/core-design.md
M2 Major Headline speedup compares two different signed cores across FlashInfer revisions; C=1 control at 0.94× — docs/design-review.md:106-115 Same-core, flag-only A/B including the C=1 control

Gates that pass plainly: Gate 2 (no vendored-file forking; external dependency URL-linked, consistent with repository practice); Layer 1 (crate unit/contract tests clean at head); Layer 3 execution (TLC + Kani wired and green); principle 13 core compatibility (the pre-change 151-graph core 887785ad loads and serves, B == 1/ScoredPrefill catalogs are provably untouched, --max-concurrency 1 drops packed shapes); and the charter's model-agnostic and small-footprint rules (capacities enumerated from packed_prefill_graphs(), no supports_* flag, no hardcoded bucket list — docs/design-review.md:27-35,58-61). The remaining blockers are a sign-off and two pieces of evidence, not a rejection.

Full report · Notes

Code correctness

Deep Correctness Audit — PR #715 "additive packed multi-request prefill (Contract 3)" @ 49d5840

Partitioned per the >12-file / >900-LOC rule into three disjoint slices (helios contract+packing+selection; helios scheduler+cost+policy+checkpoints+server; ignition/Python). Every slice applied the full 4-part protocol; I then re-verified each reported finding myself against the files at pr/715 and discarded three sub-agent claims that did not survive verification (listed at the end). Verdict: no Blocker; one Major, five Minor.


F1 — Major — packed (batch >= 2) prefill lanes skip the authoritative checkpoint-cut recheck that solo prefill lanes get

Diff site helios/src/scheduler/policy.rs:2133-2136

if ((candidate.kind.is_prefill() && candidate.batch == 1)
    || candidate.prefill_slot.is_some())
    && matches!(origin, PlanOrigin::Ordinary | PlanOrigin::Discovery)
{
    let slot = candidate.prefill_slot.unwrap_or_else(|| bits(candidate.mask).next().unwrap());

Callee/materialization site helios/src/scheduler/policy.rs:2264-2266

tokens: if let Some(ref host) = lengths {
    host[slot]

The lane work those host_lengths were priced from — policy.rs:1340-1342 calls prefill_slot_state → helios/src/scheduler/policy.rs:518-525

if !plan.ready {
    plan.cut = self.estimated_checkpoint_cut(request);

estimated_checkpoint_cut = checkpoint_selection_cached(request, false) (helios/src/scheduler/checkpoints.rs:890-898) while the planner/committer use checkpoint_cut = checkpoint_selection_cached(request, true) (checkpoints.rs:900-908) — the two differ precisely in quote_storage, and plan_checkpoints matches a capture only on exact endpoint equality (checkpoints.rs:937-941: find(|cut| cut.endpoint == end && !deferred_after)).

Packed candidates are created with prefill_slot: None (policy.rs:1771) and host_lengths: Some(choice.lengths) (policy.rs:1763), so the guard above is false for them (both disjuncts fail) and they never reach the repair at policy.rs:2152-2163:

if actual_work != work || kind_changed {
    if let Some(resized) = self.resize_prefill(candidate, request, cut, values, age_price) {

which is the only place estimated vs authoritative divergence is reconciled (resize_prefill is itself solo-only, policy.rs:2194-2206).

Counterexample: prompt 1536 tokens, interior message-boundary cut at 1024 that is quotable only when snapshot rows are quoted for the whole packed step. estimated_checkpoint_cut (quote_storage=false) → Some(1024); authoritative checkpoint_cut → None (rows contended by the 3 other lanes of the same (TerminalPrefill,4,128,512) step). The cohort is priced with work = 1024, the lane runs 1024 tokens, and at commit plan_checkpoints finds no accounting cut with endpoint == 1024 → no capture, no reserve_guard, even though promote_request_anchor already armed the anchor guard for 1024 (checkpoints.rs:1001-1019). The anchor guard is then stuck until revoke_unused_anchor_guards. Symmetrically, estimated None / authoritative Some(1024) makes the lane run the full 1536 tokens past the armed anchor, so capture.endpoint == endpoint fails in completion (scheduler.rs:3106-3112) and the boundary is silently dropped — a warm-prefix cache miss that the feature's own purpose (warm-prefix turns) depends on.

Fix: extend the guard so packed candidates are rechecked too, e.g. if candidate.kind.is_prefill() && (candidate.batch == 1 || candidate.host_lengths.is_some()), and in the packed case recompute host_lengths[slot] = self.prefill_work_through(request, candidate.capacity, self.checkpoint_cut(request)) per lane, then re-validate sum(lengths) <= candidate.packed_token_capacity and bits(mask).count() <= candidate.batch; if either fails, drop the candidate. Add a policy_tests.rs case with quote_storage divergence forced between the two cut functions.


F2 — Minor — greedy packed cohort selection can reject a shape that has a valid cohort

helios/src/scheduler/policy.rs:1628-1654

for &idx in &order[..count] {
    if selected == batch { break; }
    if seeded == Some(idx) { continue; }
    let (slot, work, val, promoted) = offers[idx];
    if total_work + work > packed { continue; }
    ...
if selected < 2 { continue; }

The two passes (by_density in [false, true], policy.rs:1582) differ only in the primary key and are both single-seed forward greedy; an oversized high-value lane that fits alone blocks the pair that would fit, and neither pass recovers because both orderings rank it first.

Counterexample (realistic: width=64, packed=128): offers A(work 70, value 140), B(60, 100), C(60, 100).

Fix: seed the greedy once per candidate seed instead of once (for seed in order[..min(count,batch)], keep the best), or run the already-available best_two_stage_cohort-style fill (policy.rs:1261) with the packed packed budget. count <= REQUEST_LANES (16), so O(k·N log N) is free.


F3 — Minor — packed prefill replay duration is keyed by (kind,B,W,P) only, so the flat median pools cohorts from B to P rows, and the whole duration is charged to the cohort

Lookup helios/src/scheduler/cost.rs:644-659 → duration_key(Key { drafts: 0, kind, batch, tokens: width, prefill: 0, packed }). Observation path helios/src/scheduler/cost.rs:947-954 builds the same key from the committed step (packed: step.packed_token_capacity), then ReplayTimes::observe (cost.rs:492-511) takes a plain 9-sample median. Consumption helios/src/scheduler/policy.rs:1774

rate: ValueRate::new(duration_ns, choice.total_value, age_price),

and the PrefillCostModel (which predicts from work) is deliberately disabled for packed shapes (cost.rs:606-607: (key.kind.is_prefill() && key.batch == 1)).

Counterexample: shape (TerminalPrefill, 4, 128, 512) — the recipe runs it at 4 x 32 = 128 rows (~2 ms) and at 4 x 128 = 512 rows (~7 ms; the PR's own 3,947.3 µs vs 7,625.4 µs per layer shows the 2× range is real). Both samples land in the same ring, so a light 128-row cohort is priced at up to ~3.5× its true cost and a 512-row cohort at ~0.3×; because the rate is value/duration the light cohort is systematically starved and the heavy one over-promoted on every step. The amended docs/scheduling-runtime-design.md (Duration estimates, ~463-476) sanctions "the same flat nine-sample median as non-prefill graphs", but non-prefill keys have a fixed row count per key, so the sanction does not cover this new variability. Fix: add a work/rows dimension to Key for packed >= 1 (e.g. bucket total_work by 64), or attach an affine PrefillCostModel on choice.total_work for batch >= 2 and predict at policy.rs:1774.


F4 — Minor — the new --packed-verification guard is always satisfied for any recipe with a speculative graph

ignition/cli/serve.py:465-467 (changed by this PR)

if not any(
        signature.kind == "speculative" and signature.packed_token_capacity
        for signature in local_model.signatures.values()):

Callee that defeats it ignition/preparation/execution.py:102-106

packed = self.batch_capacity * self.token_capacity if not self.packed_token_capacity else self.packed_token_capacity
...
object.__setattr__(self, "packed_token_capacity", packed)

Every speculative signature has packed_token_capacity >= batch_capacity > 0 after __post_init__, so signature.packed_token_capacity is always truthy and the guard can never fire. Counterexample: a recipe with a single width-one speculative round GraphSignature("speculative", 4, 1, ("tokens",)) → packed_token_capacity becomes 4 → --packed-verification is accepted silently even though no packed round exists. Scoping to kind == "speculative" is itself correct (SpeculationParameters.packed_verification, ignition/parameters.py:783; shapes from packed_speculative_shapes, ignition/components/capacity.py:91-132) — no non-speculative kind needs it and no speculative case is newly rejected. Fix: signature.kind == "speculative" and (signature.token_capacity > 1 or signature.packed_token_capacity > signature.batch_capacity).


F5 — Minor — the Python geometry validator omits the batch <= request_capacity(max_active) bound that Helios enforces, so a recipe can prepare and export a core Helios refuses to load

ignition/preparation/execution.py:80-86

if self.kind in ("prefill", "terminal_prefill") and self.batch_capacity >= 2:
    if (not 2 <= self.batch_capacity <= MAX_CONCURRENCY
            or self.packed_token_capacity < 64
            ...

MAX_CONCURRENCY = 64 is a constant (ignition/components/capacity.py:11), while PreparedExecution.__init__ already computes the real bound at execution.py:300 (request_capacity(max_active), capacity.py:30-34). Rust enforces graph.batch_capacity > prepared.next_power_of_two() as u64 (helios/src/runtime_core/selection.rs:307) and passes self.request_capacity() into valid_packed_prefill_geometry (helios/src/execution/manifest.rs:889 → predicate (2..=max_batch) at manifest.rs:459). Counterexample: max_active=4, GraphSignature("terminal_prefill", 8, 128, ("tokens",), packed_token_capacity=256) → Python accepts, core exports; Helios core selection drops the graph and the process fails with "invalid or duplicate serving graph variant". (Minor rather than Major because the same pre-existing gap exists for mixed at execution.py:59 and speculative at :54.) Fix: or self.batch_capacity > request_capacity(max_active) in the packed-prefill arm.


F6 — Minor — P <= prefill_chunk_size is silently unenforced when the recipe omits server_config["prefill_chunk_size"], while Helios fails closed

ignition/preparation/model.py:32-43

prefill_chunk = self.server_config.get("prefill_chunk_size")
if prefill_chunk is not None:
    for name, signature in self.signatures.items():

No other Python layer checks the chunk bound (PreparedExecution.__init__, execution.py:255-372, has none). Helios defaults a missing key to 0, which rejects every B >= 2 graph: helios/src/runtime_core/selection.rs:281 let max_chunk = config["prefill_chunk_size"].as_u64().unwrap_or(0); feeding Some(chunk) at selection.rs:296 into max_chunk.is_none_or(|chunk| packed <= chunk) (manifest.rs:467). Counterexample: the tests' own fixture style, _execution(..., server_config={}, signatures={"tp": GraphSignature("terminal_prefill", 4, 256, ("tokens",), packed_token_capacity=1024)}) → accepted and exported, then rejected at Helios load. Fix: fail closed — treat a missing key as 0 (matching Helios) or default it to the same 4096 Helios uses in helios/src/server/config.rs:149 (not opened).


Verified sound — suspicions I opened and cleared (reported so they are not re-raised)

  1. pack_step packed guard is not a hole. helios/src/model/packing.rs:422-439: graph.packed_tokens is the descriptor's packed_token_capacity (packing.rs:276), and manifest validation requires packed >= 64 for B >= 2 (manifest.rs:464), so graph.packed_tokens != 0 at line 436 is a redundant, always-true conjunct — the check reduces to total_tokens > P, which is exactly the contract bound. It still rejects correct inputs. Zero-token lanes are impossible here because ScheduledStep::validate_mixed rejects lane.tokens == 0 (scheduler.rs:450) and pack_inputs calls it first (model/inputs.rs:35). Worth dropping the dead conjunct for clarity, but not a defect.
  2. promoted_limit is not capped at 1. policy.rs:1363 passes Some(capacity); capacity is continuation_candidate's second parameter (policy.rs:1060-1067), and the sole caller passes batch (policy.rs:1824: continuation_candidate(kind, batch, duration_ns, …)), consistent with the pre-existing capacity - 1 reservation at policy.rs:1152. Multi-lane promotion into a packed replay therefore works.
  3. The max_concurrency filter cannot silently drop all packed graphs. selection.rs:355-365: max_batch is min(batch_capacity of generation graphs with batch_capacity >= active), and .unwrap_or(active as u64) means an empty match yields active, so max_batch >= active always; with active >= 2 packed shapes up to active survive, and --max-concurrency 1 correctly yields limit = 0 (selection.rs:370-374). The new fixture at selection.rs:2102ff is not load-bearing for this.
  4. valid_packed_prefill_geometry is mutually satisfiable and matches the doc. manifest.rs:452-468: 2 <= B <= max_batch, 0 < W <= P, P >= B, P <= B*W, 64 | P, P <= i32::MAX, P <= max_chunk. B=2, W=1, P=64 is correctly rejected (packed <= B*W fails), minimal legal shape is B=2, W=32, P=64; all six recipe shapes satisfy it.
  5. Vision rejection on packed prefill is complete. model/packing.rs:113-126 rejects all four image bindings for is_prefill() && batch_capacity >= 2 while keeping them for batch == 1 (backward compatible); ScoredPrefill is a is_prefill() variant (manifest.rs:85-87) but is forced to batch_capacity == 1 at three layers (manifest.rs:951-956, catalog.rs:282-288, selection.rs:301-303), so it never reaches the packed branch.
  6. No NaN / div-by-zero / comparator panic in the new ranking code. select_packed_prefill_cohort uses total_cmp throughout (policy.rs:1590-1597, 1666-1670), density denominators are work > 0 (both builders skip work == 0: policy.rs:1343, 1741), ValueRate::new special-cases duration_ns == 0 (scheduler/utility.rs:154-165), and the candidate comparator ends on a total tie-break (total_value, selected, total_work, mask).
  7. ReplayTimes median direction is fine (cost.rs:498-510): len == 1 → ordered[0], even counts average the middle pair; no count/2 vs (count-1)/2 inversion, and a fresh single probe correctly resets the ring (if !fresh { self.ring.reset() }).
  8. is_non_terminal_prefill_step binary search is well-founded — scheduler.rs:897-899 sorts the packed catalog by (kind as u8, batch, width, packed) and scheduler.rs:950-953 searches exactly that key; validate_mixed (scheduler.rs:436-471) and commit (scheduler.rs:2576-2617) agree on the geometry they accept, and commit validates before any mutation.
  9. server/runtime.rs:846-900 catalog partitioning is disjoint: solo catalogs are filtered to batch_capacity == 1, packed to matches!(kind, Prefill | TerminalPrefill) && batch_capacity >= 2, so no shape is double-registered.
  10. Python/Rust predicate parity holds for all nine geometry predicates except the two noted in F5/F6; type(...) is not int at execution.py:78 correctly rejects True; the direct-mode key isolation in ignition/direct/scheduler.py:194-202 cannot double-register (B==1 → 3-tuple, B>=2 → 4-tuple, disjoint branches) and packed_shapes (scheduler.py:316-318, len(key) == 5) correctly keeps packed prefill keys out of Policy.packed_catalog.
  11. external_extents test-compile fix is complete — the field is new in this changeset (runtime_core/format.rs:24-36), so no pre-existing Core { … } literal could have been missed.

Sub-agent claims I discarded after verification

Notes

Full report Merge Risk: medium_high (100%): Medium or high merge risk (core runtime/scheduler/GPU/CUDA/VMM/RoCE/multi-rank/contracts/ABI, large multi-crate changes, or Blocker/Major findings) — route to Super Agent.

Re-review

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

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).

    • Verified behavior/impact: docs/design-review.md:22-26 states: "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." At 49d5840, this PR widens the PREFILL/TERMINAL_PREFILL operation contract — accepting batch_capacity >= 2 with explicit packed_token_capacity (helios/src/execution/manifest.rs:881-900), changing InputIndexing::PackedToken extent on prefill to aggregate P rows (helios/src/model/packing.rs:169-179), defining binding-derived vision exclusion (helios/src/model/packing.rs:113-126), and formalizing per-lane QUERY_LENGTH/SAMPLE_ENABLED multi-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-el8 is a charter-named priority contributor and the design fits the charter.)
  2. Testing-hierarchy Layers 2 and 3 remain incomplete for the added cohort algorithm, timing rules, and widened B >= 2 prefill 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 against scripts/scheduling_sim/ and the 64-seed scripts/scheduling_sim/learning.py (not opened) catalog. No simulator run is reported, and scripts/scheduling_sim/scheduler.py:30-35 currently 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),49 executes existing TLC and Kani suites on helios/**, :241-246 requires extending conformance fixtures/harnesses when supported runtime geometries expand, and :226-228 requires mutation testing (check.py --mutations) when adding safety guards. Neither verification/helios-lifecycle/** nor helios/src/scheduler/lifecycle_tests.rs (not opened) / checkpoint_lifecycle_tests.rs (not opened) is updated to cover B >= 2 packed prefill geometry (scheduler.rs:436-463, packing.rs:422-439, is_non_terminal_prefill_step), and no --mutations run is reported. :247-251 states disclosure does not waive runnable CPU checks.
    • 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 widened B >= 2 prefill geometry, and run python3 verification/helios-lifecycle/check.py --mutations over the added safety guards.

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, 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 meet the "equivalent baselines" requirement in 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 same binary (or packed prefill off/on on an identical build), including the C=1 control.

Subtract / Simplify

  1. Remove the duplicate valid_packed_prefill_geometry check in ExecutionManifest::validate (helios/src/execution/manifest.rs:881-894 vs. :936-950). Inside the same for graph in &self.graphs loop, valid_packed_prefill_geometry is called twice with identical arguments (graph.batch_capacity, graph.token_capacity, graph.packed_token_capacity, self.request_capacity(), None). The second else branch at :941-949 can simply return true (already validated above) or be folded into one check.
  2. Unify the remaining duplicated offer-gathering and finishing-fill loops in helios/src/scheduler/policy.rs. While select_packed_prefill_cohort was extracted, the ~50-line offer-gathering loops at :1311-1366 and :1718-1761 still duplicate duration lookup, is_non_terminal_prefill_step, prefill_slot_state, prefill_work_through, packed_prefill_lane_compatible, and lane_value_for_tokens; similarly, the finishing cohort fill at :1372-1396 duplicates :1140-1160.
  3. Drop derived counters from PackedCohort (helios/src/scheduler/policy.rs:14-22). selected == mask.count_ones() as usize and promoted_count == promoted_mask.count_ones() as usize by construction; deriving them from the bitmasks removes redundant state that must be kept in sync across seeding (:1616-1623) and fill (:1642-1650).
  4. Consolidate the four manifest filter passes in helios/src/server/runtime.rs:848-900. A single pass over executor.manifest().graphs dispatching by (graph.kind, graph.batch_capacity) avoids repeating && batch_capacity == 1 across three sibling filter chains.

Nits

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

Applied: +triage:review, -triage:design-review decide malicious: all_clear (100%): No malicious content found

explore

Author: original-el8 (COLLABORATOR; charter-named "priority contributor"; Discord: el8) Motivation: Prefill currently runs one request per graph, so a burst of short prompts costs one GPU launch each. This PR lets a single PREFILL/TERMINAL_PREFILL graph fan several requests into one launch, which cuts prefill launches and p95 time-to-first-token for concurrent short prompts. Scale: +2257 / −115 lines in 33 files Proposal:

Touches:

Related items:

Link: https://github.com/NVIDIA/hyperflare-inference/pull/715 Autobot comments: Since the last report, head moved to 4e3e2c3d (33 files, +2257/−115) and the author's 20:06 comment claims to resolve the Layer 2/Layer 3 blocker. That claim holds for Layer 2 (simulator is real and in CI) and mostly for Layer 3 (new conformance test + three mutation guards), but the mutation guards are manual-only (helios-lifecycle.yml:34 runs check.py without --mutations) and Kani was not extended to the widened packed geometry (kani_proofs.rs has only two proofs). The simulator models no terminal/non-terminal prefill kind and no promoted-lane continuation mode, and no learning preset uses a packed catalog (learning_scenarios.py:38,:67), so the 1.73×/2.06×/1.37× synthetic figures are not reproducible from committed scenarios. The solo-vs-packed asymmetry stands unchanged (no resolve_prefill_kind in policy.rs:1657-1721 and 1518-1619; packed_prefill_lane_compatible returns true for TerminalPrefill first at policy.rs:1732-1734). Owner approval is now explicitly conceded as outstanding by the author himself; the A/B is still non-isolable (different FlashInfer revisions, 0.94× C=1 control). Commit git author is "Jason Cook" while the PR author is original-el8 — do not attribute benchmarks to the diff's git author. No instruction-redirection content found; the @flare-autobot re-review requests were treated as content.

Full report · Notes

Subtraction and simplicity

Subtraction & Simplicity audit — PR #715 helios,ignition: implement additive packed multi-request prefill (Contract 3)

Reviewed at head 4e3e2c3 (33 files, +2257/−115). Verdict: the feature is real work, not speculative generality — but the diff repeats itself in 5 places and carries 3 dead/overloaded constructs. The subtractable surface I found is roughly 120–150 lines of the new Rust/Python, with zero loss of behaviour. Nothing here is a design objection; all of it is local.

Priorities are ordered by (lines removed × risk of the duplication drifting apart).


S1 (HIGH) — Packed-lane geometry is validated three times; pack_step's copy is unreachable

The same lane invariants (lanes non-empty, len <= batch, lane.tokens <= per-request width, sum(lane.tokens) <= packed, no duplicate slots) now live in three places, and one is fully dominated.

helios/src/scheduler.rs:436-463 (ScheduledStep::validate_mixed, the owner):

if matches!(self.kind, GraphKind::Prefill | GraphKind::TerminalPrefill)
    && self.batch_capacity >= 2
{
    if !crate::execution::valid_packed_prefill_geometry(...)
        || self.lanes.is_empty()
        || self.lanes.len() > self.batch_capacity
        || self.lanes.iter().any(|lane| lane.tokens == 0 || lane.tokens > self.token_capacity)
        || self.lanes.iter().try_fold(0usize, |sum, lane| sum.checked_add(lane.tokens))
            .is_none_or(|sum| sum > self.packed_token_capacity)
        || self.lanes.iter().enumerate().any(|(i, lane)| {
            self.lanes[..i].iter().any(|other| other.request.slot == lane.request.slot)
        })

helios/src/model/packing.rs:422-439 (Inputs::pack_step) re-derives the same thing with paraphrased errors:

if graph.kind.is_prefill() && graph.batch >= 2 {
    let mut total_tokens = 0usize;
    for lane in &frame.step.lanes {
        if lane.tokens > graph.tokens {
            return Err("packed prefill lane exceeds per-request token capacity".into());
        }
        ...
        if live.image_slot.is_some() {
            return Err("packed prefill graph does not support image-conditioned lanes".into());
        }
        total_tokens = total_tokens.checked_add(lane.tokens)...
    }
    if total_tokens > graph.packed_tokens {
        return Err("packed prefill lanes exceed packed token capacity".into());
    }
}

This block is dead in the pack_inputs path: helios/src/model/inputs.rs:35 calls step.validate_mixed()? first, and inputs.rs:43-48 independently re-checks step.lanes.len() > step.batch_capacity. graph.tokens == step.token_capacity and graph.packed_tokens == step.packed_token_capacity by the match at packing.rs:413-420, so every lane bound in the copy is a strict subset of the check 40 lines earlier in the call chain. Only the image_slot guard is genuinely new — and packing.rs:117-121 already rejects ImageFeatureSlot bindings on B >= 2 prefill graphs at contract time, so the runtime guard is belt-and-braces, not the sole defence.

Subtract: delete packing.rs:422-439; keep the image_slot guard as three lines (or fold it into validate_mixed where the geometry already lives). If the belt-and-braces is wanted, extract one fn packed_lane_fits(lanes, width, packed) -> Result<()> and call it from both places instead of maintaining two paraphrases.


S2 (HIGH) — continuation_candidate's packed block duplicates packed_prefill_candidates almost verbatim

policy.rs:1306-1348 (inside continuation_candidate, the drop(consider) tail) and policy.rs:1754-1798 (packed_prefill_candidates) are the same eight-step pipeline:

  1. self.costs.packed_prefill_duration(kind, batch, width, packed)
  2. let horizon = if ns == 0 || duration_ns == 0 { 0 } else { ns.saturating_add(duration_ns) };
  3. self.is_non_terminal_prefill_step(...)
  4. self.packed_prefill_offers(..., Some((mask, kind)) | None)
  5. Self::select_packed_prefill_cohort(&offers[..n], batch, packed, Some(capacity) | None)
  6. ValueRate::new(horizon, value, age_price)
  7. if best.is_none_or(|(_, old)| rate.compare(old).is_gt()) / output.push(...)

The None-vs-Some continuation tuple is already the exact parameter that distinguishes them, and packed_prefill_offers (policy.rs:1658-1721) already takes it. Subtract: one fn packed_prefill_plan(&self, kind, batch, width, packed, continuation, ...) -> Option<(u64 mask, u64 promoted, f64 value, u64 horizon, usize work, [usize; REQUEST_LANES])> used by both — removes ~40 lines and makes the two valuation paths provably identical, which is exactly the property the PR's own scheduler/lifecycle conformance test is trying to pin.


S3 (MEDIUM) — usize::try_from(...).zip(...).zip(...).zip(...) where as usize would do

helios/src/runtime_core/selection.rs:282-300:

} else {
    usize::try_from(graph.batch_capacity).ok()
        .zip(usize::try_from(graph.token_capacity).ok())
        .zip(usize::try_from(graph.packed_token_capacity).ok())
        .zip(usize::try_from(max_chunk).ok())
        .is_some_and(|(((b, w), p), chunk)| {
            crate::execution::valid_packed_prefill_geometry(b, w, p, REQUEST_LANES, Some(chunk))
        })
}

Four try_from calls, three .ok(), a quadruple-nested tuple pattern and an is_some_and to express "cast u64→usize and test". The casts are infallible on every supported target (the manifest path at manifest.rs:459-467 already bounds packed <= i32::MAX). Subtract: take u64 in valid_packed_prefill_geometry (it is a pub(crate) helper with four call sites: manifest.rs:885, catalog.rs:273, scheduler.rs:439, selection.rs:291), or write the guard as graph.batch_capacity >= 2 && valid_packed_prefill_geometry(graph.batch_capacity as usize, ...). The if graph.batch_capacity == 1 { ... } else { ... } split then collapses too.


S4 (MEDIUM) — Tautological else-arm duplicating ScoredPrefill's width rule

helios/src/execution/manifest.rs:936-951:

GraphKind::Prefill | GraphKind::TerminalPrefill => {
    if graph.batch_capacity == 1 {
        [1, 16].contains(&graph.token_capacity)
            || (graph.token_capacity >= 64 && graph.token_capacity.is_multiple_of(64))
    } else {
        // `batch_capacity >= 2` packed prefill geometry was validated above.
        graph.batch_capacity >= 2
    }
}
GraphKind::ScoredPrefill => {
    graph.batch_capacity == 1
        && ([1, 16].contains(&graph.token_capacity)
            || (graph.token_capacity >= 64 && graph.token_capacity.is_multiple_of(64)))
}

graph.batch_capacity >= 2 inside the else of graph.batch_capacity == 1 is always true — it cannot fail and carries no information (this matches the dossier's A5 reading, but the simplification was never taken). Subtract: flatten to one arm, e.g. accept ScoredPrefill as a third alternative in the batch_capacity == 1 test, giving a single 4-line arm instead of two arms and a comment. Net −6 lines and one fewer place to update when the alignment rule changes.


S5 (MEDIUM) — Dead expression in the simulator cohort selector

scripts/scheduling_sim/scheduler.py:55-56:

key = (total_val, len(chosen), total_tokens, tuple(reversed(names)))
if best is None or key[:3] > best[:3] or (key[:3] == best[:3] and names < best[3]):

key[3] is constructed and never read — the tiebreak uses names against best[3], and best stores names (forward order) as its fourth element. tuple(reversed(names)) is wasted work on every candidate. Subtract: key = (total_val, len(chosen), total_tokens) and compare directly. (The reversed-tuple also silently disagrees in convention with best's forward order, so this is a latent-confusion site, not just dead code.)


S6 (MEDIUM) — Byte-identical validation block duplicated in the simulator's two graph classes

scripts/scheduling_sim/model.py:44-49 and scripts/scheduling_sim/timing.py:38-44 are the same six checks with the same messages:

if self.prefill_batch_capacity >= 2:
    if not self.prefill_capacity or self.decode_capacity or self.width != 1:
        raise ValueError("packed prefill graphs must be prefill-only with width 1")
    if not (max(self.prefill_batch_capacity, self.prefill_capacity)
            <= self.packed_token_capacity
            <= self.prefill_batch_capacity * self.prefill_capacity):
        raise ValueError("invalid packed prefill token capacity")
elif self.packed_token_capacity != 0:
    raise ValueError("packed_token_capacity requires prefill_batch_capacity >= 2")

Graph and GraphSpec already share the field set; GraphSpec.from_graph (timing.py:46) converts one to the other. Subtract: one module-level def _validate_graph_capacities(prefill, decode, width, prefill_batch, packed) called from both __post_init__s. Note the Python bounds here are also not the Rust bounds (valid_packed_prefill_geometry additionally requires packed >= 64, % 64 == 0), so the duplicated pair is already drifting from the source of truth.


S7 (LOW) — The same rank-key expression written out four times

(a.graph.packed_token_capacity or a.graph.prefill_capacity) + a.graph.decode_capacity * a.graph.width appears identically at:

Subtract: a Graph.cost_weight property (it lives in model.py next to the fields). The or fallback is exactly the kind of convention that should be named once.


S8 (LOW) — packed_prefill_lane_compatible's first branch makes four of its parameters dead

policy.rs:1723-1752:

fn packed_prefill_lane_compatible(&self, r: &LiveRequest, kind: GraphKind,
    non_terminal: bool, terminal_only: bool, work: usize, cut: Option<usize>) -> bool {
    if kind == GraphKind::TerminalPrefill {
        return true;
    }

On that path non_terminal, terminal_only, work and cut are unused, and kind is used only for this early return. Subtract: drop the kind parameter entirely and hoist the terminal check to the two call sites (policy.rs:1704-1715 in packed_prefill_offers, policy.rs:2091-2097 in validate/commit-side filter), which both already have kind/candidate.kind in scope. −1 parameter on a 6-parameter predicate, and the "terminal graphs accept everything" rule becomes visible where the graph kind is chosen rather than buried in a lane predicate.


S9 (LOW) — select_packed_prefill_cohort overloads one Option<usize> with three meanings

policy.rs:1518-1619. promoted_limit means:

Some(0) is reachable only from policy.rs:1327 via Some(capacity) where capacity can be 0, and it is semantically "no continuation, but also refuse" — a third mode smuggled into a numeric limit. Subtract: enum PackedCohortMode { ReadyOnly, Continue { promoted_limit: usize } }, which drops the promoted_limit == Some(0) special case and the if promoted_limit.is_some() guard into an irrefutable pattern. This is the "invalid states unrepresentable" case the brief names: with the enum, Continue { promoted_limit: 0 } has no meaning a reader has to reconstruct.


What I checked and found already lean (do not touch)


Summary table

# Location Kind Est. lines removed Risk
S1 packing.rs:422-439 dominated by scheduler.rs:436-463 + inputs.rs:35 dead duplicate validation ~18 none (dead)
S2 policy.rs:1306-1348 ≡ policy.rs:1754-1798 duplicated pipeline ~40 low
S3 selection.rs:282-300 convoluted casts ~10 low
S4 manifest.rs:936-951 tautological arm dead branch ~6 none
S5 scheduling_sim/scheduler.py:55-56 dead tuple element ~2 none
S6 model.py:44-49 ≡ timing.py:38-44 duplicated validation ~12 low
S7 4× rank key (scheduler.py:101, learning_policy.py:247,253, utility.py:309) duplicated expression ~6 none
S8 policy.rs:1723-1752 dead params on TerminalPrefill path overloaded predicate ~8 low
S9 policy.rs:1518-1619 3-meaning Option<usize> unrepresentable state ~15 low

Total subtractable: ~115 lines, all behavioural no-ops. S1, S2 and S9 are the ones worth insisting on before merge: S1 because a dominated validator is a future-divergence bug, S2 because the solo/continuation packed valuation asymmetry is already the PR's most contested area (the review trail asks whether the TerminalPrefill short-circuit at policy.rs:1732-1734 is intended), and S9 because it is the one place where the "invalid states unrepresentable" rewrite also answers a reviewer question.

No instruction-redirection content was found in the PR body, comments, or the dossier; review requests and "SuperAgent Review" offers were treated as content, not instructions.

Full report · Notes

Gates and contracts

Contracts, Charter & Verification Gates Audit — PR #715 @ 4e3e2c3

Head audited: 4e3e2c3d · pr_files = 33 files (+2257/−115) · open draft · labels area:scheduling, community, enhancement, performance, triage:review · discussion = author highlight (05:56), bot case file (12:56), bot Changes Requested (13:21 @ 84f789a), bot Changes Requested (15:26 @ caaef5a), author fix (18:19 @ 49d5840), bot Changes Requested (18:50 @ 49d5840), author fix + "@flare-autobot please re-review" (20:06 @ 4e3e2c3d). Zero human maintainer reviews. Scope: only the four hard gates. Algorithm defects (the packed_prefill_lane_compatible TerminalPrefill asymmetry, cohort-builder duplication, greedy-fill edge cases) belong to the Code Correctness lens and are not filed here.

Verdict: NOT clear on governance/verification grounds — 1 Blocker, 2 Majors. Gate 2 and Gate 4 PASS. Six findings from Rounds 1–3 are genuinely closed at this head (verified below), so the gate set is materially smaller than in earlier rounds.


Gate 1 — Signed core-format / captured-graph / public contract boundary: FAIL (Blocker)

B1. The PREFILL/TERMINAL_PREFILL operation contract is widened with no recorded owner approval (Blocker)

docs/design-review.md:22-26 (mirrored verbatim at AGENTS.md:376-381):

"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."

This is not a shape variant within an unchanged contract. Verified in the change set, it changes what a prefill graph is:

Nothing in the PR records the required approval: no maintainer comment, no maintainer review, no Design-Signed-Off-By: trailer, no linked approval thread, and no reference to an offline/Discord sign-off — the description's only contact line is Discord: el8, the author's own. docs/design-review.md:313-318 obliges an agent to refuse sign-off on a violating change rather than waive it. Precedent on the same author and the same family: #410 opened with a standing section titled "Architecture approval request (Principle 1) … explicit approval from Luke Alonso is requested for this graph operation family prior to merge" for GraphOperation::TERMINAL_PREFILL — the very family this PR widens. #715 requests nothing.

The author now concedes this: the 20:06 comment lists under "Remaining non-code items: explicit project-owner approval from Luke Alonso for widening Contract 3 PREFILL/TERMINAL_PREFILL to B >= 2".

To clear: a maintainer approval comment on #715 (or a linked thread) granting the widened multi-request prefill contract. This is a request for sign-off, not a rejection — @original-el8 is a charter-named priority contributor and the feature fits the charter.

Gate 1 — normative-doc sync: PASS (materially improved at this head)

AGENTS.md:231 requires graph-selection/scheduling-policy/timing-estimate changes to be reflected in docs/scheduling-runtime-design.md. Verified updated in this change set:

That resolves the Round-2/3 contradiction between the doc and the shipped batch == 1 gating. No leftover contradiction found in docs/scheduling-theory.md (no matches for packed/batch_capacity/one prefill) or docs/scheduling-utility.md (no matches for one prefill/at most one — packed cohorts compete on the same ValueRate, so the arithmetic is unchanged).


Gate 2 — Vendored upstream dependencies & cross-PR conflicts: PASS


Gate 3 — Mandatory verification evidence: FAIL (2 Majors); Layer 1, Layer 3 execution, and the Layer-3 geometry duty all PASS

Layer 1 — PASS

Round-1's failing-suite blocker is closed. The author reports the CI-matching invocation clean at 49d5840: FLARE_TEST_TEMPLATE_DIR=… cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features runtime-core,server → 1,918 lib + 62 integration, 0 failed, and at 4e3e2c3 → 1,919 lib + 62 integration, 0 failed. The earlier 6 failures are a documented prerequisite, not a defect: helios/README.md:168-176 states that frontend-gated tests "panic when [FLARE_TEST_TEMPLATE_DIR] is unset" and that .github/workflows/native-serving.yml (not opened) runs exactly that suite — so the requirement at docs/design-review.md:180-186 is met, not waived. The new Ignition guard carries a real runtime regression test, not a source-text check.

Layer 3 execution (TLC + Rust conformance + Kani) — PASS

.github/workflows/helios-lifecycle.yml:33-34 (not opened) runs python3 verification/helios-lifecycle/check.py --tlc-jar … and :48-49 runs cargo kani --manifest-path helios/Cargo.toml (not opened) --features runtime-core --lib; the workflow triggers on helios/** (:4-11), the change set touches helios/**, and CI is reported green. The in-crate conformance suites are also reported passing. The Round-1 "layer 3 not run" claim is withdrawn and does not carry forward.

Layer 3 widened-geometry duty — PASS (closed at this head)

docs/design-review.md:241-246 requires updating "the model, conformance fixture, or Kani harness" when supported geometries expand. That disjunction is now satisfied, verified directly:

M1. Layer 2: the simulator was extended, but the mandatory learning.py (not opened) timing catalog cannot exercise the change (Major)

docs/design-review.md:195-206 makes the simulator mandatory for cohort algorithms, and for timing estimation requires "running the screening and 64-seed validation catalog in scripts/scheduling_sim/learning.py (not opened)", closing with: "Do not diverge Helios from the simulator's qualified policy without updating and validating the rule across that catalog."

The selection half is genuinely implemented — I verified it rather than taking the comment's word:

The timing half is not covered, and the reported run is therefore vacuous for the changed rule:

So --preset screen (7×3×16) and --preset validate (62×3×64) were executed, but no configuration in either catalog contains a packed prefill graph, and the PR changes timing estimation twice over: a new cost key (helios/src/scheduler/cost.rs (not opened), packed_prefill_duration) plus batch == 1 gating of PrefillCostModel creation and context-slope refresh. Those are exactly the "timing estimation" changes :201-206 says must be validated across that catalog.

To clear: add packed-prefill scenarios to learning_scenarios.scenarios() (or a packed=True preset) and re-run --preset screen / --preset validate, reporting that the packed cohort/timing rule survives the 64-seed stationary, idle-transient, poisoned-observation, missing-timing, and recovery fixtures — or obtain recorded owner agreement that the flat-ReplayTimes packed timing rule is outside the learning catalog's qualified scope.

M2. The headline speedup has no attributable baseline (Major)

docs/design-review.md:106-115 (principle 12): "Performance claims require equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements."

The instrument is right — flare run on four GB10s across all ranks, with the pre-change 151-graph core 887785ad loading and serving on the updated binary — but the arms are different signed cores exported from different FlashInfer revisions: pre-change 887785ad vs packed 4aea5c54 exported against FlashInfer 5a8ceed80. The C=1 solo control moves 111.2 → 118.7 ms (0.94×), consistent with ~6% systematic overhead in the packed arm. The author discloses both facts in the PR body and again at 20:06 as outstanding, which is honest — the flaw is non-isolability, not concealment. But disclosure does not satisfy "equivalent baselines", so 1.68×–4.15× p95 TTFT and 1.75×–4.23× throughput must not be cited as a flag-only measurement of packed prefill.

To clear: one binary and one core, packed shapes off/on (or one core exported with and without the +6 packed shapes from the same FlashInfer revision), including the C=1 control.

Noted, not filed (anti-pedantry)


Gate 4 — Material scope / claim contradictions: PASS

No claim of a test, benchmark, or artifact that is absent from the work. The corpus is proportionate: ~186 lines of new/changed docs (docs/packed-prefill-design.md (not opened) +155, docs/scheduling-runtime-design.md +15/−9, model-contract.md +23, manifest.md (not opened) +8/−2) against ~+1,100 lines of tests across model/tests.rs (not opened) (+283), policy_tests.rs (not opened) (+328), lifecycle_tests.rs (+225), test_execution.py (not opened) (+67), test_scheduling_sim.py (not opened) (+31), execution/tests.rs (not opened) (+39). Nothing resembling thousands of lines of unrelated standalone tooling. The scripts/scheduling_sim/* and verification/helios-lifecycle/check.py changes are exactly the verification layers Gate 3 demands — in-scope by construction, not scope creep.

The Round-1/2 description defects are fixed: the stale helios/src/runtime_core/cache_memory.rs (not opened) bullet is gone, and no file named in the description is absent from the 33-file change set (verified against pr_files).


Closed or withdrawn since Rounds 1–3 (verified at 4e3e2c3, do not carry forward)

Earlier finding Status
Canonical scheduler doc contradicted shipped timing/catalog CLOSED — docs/scheduling-runtime-design.md:21-25,455-460,466-475 now documents packed prefill, cost-entry identity, and the batch == 1 scope of the stratified model, and links the design doc.
--packed-verification narrowed to speculative = undeclared public-CLI change CLOSED — declared in "What changed"; main's ignition/preparation/execution.py (not opened) already forbade nonzero packed_token_capacity on non-speculative kinds, so no previously valid recipe can now be rejected; docs/cli-design.md:765-766 documents only the speculative budget surface.
Ignition accepts P > prefill_chunk_size that Helios rejects CLOSED — ignition/preparation/model.py:32-39 now fails closed for both packed_token_capacity > prefill_chunk and a missing prefill_chunk_size, with a runtime regression test.
Required Layer-1 suites reported failing CLOSED — clean head run with FLARE_TEST_TEMPLATE_DIR set; failures were the documented helios/README.md:168-176 prerequisite and a stale local wheel.
Layer 3 TLC/Kani not run WITHDRAWN — CI runs both on helios/**; CI green.
Layer 3 widened-geometry fixture missing CLOSED — lifecycle_tests.rs:64-77,849-946 + check.py:18 prefix selection.
Layer 2 simulator blind to packed prefill CLOSED for selection — model.py:23-51, scheduler.py:11-58, workloads.py:9-18; residual gap is the learning catalog (M1).

Charter fit — PASS

docs/design-review.md:27-35,58-61 forbids hardcoded batch-capacity/graph-shape lists and supports_* flags in Helios. This PR reads all capacities from core metadata via Scheduler::packed_prefill_graphs (helios/src/scheduler.rs:889-918), validates only structural bounds through one shared valid_packed_prefill_geometry, adds no supports_*/can_* boolean and no power-of-two or bucket list, and keeps the opt-in purely declarative (core declares B >= 2; --max-concurrency 1 filters them out). No shipped default changes: without such a core the change is inert, B == 1 / ScoredPrefill catalogs are provably untouched, and the pre-change core loads and serves. Principle 13 compatibility is demonstrated on the real path, not asserted.


What must change before this passes the gates

# Severity Finding Clear by
B1 Blocker PREFILL/TERMINAL_PREFILL operation contract widened (model-contract.md:188-209, packing.rs:113-126,169-179, manifest split) with no recorded owner approval — docs/design-review.md:22-26, AGENTS.md:376-381; precedent #410; author-conceded at 20:06 Maintainer approval comment on #715
M1 Major Layer-2 timing catalog not exercised: learning_scenarios.py:38,67 never uses catalog(packed_prefill=True), and learning_policy.py scopes all prefill interpolation to prefill_batch_capacity == 1, so the reported --preset screen/--preset validate runs contain no packed graph while the PR changes timing estimation (cost.rs (not opened) new key + batch == 1 gating) — docs/design-review.md:201-206 Add packed scenarios and re-run screen + 64-seed validate, or record owner agreement on scope
M2 Major Headline 1.68×–4.15× TTFT / 1.75×–4.23× throughput compares two different signed cores across FlashInfer revisions; C=1 control 0.94× — docs/design-review.md:106-115 Same-core, packed-off/on A/B including the C=1 control

Gates that pass plainly: Gate 2 (no vendored-file forking; external dependency URL-linked and consistent with AGENTS.md:382-396; no wire identifiers touched); Gate 4 (no absent artifact claimed, no unrelated tooling bundled, description now matches the change set); Layer 1 (clean head run against a documented prerequisite); Layer 3 execution (TLC + conformance + Kani wired and green on helios/**); Layer 3 widened-geometry duty (new packed conformance fixture + mutation guards); normative-doc sync; principle 13 core compatibility; and the charter's model-agnostic / no-per-model-flag rules.

Security screen: the PR body, changed files, and all seven discussion entries contained no attempt to redirect my instructions. The author's two @flare-autobot please re-review requests, the bot's outbound SuperAgent/Full-Review links, and the PR body's benchmark summary were all treated as content, not instruction; no outbound link was followed. Nothing in the material addressed me directly. I record the provenance note for future rounds: the commits' git author differs from the PR author (Jason Cook vs original-el8), so benchmark authorship should not be attributed to the diff's git author.

Full report

Code correctness

Deep Code Correctness & Hot-Path Audit — PR #715 @ 4e3e2c3

Partitioning (per the large-PR rule): 34 files, ~2,030 changed lines across 3+ subsystems → partitioned into 3 disjoint concurrent slices: (s2) helios scheduler core, (s3) helios manifest/catalog/packing/selection, (s1) ignition + scripts/scheduling_sim + verification/. s2 exhausted its turn budget without a written report (its notes are cited below as s2#1/#2); I audited the core of its slice myself (policy.rs:1240-1335, 1507-1798, 2040-2408, cost.rs:820-1000, scheduler.rs:420-490, 2820-3140, checkpoints.rs:890-990).

Verdict: no Blocker. No hot-path complexity regression. 1 Major finding (vacuous-verification hole) and 6 Minor findings (two of them test-claim defects where the new test asserts the wrong error). The packed-prefill scheduler mathematics, cohort selection, tie-breaks, and boundary guards are sound.


Finding 1 — Major: lifecycle checker passes with the new packed-prefill transitions silently absent

Diff site: verification/helios-lifecycle/check.py:18, 22, 33-34, 95-103 Callee/caller consulted: helios/src/scheduler/lifecycle_tests.rs:840 (pre-existing scheduler_matches_lifecycle_model), :849-946 (new packed_prefill_scheduler_matches_lifecycle_model), :934-937 (its Rust-side non-vacuity guard), :939-945 (LIFECYCLE_EDGE / PACKED_PREFILL_LIFECYCLE_COVERAGE emission).

Verbatim (check.py:18,22,95-103):

TEST = "scheduler::lifecycle_tests::"
CHECKS = [("Lifecycle", TEST, "LIFECYCLE_EDGE ", 14),
...
def parse_observations(output, module, prefix, width):
    edges = [json.loads(line.removeprefix(prefix))
             for line in output.splitlines() if line.startswith(prefix)]
    if not edges:
        raise RuntimeError(f"{module} test produced no transitions")

The entire scheduler::lifecycle_tests:: suite is one cargo test filter and all LIFECYCLE_EDGE lines are merged into the single Lifecycle stream. The only guard that packed transitions were observed at all is the global non-empty check at line 98, which the unchanged scheduler_matches_lifecycle_model (lifecycle_tests.rs:840) always satisfies. The test's own non-vacuity assertion (lifecycle_tests.rs:934-937, packed_non_terminal && packed_terminal && cancel_during_packed && stale_packed_plan) lives inside the Rust test and is bypassed if that test is not selected.

Counterexample: rename the new test to packed_prefill_lifecycle_model (or narrow its #[cfg]). cargo test scheduler::lifecycle_tests:: -- --nocapture then matches one test, exits 0 with "1 passed", parse_observations sees only base-model edges, and run_observed_checks still prints "Checked N observed Rust transitions against Lifecycle.tla" — the checker green-lights the PR with zero packed-prefill coverage. Same hole for the CHECKPOINT_RESERVATION entry at check.py:33-34 (already a suite prefix).

Fix: make each Rust test its own observation source and assert non-emptiness per source, e.g. add ("PackedPrefill", "scheduler::lifecycle_tests::packed_prefill_scheduler_matches_lifecycle_model", "LIFECYCLE_EDGE ", 14); or parse the PACKED_PREFILL_LIFECYCLE_COVERAGE states=… edges=… line already emitted at lifecycle_tests.rs:941-945 and fail when edges == 0.


Finding 2 — Minor: the two new pack_step packing guards are unreachable, and the new test that claims to cover them asserts the scheduler's message instead

Diff site: helios/src/model/packing.rs:422-439; test: helios/src/model/tests.rs:2829-2853 Callee/caller consulted: helios/src/model/inputs.rs:35 (step.validate_mixed()?;) and :93 (inputs.pack(&frame)); helios/src/scheduler.rs:436-463.

if graph.kind.is_prefill() && graph.batch >= 2 {
    let mut total_tokens = 0usize;
    for lane in &frame.step.lanes {
        if lane.tokens > graph.tokens {
            return Err("packed prefill lane exceeds per-request token capacity".into());

ScheduledStep::validate_mixed (scheduler.rs:445-463) already rejects exactly these conditions:

.any(|lane| lane.tokens == 0 || lane.tokens > self.token_capacity)
...
.try_fold(0usize, |sum, lane| sum.checked_add(lane.tokens))
.is_none_or(|sum| sum > self.packed_token_capacity)

inputs.pack( appears only at model/inputs.rs:93, always after the validate_mixed() at model/inputs.rs:35, so packing.rs:426 and packing.rs:437 cannot fire. The new test nonetheless claims them:

let err = pack_inputs(&mut inputs, &cfg, &scheduler, &over_p, &admissions)
    .expect_err("packed prefill must enforce aggregate packed token capacity");
assert!(err.to_string()
    .contains("packed prefill lanes exceed their captured geometry"), ...);

That string is verbatim scheduler.rs:462, not either new packing.rs message — so the assertion passes because the packing guards never ran. (The genuinely live new packing guard, image-conditioned-lane rejection at packing.rs:429-431, is properly asserted at tests.rs:2855-2863.)

Counterexample: ScheduledStep { kind: TerminalPrefill, batch_capacity: 4, token_capacity: 128, packed_token_capacity: 256, lanes: [64,128,128] } → error raised at inputs.rs:35.

Fix: either add a test that calls Inputs::pack() on a hand-built InputStep so the packing guards actually run, or delete packing.rs:422-439 (keeping 429-431) so the duplicated invariant cannot drift.


Finding 3 — Minor: the "Reject P > prefill_chunk_size" catalog test is not isolated, and the manifest layer never enforces the chunk bound

Sites: helios/src/model/tests.rs:2710-2719; helios/src/model/catalog.rs:273-280; helios/src/execution/manifest.rs:449-467, 885-891; new test helios/src/execution/tests.rs:1405-1439.

// Reject P > prefill_chunk_size in catalog::validate.
let mut over_m = m.clone();
over_m.graphs.iter_mut()
    .find(|g| g.name == packed_graph.name).unwrap()
    .packed_token_capacity = 576;
assert!(catalog::validate(&cfg, &over_m).is_err());

Graph is B=4, W=128, cfg.limits.prefill_chunk_size = 512. 576 > B*W = 512, so the first geometry conjunct (manifest.rs:458, packed <= batch.saturating_mul(width)) already rejects it; the chunk clause is satisfied (512 <= 512). The case proves nothing about the clause it is labelled for. Separately, ExecutionManifest::validate passes max_chunk = None (manifest.rs:890) into the helper whose last conjunct is max_chunk.is_none_or(|chunk| packed <= chunk) (manifest.rs:465), so manifest-level validation accepts B=4,W=128,P=512 against prefill_chunk_size = 256; only catalog::validate rejects it. Latent (all serving paths go through catalog::validate — server/config.rs:214, server/runtime.rs:703), not a live hole.

Fix: change the test case to B=8, W=128, P=1024 with prefill_chunk_size = 512 (only the chunk clause can reject it), and either thread the chunk size into the manifest call or drop max_chunk for one enforcement point.


Finding 4 — Minor: both simulator geometry validators accept packed shapes Helios rejects

Sites: scripts/scheduling_sim/model.py:43-49 and identically scripts/scheduling_sim/timing.py:37-43

if self.prefill_batch_capacity >= 2:
    if not self.prefill_capacity or self.decode_capacity or self.width != 1:
        raise ValueError("packed prefill graphs must be prefill-only with width 1")
    if not (max(self.prefill_batch_capacity, self.prefill_capacity)
            <= self.packed_token_capacity
            <= self.prefill_batch_capacity * self.prefill_capacity):
        raise ValueError("invalid packed prefill token capacity")

Helios additionally requires packed >= 64, packed.is_multiple_of(64) (helios/src/execution/manifest.rs:464-465) and P <= prefill_chunk_size (:467); docs/packed-prefill-design.md:64 states "64-aligned".

Counterexample: Graph(..., prefill_capacity=64, prefill_batch_capacity=2, packed_token_capacity=100) passes the simulator (max(2,64)=64 <= 100 <= 128) and choose/run will model a (B=2,W=64,P=100) replay that Helios rejects (100 % 64 != 0). Likewise W=2,B=2,P=4 passes the sim but fails P >= 64.

Fix: add and self.packed_token_capacity >= 64 and self.packed_token_capacity % 64 == 0 to both __post_init__s.


Finding 5 — Minor: Ignition GraphSignature omits P <= prefill_chunk_size, so export succeeds and the core then fails to load

Sites: ignition/preparation/execution.py:80-92 vs ignition/preparation/model.py:32-39

80  if self.kind in ("prefill", "terminal_prefill") and self.batch_capacity >= 2:
81      if (not 2 <= self.batch_capacity <= MAX_CONCURRENCY
82              or self.packed_token_capacity < 64
83              or self.packed_token_capacity % 64
84              or self.packed_token_capacity >= 1 << 31
85              or self.token_capacity > self.packed_token_capacity
86              or not self.batch_capacity <= self.packed_token_capacity <= self.batch_capacity * self.token_capacity):

GraphSignature.__post_init__ has no access to the chunk; only PreparedModel (model.py:32-39) checks it. PreparedExecution owns manifest()/start_executor()/serve_rank() (execution.py:407-481) and is what tests/preparation/test_execution.py::_execution builds.

Counterexample: GraphSignature("terminal_prefill", 4, 256, packed_token_capacity=2048) with server_config["prefill_chunk_size"] = 512 → accepted by execution.py, manifest emitted at :426-427, rejected at Helios core load (catalog.rs:273 → manifest.rs:467).

Fix: validate in PreparedExecution.__init__ where the config is available, mirroring model.py:34-39.

Otherwise execution.py:78-96 is equivalent to valid_packed_prefill_geometry for B >= 2 (2 <= B <= MAX_CONCURRENCY, P >= 64, P % 64 == 0, P < 2**31, W <= P, B <= P <= B*W, all four vision binding names, and draft_tokens rejected more strictly than Helios — a superset, not a hole).


Finding 6 — Minor: direct mode keys B >= 2 prefill graphs but can never use them, failing at admission instead of at Layout construction

Site: ignition/direct/scheduler.py:200-201, 288-293, 320-327

200  elif signature.kind in ("prefill", "terminal_prefill") and signature.batch_capacity >= 2:
201      key += (signature.packed_token_capacity,)
290  if kind in ("prefill", "terminal_prefill"):
291      return sorted({key[2] for key in self.graphs if len(key) == 3 and key[0] == kind and key[1] == 1})

Key isolation is correct: a packed key is (kind,B,W,P) (len 4) and packed_shapes (:317-318) selects len 5, so packed prefill keys cannot alias solo (kind,B,W) or speculative (kind,B,W,P,D) keys. But capacities()/graph() never see the len-4 keys, and Layout.of accepts them without checking that solo B == 1 prefill also exists.

Counterexample: a model whose only prefill graphs are ("terminal_prefill", 4, 128, 512) → Layout.of builds fine; the first plan() hits prefill_kind → self.graph("prefill", tokens) and raises AdmissionError("no prepared prefill graph holds N") (:327) deep in direct execution.

Fix: raise in Layout.of when both capacities("prefill") and capacities("terminal_prefill") are empty but a B >= 2 prefill key exists.


Verified correct (audited against callee/enum definitions, no defect found)

select_packed_prefill_cohort (policy.rs:1518-1619) — sound. Verified against best_cohort (utility.rs:177-198), ValueRate (utility.rs:148-173), Candidate (policy.rs:116-131), REQUEST_LANES = 64.

packed_prefill_offers (policy.rs:1657-1721) — sound. continuation promoted/ready split (:1678-1700) matches following_kind (policy.rs:1043-1065) and eligible/request_kind (policy.rs:338-379) semantics; prefill_plans is threaded by &mut so PrefillSlotPlan caching (policy.rs:526-533) is shared across all packed shapes and the solo loop at :1877-1915 — no redundant recomputation, no per-shape Vec/HashMap allocation anywhere in the packed fast path (fixed [_; REQUEST_LANES] arrays and two sort_unstable_by over ≤64 elements per shape).

packed_prefill_lane_compatible (policy.rs:1723-1752) — sound. TerminalPrefill => true is intentional and pinned by PR test #3 (h1 at 256/300 stays in RequestPhase::Prefill per scheduler.rs:3078-3079). The Prefill branch (:1735-1751) mirrors resolve_prefill_kind (scheduler.rs:976-1007) without the solo terminal_prefill_catalog lookup — correct, because B >= 2 graphs are not in that catalog (scheduler.rs:886-916, runtime.rs:846-877).

fill_finishing_lanes refactor (policy.rs:1621-1655) — behavior-preserving. The extracted helper now also skips slots already in *selected (:1638), which is equivalent to the old other_slot == slot check at both call sites: the promo call site passes selected = 1 << slot (:1146), and both guard remaining_capacity == 0 (:1632) exactly like the old if capacity > 1.

is_unmeasured_candidate interaction (policy.rs:563-566, cost.rs:878-880) — sound. packed_prefill_duration returns Some(0) for a declared but unmeasured packed graph, and observation(...).and_then(|(_, observed, _)| observed) (:565) is still None because observed = (nanos != 0).then_some(...), so candidates() correctly routes it to PlanOrigin::Discovery. cost.rs:581/:969/:606 now gate refresh_prefill_context_slopes/PrefillCostModel on && key.batch == 1, which is required — prefill_context_slopes is [_; 3] indexed by prefill kind only, so a B >= 2 prefill key would otherwise pollute the solo context-slope peers.

ScheduledStep::validate_mixed packed branch (scheduler.rs:436-463) — correct and non-tautological. Rejects empty/oversized lanes, tokens == 0, tokens > token_capacity, sum > packed_token_capacity (with checked_add), duplicate request slots, and re-validates geometry via valid_packed_prefill_geometry(.., REQUEST_LANES, None). commit additionally rejects lanes.len() > batch_capacity (scheduler.rs:2615-2617).

valid_packed_prefill_geometry (manifest.rs:449-467) — correct. All four call sites traced (manifest.rs:889 → request_capacity(), catalog.rs:277 → usize::MAX sentinel, selection.rs:295 → REQUEST_LANES, scheduler.rs:906 → limits.request_slots). The usize::MAX sentinel is safe because request_capacity() == max_active.next_power_of_two() and max_active <= REQUEST_LANES == 64 is enforced at manifest.rs:733. B >= 2 with P == 0 is unsatisfiable (width > 0 && width <= packed && packed >= 64, :456-457); B == 1 with P != 0 is rejected at manifest.rs:895-900. saturating_mul/is_multiple_of are overflow-free.

packing.rs buffer sizing & offsets — correct. The packed_token_capacity != 0 arm (:169-188) sits after the Mixed arm and before is_prefill(), so Mixed and B == 1 prefill and Speculative are all unaffected. packed_offset advances with checked_mul/checked_add (:549-574); every write is bounded by input.elements. The new guard runs before self.staging.clear() (packing.rs:440), so a rejection leaves no partially-written state; pack() clears unconstrained_masks on any error. Vision rejection covers all four sources (ImageFeatureSlot, ImageFeatureIndex, ImageLeftContext, ImageRightContext, :109-126).

selection.rs --max-concurrency filter (:366-387) — correct. active < 2 ⇒ limit 0 drops every B >= 2 packed graph while leaving B == 1 prefill (limit max_batch >= active >= 1) intact; ScoredPrefill/Vision untouched; locating the graph at :280-300 is O(1) per graph, no new O(N²).

Simulator accounting (scripts/scheduling_sim/simulator.py:64-98, scheduler.py:11-58, 70-74) — sound and lockstep with Rust. A packed cohort decrements remaining_prefill once per lane, emitted derives from remaining_prefill == 0, prefill_tokens = prompt_tokens - remaining_prefill — no double counting of lanes or tokens. _select_packed_prefill_lanes matches select_packed_prefill_cohort on: <2 offers → None, two orders (value and value/token), per-lane min(remaining, W_req), reject when total + work > P, cap at B, require >= 2, same (total_value, lane_count, total_work) key. Off-by-one checks (== B vs >= B, > vs >= on P) match. And scheduler.candidates:70-74 skips packed graphs on the decode path so a packed shape never contributes decode rows.


Audit limitations (stated, not claimed as findings)

Full report Merge Risk: medium_high (100%): Medium or high merge risk (core runtime/scheduler/GPU/CUDA/VMM/RoCE/multi-rank/contracts/ABI, large multi-crate changes, or Blocker/Major findings) — route to Super Agent.

Re-review

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

Full report

Classify triage

Selected: (none)

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.

Classify intake

Selected: triage:review, performance, enhancement, area:scheduling

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

No label changes