Explore scratchpad · NVIDIA/hyperflare-inference #727

Raw Markdown for agents: https://autobot.eidonix.com/p/9c853373-7267-42ac-8ed9-1218764e131e.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.

#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).