Contracts, Charter & Verification Gates Audit — PR #737 (46e6a3b)
Scope: only hard governance/contract/vendored-dependency/mandatory-verification gates. No algorithm-correctness findings (separate lens).
Verdict: no Blocker. Two Major findings (one verification-evidence gate, one contract-document contradiction), plus three Minor/Info notes. No chapter of the charter, core-format, wire, or captured-graph contract is structurally violated.
Gate 1 — Signed core / wire / captured-graph / public contract boundaries: PASS with one Major doc defect
No proto, core-format, signing, or captured-graph change. The 16 changed files contain no helios/proto/*.proto, no core.proto (not opened), no verification/helios-lifecycle schema change beyond the model, no helios/native/*. ExternalExtentTable is untouched (docs/core-format-design.md:224). PayloadDescriptor/signing domain separators untouched.
The new opcode is inside the already-approved subsystem, not a new captured-graph operation family. Opcode::DevToHost = 5 (helios/src/async_transfer/ring.rs:64, from_u32 :75, ValidatedCommand::DevToHost :259, validate_command :497-514). design-review.md:22-26 requires owner approval for a new captured-graph operation family; AsyncTransfer commands are a mapped-host control ring, not graph nodes, and main treating opcodes 1..=4 as an open enum domain means 5 is a shape/variant extension of an existing contract. Approval gate not triggered.
Backward compatibility verified as claimed. ABI_VERSION remains 1 (ring.rs:12), ControlHeader stays 256 bytes (:14), and an older runtime rejects value 5 cleanly through Opcode::from_u32.
Normative docs updated where contradicted. helios/manifest.md:170-230 gains DEV_TO_HOST (5), the demand/background stream split, cross-stream cuStreamWaitEvent slot reuse, and the drain-over-all-streams wording. docs/runtime-core-design.md:729-780 gains host-wide --pool-ram-memory, pinned.saturating_mul(discrete_ranks).div_ceil(512), worker-owned io_uring, and concurrent rank startup. No contradiction exists in docs/scheduling-theory.md (not opened) or docs/scheduling-runtime-design.md — neither mentions async transfer, HOST_POOL, or offload stream policy (grep returns no async-transfer reference in scheduling-runtime-design.md).
MAJOR — docs/cli-design.md contradicts itself on a shipped, operator-visible default in the same file the PR edits:
docs/cli-design.md:761(changed by this PR): "Per-host ceiling … (divided evenly across local discrete ranks)".docs/cli-design.md:1418(unchanged): "# pool_ram = "" # Per-rank ceiling for pinned AsyncTransfer host pools".
This is not a phrasing nit: the semantics genuinely changed for existing multi-rank users. On main, async_transfer_host_ram divided host_pool_budget_and_total(host_future) (implicit Selene reserve always applied) by discrete_ranks before --pool-ram-memory was applied, so -8G meant 8 GiB per rank. At head, helios/src/runtime_core/memory.rs:113-131 applies the MemoryLimit::Reserve host-wide and subtracts the aggregate bounce before dividing (:118-124), so -8G now means 8 GiB per host. --pool-ram-memory 64G becomes 8 GiB/rank on 8 ranks. The same PR updates the flag table but not the flare.toml (not opened) sample that operators copy, leaving two contradictory authoritative statements about one flag. docs/cli-design.md is the CLI contract, so this is a contract-document defect, not pedantry. Fix: update :1418 to "Per-host ceiling (divided across local discrete ranks)". (--help at flare-cli/src/cli.rs:961-962 already said "Per-host", so no CLI-text change is required.)
Nothing else in Gate 1: no normative invariant in scheduling-theory.md (not opened) / scheduling-runtime-design.md / core-format-design.md is contradicted on a shipped default, and no supports_*/can_* model-allowlist flag was added (design-review.md:58-61).
Gate 2 — Vendored upstream dependencies and cross-PR pinning: PASS
- No vendored upstream file is forked.
helios/native/roce_proxy.c(not opened) (theROCE_ABI_VERSION 14vendored proxy) is untouched; the diff touches nohelios/native/path, andPROXY_ABI/roce_abi_versionare unchanged. - No new dependencies. Everything added is via the existing dynamic-driver table (
helios/src/runtime_core/driver.rs:cuCtxGetStreamPriorityRange,cuStreamCreateWithPriority,cuStreamWaitEvent,cuMemcpyDtoHAsync_v2), which is the repository's standard mechanism. NoCargo.toml(not opened) change in the file list. - The external dependency points the right way. The
local-inference-lab/hyperflare-recipescompanion PR is downstream (its consumer depends on this ABI), and the description states the required merge order explicitly ("Merge this PR before the companion recipes PR"), which is exactly whatAGENTS.md:126-128requires for stacked work. Nothing here consumes an unmerged upstream or an unpinned external artifact. - Info (not a violation): no in-repo producer emits opcode 5 (
helios/manifest.md,ring.rs, and the worker tests are the only references); the graph-side consumer lives in the companion recipes repository. That is a demand-evidence question, already covered by the Value lens, not a vendored-dependency violation.
Gate 3 — Mandatory verification evidence and failing tests: one Major
TLA+ layer: satisfied (Round-1 evidence, not re-flagged). verification/helios-lifecycle/AsyncTransfer.tla:158-186 adds DispatchD2h/CompleteD2h/MarkD2hFaulted; the projection grows to 20 (:336-341), matching AsyncTransfer.cfg:6 (MaxD2h = 1), verification/helios-lifecycle/check.py (ASYNC_TRANSFER_EDGE …, 20), and helios/src/async_transfer/lifecycle_tests.rs (type Projection = [i64; 20], with_max_d2h). New TLA+ and Rust mutations cover the D2H drain gate and the hardware-signaled D2H sentinel (check.py additions). The model was run per the description (check.py --tlc-jar … --mutations, exit 0, 1,847,851 generated / 125,668 distinct states, 4,410 observed transitions, 64/64 mutations). DEFAULT_MAX_D2H = 2 (worker.rs:52) vs modelled MaxD2h = 1 follows the model's existing convention (MaxTotalDma = 2 vs runtime DEFAULT_MAX_TOTAL_DMA = 16, MaxBgDma = 1 vs 4), so it is not an "aligned bounds" violation — design-review.md:241-246 is aimed at protocol states the model cannot reach at all, and D2h states are all reachable at MaxD2h = 1. Info only.
Kani: not flagged. kani_proofs.rs:199-217 adds the ValidatedCommand::DevToHost arm, and docs/design-review.md:247-251 treats an unrun applicable Kani proof as blocking. The author discloses cargo-kani is unavailable locally. The repository CI runs exactly this proof set — .github/workflows/helios-lifecycle.yml:49 (not opened) executes cargo kani --manifest-path helios/Cargo.toml (not opened) --features runtime-core --lib, which compiles async_transfer::kani_proofs (helios/src/async_transfer/mod.rs:11-12) behind #[cfg(kani)]. Per calibration I do not flag an unobservable Actions result, and the PR reports no Kani failure; the gate is dischargeable on CI rather than structurally missing.
Crate tests: satisfied as reported. --locked --release runs for eos, selene, selene-manager, flare, flare-cli, targeted helios async_transfer:: / runtime_core::memory:: / runtime_core::model:: (60/60 under RUSTFLAGS="-D warnings"), full helios --lib (1,973) and integration targets. The 6 disclosed failures are helios --lib frontend-template tests failing on an HTTP 403 while fetching an unrelated Hugging Face model through tests/frontend/prepare_templates.py (not opened) — hermeticity, unrelated to this diff, same disclosure pattern as #727. Not a failing-test gate failure on this change's paths, and the PR reports no CI failure.
MAJOR — the performance claim does not satisfy the mandatory evidence rule. The headline "cross-rank demand-stall spread >5,000 ms → 1,202 ms" (37.75–38.95 s across 8 ranks) has no baseline commit or main revision, no raw log, and no per-rank table; it is a single isolated run. Worse, it is not attributable to the claimed mechanism: the same PR halves per-channel NVMe read concurrency — DEFAULT_MAX_TOTAL_IO 32 → 16 and DEFAULT_MAX_BG_IO 8 → 4 (helios/src/async_transfer/worker.rs:48-49) — and adds a 50 ms active spin window (worker.rs:43), both of which independently change the measured stall spread. docs/design-review.md:106-115 requires "equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements … keep raw measurements", and the charter requires a benchmark showing a speedup over main on a served workload. A combined-effect number presented as the effect of DEFER_TASKRUN fails that rule. Either attach the baseline commit, the raw per-rank stall data and the configuration for a main-vs-branch A/B, or drop the quantitative claim and state the change as expected rather than measured. The 2,198,299-transfer, 0-error, 9.1 s-drain 8-GPU smoke run is likewise self-reported with no log attached, so the cross-rank execution evidence (design-review.md:252-259) is asserted but unattributable.
Gate 4 — Material scope and claim contradictions: one Major (disclosure), nothing else
MAJOR — the description omits material numerical and resource changes, against the required-description contract. AGENTS.md:92-94 requires the "what changed" section to "Identify material numerical, compatibility, and resource-lifetime changes." Undeclared in the description: (a) per-channel IO depth halving, DEFAULT_MAX_TOTAL_IO 32 → 16 and DEFAULT_MAX_BG_IO 8 → 4 (worker.rs:48-49) — directly entangled with the PR's own NVMe argument; (b) pinned bounce footprint growth: bounce_pool_geometry now returns (MAX_BOUNCE_POOL_BYTES / slot_bytes).clamp(16, 32) (worker.rs:93-94) with MAX_BOUNCE_SLOTS = 32 (:54), so 16 MiB extents pin 32 × 16 MiB = 512 MiB per channel instead of 256 MiB; (c) new DEFAULT_MAX_D2H = 2 (:52). The description's five "what changed" bullets are otherwise accurate — I verified the budget math in helios/src/runtime_core/memory.rs:75-164 (-8G → 8 GiB host-wide; 64G → host-wide then ÷ ranks = 8 GiB/rank on 8 ranks; under MemoryLimit::Reserve the aggregate bounce is subtracted before the reserve so the requested free reserve is preserved: host_bounce = total_bounce * ranks, host_cap = available - host_bounce - reserve, then / ranks), the Selene helper (selene/src/offload.rs:979-988, host_pool_budget still forwards with apply_reserve = true, so existing callers are behaviour-preserving), the peer-UVA page-table charge (pinned.saturating_mul(ranks).div_ceil(512) on discrete only, integrated unchanged), and the concurrent rank startup (helios/src/runtime_core/model.rs:1080-1110, std::thread::scope with first-error propagation). No claim of a test or benchmark that is absent from the diff; no unrelated tooling bundle; +1769/−268 matches the file list.
MINOR — the lifecycle verification README was not updated with the model it documents. docs/verification.md:118-119 requires the check documentation to "Document the functions, state projection, bounds, and external contracts needed to interpret the check." verification/helios-lifecycle/README.md:353-384 still states a "16-integer projection", lists bounds without MaxD2h, and enumerates the driven transitions without dispatch_d2h, complete_d2h or mark_d2h_faulted — every one of which this PR changes. The model, cfg, check.py and Rust fixture are all updated; only their human-readable specification is stale, so the next reviewer reading the README will be told the wrong projection width.
MINOR — the published metric contract does not describe the new traffic. docs/api.md:417-429 enumerates the flare_async_transfer_* series and includes only bytes_disk_to_host, bytes_host_to_dev and bytes_disk_to_dev; ControlHeader likewise (ring.rs:200-204), and complete_d2h/mark_d2h_faulted zero all three (scheduler.rs:994-996 (not opened), :1021-1023) while mark_d2h_faulted publishes an error sentinel. The doc is consistent with the code, so this is not a contradiction — but full-duplex D2H bytes and D2H failures are now invisible in the documented metric surface, and that gap should either be documented or closed with a D2H counter.
Info / Nit — open #726 restructures the same prepare_async_transfers (model.rs:1080-1110) that this PR parallelizes; merge order needs settling, with no contract gate of its own.
Required before merge
- Fix the
--pool-ram-memorycontradiction:docs/cli-design.md:1418must say per-host (divided across local discrete ranks), matching:761. - Make the stall-spread claim attributable — baseline commit, raw per-rank data and configuration for a
main-vs-branch A/B — or demote it to an expectation, and disclose the IO-depth halving, the up-to-512-MiB bounce increase andDEFAULT_MAX_D2H = 2in the description. - Update
verification/helios-lifecycle/README.md:353-384to the 20-integer projection,MaxD2h, and the three D2H transitions. - Confirm the CI
kanijob passes on this head (.github/workflows/helios-lifecycle.yml:49(not opened)), sincedocs/design-review.md:247-251makes it blocking, and add a D2H byte/failure counter or document its absence indocs/api.md.