Explore report · NVIDIA/hyperflare-inference #727

Raw Markdown for agents: https://autobot.eidonix.com/p/92b39541-4170-4abb-bf8b-981af4084bae.md

Case file — PR #727: helios: gate PCIe peer-access graphs and fix teardown, AsyncTransfer, and startup drain races

Link: https://github.com/NVIDIA/hyperflare-inference/pull/727 · Fixes #722 · Head 224fb40, base main (branched at cc0a49d) · open, ready for review, opened and last updated 2026-12-04 · 16 files, +1973/−221 · no labels, no reviews, CI pending.

Key findings

  1. It is a same-day self-follow-up, and part of it fixes code merged hours earlier. #727 rewrites four things introduced by #721 (merged 2026-12-04, same author, 11 files in common): the SQE flush path, the DMA fault sentinel, the async_transfer peer-copy guard, and #721's own two-phase teardown. The Prometheus wrong-rank-label defect that #727 "fixes" was introduced by #721 — #721's metrics.rs already used .enumerate() for the rank label (pr/721 server/metrics.rs:1557); #727 changes it to let rank = s.rank (helios/src/server/metrics.rs:1567). Likewise the peer_copy_graphs predicate that #722 attacks came from #628 (merged), which #727 narrows and re-uses rather than replaces.
  2. The live "measured" evidence is not the #722 reproduction. #722 hung at 32,768-token inputs with concurrency 4, --prefix-cache-memory 256G, --scheduler-policy balanced, on a 177-graph/rank core where 145 graphs were ungated. The PR's live run used ~13k-token requests, 20 concurrent, --prefix-cache-memory 4G, and a different exported core with 135 graphs/rank. The deadlock class is plausibly the same; the workload is not (#2, #7).
  3. The watchdog's remedy is a bounded std::process::abort(), not recovery — RankWedgeWatchdog fires after TIMEOUT + 30 s (≈150 s) and calls std::process::abort() (helios/src/execution/threaded.rs:23-25, :547-753, abort at :1027). The description says it "bounds wedged-rank hangs", which is accurate but does not say the process dies. This is a mitigation above #722's root cause, which is worth reading against the charter's "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error".
  4. Detection correctness for the #722 case rests on the reporter's graph inventory plus one live run, not on a test. The copy_gate_policy_* tests exercise only a pure function of synthetic booleans (helios/src/runtime_core/model.rs:1653+); the author states no core combining Execution.async_transfers without Node::Copy(Memory::Peer) existed locally, and that the local TP2 core was rejected at load as intended.
  5. Behaviour changes operators can see: more graphs take the CopyEngineGate on single-host PCIe multi-rank hosts without all-pairs NVLink (NVLink exemptions via NVML P2P_CAPS_INDEX_NVLINK, model.rs:132-174); flare_async_transfer_* rank label semantics change (flat local index → true global rank id); a failed rank drain now deliberately leaks CUDA/host resources until process exit instead of freeing them; peer FinishStartup failures now drain + error instead of unconditionally aborting.
  6. Reported by an outsider, on a release, fixed by the person who wrote the broken code. #722 is from egtoken-ai (Discord maxKonger) on flare 0.5.3, labelled bug / priority:P1; the reporter has not commented on #727, so the "fixes #722" claim is unacknowledged by the reporter. The author (lukealonso) is a charter-named priority contributor and, per the orientation packet, the only recent contributor in these files.

The change — what it does, in plain terms

Four logically independent defect clusters in one PR, on largely disjoint file sets:

1. PCIe peer-access gate (runtime_core + payload + docs). NativeResources used to flag graphs only for explicit Node::Copy with a Memory::Peer endpoint. It now records two vectors: peer_copy_graphs (strictly peer copies) and peer_access_graphs (peer copies, peer memsets, kernel argument/attribute relocations or inline fixed addresses into peer or peer-pointer-table allocations, peer-referencing module globals) — fields at helios/src/runtime_core/mod.rs:115-134, classification in node_peer_usage() (mod.rs:278, push at :1479), with the Node::Copy-only accessor kept for AsyncTransfer (:1597-1614). A pure policy decides gating: copy_gate_policy(local_ranks, all_nvlink, has_peer_copy_nodes, has_peer_access_graphs); enable_gate = has_peer_copy_nodes || (gate_peer_access && has_peer_access_graphs), gate_peer_access = local_ranks > 1 && !all_nvlink (model.rs:166-174), with all_nvlink_p2p from a pairwise NVML query (model.rs:132-165). Because the strict predicate is still what validate_async_transfer_peer_copy_compatibility uses (model.rs:181-204, called at model.rs:118-120, unit test model.rs:1613-1641), NVLink SM-P2P / kernel-P2P async_transfers cores are not falsely rejected by the widened gate. payload::load gained a scan that aligns per-rank chunk boundaries to 8 bytes (((CHUNK / ranks) & !7).max(8)) and flags allocations whose 8-byte-aligned stored words land inside a Memory::Peer interval (i.e. indirect peer-pointer tables such as rank_data) — payload.rs load() plus contains_interval_address/merge_sorted_intervals/peer_address_intervals/collect_peer_referencing_allocations helpers in mod.rs. Note this scan reads every 8-byte word of every allocation that has any peer interval, which is a load-time cost the description does not quantify.

2. Three-phase cross-rank teardown barrier (runtime_core/model + mod). stop_rank_workers evaluates both worker stops without || short-circuiting (mod.rs:2035-2042, test :2541-2567). teardown_model_ranks (model.rs:1275-~1310) runs phase 1 = drain workers + cuCtxSynchronize on every rank (drain_execution_context, mod.rs:2051-2079), phase 2 = join engram.clear() and offload.reset() while MappedHost mailboxes and contexts are live, then destroy_execution_resources per rank (mod.rs:2084-2140), phase 3 = destroy green contexts/VA reservations/primary contexts in reverse rank order. If any drain fails, all later phases abort and NativeModel::drop retains offload/engram/ranks (deliberate leak until process exit) — tests model.rs:1670, :1709. This replaces the two-phase structure #721 had introduced (release_execution_resources, pr/721 mod.rs:1530-1600).

3. AsyncTransfer SQE flush, hardware-signaled faulted DMA, true rank labels (+ TLA+). IoUringBackend::flush() now retries EINTR, drains partial submissions via flush_queued_sqes, and exposes pending_submissions() (io_backend.rs:146-161, :181-188); the worker flushes when submitted_io || pending_submissions() > 0. InflightIo tracks flushed; InflightDma/PendingEventDma/UntrackedFaultedDma track hardware_signaled (scheduler.rs:123, :708-742) so a fault after cuStreamWriteValue64_v2 was queued never overwrites a completion slot with COMPLETION_ERROR_BIT | error_code. ChannelConfig/AsyncTransferSnapshot carry true global rank ids rendered in server/metrics.rs:1566-1567. verification/helios-lifecycle/AsyncTransfer.tla grows to a 16-integer projection with FlushIo/UnflushedIoBounded and hwSignaledFaulted/HwSignaledFaultedSafe (+52/−8), plus cfg/README/check.py (not opened).

4. Startup drain handshake + rank-wedge watchdog (execution/threaded). Reply::Started now carries Result<()> (threaded.rs:1355-1356, :1431, :1435); a peer whose finish_startup fails stays in run_startup_phase to answer Command::Drain -> Reply::Drained (:1409-1445), so cleanup_failed_startup no longer reaches std::process::abort() (:1374-1405). best_effort_drain_peers uses one shared deadline (:1292-1308). RankWedgeWatchdog (:547-753, spawned :1015-1029) watches busy/closing/peer-exit stalls with zero activity-counter change using Condvar::wait_while, and aborts the process on a wedge.

Said but not done / done but not said. Everything the description lists is present in the 16 changed files (verified against pr_files and the head). Not mentioned: (a) the watchdog terminates via std::process::abort(); (b) the rank Prometheus label semantics change for existing scrapers; (c) the load-time scan cost noted above; (d) two CI workflow edits (helios-lifecycle.yml (not opened) cargo test --lib --no-run; native-serving.yml (not opened) native RoCE transport test) appear in the raw diff but are not in pr_files — most likely base drift from another PR rather than #727's own change, so attribution is unverified. Tooling caveat: the local main ref is stale (no helios/src/async_transfer, no PoolMemoryLimit/host_vmm), so the raw per-file diff includes drift from #669/#711/#721/#709; worker.rs even shows as a "new file". Only pr_files and comparison against pr/721 are trustworthy for scoping.

The why

Sole motivating report: issue #722, "helios: TP4 serving hangs under --prefix-cache-memory on SM120 PCIe; CopyEngineGate leaves 145/177 DeepSeek-V4.1-Flash graphs ungated", opened 2026-12-04 by egtoken-ai (Discord maxKonger), labels bug / performance / priority:P1 / triage:investigate, still open.

Recent activity

The repository's own history tooling is broken for these refs — search_history returns git: error: Could not read c513e46a79f3b6ac510235aaf09bcf055b841958 / cannot simplify commit ef38cb… for every path/ref tried, including pr/727; the orientation packet's per-area commit lists are likewise "not available" and it reports "People in these areas: no commits in these areas in the last 180 days". Commit-level history therefore could not be read; the reconstruction below comes from comparing pr/727 with pr/721, pr/723, and the packet's related-items list.

Established: helios/src/async_transfer/* saw three passes in ~24 h — #711 created the runtime, #721 hardened startup/DMA/teardown, #727 fixes the flush/sentinel/metrics gaps. runtime_core/model.rs + mod.rs: #628 introduced the gate wiring, #721 rewrote teardown into two phases, #727 rewrites into three and splits the gate predicate — so #727 partially reverses #721's structure while narrowing #628's predicate. verification/helios-lifecycle is being kept in lockstep with the Rust by the same author. No default-branch commits since branching are said to touch these files (could not be re-verified; local main is stale).

People

Community

Nothing. Zero comments, zero reviews, zero reactions, zero labels; CI pending on 224fb40; no linked discussion thread. #722's own discussion is empty; its Discord handle is the only outside voice on the problem. The "fixes #722" claim is unacknowledged by the reporter.

Project fit (charter and docs)

Claims and evidence

Claim Backing Gap
Prevents single-host PCIe TP≥2 CopyEngineGate deadlocks for kernel-P2P graphs Code (copy_gate_policy, peer_access_graphs, payload scan) + copy_gate_policy_* tests (model.rs:1653+) Tests cover only the pure policy function with synthetic booleans; no test that a kernel-P2P graph is detected in a real core. Author states no suitable core was available.
"Measured live SM120 PCIe TP4 result": 20 concurrent ~13k-token requests in 0.59–3.86 s, 1.09 GiB offloaded (37 records, 0 failures), clean SIGTERM status=0 in 3 s Described run, --prefix-cache-memory 4G --memory-limit 81G, 4× SM120, 135 graphs/rank Not the #722 reproduction (32k tokens/c4/256G/177 graphs/balanced policy). No patched-vs-unpatched comparison, and the author explicitly makes no throughput claim.
Formal + Rust suite green check.py --mutations exit 0: 10 TLA+ models, 9 Rust↔TLA+ conformance suites (431 AsyncTransfer, 7,940 DispatchRing transitions), TLA+ and Rust mutations incl. UnflushedIoBounded / HwSignaledFaultedSafe; release tests per crate; helios --lib 1,920 passed with -D warnings 0 warnings; Python tests/cli 206 passed; one live live_cuda_async_transfer_end_to_end on SM120 The cited command embeds a machine-specific jar path (/home/luke/.cache/flare-formal/tla2tools-1.7.4.jar), so it is not reproducible as written.
New unit tests exist as named Verified at head: mod.rs:2287/2541, model.rs:1653/1670/1709, io_backend.rs:413, scheduler.rs:1101 —
best_effort_drain_peers uses one shared deadline Verified, threaded.rs:1292-1308 —
Unrun, declared 6 helios --lib frontend template tests fail on HTTP 403 from gated HF repo meta-models/Muse-Spark-Open-816B-A42B-NVFP4; SM103/SM121 hardware; multi-host RoCE; Kani The cited "1,920 passed" run contains those 6 failures — a reviewer re-running it will see them without template setup.
Undeclared Two CI workflow edits in the raw diff (helios-lifecycle.yml (not opened) --lib --no-run; native-serving.yml (not opened) native RoCE test) Not in pr_files; likely base drift, attribution unverified.

Reach

Process

Open and marked ready for review (not a draft), hours old. No CI result yet on head 224fb40, no reviewers assigned, no labels, no comments. pr_files gives 16 files / +1973 −221; any larger figure taken from the raw diff overstates the change because the local main ref is stale. Four logically independent fix clusters touch largely disjoint files (runtime_core+payload+docs; runtime_core/model+mod; async_transfer+metrics+verification; execution/threaded), which matters to anyone deciding whether this must be reviewed and landed as one unit.

Open questions / not found