Gates and contracts report · NVIDIA/hyperflare-inference #726

Raw Markdown for agents: https://autobot.eidonix.com/p/8b7ab63f-6f94-4a10-aa97-a00fa422c8a2.md

Contracts, Charter & Verification Gates Audit — PR #726

Scope: the 4 hard gates only. Algorithm correctness is out of scope. Everything below was verified against the head (60d1b6b) and against merged pr/721 where the PR's diff base makes inheritance ambiguous.


Gate 1 — Signed core-format / wire / captured-graph / public contracts

No new proto, wire, enum, or captured-graph operation contract is added by #726. pr_files shows 8 files, none under helios/proto/, heliopause/, or ignition/. The Memory enum (Device / MappedHost / Peer) is unchanged; only a derive is added (format.rs:51 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]), matching the +1/−1 in pr_files. No PreparedContract field changes. No owner-approval dependency under Principle 1.

Base-artifact warning for reviewers (not a defect): the rendered diff of format.rs shows ExternalExtentTable, Core.external_extents, validate_async_transfers, and ![0, 1, 2].contains(&s.capacity) — all of these already exist at merged pr/721 (helios/src/runtime_core/format.rs:15-21,35,316). None of them are #726's. Likewise prepare_async_transfers, PoolMemoryLimit, and map_device_pool in the mod.rs/model.rs hunks are inherited from merged #709/#711/#721. #726's true format.rs delta is the one-line derive, and its true runtime_core delta is the startup pipeline.

Major M1 — shipped default contradicts normative runtime/format design docs, with no doc update

docs/runtime-core-design.md:1006-1018 and docs/core-format-design.md:853-861 state the loader contract in specific, normative numbers, and #726 replaces all of them unconditionally (no flag, no opt-in):

Normative text #726 shipped default
"Each rank uses four file-reader threads and four pinned staging buffers of 4 MiB / rank_count" (runtime-core-design.md:1010-1011) READERS = 8, MAX_CHUNK = 8 MiB, MIN_CHUNK = 1 MiB (payload.rs:143-147)
"Total staging is 16 MiB plus at most one 4 KiB alignment block per buffer" (runtime-core-design.md:1011-1012); "Loading retains a process-wide 16 MiB pinned staging bound" (runtime-core-design.md:1095); "The staging bound is process-wide" (core-format-design.md:857-858) staging = MemAvailable / 200 clamped to 16–128 MiB, divided per rank (payload.rs:148-149,255-262)
"Host-resident payloads are copied from staging into their final mapped allocations" (runtime-core-design.md:1016-1017) zero-copy O_DIRECT pread direct into mapped host memory (payload.rs:355-401, push_span_chunks, load_mapped_host_chunks)

These are load-path invariants, not TODO bookkeeping: the 16 MiB process-wide staging bound and the staging-copy rule for host payloads are stated as design in two documents and are silently tripled-to-octupled on every core. Per Principle 10 / AGENTS "Use explicit configuration" the new sizes are also derived from environment (/proc/meminfo, /sys/dev/block/*/queue/optimal_io_size) rather than a recipe/config/flag setting, and choose_io_plan exposes no operator control. No documentation file is touched by this PR.

A related, smaller divergence: startup.rs:174-201 re-emits completed phases into normal flare run output with a " · overlapped" suffix appended to the detail, and Allocate model memory's detail now reads "… GiB GPU · … GiB host (overlapping)" in the overlap branch (model.rs:857-864). docs/cli-design.md:1589-1607 and docs/runtime-core-design.md:983-986 describe the stage rows without either; the #[cfg(test)] gate on StartupObservation::completed is also removed (startup.rs:110-125), so production builds now retain every completed snapshot. Undeclared in the PR body.

Major M2 — unconditional MADV_HUGEPAGE contradicts the documented host-mapping THP policy

helios/src/runtime_core/mod.rs:2260-2265 applies libc::madvise(mapped, span_bytes, libc::MADV_HUGEPAGE) with let _ = to every coalesced MappedHost span, with no sysfs policy probe and no fallback.

This is exactly the pattern docs/prefix-cache-offload.md:540-557 documents as not acceptable for host mappings: eos::map_host inspects /sys/kernel/mm/transparent_hugepage/{enabled,defrag,hpage_pmd_size} and deliberately avoids MADV_HUGEPAGE under policies that can trigger synchronous direct compaction, falling back to base pages when huge pages are scarce. That policy was introduced by merged #625 after #616 (a >15-minute host-cache preparation). Here the hazard is re-applied unconditionally to a much larger surface — the 316.6 GiB of MappedHost weights in the PR's own configuration — on a shipped default, and the PR body discloses it only as "coalesced, THP-hinted VMA preparation" and reports AnonHugePages: 94.0 GiB (up from 91.0 GiB) as a benefit. No maintainer decision on deviating from the #625 policy is recorded anywhere in the PR. (I am flagging the contradicted documented policy, not the docs/TODO.txt:1-6 bookkeeping entry.)


Gate 2 — Vendored upstream dependencies & cross-PR conflicts

Clean. No vendored upstream files are touched: no helios/native/roce_proxy.c (not opened), no FlashInfer pin change, no new crate. libc = "0.2.189" is already a pinned dependency (helios/Cargo.toml:50) and the PR reuses crate::os::{allocate_aligned, free_aligned, direct_reopen}. The PR depends on merged #709/#711/#721 and introduces no unmerged dependency without a reference — the body states the measurement build explicitly.

Info / Nit (explicitly not a Blocker): open draft #710 by the same author already contains this PR's coalesced-VMA / MADV_HUGEPAGE / ordered-2 MiB-pre-fault half; #726 neither references nor closes #710. That is PR-description overlap, not a vendored-file or contract violation. It should be resolved (declare an owner for the VMA work) but it is not a gate failure.


Gate 3 — Mandatory verification evidence

Blocker B1 — the performance claim has no attributable main-vs-branch served-workload A/B.

This is a real Layer-3 / Principle 12 failure, on the PR's own words: the 75.0 s → 45.5 s result was measured "via flare run on 1× NVIDIA GB300 (SM103) on the equivalent feat/gb300-tiered-runtime build prior to rebasing cleanly onto main". That means:

  1. It was not measured on the head 60d1b6b; the body itself says the rebased head has no per-phase numbers.
  2. The baseline is not main, but a stack branch that also carries #710's VMA/THP/pre-fault work, GB300 AOT compile-pool changes and scheduler hardening. Charter line 40 (#210) requires "benchmarks showing an actual speedup over main on a served workload", and AGENTS.md:100 requires distinguishing "isolated changes from combined-stack results" and "Never attribute a combined result to one PR."

Because the VMA/THP/pre-fault half is also present in #710 on that same branch, the PR's headline — attributed by the body to this change — is not separable from #710. Fix is cheap and mechanical: re-run the per-phase cold startup on 60d1b6b against main (same 552.1 GiB core, same 2× SN850X RAID0, same flare run path) and attach the raw output. Until then the claimed result cannot be checked.

Layer 1 (crate tests): satisfied as reported. helios --features runtime-core,server --lib 1,919 pass / 0 fail / 49 ignored; flare 255/0/4; flare-cli 250/0/3; clean release build. Matches .github/workflows/native-serving.yml (not opened)'s --locked --release matrix per crate, and the counts are internally consistent with #721's 1,904/6-failed (template-gated) run on a slightly older base.

No failing CI or failing tests are reported anywhere in the PR description or the Discovery Dossier — CI on 60d1b6b is pending, not failing, and I do not flag unobservable check runs.

Layer 3 formal/simulator checks: #726 does not touch admission, fences, generations, cancellation, speculation accounting, cache compaction, snapshot aliases, response ownership, offload aggregation, readiness, or rank coordination, and it changes no scheduling/graph-selection/pricing policy, so the TLA+/Kani/scheduling-simulator clauses do not trigger on this diff. The one adjacent reordering — allocate_caches/prepare_offload now run on a background thread and prepare_async_transfers runs at the end of load — is startup allocation ordering rather than lifecycle transitions, but note that docs/runtime-core-design.md:705-740 ties the pinned HOST_POOL clamp to the allocate_caches host ceiling, so a reviewer on the Code Correctness lens should confirm that ordering; it is not a formal-model gate hit.

Core-format gate: no format/wire change, so live export/re-export and legacy-core replay are not newly required; existing fixture replay is covered by the Layer 1 suite.


Gate 4 — Material scope / claim contradictions

Major M3 — the "6 new unit tests" count is wrong; 5 are new. The five genuinely new tests are payload.rs:989, payload.rs:1013, payload.rs:1071, mod.rs:2433, mod.rs:2460 (startup_overlap_tests). The sixth claimed test, model.rs::async_transfers_reject_peer_copy_graphs_at_load_time, already exists at merged pr/721 (helios/src/runtime_core/model.rs:1517) — verified directly at that ref. The evidence section presents it as new work for this PR.

No bundled unrelated tooling, no fabricated artifacts. All 8 changed files are in scope (server/config.rs (not opened)'s PreloadedFrontend/frontend_cache_key work is described in prose even though it is missing from the "What Changed" file inventory). No invented benchmark or test is claimed to exist that is absent from the diff — the sole miscount is M3.

Info / Nit: mod.rs:22 changes #[cfg(any(windows, test))] mod host; to pub mod host;, expanding helios's public API on all platforms; mod.rs:779 uses unreachable!("non-unix platforms always set host_vmm = true") on the non-Unix branch — an assertion, not a fallback, on the Windows path that the PR declares unexecuted on hardware. Both are worth a note in the PR body rather than a gate failure.


Verdict

Not mergeable as-is: 1 Blocker, 3 Majors.

Gate 2 is clean (no vendored files, no unmerged external dependencies, libc already pinned). #710 overlap and the pub mod host / unreachable! items are Info/Nit, not blockers.