#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
- helios/src/runtime_core/mod.rs (+650/−19), model.rs (+204/−24), payload.rs (+46/−8), serving.rs (+1/−1)
- helios/src/execution/threaded.rs (+552/−64)
- helios/src/async_transfer/io_backend.rs (+83/−10), scheduler.rs (+99/−6), worker.rs (+75/−15), lifecycle_tests.rs (+83/−36)
- helios/src/server/metrics.rs (+52/−2)
- verification/helios-lifecycle/{AsyncTransfer.tla +52/−8, AsyncTransfer.cfg +2, README.md +14/−9, check.py +37/−5}
- docs/prefix-cache-offload.md (+10/−7), docs/runtime-core-design.md (+13/−7)
Four defect clusters (from description + issue #722):
- CopyEngineGate only gated Node::Copy(Memory::Peer) graphs; kernel/indirect peer P2P graphs bypassed it → PCIe TP4 deadlock (#722).
- NativeModel::drop freed peer Memory::Device / MappedHost on higher ranks before lower ranks drained, and before engram.clear() joined threads → UAF.
- AsyncTransfer: io_uring SQE stranding (submitted_io reset per loop), completion-slot sentinel clobbering after cuStreamWriteValue64 queued, wrong Prometheus rank labels (flat enumerate index).
- 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"
- Author: egtoken-ai (Discord: maxKonger) — an external reporter, not the PR author. Opened 2026-12-04 05:59, updated 17:27 same day. Labels: bug, performance, priority:P1, triage:investigate. Open.
- Environment: 4x RTX 6000D (SM120/GB202, 85,651 MiB), PCIe Gen5, driver 580.178.04, flare 0.5.3 (9cd0cfad), 2x Xeon Gold 6530, 1 TiB RAM, Ubuntu 24.04.5, Broadcom PEX890xx switch, ACS disabled.
- Failure: with --prefix-cache-memory 256G and TP4 DeepSeek-V4.1-Flash-1017, 32768-in/1024-out at concurrency 4 deadlocks >9 minutes; GPUs 0-2 at 100%, GPU 3 at 0%; flare-model in futex_do_wait, flare-offload-0/3 spinning (RNl), flare-rank-1 and -2 already exited (consistent with rank_loop 120 s TIMEOUT + executor.abandon()); no HTTP request fails or times out.
- Code finding cited by reporter: helios/src/runtime_core/mod.rs:1158-1167 (at that revision)
has_peer_copiesonly set for Node::Copy with Memory::Peer source/destination. Of 177 graphs in rank 0 (24 Memory::Peer allocations): 32 gated (prefill1536-prefill4096, terminal_prefill*, 516-972 peer copy nodes each), 145 ungated (all packed-speculative* decode graphs and prefill256; 0 peer copy nodes, 5-38 local Node::Copy nodes, plus b12x PCIeOneshotAllReducePool / PCIeTwoShotBF16 kernel-based PCIe P2P). - Second finding: no timeout recovery once CUDA blocks flare-model; CopyEngineGate::enter_peer_graph and ThreadedExecutor both have 120 s deadlines that cannot fire when the coordinator is inside libcuda.so.
- Control: --prefix-cache-memory 0 on same host/binary/core completed the 21-case, 105-round matrix, 0 failures. Untested variable acknowledged by reporter: control used --scheduler-policy throughput while the hung run used balanced; 256G+throughput not re-tested; no patched binary gating all graphs was tested.
- Expectation stated: gate all peer-collective graphs including kernel-P2P ones with local Node::Copy; ensure offload stalls/rank timeouts cannot wedge the process indefinitely.
- Issue links: mentions #628 (merged, original CopyEngineGate); referred to by #727 ("fixes #722"). Note: the issue is from an outside reporter on 0.5.3, i.e. the bug is user-facing in a released version (0.5.3), not only in main.
#3 [high] The change: code-verified mechanics (gate split, policy, payload scan)
Verified in pr/727 head code (files confirmed present in pr_files):
- CopyEngineGate split: NativeResources now carries
peer_copy_graphs(strictly Node::Copy with Memory::Peer endpoint) ANDpeer_access_graphs(peer copies, memsets, kernel arg/attribute relocations, inline fixed addresses into peer or peer-pointer-table allocations, peer-referencing module globals): helios/src/runtime_core/mod.rs:115-134 (fields), node_peer_usage() at ~mod.rs (fn node_peer_usage), push at mod.rs:1478-1479. - Policy:
copy_gate_policy(local_ranks, all_nvlink, has_peer_copy_nodes, has_peer_access_graphs)→ gate_peer_access = local_ranks > 1 && !all_nvlink; enable_gate = has_peer_copy_nodes || (gate_peer_access && has_peer_access_graphs): model.rs:166-174.all_nvlink_p2pqueries NVML P2P_CAPS_INDEX_NVLINK pairwise: model.rs:132-165. Applied at model.rs:118-120 (validate), 916-941, set viaset_gate_peer_access(mod.rs:1603), consumed bygraph_uses_copy_gate(mod.rs:1607-1614) and serving.rs:59. - AsyncTransfer validation decoupled:
validate_async_transfer_peer_copy_compatibility(model.rs:181-204) rejects only peer_copy_graphs; unit test model.rs:1613-1641; same check also retained inside prepare_async_transfers (mod.rs:1750-1755) from #721. - Indirect peer-pointer table detection: payload::load now takes peer_intervals then returns HashSet of allocations whose 8-byte-aligned stored words land inside a Memory::Peer interval; chunk boundary aligned to 8 (
((CHUNK / ranks) & !7).max(8)); per-allocation AtomicBool flags: payload.rs (load() ~242-478); contains_interval_address/merge_sorted_intervals/peer_address_intervals + collect_peer_referencing_allocations in mod.rs (module-level fns before clamp_cooperative_grid). - CopyEngineGate gating is per-graph; the gate object is still created only when needed (model.rs:940-942 enable_copy_gate).
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):
- TIMEOUT=120s, WATCHDOG_GRACE=30s, WATCHDOG_POLL=1s (threaded.rs:23-25).
- RankWedgeWatchdog (threaded.rs:547-753): WatchdogState{activity AtomicU64, busy, closing, stopped, Condvar}, spawn() monitors (a) CoordinatorStalled past stall_timeout with no activity counter change, (b) PeerExitedWithoutRecovery past peer_exit_grace, (c) CloseStalled. Idle path uses Condvar::wait_while. Spawned only after startup success, at threaded.rs:1015-1029 with stall TIMEOUT+GRACE and peer-exit grace WATCHDOG_GRACE. on_wedge action = eprintln + std::process::abort() — i.e. the fix converts an unbounded hang into a deliberate process abort after ~150 s; worth flagging that the remedy is a bounded crash, not recovery.
- FinishStartup handshake: Reply::Started now carries Result<()> (threaded.rs:1355-1356, 1431, 1435). run_startup_phase keeps serving commands after a failed finish_startup so Command::Drain → Reply::Drained still works (threaded.rs:1409-1445). finish_startup_handshake collects errors (1345-1368). cleanup_failed_startup sends Command::Drain and tolerates an in-flight Reply::Started (1374-1405). Remaining std::process::abort sites: 946, 966, 987, 1001, 1008, 1027 (watchdog). helios/src/runtime_core teardown:
stop_rank_workersevaluates both stops without||short-circuit (mod.rs:2035-2042; unit test mod.rs:2541-2567).drain_execution_context(mod.rs:2051-2079): stop workers + stop async transfers, then cuCtxSetCurrent + cuCtxSynchronize; on failure forgets the driver and nulls the context.destroy_execution_resources(mod.rs:2084-2140): destroys executables/graphs/events/modules, invalidates worker metrics and channel control regions, frees Device/MappedHost allocations (codec/host_vmm predicate), leaving Peer memory alone.teardown_model_ranks(model.rs:1275-~1310): phase 1 drain all ranks (reverse), abort all later phases if any drain fails; phase 2 release_host_subsystems() = engram.clear() + offload.reset() while MappedHost mailboxes live, then destroy each rank; phase 3 pop ranks and release_reservations_and_context in reverse order. NativeModel::drop at model.rs:~1312-1345; on failure retains offload/engram/ranks (mem::take) so nothing is freed.- Tests: model.rs:1670 teardown_model_ranks_enforces_three_phase_cross_rank_barrier, 1709 retains resources on failed drain.
#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:
- #721 already had queue-depth-aware flush logic (submitted_io at worker.rs:1166/1191/1196) but NO pending_submissions()/flush_queued_sqes; #727 adds those (io_backend.rs:146-161, 181-188).
- #721 had
mark_dma_faulted(op_id)without hardware_signaled and no unflushed_io_count/mark_io_flushed; #727 addshardware_signaled(scheduler.rs:123, 708-742) and InflightIo.flushed accounting. - #721 already rejected async_transfers + peer-copy graphs inside prepare_async_transfers (mod.rs:1495-1499); #727 moves the check earlier to model.rs load-time
validate_async_transfer_peer_copy_compatibility, i.e. it relocates/refactors an existing guard rather than adding a new one. - #721's metrics already used
.enumerate()for the rank label (metrics.rs:1557 on pr/721) — so the "wrong rank label" defect was introduced by #721, merged hours earlier, and #727 fixes it (metrics.rs:1566-1567let rank = s.rank). This is a follow-up/self-correction of the immediately preceding PR. - #721 also introduced the phase-1/phase-2 teardown split (mod.rs:1530-1600 release_execution_resources) which #727 replaces with three functions + teardown_model_ranks, again a rewrite of work merged the same day. Related history: #628 (merged) added the original CopyEngineGate keyed on Node::Copy(Peer) — the predicate #722 shows is insufficient. #711 (merged) added AsyncTransfer + runtime-sized device pools (basis for DEVICE_POOL/HOST_POOL). #709 (merged) green-context/codec work (codec_context appears in the mod.rs diff as drift from that line of work). #613/#640/#507/#430 touched release_execution_resources/prepare_async_transfers. #726 (open, same author) overlaps on release_execution_resources/prepare_async_transfers. #723 (open, same author) is concurrent fleet-allocation work. No competing or superseding PR found for #722 itself; #727 is the only item that "fixes #722".
#7 [high] Claims and evidence: what is backed, what is not, what the description omits
Claims in the PR description vs. what is backed:
- "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.
- 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.
- 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_endtest on SM120 GPU 2. Command line is user-specific (--tlc-jar /home/luke/.cache/flare-formal/...). - 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).
- 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. - The description's claim that
best_effort_drain_peersnow shares one bounded deadline across peers is verified (threaded.rs:1292-1308 uses a singledeadline).
#8 [high] Reach: users, operators, metrics schema shift, failure-mode change
Reach of the change:
- Users affected: single-host PCIe multi-rank (TP>=2) serving on SM120/GB202-class consumer/workstation GPUs with --prefix-cache-memory > 0. That is exactly the deployment class named in the charter vision ("SM120/SM121 workstations"). The bug being fixed is in a released binary (flare 0.5.3 per #722), so operators on 0.5.3 are exposed until a release contains this.
- Behaviour changes operators can observe:
- On single-host PCIe multi-rank without all-pairs NVLink, MORE graphs now take the CopyEngineGate (all peer-access graphs) → the #722-era claim "single-GPU and non-peer-copy models stay ungated" (docs/prefix-cache-offload.md:140-142 as written BEFORE this PR) is no longer the whole story; the doc at :996-1010 is updated. Offload work will interleave more coarsely on those hosts (bounded fairness turns instead of one sync per 16 MiB window) — a potential, unmeasured latency cost on the offload path. The PR makes no throughput claim either way, and #722's control run also varied --scheduler-policy, so there is no measurement isolating this cost.
- NVLink hosts are explicitly exempt (all_nvlink_p2p, model.rs:132-165), so DGX-class NVLink boxes and single-GPU deployments keep the old behaviour.
- A rank that does not drain, or a coordinator stuck in a driver call, now aborts the process after ~150 s instead of hanging indefinitely. This changes the observable failure mode for operators (and for the supervisor, e.g. Orbit restarting serving ranks per the charter's "Orbit handling placement and supervising serving ranks").
- Peer FinishStartup failures now surface as a clean drain + error instead of an unconditional abort.
- Prometheus
flare_async_transfer_*ranklabels change meaning: previously the flat vector index across local channels, now the true global rank id (metrics.rs:1566-1567). Any dashboard/alert keyed onrankmay need re-checking; docs/api.md:388-412 (in the diff region) documents the series but the label semantics change is a silent schema shift for existing scrapers. - Memory: teardown now retains CUDA/host resources until process exit if any rank fails to drain (deliberate leak, modelled in the comment at model.rs teardown_model_ranks) — previously resources could be freed and crash instead.
- Compatibility: no core format change;
NativeResourcesgains fields but is internal.Execution.async_transfers+ Node::Copy(Peer) cores are now rejected at load time rather than at prepare time (same set of rejected cores, earlier error). No new CLI flags or config keys in this PR (the pool_vram/pool_ram flags seen in docs drift belong to #711/#721-era work). - Dependencies: no new crates; NVML P2P query uses the existing crate::nvml module (device_p2p_status / P2P_CAPS_INDEX_NVLINK). io_uring code stays cfg(target_os="linux") with the PreadBackend fallback.
#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).
- Autobot review 2026-12-04 18:15 at 224fb40: Changes Requested, 1 blocker / 2 should-fix / 3 simplify / 4 nits. Blocker:
swap_removeincomplete_iodesynchronizesinflight_iofrom io_uring SQ FIFO after partial submit →mark_io_flushedmarks the wrong op →complete_iosilently drops a live CQE. Should-fix: (a)RankWedgeWatchdog::CloseStalledaborts progressing/multi-stage closes; (b)best_effort_drain_peersskips already-Reply::Drainedpeers once an earlier wedged peer burns the shared deadline. Merge risk rated High. Security and charter-fit checks passed; test-evidence check warned. - Author reply 2026-12-04 22:34 claims all findings + 3 simplifications + 4 nits fixed in c9df77bd and asks @flare-autobot for re-review. Auto re-review runs 90 min after a push, so at the time of writing no artifact verifies the new head — the round-1 findings are fixed per code reading only (below), not per review.
B. Verified at c9df77bd (code read).
- Blocker fixed:
let op = self.inflight_io.remove(pos);(helios/src/async_transfer/scheduler.rs:583-585) with comment stating SQ FIFO rationale; regression testpartial_flush_preserves_sq_fifo_order_across_completions(scheduler.rs:1127-1175) does partial flush → complete A → asserts next flush marks B not C and B's CQE is accepted.complete_dmastill usesswap_remove(scheduler.rs:747-748) — correct there, DMA order is not SQ-coupled. - CloseStalled fixed: watchdog now compares
activitywhile closing and only resetsclose_sincewhen it advances (threaded.rs:679-693);record_progress()calls at threaded.rs:1125, 1144, 1216 (after pending drain), 1229, 1240, 1282 (per peer joined inclose_peers), 1338 (per peer joined inbest_effort_drain_peers).stop_and_joindeleted;Drop(threaded.rs:745-752) is now the only stop path andclose()doesdrop(self.watchdog.take())(threaded.rs:1245). Test extended: multistage close advancing progress past stall_timeout must stay silent, then a real stall must fireCloseStalled(threaded.rs:4120-4172). - Round-robin drain fixed:
best_effort_drain_peersis now a loop over all live peers using non-blockingtry_recv(), joining in any order, one shared deadline, 1 ms sleep only when nothing moved (threaded.rs:1310-1357). New testbest_effort_drain_peers_joins_healthy_peers_even_when_earlier_peer_is_wedged(threaded.rs:4175+) with peer0 wedged, peer1 pre-queued Drained, peer2 async; asserts wedged peer not joined, both healthy joined, watchdog activity ≥2, elapsed <1 s. - Residual: after
record_progress()at threaded.rs:1240,self.local.close()runs with no further progress marks beforedrop(watchdog)—GraphExecutor::close(helios/src/execution/transport.rs:1354-1391) synchronizes compute/copy/engram streams with no timeout, so a driver-level hang there still ends instd::process::abort()after 150 s. The abort remedy is unchanged (threaded.rs:23-25 TIMEOUT 120 s + WATCHDOG_GRACE 30 s; abort at :1026).
C. New deltas in c9df77bd not in note #16.
- EINTR is now bounded:
MAX_EINTR_RETRIES: usize = 16for consecutive retries, reset on any success, then the EINTR is returned as an error (helios/src/async_transfer/io_backend.rs:146-170), test asserts exactly 16 calls then error andqueuedunchanged (io_backend.rs:463-470). Consequence: a persistent EINTR storm now ends as a flush error, which the worker records asheader.last_error = ErrorCode::IoFailure(helios/src/async_transfer/worker.rs:1245-1249) — i.e. a transfer failure surfaces rather than retrying forever. Previous report described only "EINTR retry"; the cap is new. NativeResourcesgainedpeer_refs: Option<(HashSet<String>, Vec<(u64,u64)>)>(helios/src/runtime_core/mod.rs:127-130): the transitive peer closure is computed once inprepare_kernels(mod.rs:995→1091) and consumed inprepare_graphsviaself.peer_refs.take().unwrap_or_else(...)(mod.rs:1119-1125), with a sharedstorage_intervalshelper (mod.rs:165-183, 268). This is a simplification, not a semantic change.all_nvlink_p2pnow queries NVMLP2P_CAPS_INDEX_NVLINKin both directions and treats a one-way-only link as not-all-NVLink (helios/src/runtime_core/model.rs:152-170) — fails safe toward gating; new behaviour vs 224fb40.- Correction to note #16: the
Execution.async_transfers+Node::Copy(Memory::Peer)rejection was removed fromprepare_async_transfersonly in c9df77bd (thehas_any_peer_copy_graphs()guard is gone;mod.rs:1741-1760now starts straight at host-cap accounting). At 224fb40 the prepare-time guard still existed. The check now lives solely at load time inNativeModelviavalidate_async_transfer_peer_copy_compatibility(has_peer_copy_nodes, &cores)(model.rs:191-207, called model.rs:931-935; tests model.rs:1624/1646-1659).NativeResources::load_prepared(mod.rs:510-532) never calls it, so the policy is enforced only on theNativeModel::loadpath. AsyncTransferRuntime::rank()public accessor removed (helios/src/async_transfer/worker.rs, c9df77bd diff) — no in-tree caller remained.docs/api.md:403-405now says theflare_async_transfer_*series are labeled by "the globalrankID" — the semantics are documented at head, but the doc still does not say the label changed meaning from a flat per-process channel index, so dashboards keyed onrankstill shift silently.- CI-workflow edits are no longer in the diff:
pr_difffor.github,native-serving.yml,ymlall report no matching file, andpr_fileslists 17 files, none under.github/. The two workflow hunks noted in #16/#7 were base drift and are gone; drop that caveat. - PR description rewritten in explicit before/after form per cluster, and now states the abort explicitly ("terminating the process via
std::process::abort()if a rank remains wedged pastTIMEOUT + 30 sgrace"), the 16-retry EINTR bound, and themax_total_io <= 32justification. Evidence section now says the formal+targeted runs were re-run on c9df77bd while the full-crate pass and the live TP4 serving run remain on 224fb403; CI (lifecycle, kani, pytest) reported green; unrun list unchanged (SM103/SM121 hardware, multi-host RoCE, local Kani, 6 template tests blocked on HF 403). The live serving run is still not the #722 workload (135 graphs/rank, 4G prefix cache, ~13k tokens, 20 concurrent) and no patched-vs-unpatched comparison exists.
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.
-
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. -
Note #7 / #14 / #16 CI-workflow caveat: wrong, delete it.
pr_difffor.github,native-serving.ymlandymlall return "changes no file matching", andpr_filesshows nothing under.github/. The two workflow hunks seen against the stale localmainwere base drift, not #727's change. -
Note #16 item 3 / "Said but not done": the claim that cores combining
Execution.async_transferswithNode::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 fromprepare_async_transfersin c9df77bd (helios/src/runtime_core/mod.rs:1741-1760 now has nohas_any_peer_copy_graphs()early return). The rejection now exists only invalidate_async_transfer_peer_copy_compatibility(model.rs:191-207, called model.rs:931-935), whichNativeResources::load_prepared(mod.rs:510-532) does not call. -
Note #16 "Said but not done (a)" — the description now does state the
std::process::abort()remedy (rewritten description, "terminating the process viastd::process::abort()if a rank remains wedged pastTIMEOUT + 30 sgrace"). The charter root-cause tension stands but is no longer an omission; it is a disclosed design choice. -
Note #16 / #7 metrics bullet:
docs/api.md:403-405now reads "labeled bychanneland the globalrankID" — 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 onrankstill shift silently. -
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). -
Notes #4/#16 on
all_nvlink_p2p: it now requires the NVMLP2P_CAPS_INDEX_NVLINKquery 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. -
Note #16 "no labels": now labelled
bug,performance,priority:P1,triage:review; still no human reviewers, and reporter egtoken-ai has still not commented. -
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:
- verification/helios-lifecycle (AsyncTransfer.tla/cfg/check.py) was created/extended by the AsyncTransfer series (#711 added the primitive; #721 hardened it; #727 extends the model to 16 ints with FlushIo/hwSignaledFaulted). The TLA+ model is being kept in lockstep with the Rust by the same author, and check.py drives both TLC and Rust conformance.
- helios/src/async_transfer/{worker,scheduler,io_backend}.rs history within one day: #711 created the runtime, #721 hardened startup/DMA/teardown, #727 fixes SQE flush + hardware_signaled sentinel + metrics labels. Three passes in ~24h.
- helios/src/runtime_core/model.rs + mod.rs: #628 introduced CopyEngineGate wiring (the predicate #722 attacks), #721 rewrote teardown into two phases, #727 rewrites into three phases and splits the gate predicate. So this PR partially reverses #721's teardown structure (function-per-phase + a shared barrier helper) and narrows #628's predicate while widening what it gates.
- docs: docs/prefix-cache-offload.md and docs/runtime-core-design.md are the two docs this PR edits; both are the canonical descriptions of the offload gate and runtime teardown, so the doc edits keep the "documented behaviour" claim honest.
- No commits on the default branch since the PR branched touched its changed files (orientation packet), i.e. no rebase conflict with main reported at packet time; but the local main is stale so this could not be re-verified.
#11 [medium] People: sole owner of the area; self-follow-up on #628/#721
People angle, consolidated:
- Author: lukealonso (GitHub association COLLABORATOR), a charter-named priority contributor. 51 merged PRs in 180 days, 0 closed, 1 other open (#723) besides this one. Areas: helios/src (36), docs (31), ignition/preparation (20), tests/preparation (15), flare-cli/src (14). In this 24h window: #708, #707, #709, #711, #716, #720, #721 merged; #723, #726, #727 opened. That makes the author the de-facto owner of the AsyncTransfer/teardown/CopyEngineGate area right now — there is no other recent contributor in these files in the orientation packet ("People in these areas: (no commits in these areas in the last 180 days)").
- Reporter: egtoken-ai / Discord maxKonger — external, provided a detailed P1 repro with graph inventory and control run; has NOT commented on #727.
- No reviewers assigned; nobody else has engaged.
- #722 is the only external voice on this problem; the fix is entirely authored by the same person who wrote the code being fixed (#628 gate) and the immediately preceding rewrite (#721), so review independence is a live question for the deciders (not a judgement on the change itself).
#12 [medium] Related work: lead-by-lead disposition (all followed; none competing)
Orientation-packet leads, each followed or dismissed:
- #721 (merged, pr) — FOLLOWED, highly relevant. Same author, merged 2026-12-04, 11 files in common. #727 refines four things #721 introduced (SQE flush, hardware_signaled, metrics rank label, load-time vs prepare-time async_transfer check) and replaces #721's two-phase teardown. #721 is where the metrics rank-label defect actually came from.
- #711 (merged) — FOLLOWED. Introduced the domain-agnostic AsyncTransfer primitive + runtime-sized device pools; the base on which all of cluster 3 stands.
- #709 (merged) — FOLLOWED lightly; green-context/codec work explains
codec_context/reserve_codec_partitiondrift seen in the mod.rs/model.rs diff text; not part of #727's 16 files. - #722 (open issue) — FOLLOWED in full, saved as entry 2. It is the sole motivating report and is labelled priority:P1.
- #628 (merged) — FOLLOWED. This is the PR whose
peer_copy_graphspredicate #727 narrows/replaces; #722 explicitly measures #628's gate as covering 32/177 graphs. - #640 (open, persistent workers on rank 0) — checked, touches release_execution_resources but does not overlap #727's teardown rewrite in a conflicting way; no shared fix. Not blocking.
- #613, #507, #430, #674, #669, #714, #720 — same-file overlaps only (release_execution_resources / prepare_async_transfers / host VMM). #669 is the source of the
host_vmmpredicate that appears as drift inside #727's mod.rs diff. None compete with #727. - #726 (open, same author) — overlaps release_execution_resources and prepare_async_transfers; a sibling in the stacked series; a reviewer should expect both to touch the same functions and serialise the two if both merge.
- #723 (open, same author) — concurrent fleet-wide codec/green-context/ScratchArena work; shares the mod.rs/host.rs surface, no direct conflict found. Conclusion for the packet: every lead was either followed or accounted for; none is a competing fix for #722.
#14 [medium] Process: ready-for-review, no CI yet, no reviewers, four separable clusters
Process facts, consolidated for the report:
- State: open, marked "ready for review" in the orientation packet; NOT a draft. Opened 2026-12-04 and last updated 2026-12-04 (same day — age is hours, not days).
- CI on head 224fb40: pending at packet time; no CI result obtainable.
- Reviews: none. Reviewers: none assigned. Labels: none. Comments: none.
- Size: 16 files, +1973/−221 per pr_files (matches the packet). Note the raw
pr_diffoutput is much larger and includes other PRs' drift, so any size figure quoted from the diff tool would overstate the change. - Base: main, branched at cc0a49d. Packet asserts no default-branch commits since branching touched its files; the local main ref is stale so this could not be re-verified.
- The description's evidence section cites a command line with a user-specific jar path (--tlc-jar /home/luke/.cache/flare-formal/tla2tools-1.7.4.jar --java /usr/bin/java), so the exact verification run is not reproducible as written without substituting the jar.
- Four logically independent fix clusters in one PR (gate detection / teardown barrier / AsyncTransfer+metrics / startup drain+watchdog) touch largely disjoint file sets: runtime_core+docs+payload for (1), runtime_core/model+mod for (2), async_transfer+metrics+verification for (3), execution/threaded for (4). Worth noting for anyone deciding whether this must be reviewed/landed as one unit.
#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:
- The defect is latent since #628 (merged) introduced
CopyEngineGatekeyed only onNode::Copy(Memory::Peer); #722 measures that predicate covering only 32 of 177 graphs on a TP4 DeepSeek-V4.1-Flash core, leaving 145 ungated, and the reporter explicitly notes the gate was "unchanged on main through 17961ccd". - The user-visible symptom is in a RELEASE: #722 reports it on
flare 0.5.3(commit 9cd0cfad), with a 9+ minute hang, GPUs pinned at 100%, exited rank threads, and HTTP requests that never fail — i.e. the worst failure shape for an operator (no error, no timeout). - Breadth of demand: only one report (#722), from one external operator (egtoken-ai / maxKonger) on one topology (4x RTX 6000D PCIe, Broadcom PEX890xx, ACS disabled). The class it affects — single-host PCIe multi-rank with --prefix-cache-memory — is the documented target of docs/prefix-cache-offload.md and the SM120 workstation class named in the charter vision, so the blast radius is wider than the one report, but there is no second independent report.
- The reporter's control experiment (--prefix-cache-memory 0 completing the full 21-case/105-round matrix on the same host/binary/core) is the strongest evidence in the thread that the gate, not inference itself, is at fault; the reporter also candidly lists the untested variables (scheduler-policy differed between hung and control runs).
- The third and fourth clusters in #727 (SQE stranding, sentinel clobbering, rank labels, FinishStartup abort) have no external report at all — they are self-found defects in code merged the same day (#711/#721), so their "want" is only as strong as the author's own analysis.
#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).