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:
helios/model-contract.md:188-209— a new normative subsection "Optional packed multi-request prefill" under contract version 3: multiple simultaneously active requests per replay,PACKED_TOKENcoveringProws, and per-laneQUERY_LENGTHandSAMPLE_ENABLEDso each lane samples independently on reaching its own prompt end. Per-lane completion semantics on a prefill graph were previously exclusive to decode/speculation.helios/src/model/packing.rs:169-179— forB >= 2prefill theInputIndexing::PackedTokenextent becomesgraph.packed_token_capacity(an aggregate multi-request row block), nottoken_capacity. New row layout, not a new capacity of an existing one.helios/src/model/packing.rs:113-126— eligibility is now derived from the absence of vision bindings:ImageFeatureSlotis conditioned onmatches!(kind, Vision | Mixed) || (kind.is_prefill() && batch_capacity == 1), andImageFeatureIndex | ImageLeftContext | ImageRightContextnow require!(kind.is_prefill() && batch_capacity >= 2). A new contract-derived admission rule.helios/src/execution/manifest.rs(not opened) /helios/src/scheduler.rs:889-918— the previously flat rule "any non-speculative graph withpacked_token_capacity != 0is rejected" is split to admitPrefill | TerminalPrefillatB >= 2withdraft_tokens == 0, through the new sharedcrate::execution::valid_packed_prefill_geometry(re-exported athelios/src/execution.rs:10(not opened), consumed atscheduler.rs:439and:902).
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:
docs/scheduling-runtime-design.md:21-25— the native catalog now reads "solo and optional packed multi-request prefill" and linkspacked-prefill-design.md(not opened).docs/scheduling-runtime-design.md:455-460— cost-entry identity now includes "packed token capacity (packed verification or packed multi-request prefill)".docs/scheduling-runtime-design.md:466-475— the six-stratumPrefillCostModelis now scoped to "solo (batch == 1)" pure prefill, with "Packed multi-request prefill graphs (batch >= 2) use the same flat nine-sample rolling median as non-prefill graphs rather than single-lane context stratification."
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
- No vendored upstream file is forked. None of the 33 changed files is under
helios/native/*,selene*/native,eos, or third-party C/Python sources; no unmerged upstream patch is applied locally ahead of its PR. - No core-format/wire change requiring identifier reservation.
packed_token_capacityalready existed on the descriptor for speculative verification; no protobuf/schema file is in the change set, so no wire identifier duty is triggered. - 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(not opened). This matches existing practice (AGENTS.md:382-396places official exports in the recipes repo, which pinsuv.lock; coreignitionmust not importhyperflare_recipes, and it does not). - Overlap is not duplication. #729 (owner-authored, same 8 files incl.
policy.rs(not opened)/cost.rs(not opened)/scheduler.rs), #621, #693, #718 share files but not the feature. Recorded asInfo / Nitordering risk only.
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:
helios/src/scheduler/lifecycle_tests.rs:64-77—Fixture::new_packed_prefill()registers real(Prefill, 2, 256, 512)and(TerminalPrefill, 2, 256, 512)packed shapes alongside theB == 1catalogs.helios/src/scheduler/lifecycle_tests.rs:849-946—packed_prefill_scheduler_matches_lifecycle_modelexplores to depth 7 and asserts four distinct packed properties are reached:packed_non_terminal,packed_terminal,cancel_during_packed, andstale_packed_plan(the last also assertingcommitrejects the stale plan and the state key is unchanged). A hard assertion, not a smoke test.verification/helios-lifecycle/check.py:18now selects the whole module (TEST = "scheduler::lifecycle_tests::") with--exactsuppressed for prefixes (:185,:255), so both lifecycle tests feedLifecycle.tla.helios/src/model/packing.rs:422-439andhelios/src/scheduler.rs:436-463(the new guards) are now targeted by three mutation guards atcheck.py:748-801.
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:
scripts/scheduling_sim/model.py:23-51addsprefill_batch_capacity/packed_token_capacitywith mirroring validation (max(B, W) <= P <= B*W, prefill-only, width 1).scripts/scheduling_sim/scheduler.py:11-58adds_select_packed_prefill_lanes, a real two-order (by_density in (False, True)) greedy under both theprefill_batch_capacityandpacked_token_capacitybudgets, with a deterministic tie-break — structurally mirroringRequestScheduler::select_packed_prefill_cohort.scripts/scheduling_sim/workloads.py:9-18addscatalog(packed_prefill=True), andtests/test_scheduling_sim.py(not opened) (+31) covers it.
The timing half is not covered, and the reported run is therefore vacuous for the changed rule:
scripts/scheduling_sim/learning_scenarios.py:38usescatalog()and:67usescatalog(mixed=True)— nopacked_prefill=Trueanywhere inscenarios().catalog(has exactly those two call sites in the whole directory.scripts/scheduling_sim/learning_policy.pyconsequently guards every prefill interpolation/borrow path onprefill_batch_capacity == 1(:189,:192,:204,:211,:222,:317,:324).
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)
check.py --mutationsis manual-only in CI..github/workflows/helios-lifecycle.yml:34(not opened) invokescheck.pywithout--mutations, which is opt-in atcheck.py:299. Butdocs/design-review.md:226-228requires running mutation testing when safety guards change, not wiring it into CI, and the author reports all three new mutations detected on the idle worktree. Requirement met →Info / Nit(CI wiring would be an improvement, not a gate).- Kani not extended to
valid_packed_prefill_geometry.helios/src/model/kani_proofs.rs:145-182still holds only the two completion accept/reject proofs, andvalidate_completion(helios/src/model.rs:374(not opened)) is not in the change set, so the:221-225triggers are not directly hit. The new geometry predicate is a sequential validator over an input domain, and a proof would be valuable — but:241-246's duty is a disjunction already met by the conformance fixture.Info / Nit. - The three synthetic simulator burst figures (1.73×/2.06×/1.37×) come from a
gb10_catalogplus ad-hocpacked-b4-w512-p2048/packed-b8-w512-p4096graphs that are not in the committedgb10_catalog(workloads.py:65-98has no packed graphs), so they are not reproducible from committed scenarios.docs/design-review.md:207-208already states simulator results do not establish GPU performance, so these are not gate-bearing.Info / Nit(tied to M1's fix).
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.