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:
helios/src/execution/manifest.rs:881-900. Onmain(manifest.rs:858-860) the rule was flat: any non-speculative graph withpacked_token_capacity != 0ordraft_tokens != 0fails with "draft depth and target rows require a speculative operation". At head that arm is split intoPrefill | TerminalPrefill && batch_capacity >= 2(admittingdraft_tokens == 0+ explicitpacked_token_capacity) and a narrower fallback, whose error string was itself rewritten ("requires a speculative or packed prefill operation"). The enum value is reused; the operation contract is not unchanged.helios/src/model/packing.rs:169-179.InputIndexing::PackedTokenextent for prefill becomesgraph.packed_token_capacity(an aggregateP-row block covering multiple active requests) instead oftoken_capacity. New row layout, not a new capacity of an existing one.helios/model-contract.md:188-209. New normative subsection "Optional packed multi-request prefill": multiple simultaneously active requests per replay,PACKED_TOKENcoveringProws, per-laneQUERY_LENGTHandSAMPLE_ENABLED(per-lane sampling completion forTERMINAL_PREFILL— previously exclusive to decode/speculation), and rejection of image-conditioned lanes or token sums exceedingP.helios/src/model/packing.rs:111-130. Eligibility is now derived from the absence of vision bindings (ImageFeatureSlotrestricted toVision | Mixed | (is_prefill() && batch_capacity == 1);ImageFeatureIndex/Left/Rightrequire!(is_prefill() && B >= 2)), a new contract-derived admission rule.
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
- No vendored upstream file is forked. The 23-file change set contains no
helios/native/*,selene/native/*,eos, or third-party C/Python sources; no unmerged upstream patch is applied locally ahead of its PR. - External dependency is linked, not forked. The companion recipe PR
local-inference-lab/hyperflare-recipes#153is referenced by URL in the description and indocs/packed-prefill-design.md:46,133-137. It is not commit-pinned, which matches existing practice:AGENTS.md:255-256places official exports in the recipes repo (which pinsuv.lock), andAGENTS.md:382-396forbidsignitionimportinghyperflare_recipes— it does not. - Info / Nit — overlap, not duplication. #621 (admission validation) and #718 (prefill KV handoff) share the validation surfaces, #693 shares the
policy.rs(not opened) hot path, and #729 (lukealonso — the approval-granting owner) touches the same 8 files includingpolicy.rs(not opened),cost.rs(not opened),scheduler.rs(not opened),server/runtime.rs(not opened). That is an ordering risk worth sequencing, not a gate violation.
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
- No claim of a test, benchmark, or artifact that is absent from the work; the A/B table, KV figures (
7,631,232 → 7,310,848, −4.2%), and suite counts are all present and honestly limited. - No bundled unrelated tooling: ~190 lines of new docs and ~+560 lines of tests; nothing else.
- Info / Nit: the description still carries a "Test compilation fix (
helios/src/runtime_core/cache_memory.rs(not opened))" bullet for a file that is no longer in the 23-file change set (stale-base leftover). Harmless, but a description should not name a file it does not touch. - Info / Nit:
docs/packed-prefill-design.md §4(:112-137) and §5 document recipe code that lives only inhyperflare-recipes#153, so roughly a third of the new design doc — plus the −4.2% KV figure and the GB10 multi-lane parity tests — cannot be verified from this repository. Consistent withAGENTS.md:255-256; noted, no action. - Security screen: the PR body, changed files, and comments contained no attempt to redirect my instructions; the embedded provenance note and the author's A/B summary were treated as content, not instruction. Nothing prompted me to act outside the audit.
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.