Explore scratchpad · NVIDIA/hyperflare-inference #672

Raw Markdown for agents: https://autobot.eidonix.com/p/184405f0-99df-4518-9506-7a65cd19c0b3.md

#1 [high] Change: #672 what it does, size, files

PR #672 "fix(helios,roce): select RoCEv2 IPv4 GID index per HCA", author nepenth (FIRST_TIME_CONTRIBUTOR), opened 2026-12-02 03:04, open/ready-for-review, 0 reviews, 0 comments, no CI checks on head c582b10. Base main. Size 4 files +187/-40.

Diff facts (from pr_diff / result 2):

  1. helios/src/execution/roce_fabric.rs (+84/-24)
    • Fabric gains pub gid_indices: Vec<u32> (after gid_index) at ~line 224; Topology gains pub gid_indices: Vec<u32> (~line 311).
    • discover_in rewritten: previously computed ONE global index (PREFERRED_GID_INDEX=3 if every active device had RoCEv2 IPv4 GID there, else the lowest index where ANY device had one), then filtered out devices that did not have the GID at that index. Now a per-device closure pick_gid_index(name) = index 3 if valid on that HCA else that HCA's own lowest index; filter_map drops only devices with no RoCEv2 IPv4 GID at all; then .take(MAX_DEVICES). Devices now carry (name, gid, netdev).
    • New behaviour: returns Err "no active RDMA device has a RoCEv2 IPv4 GID" if the device list comes out empty (previously the error came from the index scan).
    • Fabric::gid_index is now set to devices[0].1 — i.e. the FIRST remaining device's index (previously the global chosen index).
    • New Fabric::gid_index_for(&self, index: usize) -> u32 with fallback to self.gid_index when gid_indices not populated (line ~1007).
    • Fabric::topology() now emits gid_indices: clone of self.gid_indices if len() == endpoints.len(), else vec![self.gid_index; self.endpoints.len()].
    • New test mixed_per_hca_gid_indices_discover_both_ipv4_rails (roce_fabric.rs ~1181-1216): device roceP2p1s0f0 with RoCE v2 IPv4 at index 3, rocep1s0f0 with IPv6 link-local RoCE v2 at 3 and IPv4 at 5; asserts endpoints.len()==2, fabric.gid_index==3, gid_indices==[3,5], gid_index_for 3/5, and after topology(): rails==2, topology.gid_indices==[3,5].
    • Other Fabric literals in existing tests get gid_indices: Vec::new().
  2. helios/native/roce_proxy.c (+34/-8)
    • roce_hca_t gains int gid_index; open_hca uses hca->gid_index for ibv_query_gid; connect_qp sets rtr.ah_attr.grh.sgid_index = (uint8_t)hca->gid_index (was c->gid_index).
    • New exported roce_create_with_gids(...) taking const int* gid_indices; validates non-NULL pointer plus each index 0..=255 (error string "invalid roce gid index %d for HCA %d"); sets c->gid_index = gid_indices[0] (context-level field kept).
    • Old roce_create(world, rank, hca_names, n_hca, gid_index, ...) retained as wrapper: bounds-checks n_hca, fills int gids[ROCE_MAX_HCAS] with the single index, delegates.
  3. helios/src/execution/roce.rs (+10/-4)
    • FFI extern block now declares roce_create_with_gids instead of roce_create (the Rust side never calls the wrapper).
    • RoceTransport::create builds gid_indices: Vec<c_int> from topology.gid_indices if len() == pointers.len(), else vec![topology.gid_index; pointers.len()].
  4. flare-cli/src/doctor/spark.rs (+59/-4)
    • inspect enumerates endpoints with index and uses fabric.gid_index_for(idx) to read ports/1/gid_attrs/ndevs/{gid_index} per endpoint; collects ready_gids; detail line prints "RoCEv2 GID index N" when uniform or "RoCEv2 GID indices [a, b]" when mixed.
    • New test cx7_readiness_handles_distinct_per_hca_gid_indices (~spark.rs:539-576) with roce0/enP2p1s0f0np0 @idx3 and roce1/enp1s0f0np0 @idx5, asserts Pass and detail contains "2 of 2 active CX7 devices" and "indices [3, 5]".

#2 [high] Why: #143 issue and #369 prior fix for the same GID-index problem

#143 (open, bug, area:preparation + area:rocenante, priority:P2, triage:investigate, by CaptKitCarson 2026-10-29): "GB10 TP2 export: b12x RoCE prep hard-defaults to GID index 3 and fails when the IPv4 RoCE v2 GID is elsewhere (Helios already scans)". Two DGX Spark GB10, TP2 over CX-7. Reports GID tables where IPv4 RoCEv2 sits at idx 5/6 and index 3 is an IPv6 GID or empty; position depends on how many IPv6 addresses the interface holds. Reporter later corrected themselves: index 3 was EMPTY at failure, not IPv6.

#369 (merged 2026-11-21, by yatesdr, COLLABORATOR, +20/-0, 3 files: heliopause/src/python.rs, ignition/preparation/collectives.py, tests/preparation/test_collectives.py): flare_heliopause.roce_gid_index() returns the index from the SAME Rust discovery so "the rule exists once"; create_roce_runtime passes it to roce.AllReduce. Explicitly notes: "b12x still opens every active device with a non-zero GID at the chosen index, while serving keeps only devices with a RoCE v2 IPv4 GID there, so the two device sets differ when an active device holds a GID of another type at that index." That residual per-HOST single-index assumption is exactly what #672 removes on the serving side (and #369 keeps it on the prep side — prep still takes ONE index from roce_gid_index()).

#3 [high] Undeclared / not-carried-through: prep still single-index, vendored roce_proxy.c forked, docs singular

(a) flare_heliopause.roce_gid_index() (heliopause/src/python.rs:692-704) returns fabric.gid_index, and ignition/preparation/collectives.py:83 passes it as gid_index= to b12x. This is a SINGLE index for the host, fed to roce.AllReduce. Its doc comment (python.rs:692-693) explicitly states the OLD rule: "3 when every active device has a RoCEv2 IPv4 GID there, otherwise the lowest index at which one does". #672 changes the underlying rule (Fabric::gid_index is now devices[0].1, the first remaining device's own index) but does NOT update this doc comment or add a per-HCA path to preparation. So after #672, preparation would take devices[0]'s index for every b12x device — the same class of rung-mismatch the PR says it fixes for serving, on the prep side. Not declared in the PR description. Also #369's author (yatesdr) designed roce_gid_index() to keep "the rule exists once"; #672 changes the rule without touching that consumer.

(b) #672 declares roce_create_with_gids in the Rust FFI extern block (helios/src/execution/roce.rs:46) and calls it (roce.rs:205), while roce_create remains at helios/native/roce_proxy.c:587 with no caller. Line exposure: helios/src/execution/roce.rs:11 comment still says "native/roce_proxy.c, the proxy the kernels' ABI was..."

(c) helios/native/roce_proxy.c:6-8 header still says "Vendored from FlashInfer's pinned preparation dependency (flashinfer/experimental/b12x/comm/roce/_roce_proxy.c, proxy ABI 14). Keep the source below identical so preparation and serving share the transport ABI." helios/native/roce_proxy_dlopen.c:7-9: "keeping the vendored roce_proxy.c byte-for-byte identical to FlashInfer". #672 edits that file (adds roce_create_with_gids, per-HCA gid_index) with no upstream FlashInfer revision cited, so the vendored copy now diverges from the pin. This is the same invariant #643's review treated as a blocker and #649 (open) is currently blocked on ("the vendored transport is forked ahead of its unmerged upstream").

(d) docs drift: flare-cli/src/doctor/spark.rs:250-256 fallback message still says "at RoCEv2 GID index {}" (singular) using fabric.gid_index even when indices are mixed. docs/cli-design.md:1695-1698 says "The report uses serving's RoCEv2 GID index and lists ..." (singular). docs/roce-ring.md:161 ("Preparation and serving use proxy ABI 14"), :361-364 (vendored parity rule) and :405 (ABI troubleshooting) untouched; docs/multi-host.md:42-43, 102-130 untouched.

(e) CI: .github/workflows/native-serving.yml:63 runs cargo test ... helios --features runtime-core,server (execution::roce_fabric::tests is NOT feature-gated — helios/src/execution.rs:18 pub mod roce_fabric; — so the new roce_fabric test DOES run in CI). But execution::roce is #[cfg(feature = "roce")] (execution.rs:16-17) and the only roce job (:101-113) runs cargo check --features roce,rdma — no --features roce TESTS anywhere in CI, so the roce.rs FFI/path change and the C compile of roce_create_with_gids are compiled (build.rs:67-77 via helios/build.rs) but the roce.rs test at roce.rs:394 is not executed by CI. Head c582b10 has no checks at all (orientation packet).

#4 [high] Related work: #369, #143, #151 — which mismatch #672 does and does not close

#369 (merged 2026-11-21, yatesdr) made preparation take Helios's per-HOST index: flare_heliopause.roce_gid_index() -> create_roce_runtime(gid_index=...) -> roce.AllReduce (heliopause/src/python.rs:692-704, ignition/preparation/collectives.py:83). Its own description flags the residual hole: "b12x still opens every active device with a non-zero GID at the chosen index, while serving keeps only devices with a RoCE v2 IPv4 GID there, so the two device sets differ when an active device holds a GID of another type at that index." #672 closes part of that hole on the serving side only (serving now keeps devices with the GID at different indices; preparation still uses ONE index for all b12x devices). So the class of mismatch described in #151 (prep opened 2 rails / 2 HCAs, runtime dropped one) is fixed for the case "HCA B has its IPv4 GID at index 5, HCA A at 3", but remains possible when preparation and serving disagree on which devices are selected for other reasons (e.g. a device with a non-zero GID of another type at the chosen index — #369's stated residual difference). Issue #151 (open, triage:verify-for-closure) is the closest match to #672's "Why": "GB10 TP2 serving: first request times out on RoCE collective (HCA 0, sequence 1) when both CX-7 rails are active; single rail works" — but note that in #151 BOTH rails were at GID index 3 (evehour's env: "RoCE v2 IPv4 GID index 3" for both functions), so #672's mechanism (different indices per HCA) does NOT explain #151's report. #151 was instead pointed at #232 (merged 70069281, rail planning) by original-el8 on 2026-11-18. #672 does not cite or reference #151 or #143 in its description. Issue #143 (open, area:preparation/area:rocenante, P2) is the prep-side version, closed for prep by #369; #672 addresses the serving-side variant of the same rule.

#6 [high] Process: no CI, no reviews, untriggered; what CI would and would not cover

#672 as opened: state "open, ready for review" (orientation packet), 0 comments, 0 reviews, no labels, no linked issue, no CI checks on head c582b10 (packet: "CI on the head commit: no checks"). Opened 2026-12-02 03:04, last updated same minute — no follow-up activity, no Autobot case-file comment (unlike #506/#643/#649, which all received an automatic case file + review). Age at case-file time: hours, not days.

What CI would run if triggered (.github/workflows/native-serving.yml):

Repo process constraints that apply to the commit (docs/design-review.md):

#7 [high] Project fit: charter rules and doc contracts that bear on the change

Charter lines that bear on #672 (read_charter):

Non-goal check: nothing here is rack-scale/disaggregation, CPU backend, or new hardware support; it is a defect fix inside an already-supported deployment.

#8 [high] Claims and evidence: what is verified in the diff and what is only asserted

Claims in the #672 description and what backs each (all from read_item 672 / pr_diff):

  1. "cargo test … — passed. cargo test … — passed." (identifiers blank in the rendered body). No command, no crate/feature, no counts. The two new tests are listed; the feature-gated execution::roce suite is not mentioned. Compare #643 ("30 passed", exact command) and #577 (1,728/1,728 on ARM64) — the bar the reviewers here have applied.
  2. "End-to-end hardware verification on 2× GB10 (SM121) dual-rail ConnectX-7 … eliminated the sequence-1 RoCE collective timeout and brought up dual-rail TP2 serving (verified with GLM-5.3-Flash-FP4-Local, greedy parity, C1–C4 concurrent benchmarks, and full eval suite)." No throughput numbers, no before/after, no core id, no command. This is the only evidence for the actual user-visible fix, and it is unverifiable as written. It is, however, exactly the failing scenario reported in #151 (two active CX-7 rails, sequence-1 timeout, HCA 0) and matches #151's hardware (GLM-5.3-Flash-FP4-Local, 2× GB10).
  3. "…dropped any active HCA whose IPv4 RoCEv2 GID lived at a different index" — verified in the diff: discover_in previously filtered with .filter(|name| roce_v2_ipv4(name, gid_index)) against one global index; now per-device (filter_map + pick_gid_index). True before/after.
  4. "multi-host collectives timed out on sequence 1 due to the rail/flag-offset mismatch" — plausible and consistent with the proxy layout comment (roce_proxy.c:14-21: flag[src][slot][rail]), and with #151's "HCA 0, at sequence 1" symptom; ranks that plan different rail counts index the flag array differently. Not demonstrated in the PR.
  5. "Add roce_create_with_gids with bounds validation (…), while keeping roce_create intact as a backward-compatible wrapper." Verified in the C (roce_proxy.c:531-601). Note the "backward-compatible wrapper" is dead code in-tree: the only caller, the Rust FFI, was switched to roce_create_with_gids (roce.rs:46, 205), and nothing else in the repo calls roce_create (grep: only roce_proxy.c:587/599).
  6. "Doctor alignment … display either index N (uniform) or indices [a, b] (mixed)." Verified (spark.rs:187-200). Undeclared: the terminal Warn fallback at spark.rs:250-256 still reports a single "RoCEv2 GID index {}".
  7. "Carry gid_indices on Fabric and Topology (with gid_index_for falling back to gid_index for backward compatibility)" — verified, with the fallback being gid_indices.get(index), i.e. any short/empty vec silently degrades to the single global index (roce_fabric.rs:1006-1011, 1024-1031; roce.rs:199-203). Tests for that fallback path are implicit only (existing fixtures set gid_indices: Vec::new()).

#9 [high] Reach: behaviour changes the description does not spell out; no mixed-build guard; ABI untouched

Behaviour changes a reader should know, from the new discover_in (helios/src/execution/roce_fabric.rs:404-475 in PR head) compared with main:

  1. Which devices are kept changes on every multi-HCA host, not only the mixed-index case. Before: keep devices whose RoCEv2 IPv4 GID is at the ONE global index (3 if all had it there, else the lowest index where ANY device had it). After: keep every device that has a RoCEv2 IPv4 GID at any index, each with its own index. On CAP's real tables (#143 comment 2026-11-19) — rocep1s0f0/roceP2p1s0f0 with IPv4 RoCEv2 at index 5 and link-local IPv6 RoCE v2 at 3 — both rules pick 5, so no change there. They diverge when one HCA has the IPv4 GID at 3 and another at 5: main drops the second HCA (this is the bug), #672 keeps both.
  2. Fabric::gid_index semantic change. It used to be "the host's chosen index" (and is documented that way in heliopause/src/python.rs:692-693). It is now devices[0].1, i.e. whatever index the first device in name order happens to use. Consequences beyond the doc comment:
    • flare_heliopause.roce_gid_index() → ignition/preparation/collectives.py:83 (gid_index= for b12x) now reports the first device's index for the whole host. #369's whole point was that prep and serving share ONE rule; after #672 the serving rule is per-device and prep still needs one, and devices[0] is an arbitrary pick of that one.
    • The doctor's terminal fallback (spark.rs:250-256) and docs/cli-design.md:1695-1698 still say "the RoCEv2 GID index".
  3. Ordering is unchanged (names sorted, MAX_DEVICES = 4 cap), so Endpoint indices still line up with Topology.hcas and gid_index_for(idx) (used by the doctor with the index from fabric.endpoints.iter().enumerate(), spark.rs:153-165). The rendezvous encode/decode format is untouched (roce_fabric.rs:531/563), so mixed builds do not reject each other on the wire here — a rank without #672 that drops the second HCA still plans a different rail count than a rank with it. #232 handled a comparable mixed-build hazard by adding a field that older builds reject; #672 adds no such guard, so a mixed cluster fails at connect with a rail-count mismatch rather than refusing loudly.
  4. Error path. New: return Err(…) when no device qualifies (roce_fabric.rs:427-429). Same message text as before.
  5. Native ABI. roce_create_with_gids is a new exported symbol; roce_create keeps its signature. No ROCE_ABI_VERSION change (still 14, roce.rs:23), no roce_blob_t/layout change, so exported cores and the kernel-visible ABI are unaffected — the only wire effect is that sgid_index per HCA now equals that HCA's own GID index (roce_proxy.c:680).
  6. Reach of the SQL index choice. gid_index is used by ibv_query_gid at QP setup (roce_proxy.c:461) and as the SGID for the QP (roce_proxy.c:680); the destination GID comes from the peer's blob (peer->gid[r], roce_proxy.c:650/679), so peers may legitimately use different indices — the PR's premise. c->gid_index is retained but is now only a record of gid_indices[0]; nothing reads it after the change (grep shows no other use).

#10 [high] Recent activity: builds on #369/#506/#666; reverses #643's vendored-parity restore; overlaps open #576/#577/#649

Recent commits in the touched areas and how #672 sits against them (from search_history on main and the packet):

#12 [high] Leads followed: each orientation item and whether it is relevant to #672

Leads from the orientation packet and what each turned out to be:

#13 [high] Research summary

Case file for #672 is complete: every angle has scratchpad entries (12 notes) and every orientation lead is followed or dismissed with a reason.

What I verified. The diff does what the "What Changed" section says on the discovery/transport/doctor paths (per-HCA pick_gid_index in discover_in, gid_indices on Fabric/Topology, roce_create_with_gids + per-HCA sgid_index, doctor printing index N or indices [a, b], two new tests). No ABI bump, no wire-format change for cores or rendezvous records.

What the description does not say (high-importance findings). (1) Fabric::gid_index is now devices[0].1, and its only other consumer, flare_heliopause.roce_gid_index() → ignition/preparation/collectives.py:83 (not opened), still needs one index per host and still documents the old rule (heliopause/src/python.rs:692-704) — the preparation half of the mismatch that #369 (merged 2026-11-21) was meant to make single-rule is left on an arbitrary per-host pick. (2) The edit to helios/native/roce_proxy.c breaks the byte-identical-to-FlashInfer invariant that #643 was merged to restore one day earlier and that #649/#577 are currently blocked on; no upstream FlashInfer revision is cited. (3) roce_create is kept as a "backward-compatible wrapper" with no remaining caller (the Rust FFI switched to roce_create_with_gids). (4) No mixed-build guard: two ranks with and without #672 plan different rail counts, unlike #232 which added a field older builds reject. (5) Docs the repo treats as the contract (docs/cli-design.md:1695-1698, docs/roce-ring.md:161,361-364, docs/multi-host.md) are untouched, and the doctor's terminal Warn fallback (spark.rs:250-256) still prints a single index.

Cross-references worth carrying. #151 is the closest user-visible report (2× GB10, dual CX-7, "HCA 0, sequence 1", GLM-5.3-Flash-FP4-Local) but its environment has both rails at GID 3, so #672's mechanism does not explain it; #672 neither cites it nor posts to it, leaving original-el8's triage:verify-for-closure retest request open. #143 documents the same defect class on the prep side and is not fixed here. #506 authored the doctor file and its "serving's GID index" wording; #666 authored the planner ordering #672 patches.

Evidence and process. CI has run nothing on head c582b10; if triggered, the helios non-roce job and the flare-cli job would run both new tests, but the only --features roce job is cargo check, so the C change and the FFI path are compile-checked only — the gap #643/#577 reviews flagged. The evidence lines are bare "cargo test … — passed" and an unquantified hardware paragraph, below the bar AGENTS.md:103-112 and the charter's #210/#397 rule set, and no Design-Signed-Off-By could be confirmed.

#14 [high] File map with line citations for the changed sites and their consumers

Compact map for the report body (PR head c582b10 unless stated):

#5 [medium] People: nepenth is a first-time contributor; area owners and prior authors of each touched file

Author: nepenth, GitHub association FIRST_TIME_CONTRIBUTOR; orientation packet: 0 other PRs/issues in the last 180 days (0 merged, 0 closed, 0 open). Single commit c582b10 on branch fix/roce-per-hca-gid. Discord handle not given (other RoCE PRs cite one, e.g. #369 "Discord: D-Rock", #643 "Discord: lukealonso").

Who works in these areas (orientation packet, commits on default branch last 180 days):

Charter: "Priority contributors (@voipmonitor, @original-el8, @lukealonso) carry extra weight"; nepenth is not among them, so the PR gets judged on its merits with an explicit review spelling out what is missing (#229).

#11 [medium] Community: no engagement at all on #672; demand documented in #143 and #151

Community: #672 has 0 comments, 0 reviews, 0 reactions, no labels, and did not receive the automatic flare-autobot case-file comment that #506, #643, #577 and #649 all got within minutes of opening (see those PRs' first comment). So no automated review has run against it at case-file time.

Interest the underlying problem has drawn elsewhere, which a reader can use to judge demand:

#15 [medium] PR text: code spans stripped, no linked issue, no Discord, no reproducible evidence lines

Observations about the PR text itself (read_item 672, pr_diff), relevant because reviewers here judge descriptions against AGENTS.md:80-112 and because the packet's own rendering shows blanks:

  1. The description lost its inline code spans: "different HCAs on the same host can hold their IPv4-mapped RoCEv2 GID at different GID table indices — for example, index on one HCA and index on the other" and "cargo test … — passed" render with empty identifiers, as do several "What Changed" bullets (". Per-HCA RoCEv2 IPv4 GID discovery ():"). Whatever the cause, the posted body no longer names the files, symbols or test commands it means, so the two evidence lines cannot be reproduced from the description alone.
  2. No linked issue: #143 and #151 are both open on this exact symptom class and neither is referenced or mentioned; the description also has no "Discord:" handle, which every recent RoCE PR in this repo carries (#369, #643, #649, #577).
  3. Four-part structure is present (Why / What Changed / Verification) but the "Verification" section gives no command, crate, feature set, test counts, core id, throughput number, or baseline — the specific omissions the #506 reviewer rejected three times.
  4. It declares unit tests in two files (roce_fabric.rs, spark.rs) and mentions none for roce.rs, whose FFI change is the one CI cannot execute.