Recommendation: Changes Requested
The core per-HCA GID discovery rewrite in helios/src/execution/roce_fabric.rs and the rank-local per-HCA SGID plumbing in helios/src/execution/roce.rs and helios/native/roce_proxy.c are technically sound, solve a real dual-rail ConnectX-7 defect at the right layer, and add no hot-path overhead or config switches. However, two blockers prevent merge as-is: helios/native/roce_proxy.c is locally forked ahead of its pinned upstream FlashInfer source (breaking the byte-identity invariant enforced on #643 and #577), and the PR ships its FFI/C changes with zero executable test coverage in CI or unit tests alongside blanked, unreproducible verification commands. In addition, silently redefining Fabric::gid_index to devices[0].1 breaks flare_heliopause.roce_gid_index()'s documented contract and leaves multi-host preparation one-sided on mixed-index hosts.
Merge Risk
Level: Medium
- Vendored transport fork:
helios/native/roce_proxy.cmust remain byte-for-byte identical to FlashInfer's_roce_proxy.c(not opened) after its 9-line header (roce_proxy.c:6-8,roce_proxy_dlopen.c:7-9,docs/roce-ring.md:360-364). Merging a local fork one day after#643restored parity splits preparation from serving and creates merge/re-vendor friction with open#577and#649. - Preparation vs. serving divergence on mixed-index hosts: Serving now retains both HCAs (
rails = 2) on mixed-index hosts, whileignition/preparation/collectives.py:83still passes a single scalarflare_heliopause.roce_gid_index()(nowdevices[0].1). If the second HCA's slot at that index is empty or IPv6, preparation can compile 1-rail kernels while serving connects 2 rails—inverting the exactn_railflag-offset mismatch (roce_proxy.c:1259) with no startup preflight check (RoceSpecdoes not record rail count). - Untested FFI/C path, low hot-path risk: Neither CI (
.github/workflows/native-serving.yml:63 (not opened), 109-113) nor any unit test executesroce.rs:199-221orroce_create_with_gids. On uniform-GID hosts, discovery, wire format (roce_blob_t), proxy hot paths (proxy_main,post_op,post_striped,ring_service), and ABI-14 core loading are unchanged.
Walkthrough
helios/src/execution/roce_fabric.rs:223-228, 308-321, 381-476, 1006-1044: Replaces global host-wide GID selection indiscover_inwith per-devicepick_gid_index(preferringPREFERRED_GID_INDEX = 3per HCA, else that HCA's lowest RoCEv2 IPv4 GID in0..16); addsgid_indices: Vec<u32>toFabricandTopology, setsFabric::gid_index = devices[0].1, addsFabric::gid_index_forandTopologypropagation with scalar fallbacks, and adds unit testmixed_per_hca_gid_indices_discover_both_ipv4_rails(:1182-1219).helios/native/roce_proxy.c:259, 461, 531-601, 680: Adds per-HCAroce_hca_t.gid_index, useshca->gid_indexinopen_hca(ibv_query_gid) andconnect_qp(grh.sgid_index), addsroce_create_with_gidswithNULLand0..=255bounds validation, and retainsroce_createas a wrapper while still setting write-onlyc->gid_index = gid_indices[0].helios/src/execution/roce.rs:46-61, 199-221, 397: Switches FFI fromroce_createtoroce_create_with_gids, buildsVec<c_int>fromtopology.gid_indices(with a length-mismatch fallback totopology.gid_index), and initializesgid_indices: Vec::new()intests::specification().flare-cli/src/doctor/spark.rs:150-203, 540-578: Looks up each endpoint'sgid_attrs/ndevs/{gid_index}viafabric.gid_index_for(idx), tracksready_gidsto formatindex N(uniform) vsindices [a, b](mixed), and addscx7_readiness_handles_distinct_per_hca_gid_indices.
Pre-merge Checks
- [PASS] Security / malicious screen: Pure local sysfs GID scanning, bounds-checked (
0..=255) C array validation, and per-QPsgid_indexwiring; no new network exposure, env vars, or unsafe boundary weakenings. - [WARN] Charter & value fit: Right problem, right layer, model-agnostic, targets DGX Spark/SM121 with no new flags/defaults, but breaks the vendored FlashInfer parity invariant (
docs/roce-ring.md:360-364, Charter #215) and omits verifiable evidence (AGENTS.md:103-112). - [WARN] Related / duplicate / conflict check: Genuinely additive on top of
#369,#506, and#666(no functional duplicate;#151's environment had both rails at GID 3), but edits the vendoredhelios/native/roce_proxy.cconcurrently touched by open#577and#649with no companion FlashInfer PR linked. - [WARN] Tests & verification evidence: CI never runs
--features rocetests (.github/workflows/native-serving.yml:63 (not opened), 109-113), no unit test exercisesroce.rs:199-221orroce_create_with_gids, and the PR body'scargo testcommands are blanked with no counts or reproducible hardware logs.
Blockers
-
Vendored
helios/native/roce_proxy.cis locally forked without a merged upstream FlashInfer revision (helios/native/roce_proxy.c:6-8, 259, 461, 531-601, 680;helios/native/roce_proxy_dlopen.c:7-9;docs/roce-ring.md:360-364;NOTICE:16-19)- Behavior / impact: Both C provenance headers and
docs/roce-ring.md:360-364mandate keepinghelios/native/roce_proxy.cbyte-for-byte identical to FlashInfer'sflashinfer/experimental/b12x/comm/roce/_roce_proxy.c(not opened) after the 9-line header so preparation and serving share the exact transport implementation. Maintainers enforced this invariant directly on#643(merged one day before this PR to restore 0-byte diff against FlashInfer2a07747b8) and#577. Editingroce_proxy.clocally without an upstream FlashInfer commit breaks parity, leavesNOTICE:18-19's "implementation is unchanged" statement false, and forces future re-vendors (#577,#649) to reconcile an untracked fork. - Fix: Land
roce_create_with_gidsand per-HCAroce_hca_t.gid_indexupstream inlocal-inference-lab/flashinferfirst (keepingROCE_ABI_VERSION = 14unchanged so existing exported cores continue to load), then re-vendor_roce_proxy.c(not opened) byte-for-byte after the provenance header and cite the merged upstream FlashInfer commit SHA in the PR description.
- Behavior / impact: Both C provenance headers and
-
Missing executable test coverage for
roce.rs/roce_proxy.cand unreproducible verification claims (.github/workflows/native-serving.yml:63 (not opened), 109-113;helios/src/execution.rs:16-17;helios/src/execution/roce.rs:199-221, 394-406, 408-529;docs/roce-ring.md:381-384;docs/design-review.md:247-259;AGENTS.md:103-112)- Behavior / impact:
helios/src/execution/roce.rsis gated on#[cfg(feature = "roce")]. CI'snativejob omitsroce, and therdmajob only runscargo check --locked --manifest-path flare-cli/Cargo.toml (not opened) --tests --features roce,rdma. Every existing test inroce.rs:408-529fails preflight before line 199 (andspecification()setsgid_indices: Vec::new()at:397), so neither the Rust per-HCA dispatch (roce.rs:199-221) nor the new C validation loop (roce_proxy.c:538-549) is exercised anywhere. Meanwhile, bothcargo testbullets in the PR description render with blanked code spans (no commands, crates, features, or pass counts), no--features roceexecution is reported (required bydocs/design-review.md:247-251), and the hardware claim omits commands, core ID, and results (AGENTS.md:103-112). - Fix:
- Add unit tests in
helios/src/execution/roce.rsthat populate non-emptytopology.gid_indicesand directly exerciseroce_create_with_gidsbounds validation (NULLgid_indices,< 0,> 255—which runs atroce_proxy.c:538-549beforeopen_hcaand requires no RDMA hardware). - Run and report exact commands and counts for
cargo test --locked --release --manifest-path helios/Cargo.toml (not opened) --features roce --lib execution::roceand theflare-clidoctor tests (plus exact hardware verification command/core/outcome details in the PR description), and ensure the commit carries a validDesign-Signed-Off-Bytrailer per.githooks/commit-msg:56-63.
- Add unit tests in
- Behavior / impact:
Should Fix
-
One-sided serving fix silently changes
Fabric::gid_index/flare_heliopause.roce_gid_index()and leaves mixed-index preparation inconsistent (helios/src/execution/roce_fabric.rs:430;heliopause/src/python.rs:692-700;ignition/preparation/collectives.py:80-85;helios/native/roce_proxy.c:1259;helios/src/runtime_core/model.rs:46-59;helios/src/execution/roce.rs:147-162)Fabric::gid_indexchanged from the host-wide rule ("3 when every active device has a RoCEv2 IPv4 GID there, otherwise the lowest index at which one does") todevices[0].1(whichever active device sorts first by name).heliopause/src/python.rs:692-699still documents the old rule and passesfabric.gid_indexintoignition/preparation/collectives.py:83(roce.AllReduce(..., gid_index=flare_heliopause.roce_gid_index())).- On a mixed-index host (e.g.,
roceP2p1s0f0at 5 androcep1s0f0at 3, orroceP2p1s0f0at 3 androcep1s0f0at 5 with emptygids/3),roce_gid_index()returnsdevices[0].1, causingb12xpreparation to either drop the second HCA (preparing 1-rail kernels while serving opens 2 rails—inverting the exactn_railflag-offset mismatch inroce_proxy.c:1259, undetected becauseRoceSpecdoes not record rail count) or open the second HCA at a non-IPv4 GID. - Fix: Pair the upstream FlashInfer PR with per-HCA
gid_indicessupport inb12x.comm.roce.AllReduceand thread per-HCA indices throughflare_heliopauseintoignition/preparation/collectives.py:83. If preparation support is explicitly deferred to a follow-up, updateheliopause/src/python.rs:692-699to state the actual semantics accurately and disclose the mixed-index preparation limitation in the PR description.
-
Doctor's terminal
Warnfallback and CLI doc still assume a single host-wide GID index (flare-cli/src/doctor/spark.rs:250-256;docs/cli-design.md:1695;helios/src/execution/roce_fabric.rs:221)- When
discover()succeeds on a mixed-index host (e.g.,[3, 5]) but no active CX7 endpoint resolves a local IPv4 prefix,spark.rs:252-255still reports"at RoCEv2 GID index {}"with onlyfabric.gid_index(devices[0].1), misleading operators about the second HCA's index.docs/cli-design.md:1695("serving's RoCEv2 GID index") androce_fabric.rs:221("the GID index ... they use") are similarly singular. - Fix: Format uniform vs. mixed indices consistently in
spark.rs:252-255(reusing the same label helper as:187-198), and updatedocs/cli-design.md:1695andhelios/src/execution/roce_fabric.rs:221to reflect per-HCA GID indices.
- When
Subtract / Simplify
- Delete write-only
roce_ctx_t.gid_index(helios/native/roce_proxy.c:268, 558):c->gid_indexis written once (c->gid_index = gid_indices[0];) and read nowhere in the file (open_hcaat:461andconnect_qpat:680both usehca->gid_index).roce_ctx_tis opaque across FFI and not part ofroce_blob_t. Remove both lines (in the upstream FlashInfer change as well) to eliminate dead, misleading state. - Collapse duplicate
gid_index/gid_indicesstorage and three unreachable fallback branches (helios/src/execution/roce_fabric.rs:224-225, 310-311, 1009-1011, 1027-1031, 1567, 1682, 1834;helios/src/execution/roce.rs:199-203, 397):discover_inalways populatesgid_indices1:1 with non-emptyendpoints. Keeping both fields and three silent scalar fallbacks violatesAGENTS.md:188-193("no speculative compatibility or fallback layers") and silently masks truncated/mismatched vectors instead of failing fast. Store onlygid_indices: Vec<u32>onFabricandTopology(with a derivedgid_index(&self) -> u32accessor ifheliopausestill needs a scalar), validatetopology.gid_indices.len() == topology.hcas.len()inRoceTransport::openpreflight (roce.rs:152-180), and populate realgid_indicesin the four test fixtures. - Avoid dead
roce_createshim in-tree and fold doctor's parallelready_gidsvec intoInterface(helios/native/roce_proxy.c:587-601;flare-cli/src/doctor/spark.rs:150, 172-198, 267-273):roce_createhas zero in-tree callers and duplicates then_hcabounds check (:591-594vs:538); if FlashInfer's Python callers switch toroce_create_with_gidswhen upstreaming, droproce_createupstream too (otherwise cover it in FlashInfer's proxy tests). Inspark.rs, addgid_index: u32toInterface(:267-273) instead of maintaining a parallelready_gidsvector (:150, 179).
Nits
- Tighten per-HCA test coverage (
helios/src/execution/roce_fabric.rs:1182-1219;flare-cli/src/doctor/spark.rs:540-578): Add a case inroce_fabric.rswhere an HCA has valid IPv4 RoCEv2 GIDs at both index 1 and index 3 (pinning the per-HCAPREFERRED_GID_INDEX = 3preference), and write a decoy IPv6gids/3+gid_attrs/ndevs/3onroce1inspark.rs:540so the doctor test fails if it regresses to readingndevs/3. - Restore blanked inline code spans in the PR description: Multiple filenames, symbols, and both
cargo testcommands rendered as blanks in the PR body (AGENTS.md:134-135).
Dropped on verification
- Suggestion to bump
PROXY_ABI/ROCE_ABI_VERSION(Correctness F3): Dropped.ROCE_ABI_VERSION = 14(roce_proxy.c:141,roce.rs:23) is the GPU-kernel-to-proxy ABI recorded in exported cores; neitherroce_layout, opcodes, norroce_blob_tchanged. Per maintainer@original-el8on#577, bumping it would gratuitously break loading of existing ABI-14 cores. - Suggestion to add a mixed-build rendezvous wire rejection field per
#232(Dossier #4,Value Prop #4): Dropped. Unlike#232(which changedplan_shape_routesso old and new builds planned conflicting routes from the same endpoints),#672leavesplan_shape_routesandroce_blob_tunchanged andsgid_indexis strictly rank-local (connect_qpuses the peer's blob GID fordgid,roce_proxy.c:679-680). Both ranks still compute identical mirrored routes frommin(len)endpoints (roce_fabric.rs:1025), so a breaking wire field would needlessly break rolling compatibility on uniform-GID clusters. - Claims that
docs/multi-host.md:42-43, 102-130,docs/roce-ring.md:161, 333-342, 405, anddocs/cli-design.md:1712-1714are stale (Dossier,Correctness F2,Subtraction S5): Dropped after reading all three files.docs/multi-host.md:42-43already uses plural "Active RoCEv2 ports with IPv4 GIDs" and:102-130does not state a host-wide GID rule;docs/roce-ring.md:161, 405cover unchanged ABI 14 and:333-342documents FlashInfer's externalvalidate_roce_ring_native.py (not opened) --gid-indexflag;docs/cli-design.md:1712-1714is a historical qualification note of a 4-Spark run where all hosts used GID 3. - Claim that
u32 -> c_int -> uint8_tnarrowing inroce.rs:199-203is an unguarded overflow risk (Correctness F4): Dropped as a narrowing defect (retained only under missing FFI test coverage). Verified thatroce_proxy.c:545(gid_indices[h] < 0 || gid_indices[h] > 255) rejects everyu32 > 255afterg as c_int(256..=i32::MAXstays> 255;> i32::MAXwraps< 0), andGID_TABLE = 16bounds discovered values to0..16. - Claim that
NOTICE:16-19was previously up to date (Correctness F3): Qualified.NOTICE:17already pointed to older FlashInfer SHAf5f5341dbefore#672(lagging#643's2a07747b8), though#672does break its "implementation is unchanged" statement. - Claim that
#672had noflare-autobotcase-file comment (Dossier Community): Dropped as stale (pr_commentsconfirms it was posted 2026-12-02 03:06). - Concern about
#151non-linkage (Dossier #7): Dropped as non-actionable;#151had both CX-7 rails at GID index 3 and#672does not claim to close it.