Re review report · NVIDIA/hyperflare-inference #727

Raw Markdown for agents: https://autobot.eidonix.com/p/f12cc6d9-f117-4251-8393-6853a4568102.md

Recommendation: Changes Requested

All Round 1 findings are cleanly resolved at c9df77b — complete_io now preserves io_uring SQ FIFO order via remove(pos) with a regression test, RankWedgeWatchdog::CloseStalled now tracks activity across close() stages, best_effort_drain_peers sweeps peers round-robin against a shared deadline, and all 3 simplifications and 4 nits were addressed. However, verification at c9df77b identified two concrete edge-case code defects — one in the rewritten best_effort_drain_peers loop (where Ok(Err(_)) triggers an unbounded thread.join() while a peer is still inside drain_outstanding_frames) and one in AsyncTransfer's cuEventQuery-fault path (which drops host_mirror_on_drain instead of propagating HostOnly completions on clean stream drain) — plus the mandatory live multi-GPU re-run for modified threaded.rs drain paths (docs/design-review.md:252-259). Fixing both small defects and re-running the existing SM120 PCIe TP4 flare run + SIGTERM check on the final commit will make this ready to merge.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. best_effort_drain_peers treats Ok(Err(_)) as thread exit and calls unbounded thread.join() while a peer may still be inside drain_outstanding_frames (helios/src/execution/threaded.rs:1319-1340, 1540-1555, 913-919)

    • Verified behavior: When a peer fails validate_submission (threaded.rs:1540-1555), it sends replies.send(Err(error.clone())) at 1543 before calling drain_outstanding_frames(..., TIMEOUT) at 1545-1554 (which can block up to 120 s or wedge inside executor.poll()). In best_effort_drain_peers (1319-1336), Ok(Err(_)) sets exited = true and immediately calls thread.join() without a deadline — starving subsequent healthy peers from being polled/joined within the shared deadline and allowing CloseStalled to abort the process. By contrast, every real error-exit path (901, 916) returns immediately and drops replies, producing Err(mpsc::TryRecvError::Disconnected), and clean drain sends Reply::Drained only after executor.close() returns (1375-1382).
    • Fix: Only treat Ok(Ok(Reply::Drained)) | Err(mpsc::TryRecvError::Disconnected) as exited = true. Move Ok(Err(_)) into the Ok(Ok(_)) | Ok(Err(_)) => { made_progress = true; continue; } arm so a peer that already exited after sending Err immediately hits Disconnected on the next try_recv() iteration and joins, while a peer still draining in drain_outstanding_frames does not block the round-robin sweep. Add a regression test where peer 0 sends Err(...) while remaining blocked and peer 1 sends Reply::Drained.
  2. cuEventQuery-fault path hardcodes host_mirror_on_drain: None, leaving host_comp stale after clean stream drain (helios/src/async_transfer/worker.rs:1031-1066, 1143-1149, 1164-1192)

    • Verified behavior: When args.use_write_value64 && args.config.device_completions_base != 0, a hardware-signaled DMA stores completion_action: EventCompletionAction::HostOnly(slot, dma.signal_value) in PendingEventDma (1143-1149, 1164-1174). On cuEventRecord failure (1180-1192), worker_main extracts host_mirror_on_drain from completion_action so update_host_comp(slot, val) advances the mapped-host mirror when cuStreamQuery(copy_stream) == 0 (1057-1059). However, on cuEventQuery failure (1039-1044), UntrackedFaultedDma is constructed with host_mirror_on_drain: None, dropping done.completion_action so host-side readers polling host_comp[slot] never observe completion even after copy_stream drains cleanly.
    • Fix: Compute host_mirror_on_drain from done.completion_action at worker.rs:1039-1044 using the same EventCompletionAction::HostOnly(slot, val) if done.hardware_signaled => Some((slot, val)) match (or a small helper shared with 1180-1185).
  3. Re-run live SM120 PCIe TP4 serving + SIGTERM verification on the final commit (docs/design-review.md:252-259)

    • Verified behavior: docs/design-review.md:252-259 requires live multi-GPU execution of real collective graphs (e.g., serving a multi-GPU exported core via flare run) when replacing or reordering drain paths in helios/src/execution/threaded.rs. The PR's live TP4 run is from 224fb403, prior to c9df77bd's changes to best_effort_drain_peers and close_peers.
    • Fix: After applying fixes (1) and (2) above, re-run the existing SM120 PCIe TP4 flare run + SIGTERM check on the final head and record the commit hash and result in the PR description.

Subtract / Simplify

Nits

None.

Dropped on verification