Explore scratchpad · NVIDIA/hyperflare-inference #727

Raw Markdown for agents: https://autobot.eidonix.com/p/7ae11d37-ad41-4533-a5c1-1ee41a672b15.md

#1 [high] The change: scope and shape (16 files, +1973/-221)

PR #727, head 224fb40, base main (branched at cc0a49d), open/ready-for-review, opened and last updated 2026-12-04, no reviews, CI pending, no labels.

Files actually changed (pr_files): 16 files, +1973/−221

Four defect clusters (from description + issue #722):

  1. CopyEngineGate only gated Node::Copy(Memory::Peer) graphs; kernel/indirect peer P2P graphs bypassed it → PCIe TP4 deadlock (#722).
  2. NativeModel::drop freed peer Memory::Device / MappedHost on higher ranks before lower ranks drained, and before engram.clear() joined threads → UAF.
  3. AsyncTransfer: io_uring SQE stranding (submitted_io reset per loop), completion-slot sentinel clobbering after cuStreamWriteValue64 queued, wrong Prometheus rank labels (flat enumerate index).
  4. Peer FinishStartup failure → std::process::abort() in cleanup_failed_startup.

TOOLING CAVEAT: the local pr_diff and local main ref are stale (main has no helios/src/async_transfer at all, no PoolMemoryLimit/host_vmm). So the combined/per-file diff includes drift from other merged PRs (#711, #721, #669, etc.: AGENTS.md, docs/api.md, docs/cli-design.md, docs/TODO.txt, .github/workflows/*). Only pr_files + comparison against pr/721 is trustworthy for scoping. Notably worker.rs shows as "new file" in the diff — false, it exists on pr/721.

#2 [high] The why: issue #722 (P1, triage:investigate, external reporter)

Issue #722 "helios: TP4 serving hangs under --prefix-cache-memory on SM120 PCIe; CopyEngineGate leaves 145/177 DeepSeek-V4.1-Flash graphs ungated"

#3 [high] The change: code-verified mechanics (gate split, policy, payload scan)

Verified in pr/727 head code (files confirmed present in pr_files):

TLA+/verification: AsyncTransfer.tla extended to 16-int projection with FlushIo (UnflushedIoBounded) and hwSignaledFaulted (HwSignaledFaultedSafe); check.py + AsyncTransfer.cfg + README updated (+37/-5, +2, +14/-9). Docs: docs/prefix-cache-offload.md:992-1010 now documents BOTH trigger sets (in-graph Node::Copy(Peer), and single-host PCIe multi-rank without all-pairs NVLink with kernels/memsets/globals/pointer tables touching Memory::Peer); docs/runtime-core-design.md:686-711 documents three-phase teardown and load-time async_transfer pe==peer-copy rejection.

#4 [high] The change: watchdog, startup drain handshake, three-phase teardown

helios/src/execution/threaded.rs (pr/727):

#5 [high] Related work: #727 is a same-day follow-up to merged #721 and #628

#727 is the fourth PR in a same-day StackedWriter series by lukealonso; scoping note: local main is stale (no helios/src/async_transfer at all on main, no PoolMemoryLimit/host_vmm), so local pr_diff (whole-PR and per-file) includes drift from already-merged PRs.

Overlaps with #721 (merged 2026-12-04, same author) — "helios,flare-cli: harden AsyncTransfer startup, DMA and teardown lifetimes, unified DRAM, and Copy E…" — 11 files in common. Verified by reading pr/721:

#7 [high] Claims and evidence: what is backed, what is not, what the description omits

Claims in the PR description vs. what is backed:

  1. "Prevents single-host PCIe TP>=2 CopyEngineGate deadlocks for kernel-P2P graphs under --prefix-cache-memory": backed by the code change (copy_gate_policy, peer_access_graphs) and by unit tests copy_gate_policy_* (model.rs:1653+) — but those tests exercise only the pure policy function with synthetic booleans; there is no test that a kernel-P2P graph is actually detected in a real core, and the author states no core with async_transfers-without-Node::Copy(Peer) was available and that the local DeepSeek TP2 tiered-MoE core was rejected at load as intended. So detection correctness for the #722 case rests on the reporter's graph inventory (145/177 graphs) plus one live TP4 run.
  2. Live evidence: "Measured live SM120 PCIe TP4 result" — 4-rank DeepSeek-V4.1-Flash core with 135 graphs/rank, 1.92 GiB peer views, --prefix-cache-memory 4G --memory-limit 81G, 20 concurrent ~13k-token requests in 0.59–3.86s, 1.09 GiB offloaded (37 records, 0 failures), SIGTERM status=0 in 3s. Note this is NOT a reproduction of the #722 workload: #722 hung at 32,768-token inputs (concurrency 4) with a 256G budget and --scheduler-policy balanced; the PR run used ~13k tokens, 4G budget, 20 concurrent, and a differently exported core (135 graphs/rank vs 177). The author explicitly makes no throughput/speedup claim.
  3. Formal/test evidence: check.py --mutations exit 0; 10 TLA+ models, 9 Rust-to-TLA+ conformance suites (431 AsyncTransfer transitions, 7,940 DispatchRing transitions); Rust release test suites listed per crate; helios --lib 1,920 passed with RUSTFLAGS="-D warnings" 0 warnings; Python tests/cli 206 passed; one live live_cuda_async_transfer_end_to_end test on SM120 GPU 2. Command line is user-specific (--tlc-jar /home/luke/.cache/flare-formal/...).
  4. Declared unrun: 6 helios --lib frontend template tests fail due to HTTP 403 on gated HF repo meta-models/Muse-Spark-Open-816B-A42B-NVFP4 (pre-existing/environmental, not this PR); SM103/SM121 hardware unrun; multi-host RoCE unrun; Kani unrun (cargo-kani not on PATH; validators untouched).
  5. Undeclared in the description but present in the change: (a) two new CI workflow steps are in the diff (helios-lifecycle.yml: cargo test --lib --no-run compile step; native-serving.yml: cargo test --release --features roce --lib execution::roce "Test native RoCE transport"). These two workflows are NOT in pr_files (16 files) and the description mentions neither → likely base drift from another PR rather than #727's own change; treat as unverified attribution. (b) docs/prefix-cache-offload.md:992-1010 and docs/runtime-core-design.md:690-711 document the new gating and teardown (declared). (c) The watchdog ends in std::process::abort() (threaded.rs:1027) — the description says it "bounds wedged-rank hangs", which is accurate but the outcome is a bounded abort, not recovery; it does not say that.
  6. The description's claim that best_effort_drain_peers now shares one bounded deadline across peers is verified (threaded.rs:1292-1308 uses a single deadline).

#8 [high] Reach: users, operators, metrics schema shift, failure-mode change

Reach of the change:

#13 [high] Research summary

Case file gathered across all nine angles; 12 scratchpad entries hold the detail with file:line and PR/issue citations.

What it is: PR #727 (head 224fb40, open/ready-for-review, no reviews, CI pending, 0 comments, no labels) is a 16-file, +1973/−221 fix for four concurrency/lifetime defects in Helios, fixing the P1 external bug report #722. It splits CopyEngineGate's predicate into peer_copy_graphs (strictly Node::Copy(Memory::Peer)) vs a new peer_access_graphs (copies, memsets, kernel args/attributes, indirect peer-pointer tables found by scanning 8-byte-aligned payload words, peer-referencing module globals), gated by a new copy_gate_policy that applies peer-access gating only on single-host multi-rank hosts lacking all-pairs NVLink; replaces NativeModel::drop with a three-phase cross-rank teardown barrier; fixes io_uring SQE stranding, post-WriteValue64 completion-slot clobbering, and wrong Prometheus rank labels; and replaces peer FinishStartup aborts with a drain handshake plus a new RankWedgeWatchdog.

Most important things a reader could not learn from the description: (1) #727 is a same-day follow-up to already-merged #721 by the same author, and three of its four fix clusters are corrections of code #721 introduced hours earlier — the wrong rank metric label was #721's .enumerate(), and #727 replaces #721's two-phase teardown; (2) the watchdog's terminal action is std::process::abort() after ~150 s, so a wedged rank becomes a bounded crash, which the "bounds wedged-rank hangs" wording does not say; (3) the "measured live TP4 result" is not a reproduction of #722's workload (13k vs 32k tokens, 4G vs 256G, 135 vs 177 graphs/rank), and no core exercising the new kernel-P2P detection path was available — that path is covered only by pure-function policy tests; (4) flare_async_transfer_* rank labels silently change meaning for existing scrapers; (5) the PR's own evidence section concedes 6 failing template tests in the same run it cites as 1,920 passed, plus unrun SM103/SM121, multi-host RoCE and Kani.

Two workflow edits (.github/workflows/helios-lifecycle.yml (not opened), native-serving.yml (not opened)) appear in the diff but not in the PR's 16 files and are not mentioned anywhere — most likely base drift; the local main ref is stale (predates #711/#721), so the raw diff also folds in unrelated merged work and cannot be used for scoping. search_history fails for every ref with a missing-git-object error, so commit-level history could not be read; recent activity was reconstructed by comparing pr/727 against pr/721/pr/723. Author lukealonso is a charter priority contributor and the only recent contributor in these files; the reporter of #722 (egtoken-ai / maxKonger) has not engaged with the PR. Charter fit is close (reproducible P1 bug, runtime-general, four-part description), with tension on the "check the whole supported matrix" review standard and on mitigation-above-root-cause for the watchdog.

#17 [high] Amendment 2026-12-04 (head c9df77bd): review round, verified fixes, new deltas

AMENDMENT to note #16 (report of run 3315). New head c9df77bd, 17 files, +2234/−253; branch fix-helios-p0s; labels now present: bug, performance, priority:P1, triage:review.

A. Review round (pr #727 comments, read_item 727).

B. Verified at c9df77bd (code read).

C. New deltas in c9df77bd not in note #16.

D. Still open (unchanged): no disclosure that the watchdog kills the process vs the charter root-cause rule in note #16 now partly moot since the description says abort; detection correctness still rests on a pure-policy unit test (copy_gate_policy_*, model.rs:1662-1677) plus one live run; reporter egtoken-ai has still not commented on #727.

#18 [high] Research summary

Amendments to the case file for PR #727 (note #17), following the new head c9df77bd and the first review round.

New event. The PR now has a formal review: flare-autobot posted Changes Requested at 224fb40 (1 blocker, 2 should-fix, 3 simplify, 4 nits; merge risk High), and the author replied at 22:34 UTC claiming all findings fixed in c9df77bd and requesting re-review. Auto re-review runs 90 min after a push, so nothing has yet verified the new head — the fixes below are code-verified by me, not by the reviewer. Labels are now present (bug, performance, priority:P1, triage:review); the PR is 17 files, +2234/−253.

The three findings are fixed at head. (1) Blocker: complete_io now uses ordered self.inflight_io.remove(pos) (helios/src/async_transfer/scheduler.rs:583-585) with a real regression test, partial_flush_preserves_sq_fifo_order_across_completions (:1127-1175), asserting a partial flush then completion leaves the next flush marking the older op and its CQE accepted. (2) CloseStalled is now progress-aware (threaded.rs:679-693) and record_progress() is threaded through every close stage (:1125, :1144, :1216, :1229, :1240, :1282, :1338), with the test extended to require silence during a progressing multi-stage close (:4120-4172). (3) best_effort_drain_peers sweeps all live peers with try_recv() against one shared deadline (threaded.rs:1310-1357), with a new three-peer test where a wedged peer must not block joining the two healthy ones (:4175+). Residual: GraphExecutor::close (helios/src/execution/transport.rs:1354-1391) synchronizes with no timeout after the last progress mark, so a driver hang there still ends in std::process::abort() at ~150 s.

Corrections and new deltas. EINTR retry is now bounded at 16 consecutive attempts (io_backend.rs:146-170) and a persistent storm surfaces as last_error = IoFailure (worker.rs:1245-1249) — a behaviour change my earlier note missed. all_nvlink_p2p now requires NVML P2P_CAPS_INDEX_NVLINK in both directions (runtime_core/model.rs:152-170), failing safe toward gating. The async_transfers+peer-copy rejection was removed from prepare_async_transfers only in this push and now lives solely at load time (model.rs:191-207, called :931-935), not enforced on NativeResources::load_prepared. A peer_refs cache (mod.rs:127-130, :1091, :1119-1125) makes the peer closure computed once, a simplification rather than a semantic change. My earlier "two CI workflow edits in the diff" caveat is void: pr_diff and pr_files now show no .github/ files at all, so that was base drift. docs/api.md:403-405 now labels the series as "the global rank ID" but still does not say the label's meaning changed, so operator dashboards keyed on rank shift silently. The PR description was rewritten in before/after form and now states the abort, the 16-retry bound and the max_total_io ≤ 32 rationale.

Unchanged weaknesses. The live SM120 TP4 run (135 graphs/rank, 4G prefix cache, ~13k tokens, 20 concurrent) is still not the #722 workload (177 graphs, 256G, 32k tokens, balanced), no patched-vs-unpatched comparison exists, detection correctness still rests on the pure-policy test copy_gate_policy_* (model.rs:1662-1677), the full-crate and live-run evidence is still dated 224fb403 while only the targeted and formal suites were re-run on c9df77bd, SM103/SM121, multi-host RoCE and local Kani remain unrun, and reporter egtoken-ai has still not engaged with the PR.

#19 [high] Superseded / corrected statements in earlier notes (errata list)

Errata — apply these before writing the final report; the detail and citations are in note #17.

  1. Note #1 / #14 size and file list: superseded. At head c9df77bd the PR is 17 files, +2234/−253 (pr_files and read_item 727), not 16 files / +1973/−221. The 17th file is docs/api.md plus the already-listed set; no .github/ file is changed.

  2. Note #7 / #14 / #16 CI-workflow caveat: wrong, delete it. pr_diff for .github, native-serving.yml and yml all return "changes no file matching", and pr_files shows nothing under .github/. The two workflow hunks seen against the stale local main were base drift, not #727's change.

  3. Note #16 item 3 / "Said but not done": the claim that cores combining Execution.async_transfers with Node::Copy(Memory::Peer) are "now rejected at load rather than at prepare" was only true from c9df77bd onward. At the reviewed head 224fb40 the prepare-time guard still existed; the guard was deleted from prepare_async_transfers in c9df77bd (helios/src/runtime_core/mod.rs:1741-1760 now has no has_any_peer_copy_graphs() early return). The rejection now exists only in validate_async_transfer_peer_copy_compatibility (model.rs:191-207, called model.rs:931-935), which NativeResources::load_prepared (mod.rs:510-532) does not call.

  4. Note #16 "Said but not done (a)" — the description now does state the std::process::abort() remedy (rewritten description, "terminating the process via std::process::abort() if a rank remains wedged past TIMEOUT + 30 s grace"). The charter root-cause tension stands but is no longer an omission; it is a disclosed design choice.

  5. Note #16 / #7 metrics bullet: docs/api.md:403-405 now reads "labeled by channel and the global rank ID" — the semantics are documented at head, but the doc still does not flag that the label previously meant a flat per-process channel index, so existing dashboards keyed on rank still shift silently.

  6. Note #3's description of EINTR handling as plain "retry" is out of date: the retry is bounded to 16 consecutive attempts (helios/src/async_transfer/io_backend.rs:146-170) and a persistent EINTR becomes a flush error recorded as header.last_error = ErrorCode::IoFailure (worker.rs:1245-1249).

  7. Notes #4/#16 on all_nvlink_p2p: it now requires the NVML P2P_CAPS_INDEX_NVLINK query to succeed in both directions and treats a one-way-only link as not-all-NVLink (helios/src/runtime_core/model.rs:152-170) — new in c9df77bd, fails safe toward enabling the gate.

  8. Note #16 "no labels": now labelled bug, performance, priority:P1, triage:review; still no human reviewers, and reporter egtoken-ai has still not commented.

  9. Note #16 "no CI result": the PR description now reports CI lifecycle/kani/pytest green, but that is the author's claim, not an artifact I could read; and the full-crate + live TP4 serving evidence is still dated 224fb403 while only targeted and formal suites were re-run on c9df77bd.

#6 [medium] Community/People/Process: no engagement yet; priority-contributor author; charter fit

Community/process as of orientation packet + PR page: 0 comments, 0 reviews, 0 labels, CI pending on head 224fb40, state "open, ready for review", opened and last updated 2026-12-04 (same day as #720/#721/#723 merges/opens). Author tied to Discord handle "lukealonso" in the description; the reporter of #722 signs as "maxKonger" (egtoken-ai) — different person, and no comment from the reporter on the PR yet (so the "fixes #722" claim has not been acknowledged by the reporter). Author standing: lukealonso is named in the charter's priority-contributor list (@voipmonitor, @original-el8, @lukealonso) — "we never close their PRs out of hand as 'low value'". 51 merged PRs in 180 days, 1 open besides this (#723); dominant areas helios/src (36), docs (31), ignition/preparation (20). The series #711→#720→#721→#723/#726→#727 in one week shows a high merge cadence with fast turnaround. Charter mapping: the PR addresses a reproducible bug reported with labels bug/priority:P1 (charter: "What gets merged: PRs that address a maintainer request, a roadmap item, a reproducible bug…"); it touches runtime-wide concurrency, not per-model branches, and explicitly refuses to gate NVLink SM P2P (keeps runtime general — consistent with "Keep the runtime small and model-agnostic"). Tension points: the charter's "Check interactions across every supported model, cache scheme, parallel layout, multi-host setup, and hardware target named in the docs" — this PR's own limitations concede SM103/SM121 and multi-host RoCE were not run; and "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error" — the RankWedgeWatchdog's outcome is process abort (a bounded crash) rather than recovery, which is a mitigation layer above the root cause. Description format matches the charter's four-part expectation (why/what/result/evidence) closely.

#9 [medium] Recent activity: three passes over AsyncTransfer in ~24h; #727 rewrites #721 teardown

Recent activity in the touched areas, as far as could be established (the repo's own history tooling is broken for these refs: search_history returns "git: error: Could not read c513e46a79f3b6ac510235aaf09bcf055b841958 / cannot simplify commit ef38cb9395f6cb2a6598cb7b603177a93d0029f4" for every path/ref tried, including pr/727 — so commit-level history could not be read). Workarounds used: (a) the orientation packet's "Possibly related items" list; (b) direct comparison of pr/727 against pr/721 and pr/723; (c) local main (stale) as a lower bound; (d) the PR description's own supporting-evidence section. What that establishes:

#11 [medium] People: sole owner of the area; self-follow-up on #628/#721

People angle, consolidated:

#12 [medium] Related work: lead-by-lead disposition (all followed; none competing)

Orientation-packet leads, each followed or dismissed:

#14 [medium] Process: ready-for-review, no CI yet, no reviewers, four separable clusters

Process facts, consolidated for the report:

#15 [medium] The why: latent since #628, user-visible in release 0.5.3, one external report

How long and how widely the problem has been wanted:

#10 [low] Community: nothing to report; process caveat on the cited test run

Angle with no findings beyond the above: there is no reviewer, no comment, no reaction, no label on the PR, and no linked discussion thread. #722's own discussion section is empty ("Discussion (0)") and its Discord handle (maxKonger) is the only community voice attached to the problem; the PR's Discord handle is lukealonso. No test-plan/CI result was observable beyond "pending". Also worth recording as a process fact: the PR description documents 6 failing frontend template tests in the same helios --lib run it cites as "1,920 passed", attributing them to an HTTP 403 on a gated HuggingFace repo. A reviewer re-running the suite will see those failures unless they set up templates, so the "all suites passed" summary needs that caveat read with it. One more verifiable-but-unclaimed detail: helios/src/runtime_core/mod.rs also gained merge_sorted_intervals, peer_address_intervals (also used by the storage-access path) and address_in_intervals, plus two new unit tests referenced in the description (peer_usage_tests::, flush_queued_sqes_, hardware_signaled_faulted_dma_, async_transfer_metrics_label_true_rank_ids_, finish_startup_peer_error_drains_mixed_peers_cleanly_without_abort, stop_rank_workers_, teardown_model_ranks_) — these do exist at the head (verified: io_backend.rs:413 flush_queued_sqes_retries_eintr_handles_partial_submit..., scheduler.rs:1101 hardware_signaled_faulted_dma_suppresses_completion_slot_sentinel, model.rs:1653/1670/1709, mod.rs:2541).