Contracts, Charter & Verification-Gates Audit — PR #709 @ eb6c1e1
Verdict: two hard-gate violations (one Major, one Major-but-mechanical). No vendored-dependency, owner-approval, or mandatory-verification-gate blocker.
Gate 1 — Signed core-format / wire / captured-graph / public-contract boundaries
1a. No owner-approval gate triggered. docs/design-review.md:22-26 requires prior project-owner approval only for a new captured-graph operation family / operation contract. The PR adds none: no .proto change anywhere in the 19 files (helios/proto/runtime_core.proto (not opened) untouched), no new graph kind, op id, or buffer kind, and helios/src/model/contract.rs:182 (not opened) codec_layout is unchanged. Ignition's new CodecEncoding enum (ignition/preparation/contract.py:16-51) is an authoring-side Python enum whose values map 1:1 to the already-shipped Rust table in selene/src/shared/codec_layout.rs:17-31 — verified identical to the normative selene-manager/PROTOCOL.md:1119-1130 table (ids 0,1,2,20,32,40,41,42,45,47,48; block bytes 1/65 536/2/20/32/135 168/8 448/32 768/33 792/18 432/73 728; encoding 1 aligned to four bytes). No new wire kind or core-format field: packed v4 / raw v3 bytes are unchanged, and only who may use packed records changes.
1b. 🚩 MAJOR — contradicted normative doc left stale: docs/runtime-core-design.md:642-672.
The diff changes the structured SM split from two groups to three (plan_sm_split(..., reserve_codec_partition) at helios/src/runtime_core/persistent_worker.rs:77-160, codec_index: Option<usize> at :58, codec_context: Handle at :40, creation at :392, teardown at :453), and moves offload/pool registration to a new context (NativeResources::offload_context() at helios/src/runtime_core/mod.rs:1416-1421; model.rs:820-828 passes it to prepare_offload; memory.rs:1010 registration_context = self.ranks[0].context). The normative core-format/runtime-core spec still states:
:648-651— "partitions device SMs withcuDevSmResourceSplitinto two explicit structured SM resource groups (a worker green context … and a compute green context …)":652— "applies the core's recorded CUDA context limits and cache configuration to the primary context and both green contexts":670-671— teardown destroys "worker and compute streams, executables, modules, mappings, green contexts"
That is a documented invariant of core loading/teardown ("Resource teardown … only after context synchronization succeeds destroys worker and compute streams … green contexts") that the shipped default now contradicts whenever --lossless-kv-compression gpu is active on a persistent-worker core. Only docs/prefix-cache-offload.md:60-63 was updated; docs/runtime-core-design.md was not touched by the PR. Charter/design-review requires updating the contradicted normative document (or recording the deviation) — this is not a prose nuance: the same document specifies which context workloads are instantiated under (:653-658), which is exactly the behavior this PR redirects for offload and codec kernels. Fix: amend docs/runtime-core-design.md:642-672 (2-way vs 3-way split, codec_context existence/teardown, and the fact that modules/kernels/graphs remain under worker/compute contexts while GPU codec and offload streams bind the codec context, else the rank base context).
1c. 🚩 MAJOR — normative pool protocol changed behaviorally, selene-manager/PROTOCOL.md not updated.
selene-manager/PROTOCOL.md:1048-1063 ("Opaque checkpoint envelopes (revision 4)") is the normative statement of who may exchange packed records: caps are exchanged in OpenSession.codec/SessionOpened.codec/RankAttach.codec/RankAttached.codec (§1050-1055), and §1057-1060 defines claim/lookup packed-permission. The PR rewrites that policy: core.rs:645-651 (not opened) now negotiates codec = None whenever ranks.is_some(), store_bridge.rs:412 (not opened) refuses PutBegin.packed on sessions[&sid].ranks.is_some(), claims.rs:1181 (not opened) keys the PinAck refusal on world() > 1, and claims.rs:637-642 (not opened)/:922-929 plus lookup.rs:226 (not opened) gate permits_holding/permits_offer on requester/source shape. pr_diff for PROTOCOL returns "the pull request changes no file matching", and docs/same-process-tp.md has no compression/packed/codec content (unchanged). A reviewer following the normative protocol doc will conclude single-host TP≥2 ranks are refused for packed puts; the code now accepts them. Note the file does already name both profiles (§1105-1117) and the v4 disk header (§1072-1081), so the missing piece is specifically the multi-process vs single-host TP≥2 negotiation/exclusion rule. Fix: state in §13.1/§13.4-13.5 (or the revision-4 section) that a session with ranks negotiates raw-only, that packed holdings/offers are excluded for a multi-process requester or source while raw v3 stays claimable, and record it in the same place §1053 states the "identical capabilities" rule.
Not a gate violation but adjacent (Info): no docs/core-format-design.md / docs/scheduling-theory.md (not opened) / docs/scheduling-runtime-design.md (not opened) invariant is contradicted — those docs contain no codec/partition/green-context content (grep for codec|compress|partition|green in core-format-design.md: no matches; scheduling docs untouched by the change).
Gate 2 — Vendored upstream dependencies & unmerged cross-PR dependencies
Clean. No vendored upstream file is locally forked: no helios/native/*.c (e.g. roce_proxy.c (not opened)) in the changed-file list, no Cargo.toml (not opened)/Cargo.lock change in any of the 19 files, and no new crate or external source. The one external-input-looking addition is legitimate and in-repo: the #[ignore]d test at helios/src/runtime_core/persistent_worker.rs:2596 compiles ignition/preparation/kv_codec_gpu.cu from this repository. No dependency on an unmerged external PR: the only external references are two recipe repositories named in prose ("companion recipe PRs in local-inference-lab/hyperflare-recipes"), which are outside-repo beneficiaries, not build or test dependencies — nothing in the diff or tests requires them. The #698/#701 overlap with an open PR is a duplication/collision issue for maintainers (already in the dossier), not a vendored-file or pin violation.
Gate 3 — Mandatory verification evidence & failing tests
No falsified or failing evidence; one narrow evidence gap (Info/Major-lite, disclosed).
- Layer 3 (TLA+ + conformance) is satisfied, not skipped.
docs/design-review.md:209-240makespython3 verification/helios-lifecycle/check.py(not opened) mandatory for offload-aggregation/readiness/lifecycle changes and forbids disclosure as a substitute. The description reportscheck.py (not opened) --tlc-jar …: passed across all 8 TLA+ models … and Rust conformance tests. This is the re-review-round-specific evidence the calibration rules ask for; I am not flagging it. - Layer 1 is satisfied.
cargo test --locked --releasereported per crate: eos 12, selene 553, selene-manager 408 (+1 ignored; 12/12 intests/packed.rs(not opened) includingsingle_host_tp2_packed_put_stores_and_serves_over_shm_and_tcpatselene-manager/tests/packed.rs:1780(not opened),single_host_tp2_peer_dram_packed_export_succeeds_over_shm_and_tcpat:1857,multi_process_tp2_stays_raw_only_and_excludes_packed_recordsat:2015), helios--features runtime-core,server --lib1,835 passed / 48 ignored, flare 255, flare-cli 246, plus pytest 163 passed withFLARE_RUN_CUDA_TESTS=1. - No proto/core-format addition, so the "live export/serve + legacy core replay" gate (
docs/design-review.md:116-123) is not triggered. - No failing test or CI failure. The six chat-template failures are explicitly attributed to
FLARE_TEST_TEMPLATE_DIRbeing unset, and that variable is set in.github/workflows/native-serving.yml:59 (not opened),67,72,76— an environment gap on the author's host, not a regression, and correctly disclosed. I am not flagging CI (no observable failure oneb6c1e1; the description reports CI green). - Evidence for the headline claim is short of the charter bar but honestly labelled — report as Info, not a blocker.
AGENTS.md:106-115/design-review.md:107-112require performance claims to rest on "actual Helios service measurements" with equivalent baselines; the only number is a component CUDA test on SM120 (135,922.6 steps/s, 251 rounds, 266.4 MiB/s, 5.98×), and the served-workload outcome is stated as "Expected (whole-model / SM103) … pending live SM103 serving verification" with the unrun items listed under "Unrun checks and material limitations." Because the claim is marked expected rather than measured, this is a claim-strength observation, not a violation of the honesty requirement — the concrete ask is to keep the claim labelled until an SM103flare run --lossless-kv-compression gpuA/B atB>=2exists. - Minor, worth naming:
design-review.md:226-228asks for mutation testing when adding or changing safety guards, and this PR tightens/relaxes several (_validate_codec_encoding, the pool capability gating,close_store). Nocheck.py (not opened) --mutationsorcargo-mutantsrun is reported. I list it as a follow-up, not a blocker, since the TLA+ conformance suite was run. - Correctness note that removes a declared limitation: the dossier's "a
cpu-mode core that embeds GPU codec cubins would also reserve the third partition" concern does not survive readinghelios/src/runtime_core/model.rs:629-658—gpu_codec_cubinsis populated only whenoptions.prefix_cache.compression == KvCompression::Gpu, soreserve_codec_partition(model.rs:820-821) cannot be true incpu/offmode. The undeclared-risk framing should be dropped.
Gate 4 — Material scope / claim contradictions
No fabricated evidence. Every headline artifact in the description is present in the diff at the cited locations: tests/preparation/test_codec_layout.py (not opened) (+150, incl. the CodecEncoding table test at :75-87 and default_field_encoding test at :209), the three TP≥2 pool tests at selene-manager/tests/packed.rs:1780 (not opened)/1857/2015, the #[ignore]d 3-way Green Context CUDA test at persistent_worker.rs:2596 (with the offload_context() == codec_context assertion at :3004 and the #698 comment at :3008), and early_startup_close_store_preserves_drain_and_slab_retention_contract at helios/src/server/runtime/phase_tests.rs:2367. The close_store free function and method exist exactly where described (helios/src/server/runtime.rs:1172 and :1357, invoked at :706, :719, :783, :821) and offload::open at :683 now precedes RankExecutor::new at :699. No thousands-of-lines unrelated tooling.
Two scope observations (Info, per charter AGENTS.md:171-199 "keep each PR focused on one coherent outcome"):
- The visible
+2032/−137is roughly double the authored change because the branch base predates mergedmainwork (PR #697preserve_message_anchor, PR #689 typed-error test) that appears inhelios/src/server/runtime.rs,event_tests.rs(not opened) and most ofphase_tests.rs. Rebasing drops the inherited half — hygiene, not a gate. - Three independent outcomes are bundled (Ignition authoring, Selene pool policy, Helios CUDA scheduling). Not a hard violation, but the pool-policy part is the one that alters an already-merged safety posture (#612) and would review far faster on its own.
Also for maintainers (not a gate): #698 is the same startup-ordering fix and stays open; its review demanded the close_store ownership work this PR now contains, so the two will conflict textually and one must be closed as superseded.
Bottom line
- Gate 1: 🚩 Major —
docs/runtime-core-design.md:642-672still normatively describes a two-group SM split, "both green contexts", and contexts-teardown withoutcodec_context, while the shipped path is 3-way with a new offload/codec context. 🚩 Major —selene-manager/PROTOCOL.md(revision-4 envelope section, §1048-1063) is the normative packed-record permission rule and was not updated for raw-only multi-process negotiation and packed-holding exclusion. No owner-approval violation (no new op family / proto / wire kind). - Gate 2: ✅ Clean — no vendored fork, no unmerged-external dependency.
- Gate 3: ✅ No failing tests or CI failure; TLA+ (8 models + Rust conformance) and
--releaseLayer-1 suites reported. ⚠️ Info: nobody has a served-workloadmain-vs-branch A/B; the SM103/B≥2 result is honestly marked expected/pending rather than claimed. Minor follow-up: mutation run for the changed guards. - Gate 4: ✅ No invented evidence; every claimed test and benchmark artifact exists in the diff. Info: rebase to halve the diff, split the three outcomes.
Merging should be blocked on the two normative-doc updates (Gate 1) only; neither requires a design change to the implementation.