Opened by a workflow run, Dec 3, 2026 12:25 PM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: lukealonso (COLLABORATOR; charter-named priority contributor, 41 merged PRs in 180 days); Discord lukealonso Motivation: Multi-node RoCE tensor-parallel serving and preparation share one vendored C RDMA proxy. Three open PRs had modified that file separately and collided, the runtime silently dropped a network rail on hosts whose NICs put their RoCE GID at different slots, the mesh all-gather relay was compiled but never enabled, and the native RoCE unit tests never ran in PR CI. This PR lands the resolved proxy plus the missing wiring and a byte-parity check. Scale: +1247 / −129 lines in 12 files Proposal:
- Re-vendor
helios/native/roce_proxy.cbyte-for-byte from FlashInfer PR #213 commit524799c4(per-HCAroce_create_with_gids, 1-hop closed-ring opcodes,RING_WINDOW8→16, connect-blob 1168→1176 bytes, send-queue caps 48/64), keepingROCE_ABI_VERSION = 14. - Discover a RoCEv2 IPv4 GID index per active HCA instead of one host-wide index; propagate through
heliopause, Ignition preparation,flare doctor, androce_create_with_gids, raisingRuntimeErrorrather than dropping rails on old FlashInfer. - Port
partners()/relay_plan(), addTopology::relay_plan, validate it, and callroce_set_relaybetweenroce_connectandroce_start— enabling the mesh all-gather relay by default. - Add
tests/preparation/test_roce_proxy_parity.py(byte parity + GID forwarding) andcargo test --features roce --lib execution::rocetonative-serving.yml. - Repin
pyproject.tomlto the new FlashInfer rev; updatedocs/roce-ring.md. Touches: helios/native/roce_proxy.c(wire-visible RDMA transport, ABI-14)helios/src/execution/{roce.rs,roce_fabric.rs}(live data path + discovery)ignition/preparation/collectives.py(preparation can now abort on mixed-GID hosts) Related items:- #672 fix(helios,roce): select RoCEv2 IPv4 GID index per HCA (open): superseded by this PR; holds the only hardware evidence for the GID work
- #649 helios: add 1-hop closed-ring RoCE prefill proxy opcodes (open): superseded; source of the prefill numbers
- #577 roce_proxy: raise ring mailbox window to 16 and drain relays eagerly (open): superseded; carries maintainer CHANGES_REQUESTED whose fix this PR implements
- #279 Match native RoCE transport to the pinned FlashInfer proxy ABI 14 (merged): merged PR that explicitly left
roce_set_relayoff — this PR reverses that - #643 perf(helios): sync vendored roce_proxy.c to FlashInfer 2a07747b8 (merged): same author, immediately preceding sync of the same pattern
Link: https://github.com/NVIDIA/hyperflare-inference/pull/707
Autobot comments: Three things the description underplays. (1) It claims to supersede #672/#649/#577 but closes none; two authors are first-time contributors and their work is absorbed without a comment on their PRs. (2) It reverses merged #279's documented decision that serving does not call
roce_set_relay: the relay is now on by default for any even-world mesh with mutual direct-cable pairs, and the "25% less switch traffic" benefit is explicitly never measured — every performance number is inherited from #649/#577 on 4× DGX Spark, against the charter's "bring real evidence over main on a served workload". (3) The parity test is the only lock on the FlashInfer rev (nouv.lockexists) and that rev is an unmerged PR branch, so a force-push or squash-merge breaks CI on main. Also:docs/multi-host.mdstill says relays are ring/chain-only; the extra files appearing in the diff (flare-cli/src/cli.rs(not opened),docs/api.md, orbit wording) are main-side drift from merged #687/#697, not hidden scope. No reviews, no labels, no comments yet; CI green.
Value Proposition
Value Proposition — PR #707 (helios,ignition,flare-cli: unify ABI-14 RoCE proxy sync, wire roce_set_relay, and enforce CI parity)
Charter alignment: mostly aligned, one direct conflict. The change targets the model-agnostic transport layer (helios/src/execution/roce.rs, roce_fabric.rs, the vendored helios/native/roce_proxy.c) with no new flags, no per-model branches, and no new hardware matrix — inside "keep the runtime small and model-agnostic" and the cross-node serving goal on SM121/DGX Spark. It keeps ROCE_ABI_VERSION = 14, satisfying the review standard that exported cores still load, and adds an exact FlashInfer pin (pyproject.toml:47) plus an automated drift check, matching roadmap item #215's "strictly pinned" position.
The conflict is explicit: the charter's "Bring real evidence" rule (#210) requires benchmarks on a served workload for performance PRs. #707 is substantially a performance PR whose transport gains are stated as not re-measured; every number (1.20–1.46× RS/AG, +3.76–4.32% prefill, −6.2/−9.7% ring latency) is inherited from #649 and #577 on 4× DGX Spark, while the author ran a single-host SM120. The "25% less switch-traversed all-gather traffic" figure has no derivation. Enabling roce_set_relay by default also reverses merged #279's documented decision ("the runtime does not call roce_set_relay"), a live data-path change on already-exported cores — against "no magic defaults".
Novelty & status: genuinely additive. Not obsolete — nothing on main fixes per-HCA GIDs or runs execution::roce in CI; #643 was a different proxy sync. Not superseded — it is the aggregator of #672/#649/#577. But it closes none of them, so two first-time contributors' work (nepenth, fordbmorris) is duplicated in-tree with no comment on their PRs, contrary to "Respect contributors".
Value vs maintenance cost: real but unevenly evidenced. Part (b) per-HCA GIDs fixes reproducible bugs (#143, #151) and is the strongest piece — though its only hardware evidence lives in #672, not here. Part (d) closes a CI blind spot all three superseded PRs were flagged for. Part (a)'s re-sync follows the merged #643 pattern, but the parity guard is fragile: the pinned rev is unmerged FlashInfer #213, there is no uv.lock, and a squash-merge breaks main CI (admitted in merge-order step 2). docs/multi-host.md still describes relays as ring/chain-only, and mixed-GID hosts now hard-fail preparation against older FlashInfer.
Verdict: Worth it with changes. Land the GID fix and CI coverage. Before merge: gate roce_set_relay behind an opt-in or provide a measured 4-node A/B, repin to a merged FlashInfer SHA, update docs/multi-host.md, and close/credit #672, #649, #577.
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Classify intake
Selected: triage:review, performance, enhancement, area:rocenante
Threshold: 65%
Triage
- [✓]
triage:review: 93.2% -
triage:design-review: 6.0% -
triage:validation: 0.5% -
triage:integration: 0.2% -
triage:investigate: 0.1% -
none: 0.0% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 58.3% -
priority:P2: 40.1% -
priority:P1: 1.6%
Type
- [✓]
performance: 97.4% - [✓]
enhancement: 79.8% -
bug: 50.0% -
duplicate: 40.7% -
community: 32.1% -
documentation: 0.2%
Area
- [✓]
area:rocenante: 92.4% -
area:preparation: 56.2% -
area:memory: 43.8% -
area:api: 32.1% -
area:packaging: 8.5% -
area:kernels: 6.0% -
area:selene: 6.0% -
area:orbit: 2.9% -
area:engram: 0.4% -
area:scheduling: 0.3% -
area:caching: 0.2%
Model
-
model:inkling-small: 6.0% -
model:deepseek-v4: 0.8% -
model:glm-5.3: 0.5% -
model:nemotron-3.5-bolt: 0.4% -
model:muse-glimmer: 0.3% -
model:kimi-k3.1: 0.2% -
model:mimo-v2.6: 0.2% -
model:qwen3.8-27b: 0.2% -
model:deepseek-v4.1: 0.1% -
model:gemma4: 0.1% -
model:qwen3.8-flash-next: 0.1%
Apply Labels (Intake)
Applied: +triage:review, +performance, +enhancement, +area:rocenante
Gates and contracts
Contracts, Charter & Verification Gates Audit — PR #707 (head 81ef561)
Scope: docs/design-review.md, AGENTS.md, docs/roce-ring.md, docs/multi-host.md, vendored upstream pin, and Layer‑1–3 verification gates. Algorithmic correctness is out of scope.
Gate 1 — Signed core-format / wire / captured-graph / public contract boundaries: PASS
- No new captured-graph operation family, proto field, core-format enum, or wire kind.
ROCE_ABI_VERSIONstays14(helios/src/execution/roce.rs:23;roce.rs:164accepts9 | 10 | 11 | 14), sodocs/design-review.md:22-25owner approval for a new op contract is not triggered. - No scheduler, admission, speculation, cache-ownership, readiness, or rank-coordination files are touched. The TLA+ / conformance-fixture / Kani / scheduling-simulator gates (
docs/design-review.md:209-259) are therefore not triggered. - No contradicting edits to
docs/scheduling-theory.md(not opened),docs/scheduling-runtime-design.md, ordocs/core-format-design.md(searched: no RoCE / relay / collective-proxy content incore-format-design.md). - Info: the connect blob grows 1168 → 1176 bytes while the ABI number remains 14 and the record carries no revision marker, so a mixed-revision rank set now fails at
roce_connect. This is disclosed (docs/roce-ring.md:161-170, test atroce.rs:487-513) and matches the "ABI numbers are descriptive metadata" rule (design-review.md:116-123), so it is not a violation — but it is a real operational constraint worth a release note.
Gate 2 — Vendored upstream dependencies & cross-PR conflicts: VIOLATION (Major)
- Pin points at an unmerged upstream branch commit.
pyproject.toml:47movesflashinfer-pythonto524799c47fca54229c15b6db12261171854a7b7d, the commit of the still-openlocal-inference-lab/flashinfer#213. The merge-order section of the PR admits it must be repinned after that PR's squash-merge. The directly preceding precedent #643 re-vendored from a merged commit, and #672/#649/#577 were blocked repeatedly by review for exactly this.helios/native/roce_proxy.c:6-9documents the upstream path and ABI but names no upstream SHA and no body hash (the SHA and SHA-256 exist only in the PR body), so the pin is not traceable from the tree. - No
uv.lockexists in the repository (verified:list_files *lock*atmainreturns onlyCargo.lockfiles).docs/roce-ring.md:336still instructs readers to check out "the revision pinned inuv.lock", which does not exist. The consequence is that the new parity test (tests/preparation/test_roce_proxy_parity.py:35-65, run by.github/workflows/python-cpu.yml:29-33(not opened)) compares the vendored file against whatevergit revresolve to at install time; a force-push or squash of the FlashInfer branch breaksmainCI with no repository-side lock to fall back on. - Unmerged external dependency not pinned or linked. The claimed prefill gain requires
local-inference-lab/hyperflare-recipes#114(unmerged); the PR links it and states the merge order, so it is disclosed, but the branch cannot deliver the claimed 8K–128K prefill improvement without it. - Cross-PR collision on the same vendored file.
items_touching helios/native/roce_proxy.cshows #672, #649, #577 all still open on the same file. This PR states it "unifies and supersedes" all three, closes none, and leaves no comment or credit on those PRs — two of whose authors are first-time contributors. After merge, three open PRs become unmergeable. That is a duplication of in-tree contribution contrary to "Respect contributors" (AGENTS.md:199-212), and it must be discharged before merge (close with credit), not merely noted.
Gate 3 — Mandatory verification evidence & failing tests: VIOLATION (Blocker)
No CI failure and no failing test is reported or visible for 81ef561 — the single flare hub test that failed once is described as passing on immediate re-run, which is correctly disclosed. Layer‑1 crate tests were run with --release for helios (1,831), flare (247), flare-cli (247), heliopause (229), plus tests/preparation and tests/cli; cargo check was not substituted for cargo test. The new CI step (.github/workflows/native-serving.yml:114-115 (not opened)) genuinely closes the execution::roce blind spot. None of that is the problem.
The blocker is the mandatory layer above:
"Multi-GPU collective execution is mandatory for TP dispatch and transport changes. Replacing or reordering cross-rank launch, commit, cancellation, or drain paths in
helios/src/execution/{threaded,parallel,roce}*requires an explicit before/after cross-rank happens-before analysis and live multi-GPU execution of real collective graphs (for example, serving a multi-GPU exported core throughflare run), not only independent per-rank synthetic graphs. Disclosing busy or unavailable GPUs does not waive this requirement." —docs/design-review.md:252-259; reinforced by:247-251("Disclosure does not excuse skipping runnable CPU checks") and principle 12 (:106-115).
This PR reorders the transport setup path in helios/src/execution/roce.rs — roce_create_with_gids replaces roce_create (roce.rs:243-260), and roce_set_relay is inserted between roce_connect and roce_start (roce.rs:344-353) — and adds roce_create_with_gids to the serving FFI surface, on a file the rule names explicitly. What was actually executed is a single-host workstation, one active HCA (rocep82s0f0), 38 unit tests plus one live-HCA FFI smoke call. There is:
- no live multi-GPU/multi-node collective run (no multi-rank
flare run, nonvidia-smi-visible multi-GPU graph); - no before/after cross-rank happens-before analysis for the newly enabled relay data path (the FFI smoke test proves the call links and returns, not that the relaying plan orders correctly against peer commits);
- no legacy-core serve/replay. Principle 13 (
design-review.md:116-123, "Validate previous cores through loading and serving") is satisfied only at the descriptor level —ABI 9|10|11|14acceptance plusblob_bytes == 1176and 1168-byte rejection are asserted in unit tests (roce.rs:487-513), but no previously exported ABI‑14 core was actually loaded and served against the new 1176-byte handshake.
The PR explicitly lists "Multi-node RDMA serving, 4-node DGX Spark (SM121) prefill/decode throughput, and live switch-traffic reduction with roce_set_relay were not run" as limitations. Per :258-259, that disclosure does not waive the gate. A B3000/B2000-class 2–4 rank run of a multi-GPU exported core through flare run with the relay enabled, plus the happens-before analysis, is required before this can be accepted.
Secondary, same gate: RUSTFLAGS=-D warnings checks and the --features rdma Selene build were not run locally (the latter attributed to host rdma-core header mismatch); CI does cover --features roce,rdma at native-serving.yml:111-113, so this alone would be an Info note, not a violation.
Gate 4 — Material scope / claim contradictions: VIOLATION (Major)
- Unmeasured performance claim behind a default-on data-path change. The headline benefit — "expected to reduce switch-traversed mesh all-gather traffic by 25%" — has no derivation and no measurement of any kind; every other number is inherited from #649/#577 on 4× DGX Spark, on hardware different from the author's, and the prefill figure additionally depends on unmerged
hyperflare-recipes#114.AGENTS.md:95-102requires distinguishing an expectation from a measured result (done) — but the charter "Bring real evidence … performance PRs need benchmarks showing an actual speedup overmainon a served workload (#210)" anddesign-review.mdprinciple 12 ("Performance claims require equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements") are not met for the change that is actually being enabled by default. This is not scope creep; it is a behaviour change on already-exported cores shipped without the evidence the rules demand. - It reverses a documented decision from merged #279.
main'sdocs/roce-ring.mdsaid "Serving does not enable FlashInfer's all-gather relay", and #279's description says the same. This PR replaces that with on-by-default for everyShape::Mesh+ evenworld >= 4fabric with mutual direct-cable pairs (docs/roce-ring.md:166-169,roce.rs:344-353), opt-out only via--roce-switch-only. Reversing a recorded decision is legitimate, but the reversal of a merged invariant with no measurement falls underAGENTS.md:201-207("A feature request, passing tests, or a performance gain does not waive an architectural invariant … Resolve conflicts through an explicit maintainer decision on the design"). - Documentation now asserts unqualified support, and the contradicted doc is left stale.
AGENTS.md:52-56requires present-tense support claims to state what has been qualified and what has not, and prohibits presenting partially wired features as supported.docs/roce-ring.md:161-170now states serving "enables FlashInfer's two-shot all-gather relay" with no qualification statement and no hardware run behind it. Meanwhiledocs/multi-host.md— the operator-facing cross-node document — is not updated::94,:344,:574-577still describe relays only in the ring/chain sense and never mention that mesh all-gather relay is now on by default. A reader ofmulti-host.mdcannot learn that their 4-node direct-cable mesh changed collective routing. The PR's owndocs/roce-ring.md:422-424component table ("enables the ring or mesh all-gather relay") andmulti-host.md:574now contradict each other.
Additional Layer‑1 finding (Minor) — mock-based test bypasses the new contract
docs/design-review.md:186-189 requires tests to "exercise the actual production entry points … and avoid mocks or source-text checks that bypass runtime behavior." tests/preparation/test_roce_proxy_parity.py:68-131 injects fakes into sys.modules for both flare_heliopause and b12x.comm.roce.AllReduce. Two consequences:
- The new cross-boundary contract — that the pinned FlashInfer's
AllReduce.__init__acceptshca_namesandgid_indicesand that they arrive aslist[str]/list[int]— is asserted only against a hand-written Python class. Nothing exercises the real pinnedb12xclass, which is exactly the boundary a dependency repin can break. ignition/preparation/collectives.py:81-97selects the new path withinspect.signature(roce.AllReduce.__init__).parameters. PyO3/C-extension__init__objects commonly lack__text_signature__, so this probe can raiseValueErrorin production while the mock class always passes. This needs either a capability probe that survives a C-level__init__or an integration test against the real pinned dependency.
Summary
| Gate | Verdict |
|---|---|
| 1. Core-format / wire / captured-graph / public contract | PASS — ABI stays 14, no new graph family, no lifecycle files, no contradicted normative doc |
| 2. Vendored upstream & cross-PR | MAJOR — pin to unmerged FlashInfer #213; no uv.lock (docs still cite one); vendored header names no SHA/hash; three open PRs on the same file left unclosed/uncredited |
| 3. Mandatory verification | BLOCKER — design-review.md:252-259 live multi-GPU collective run + cross-rank happens-before analysis for helios/src/execution/roce.rs transport changes is unrun; no legacy ABI‑14 core loaded and served |
| 4. Scope / claim contradictions | MAJOR — default-on relay with no measurement (reverses merged #279); docs/roce-ring.md overclaims qualified support; docs/multi-host.md left stating the opposite |
| Layer‑1 test quality | MINOR — new Python test mocks the very dependency boundary it is meant to guard |
Required before merge: (a) live multi-rank flare run of a multi-GPU exported core with relay on, plus the before/after cross-rank happens-before analysis; (b) either an A/B measurement on a served workload or hold roce_set_relay behind an explicit flag until one exists; (c) repin pyproject.toml to a merged FlashInfer SHA (or land a uv.lock) and record the upstream SHA/body hash in helios/native/roce_proxy.c's provenance header; (d) add a qualification statement to docs/roce-ring.md and update docs/multi-host.md; (e) close #672/#649/#577 with credit to nepenth, FujitsuPolycom, and fordbmorris.
No docs/TODO.txt, no lint-level, and no unobservable-CI false positives are included above.
Subtraction and simplicity
Subtraction & Simplicity Audit — PR #707
The diff is decent-sized (12 files, +1247/−129) but it is mostly the vendored C proxy (byte-identical, not ours to simplify) and tests. The hand-written Rust/Python does contain nine concrete subtraction opportunities, of which three are real dead or unreachable code and one is a genuine "invalid states unrepresentable" pairing. Ordered by value.
1. roce_gid_index is a dead export whose fallback can never fire (highest value)
heliopause/src/python.rs:693-706 adds a whole Python-visible function whose only consumer reaches it through unreachable code:
/// The first selected RoCE device's GID index by the rule native serving uses: each active device
/// prefers index 3 when it has a RoCEv2 IPv4 GID there, otherwise its own lowest RoCEv2 IPv4 GID
/// index. Prefer `roce_devices` when HCAs on the host may have distinct GID indices.
#[pyfunction]
fn roce_gid_index() -> PyResult<u32> {
The single call site is the legacy fallback in ignition/preparation/collectives.py:97:
gid_kwargs = {"gid_index": distinct[0] if distinct else flare_heliopause.roce_gid_index()}
distinct derives from devices = flare_heliopause.roce_devices() (:83), which is discover() and therefore survives only when at least one device was found. Discovery itself rejects the empty case, helios/src/execution/roce_fabric.rs:429-431:
if devices.is_empty() {
return Err(failure("no active RDMA device has a RoCEv2 IPv4 GID"));
}
So distinct is never empty and the else flare_heliopause.roce_gid_index() arm cannot execute. That makes roce_gid_index (python.rs:669 registration + :693-706) dead, and takes Fabric::gid_index() (roce_fabric.rs:1094-1100, "The first selected device's RoCEv2 GID index, or PREFERRED_GID_INDEX when empty") with it — a public accessor whose unwrap_or(PREFERRED_GID_INDEX) default is likewise unreachable, kept alive only by the dead export and by tests (roce_fabric.rs:1242, :1276, :1303).
Subtraction: delete roce_gid_index + its add_function line, delete Fabric::gid_index(), and simplify collectives.py:97 to gid_kwargs = {"gid_index": distinct[0]}. Cleanest end state: move the mixed-GID RuntimeError out of the else and make it the unconditional legacy branch, so the legacy path drops both the fallback and the ambiguity. ~35 lines of Rust + the branch go away, and the PR's own description stops advertising a twice-documented API that nothing should call ("Prefer roce_devices…").
2. The inspect.signature feature probe is speculative generality against a hard pin
ignition/preparation/collectives.py:81-97:
import inspect
devices = flare_heliopause.roce_devices()
gid_kwargs: dict[str, object]
if "gid_indices" in inspect.signature(roce.AllReduce.__init__).parameters:
The repository pins FlashInfer to one exact commit — pyproject.toml:47:
flashinfer-python = { git = "https://github.com/local-inference-lab/flashinfer.git", rev = "524799c47fca54229c15b6db12261171854a7b7d" }
and the vendored proxy is CI-enforced byte-identical to that revision (new tests/preparation/test_roce_proxy_parity.py:35-65). roce.CreateWithGids exists in the C proxy at helios/native/roce_proxy.c:557, so the pinned AllReduce.__init__ accepting gid_indices is a fact of the pin, not a runtime question. The else branch at :90-97 (the mixed-GID RuntimeError and the uniform-GID legacy call) is unreachable in every environment the project supports, which in turn makes tests/preparation/test_roce_proxy_parity.py:83-85 (_AllReduceLegacy), :108-119 and :121-131 tests of code that cannot run. Signature introspection also costs an inspect import inside the hot preparation entry point.
Subtraction: drop the probe; always pass hca_names + gid_indices. If authority is wanted, assert the pin instead of probing for it. Removes ~18 lines of Python plus ~25 lines of the parity test's third case, and deletes the "fails loudly on an older FlashInfer" user-visible regression path the description itself flags as a limitation.
3. validate_relay_plan duplicates a predicate the C proxy already enforces
helios/src/execution/roce.rs:102-133 restates the C-side check nearly clause for clause — roce_fabric/roce_proxy.c:838-849:
int bad = (p == c->rank && (via != -1 || to != -1)) ||
(via != -1 &&
(via < 0 || via >= c->world || via == c->rank || via == p || plan[via] != -1)) ||
(to != -1 && (to < 0 || to >= c->world || to == c->rank || to == p));
versus Rust:
let bad_self = p == rank && (via != -1 || to != -1);
let bad_via = via != -1
&& (via < 0
|| via as usize >= world
|| via as usize == rank
|| via as usize == p
|| plan[via as usize] != -1);
let bad_to =
to != -1 && (to < 0 || to as usize >= world || to as usize == rank || to as usize == p);
roce_set_relay is already called with the same plan and already returns -1 with a message for every one of these conditions (roce.rs:344-353), so the Rust copy buys only a different error string and forces three of the "before modifying region" test cases (roce.rs:536-561, cases 11/12/13) to exist purely to exercise the duplicate. Simplification: keep the two checks the C side cannot make — shape != Shape::Mesh and plan.len() != 2 * world — and delete the per-entry loop (~22 lines) plus test cases 11/13; case 12 survives as the length check. The Shape::Mesh requirement also lands better as a relay_plan: Option<(Shape-agnostic plan)> invariant than as a validation arm (roce.rs:103-105 "RoCE all-gather relay requires a mesh topology" is only reachable because the mesh gate lives in the caller — see #7).
4. hcas + gid_indices should be one vector (invalid state is representable)
roce_fabric.rs:309-310:
pub hcas: Vec<String>,
pub gid_indices: Vec<u32>,
Two parallel vectors that must stay index-aligned, and the PR pays for the invariant in three separate places:
roce_fabric.rs:1119-1125—if self.gid_indices.len() != self.endpoints.len() { Err("RoCE fabric has {} GID indices for {} devices") }roce.rs:214-220—if topology.gid_indices.len() != topology.hcas.len() { Err("RoCE topology has {} GID indices for {} HCAs") }heliopause/src/python.rs:717-719—zip(fabric.gid_indices)silently truncates instead of erroring, a third, inconsistent policy for the same invariant.
Reflecting the same idea back one level: Fabric already holds endpoints: Vec<Endpoint> where Endpoint.name is the HCA name (roce_fabric.rs:77, populated at :459-460 from the same name), so gid_indices is a shadow index into a vector that already carries its own key.
Simplification: make it pub devices: Vec<(String, u32)> (name, gid) on both Fabric and Topology, or keep gid_indices inside Endpoint. Then Fabric::gid_index_for (:1102-1105) collapses to field access, roce.rs builds its Vec<c_int> from the paired vector with no length check, python.rs:714-722 becomes a plain map with no zip truncation hazard, and the two error branches disappear. This deletes two validation blocks and one silent-truncation bug class for a net reduction in code.
5. relay_plan recomputes every route the caller already planned
roce_fabric.rs:1126-1132:
let rails = endpoints.iter().map(Vec::len).min().unwrap().min(MAX_RAILS);
let routes = plan_shape_routes(endpoints, rank, rails, shape, links)?;
let relay_plan = if shape == Shape::Mesh {
relay_plan(endpoints, rank, rails, links)?
} else {
None
};
relay_plan → partners (:979-1012) constructs a second Planner::new (:988) and calls planner.peer(rank, peer) for all world × world pairs (:996) — O(world² × devices²) of route planning executed a second time, immediately after plan_shape_routes did the same work. The sibling helper direct_peers (:957) shows the intended shape: it takes routes as a parameter and reuses them.
Simplification: pass the already-computed &routes into partners/relay_plan (it contains exactly the (local, remote) pairs the cable test inspects) and drop the Planner construction and the rails/links parameters from both signatures — rails in particular is then only used by the Planner, and links can be folded into the caller's existing Shape::Mesh / Links gate at :1131. Removes a redundant planning pass and two of the four parameters on a pub fn.
6. format_gid_indices has an unreachable arm
flare-cli/src/doctor/spark.rs:259-262:
fn format_gid_indices(indices: &[u32]) -> String {
match indices {
[] => "index (none)".into(),
Both call sites guarantee non-empty input: spark.rs:189-190 builds ready_gids inside if !ready.is_empty() (:183), and spark.rs:246 formats fabric.gid_indices, which discover_in has already proven non-empty at roce_fabric.rs:429-431. The arm is additionally inconsistent with its siblings, which use "index N" / "indices [..]", not "index (none)".
Subtraction: drop the [] arm (or take first: u32, rest: &[u32] so emptiness is unrepresentable) and, per #4, the whole helper collapses to comparing indices.first() against the rest.
7. Interface::gid_index exists only to be collected straight back into a Vec
flare-cli/src/doctor/spark.rs:277 adds the field, :177 sets it, :189 immediately turns it back into a Vec<u32>:
let ready_gids: Vec<u32> = ready.iter().map(|port| port.gid_index).collect();
let gid_label = format_gid_indices(&ready_gids);
Interface is the output record of the readiness pass; the GID index is only needed as a label. Simplification: push gid_index into a separate Vec<u32> alongside ready, or compute gid_label from fabric/per-device lookups at :190, and keep Interface free of the field. Saves three touch points (struct field, two test literals at :516 and :524) and keeps Interface describing an interface, not a discovery decision.
8. cluster.rs nested if/else inside a format!
flare-cli/src/cluster.rs:101-113 grows the format to four placeholders and adds:
if topology.relay_plan.is_some() {
", all-gather relay"
} else {
""
},
Now connected() has two independently-built "conditional middle segment" arms — Links::All => "" / Links::Shared => ", switch only" (pre-existing, :105-106) and this new one — spliced into one format string. Simplification: build the segments as a Vec<&str> and join(""), or implement Display for Topology and let both cluster.rs:94-113 and spark.rs:191-195 render it; one conditional-arm pattern instead of two. Small, but it's the kind of growth that makes the next transport flag add a fifth placeholder.
9. The mesh gate is split from the plan builder, leaving a redundant arm
relay_plan (roce_fabric.rs:1021) takes no Shape and gates only on world, % 2, and Links::Shared (:1031); the caller re-adds the shape gate (:1128). That split is what makes validate_relay_plan's shape arm (roce.rs:103-105) and roce.rs test case 11 (:536-539, which sets relay_plan on a Shape::Ring topology purely to trip the shape check) necessary in the first place. Simplification: fold shape into relay_plan's signature (:1021) and make it the single owner of "relay applies here"; the duplicate shape check in roce.rs and its test case disappear with it.
What is already lean
helios/native/roce_proxy.c: not reviewable for subtraction here — it is byte-identical vendoring enforced bytests/preparation/test_roce_proxy_parity.py:35-65. Registering it is right; hand-editing it is what the pin forbids.roce_fabric.rs:409-415pick_gid_index: a clean closure that replaces the old branchy scalar selection; thefilter_map+take(MAX_DEVICES)restructure at:416-428is shorter than the code it replaces and fixes an ordering subtlety (filter before cap). No change wanted.roce_fabric.rs:1014-1060relay_planbody: ~30 lines for a non-obvious pairing derivation, densely commented with the semantics of the two halves of the plan. Theside/pairedderivation is about as compact as this gets; only the redundantPlanner(#5) is worth removing.docs/roce-ring.mdedits: +17/−14, all corrections tied to real behaviour changes (RING_WINDOW = 16, 2.008 MiB, relay-on-by-default). No bloat.- The test additions are large (≈600 lines) but a bulk of them are table-driven (
roce_fabric.rs:2314-2400generates its assertions over 4/4-LLDP/8-rank cases rather than triplicating them), which is the right call.
Minor, not worth its own item
tests/preparation/test_roce_proxy_parity.py holds both the vendoring guard (:35-65) and create_roce_runtime unit tests (:68-131) despite its name; if #1 and #2 are taken, the latter half shrinks to one forwarding assertion and belongs in tests/preparation/test_collectives.py (not opened).
Net
Taking #1, #2, #3, #6 and #7 removes roughly 100 lines of hand-written Rust/Python and three unreachable branches with no behavioural change; #4 and #5 remove two duplicated invariants and a redundant O(world²) planning pass. The PR's genuinely added logic — per-HCA discovery, the relay-plan derivation, and the parity guard — is lean and should stay as written.
Code correctness
Deep Code Correctness, Invariants & Hot-Path Audit — PR #707 @ 81ef561
Partitioned into 3 disjoint slices (C proxy / helios Rust / CLI+heliopause+ignition+parity) and audited with the full 4-part protocol (callee/enum resolution, same-loop state ordering, adversarial boundary inputs, hot-path big-O) on each. I independently re-read and verified the C findings below.
FINDING 1 — Major: credit_phases() holds only ONE phase on a pipe↔1-hop transition, leaving the other phase of a two-phase op unguarded (silent peer-row/flag corruption)
Diff site: helios/native/roce_proxy.c:1530-1547, buggy branch at 1536-1538 (new in this PR).
static uint32_t credit_phases(uint32_t prev, uint32_t kind) {
uint32_t prev_p = kind_phases(prev);
uint32_t cur_p = kind_phases(kind);
if (prev_p == 0 || cur_p == 0) {
return 0;
}
if (kind_1hop(prev) != kind_1hop(kind)) {
return (cur_p & PIPE_PHASE_RS) != 0 ? CREDIT_RS : CREDIT_AG; // <-- drops the other phase
}
Callee / enum resolution (verified by me):
kind_phases(roce_proxy.c:1508-1522):KIND_TWOSHOT(1) andKIND_RING_RSAG(9) →PIPE_PHASE_RS|PIPE_PHASE_AG(=3);KIND_REDUCE_SCATTER(3)/KIND_RING_RS(7) →PIPE_PHASE_RS;KIND_GATHER_SHARDS(4)/KIND_RING_AG(8) →PIPE_PHASE_AG. Kinds defined:187-196;PIPE_PHASE_RS 1u/PIPE_PHASE_AG 2uat:207-208;CREDIT_RS 1u/CREDIT_AG 2uat:185-186.kind_1hop(:1524):kind >= KIND_RING_RS && kind <= KIND_RING_RSAG.- Credit mask consumers:
run_pipe_opposts RS at:1668(!(credit & CREDIT_RS)) and AG at:1676(!(credit & CREDIT_AG)), relay forward at:1684;run_ring_bidir_opgates AG forwarding at:1823, RS at:1846, AG step 0 at:1867. The mask is cleared in one step when all peers arrive (:1665-1667,:1816-1818), so holding more bits cannot deadlock. - The file's own normative statement this branch contradicts —
:78-81: "For those transitions every rank writes a start-of-op credit … and holds the hazardous phase until every peer's credit reached the op", and the newly added:92-93: "Cross-family transitions between two-shot/pipe and ring_bidir ops exchange start-of-op credits because their pipe_recv layouts overlap." The code holds one phase, not every overlapped phase. - Region fact that makes the overlap real:
pipe_recvrows are2*shard_capwide (post_pipe_chunk,:1452-1454), while 1-hop half-shard slots areshard_cap/2(:1747-1752), so 1-hop slot k aliases pipe row k/2, i.e. both phases interleaved; 1-hop AG flag rows areW+dir(:1833-1834) which are exactly the pipe phase-1 flag rows read bypipe_chunk_arrived, whose row is(world + s)(:1469-1472) — flags are shared across families too.
Concrete counterexample (prev = KIND_GATHER_SHARDS, cur = KIND_RING_RSAG, world W=4, rank R=0, 2 rails, chunks=4, chunk_packs=8, nbytes=1024 → total=64 packs, half_max=32, widest=8, half_cap large):
prev_p = 2, cur_p = 3, kind_1hop(4)=0 != kind_1hop(9)=1 → returns CREDIT_RS only. The AG half (do_ag) is therefore never gated: at :1823 and :1867 credit & CREDIT_AG == 0 from the first loop iteration, so with dir=0, s=1, c_idx=0 we take src_slot = 2*(4-1)+0*(4-1)+(1-1) = 6, dst_slot = 7 → bytes [3·sc, 3.5·sc) written into peer 3's pipe_recv row 3 = (source 1, phase 1) region while peer 3 may still be reading that row for its predecessor op, and the AG flag write lands on row W+0 = 4 = peer 3's pipe (source 0, phase 1) flag row. Result per :76-78: "Either write could replace a flag before the peer saw it (a wait timeout) or the rows it is reading (silent corruption)." The same under-hold exists in the reverse direction (prev = KIND_RING_RSAG(9), cur = KIND_TWOSHOT(1) → CREDIT_RS only, while :1676 posts pipe phase 1 unguarded).
Fix — hold every phase the new op performs:
if (kind_1hop(prev) != kind_1hop(kind)) {
uint32_t need = 0;
if (cur_p & PIPE_PHASE_RS) need |= CREDIT_RS;
if (cur_p & PIPE_PHASE_AG) need |= CREDIT_AG;
return need;
}
Safe because credits_arrived clears the whole mask once every peer's credit lands. Escalates to Blocker once the companion recipes PR (#114) enables KIND_RING_RSAG: it is an unfixable-after-the-fact silent data-corruption race, and no in-tree test covers it (roce.rs:695-746 only exercises roce_set_relay rejection).
FINDING 2 — Minor: the mixed-GID legacy guard is keyed on a parameter name, so a legacy AllReduce that declares gid_indices=None/**kwargs is misclassified as per-HCA-capable, silently preparing fewer rails than serving connects
Diff sites: ignition/preparation/collectives.py:85-97; test tests/preparation/test_roce_proxy_parity.py:77-81, 110-119.
if "gid_indices" in inspect.signature(roce.AllReduce.__init__).parameters:
gid_kwargs = {
"hca_names": [name for name, _ in devices],
"gid_indices": [gid for _, gid in devices],
}
The test models "legacy" as def __init__(self, *, gid_index=None, **kwargs), so it exercises only the **kwargs-free case. Counterexample: a legacy __init__(self, *, gid_index=None, gid_indices=None, **kwargs) (or a **kwargs-only signature) plus roce_devices() == [("roce0",3),("roce1",5)] selects the gid_indices branch, never raises the RuntimeError("… distinct GID indices") the code claims guarantees "fail loudly rather than dropping rails", and the hca_names/gid_indices kwargs are swallowed. Fix: require both names to be explicit parameters and reject a VAR_KEYWORD-only signature (per_hca = {"hca_names","gid_indices"} <= params), and add a third test class whose signature accepts but ignores gid_indices, asserting the mixed-GID host raises. Minor because the pinned environment (pyproject.toml:47) does honour gid_indices.
Verified sound (no defect found)
roce_blob_t1168 → 1176 (roce_proxy.c:257-269): two appended fields, natural alignment; validation inroce_connect(:744-763) is symmetric (each side compares against its ownRING_WINDOW/ring_bytes(world)) and runs in the first peer loop before any region write; a legacy 1168-byte record is rejected earlier in Rustpeer_blobs(roce.rs:86-95) and the ABI gate (:164).roce.rs:491assertssize == 1176,:501-503asserts 1168 rejection (intentional tripwires).- Send-queue arithmetic:
ROCE_SEND_DEPTH 512(:150),ROCE_RELAY_OPS = 64(:156),ROCE_RESERVE_OPS = 48(:157),_Static_assert(RESERVE < RELAY)(:158); static asserts64*3+16*16 = 448 ≤ 512and222+192+4*16 = 478 ≤ 512(:225-230). Onlyoutstanding[p][0]is read byreserve/ring_service_slot/ring_submit/post_credits, so lane-0 ≤ 448 holds forworld = 2..16;world > 16is rejected byroce_layout(:389). The "48 < 64 preserves relay headroom" claim is arithmetically correct. - 1-hop slot/flag bounds: RS slots
dir*(W-1)+s ≤ 2W-3, AG src/dst≤ 4W-5 = 4(W-1)-1(:1831-1834,:1871-1872) exactly fitting the4(W-1)half-shards;r_word ≤ 63by:1776; chunk-coverage andhalf_capguards at:1786-1795(including the clamped empty-chunk path). CTRL word ranges (RS 64-127, AG 128-191, VL 256-767, CREDIT 768-783) do not overlap. drain_allordering (:1271-1276):drain_cqsbeforering_serviceis required — the reverse could spin on a completion already reaped.post_creditsat:1552-1587is correct (rail-0/lane-0 inline 4-byte write, or empty mailbox write for non-neighbours).ring_service_slotre-checksserialagainstring_inflightat ack time (:1010) andring_pendingpreserves two-pass ordering;wr_idencode/decode (:1219/1237,:927/965/1050,:866-871) is consistent, sooutstanding[peer][lane]cannot underflow.roce_create_with_gidsvalidatesgid_indices != NULLand0..=255(:563-575) beforecalloc/anyibv_*call;sgid_indexisuint8_t(:702), so the cast is exact.- helios Rust slice (
helios/src/execution/roce_fabric.rs,roce.rs): no defect.Shape/Linksare complete partitions (roce_fabric.rs:231-293);relay_plan(:1021-1061) implements "even world ≥ 4,Links::All, every rank exactly one mutual direct partner" and fails closed (None) otherwise — verified for world 1,2,3,4,5,6,16, duplicate partners, all-false/all-truedirect, self-partner.gid_indicesis indexed by local HCA,directby peer rank — no index-space swap; all three parallel vectors are built from one filtereddevicesvector (:416-476),pick_gid_index(:409-415) is stateless so no stale accumulator, andfindover0..16ascending really is "lowest".RoceTransport::openvalidatesgid_indices.len() == hcas.len()(roce.rs:214-220) before zeroing the region and beforeroce_create_with_gids;connectcallsroce_set_relaybetweenroce_connectandroce_start(:344-354) exactly as C requires, andvalidate_relay_plan(:102-132) mirrors C'sroce_set_relaychecks statement-for-statement (roce_proxy.c:838-849), withvia < 0short-circuiting theas usizecast — no accept-then-reject, no leftover plan (the plan lives in immutableself.topology). No leaks on error paths (Drop→roce_destroy, one call site each). Hot path:partners/relay_planis O(world²)Planner::peercalls (240 at world=16) but runs once per connect, never per collective step;health()/posting never readsrelay_plan. Tests are not tautologies (the mixed-GID test would fail under a reverted host-wide index; the relay test independently recomputes writers/forwarders). - CLI/heliopause/ignition slice:
cluster.rs:96-114appends", all-gather relay"only whentopology.relay_plan.is_some(), which isMesh-only — ring/chain/switch onlysummaries unaffected.flare-cli/src/doctor/spark.rs:152-181keepsfabric.endpoints[i]aligned withfabric.gid_index_for(i), treats a missing index as unresolved (no OOB), computes sufficiency over all accumulated devices (ready.is_empty()), and reports unselected devices separately.heliopause/src/python.rs:710-727really exportsroce_devices() -> Vec<(String,u32)>in discovery order, consistent withroce_gid_index()'s first-device/PREFERRED_GID_INDEXfallback. The parity test cannot pass vacuously:PROVENANCE_LINES = 9matches the actual header (roce_proxy.c:1-9, line 9 blank), itpytest.fails rather than skips when flashinfer is absent, asserts LF-only, and byte-compareslines[9:]against the whole upstream file; the monkeypatch ofsys.modules["flare_heliopause"]/b12x.comm/b12x.comm.rocematches the function-local imports atcollectives.py:64-65.pyproject.toml:47rev is valid 40-hex and is the same sourceuvinstalls, so pin and test cannot skew. Doctor/cluster cost is O(devices) startup-only withMAX_DEVICES = 4; no hot-path work. - Docs ↔ code consistency (as a runtime contract, not wording):
docs/roce-ring.md:109-114,129,161-171matchesRING_WINDOW = 16, ~2.008 MiB/rank (32.13 MiB at 16 ranks) againstring_bytes = 16*16*2*(65664+8+128), and the 1-hop/relay behaviour.
Unverifiable here: byte-for-byte parity against FlashInfer 524799c4 (upstream tree not present in-repo), multi-node wire behaviour, and the claimed 25% switch-traffic / 1.20x–1.46x speedups (single host, as the PR itself states).
Final review
Recommendation: Changes Requested
The per-HCA GID plumbing, the mesh relay-plan derivation with its Rust preflight, the CI parity guard, and the new execution::roce CI step are well built and verified clean at 81ef561 — I found no defect in roce_fabric.rs discovery/planning, roce.rs preflight/ordering, heliopause, flare doctor, or cluster.rs. Three blockers remain: a verified state-machine defect in the vendored proxy's cross-family credit holding (roce_proxy.c:1536-1538), the unrun mandatory multi-GPU collective gate that docs/design-review.md:252-259 names for exactly these files, and a default-on relay data path shipped with no measurement, reversing a documented decision from merged #279.
Merge Risk
Level: High
- Default-on collective-routing change on already-exported ABI-14 cores.
roce.rs:344-353now callsroce_set_relayfor everyShape::Mesh+Links::All+ evenworld >= 4mutual-pair fabric; opt-out is only--roce-switch-only. Existing 4-rank cabled mesh jobs change all-gather routing without re-export, and the benefit is stated as "expected", never measured. - Wire-format change inside an unchanged ABI number.
roce_blob_tgrows 1168 → 1176 bytes (roce_proxy.c:257-269) whileROCE_ABI_VERSIONstays 14, so mixed-revision rank sets fail only atroce_connect(:754-761).ROCE_ABI_VERSIONgives no protection here. - Pin targets unmerged upstream.
pyproject.toml:47points at524799c4…from still-open FlashInfer #213; the new parity test (tests/preparation/test_roce_proxy_parity.py:35-65, run bypython-cpu.yml:33) hard-fails if that branch is squashed or force-pushed, and nouv.lockexists in the repo to fall back on.
Walkthrough
helios/native/roce_proxy.c(+339/−59): re-vendored to add per-HCAroce_create_with_gids(:557,roce_createkept as wrapper:611),RING_WINDOW 16(:223),ring_window/ring_byteshandshake validation (:665-666,:744-761),KIND_RING_RS/AG/RSAG = 7/8/9(:194-196) withrun_ring_bidir_op(:1768), send-queue splitROCE_RESERVE_OPS 48 < ROCE_RELAY_OPS 64(:156-159), anddrain_cqsbeforering_serviceindrain_all(:1271-1276).ROCE_ABI_VERSIONremains 14.helios/src/execution/roce_fabric.rs(+375/−34):gid_indices: Vec<u32>replaces the scalar index, per-HCApick_gid_index(:409-415),partners()/relay_plan()(:979-1061) ported from FlashInfer_routes.py(not opened),Topology::relay_planpopulated only forShape::Mesh(:1128-1131).helios/src/execution/roce.rs(+231/−7):roce_create_with_gidsFFI with length-alignment check before the region is zeroed (:214-241),validate_relay_plan(:102-132),roce_set_relayinvoked betweenroce_connectandroce_start(:344-353), plus 1176/1168 tripwire tests (:491,:502).ignition/preparation/collectives.py:83-97:roce_devices()forwarding ofhca_names+gid_indices, with aRuntimeErroron mixed-GID hosts against a legacyAllReduce.flare-cli/src/doctor/spark.rs:161-190,259-273per-device GID validation andformat_gid_indices;flare-cli/src/cluster.rs:108-112appends", all-gather relay"only whenrelay_plan.is_some()..github/workflows/native-serving.yml:114-115(not opened) adds theexecution::rocelib tests to the Linuxrdmajob;tests/preparation/test_roce_proxy_parity.py(new, 131 lines) enforces header + 0-byte parity and exercisescreate_roce_runtime.
Pre-merge Checks
- [PASS] Security / malicious screen: No new network listeners, credentials, eval, or shell interpolation. The new Python test writes into
sys.modulesonly insidemonkeypatch, which is scoped. No prompt-injection or instruction-like content in the PR text or comments. - [WARN] Charter & value fit: Transport-layer change with no new flags, no per-model branches, ABI 14 preserved, pin tightened — squarely inside "keep the runtime small" and roadmap #215. But the "Bring real evidence" rule (#210) and
design-review.mdprinciple 12 are not met for the relay that is switched on by default (Blocker 3). - [WARN] Related / duplicate / conflict check:
items_touching helios/native/roce_proxy.cconfirms #672, #649 and #577 are still open on this exact file; the PR says it "supersedes" all three and closes none, and two of the three authors (nepenth, fordbmorris) are first-time contributors whose work is absorbed with no comment on their PRs (charter "Respect contributors"). Also reverses merged #279's documented "serving does not enable FlashInfer's all-gather relay". Discharge both before merge — do not treat as a code defect. - [WARN] Tests & verification evidence: Layer-1 is genuinely strong (1,831 helios / 247 flare-cli / 229 heliopause / 7 preparation / 148 CLI, plus the new CI step closing the
execution::roceblind spot). Layer "multi-GPU collective execution" is explicitly unrun, and no previously exported ABI-14 core was loaded and served against the 1176-byte handshake (Blocker 2).
Blockers
-
credit_phases()holds only one phase across a pipe↔1-hop transition, leaving the other phase of a two-phase op unguarded — silent peer-row/flag corruption.helios/native/roce_proxy.c:1536-1538.if (kind_1hop(prev) != kind_1hop(kind)) { return (cur_p & PIPE_PHASE_RS) != 0 ? CREDIT_RS : CREDIT_AG; // one bit, not both }Verified callees and masks:
kind_phases(:1508-1522) mapsKIND_TWOSHOT(1) andKIND_RING_RSAG(9) →PIPE_PHASE_RS|PIPE_PHASE_AG,KIND_REDUCE_SCATTER(3)/KIND_RING_RS(7) → RS,KIND_GATHER_SHARDS(4)/KIND_RING_AG(8) → AG;kind_1hopat:1524;CREDIT_RS 1u/CREDIT_AG 2uat:185-186. Verified consumers:run_pipe_opgates RS at:1668, AG at:1676, relay forward at:1684;run_ring_bidir_opgates AG forwarding at:1823, RS at:1846, AG step 0 at:1867. So forprev = KIND_GATHER_SHARDS,cur = KIND_RING_RSAGthe function returnsCREDIT_RSonly and every AG post inrun_ring_bidir_opruns ungated from the first iteration.The overlap the mask exists to guard is real, verified at the layout level: pipe flags occupy rows
phase*world + s(:1457, read at:1470-1472), while 1-hop RS uses flag rowsdir(:1855) and 1-hop AG uses rowsW + dir(:1834,:1872) — so a peer's pipe AG rows are shared with the previous 1-hop AG rows (atW = 4, pipe rows 1/3/5 are 1-hop AG rows 3/4/5).pipe_recvshows the same aliasing: pipe rows ares*2 + phasewideshard_cap(:1452-1454) while 1-hop slots areshard_cap/2(:1749-1752, slot2(W-1)+dir(W-1)+(s-1) ≤ 11atW=4→ full rows 3..5), so a peer still gathering pipe phase 1 from row 3 can have it overwritten by our ungated AG write. That is exactly the hazard the file's own normative statement forbids —:78-81"holds the hazardous phase until every peer's credit reached the op" and the newly added:92-93"Cross-family transitions … exchange start-of-op credits because their pipe_recv layouts overlap." The mask is cleared wholesale once every peer's credit lands (run_pipe_op:1665-1667,run_ring_bidir_op:1816-1818), so holding both bits cannot deadlock.I confirmed the same-family pipe-only path is not a regression: old
(prev==RS && kind∈{RS,TWOSHOT})/(kind==GS && prev∈{TWOSHOT,GS})produces the same bits as the new body, so this defect is introduced only by the cross-family branch.Fix (hold every phase the new op performs):
if (kind_1hop(prev) != kind_1hop(kind)) { uint32_t need = 0; if (cur_p & PIPE_PHASE_RS) need |= CREDIT_RS; if (cur_p & PIPE_PHASE_AG) need |= CREDIT_AG; return need; }Because the file is byte-identical vendoring enforced by
tests/preparation/test_roce_proxy_parity.py:35-65, this must be fixed inlocal-inference-lab/flashinferand re-vendored — do not hand-edit. It is currently dormant (no in-tree code posts kinds 7/8/9;helios/src/execution/roce.rs:695-746only testsroce_set_relayrejection), but the author's own merge step 4 landshyperflare-recipes#114, which enablesKIND_RING_RSAG. Shipping a silent data-corruption race in the shared ABI-14 transport immediately before the PR that turns it on is not mergeable. -
The mandatory multi-GPU collective gate is unrun for a transport-ordering change it names by path.
docs/design-review.md:252-259: "Replacing or reordering cross-rank launch, commit, cancellation, or drain paths inhelios/src/execution/{threaded,parallel,roce}*requires an explicit before/after cross-rank happens-before analysis and live multi-GPU execution of real collective graphs … Disclosing busy or unavailable GPUs does not waive this requirement."This PR reorders exactly that path:
roce_create_with_gidsreplacesroce_create(roce.rs:243-260) androce_set_relayis inserted betweenroce_connectandroce_start(roce.rs:344-353). What was executed is one host, one active HCA (rocep82s0f0), 38 unit tests plus a live-HCA FFI smoke call that proves the call links and returns — not that a relaying plan orders correctly against peer commits. The PR itself lists "Multi-node RDMA serving, 4-node DGX Spark (SM121) prefill/decode throughput, and live switch-traffic reduction withroce_set_relaywere not run". There is also no cross-rank happens-before analysis for the new default-on relay path, and principle 13's "Validate previous cores through loading and serving" (:116-123) is satisfied only at the descriptor level — no previously exported ABI-14 core was loaded and served against the 1176-byte handshake.Fix: a 2–4 rank run of a multi-GPU exported core through
flare runwith relay enabled (and one with--roce-switch-onlyas the baseline), plus the written before/after happens-before analysis. -
roce_set_relayis enabled by default with no measurement, reversing a documented decision from merged #279 without maintainer sign-off.roce_fabric.rs:1128-1131+roce.rs:344-353; docs atdocs/roce-ring.md:166-169.The benefit is stated as "expected to reduce switch-traversed mesh all-gather traffic by 25%" with no derivation and no measurement of any kind; every accompanying number is inherited from #649/#577 on 4× DGX Spark, on hardware different from the author's single-host SM120, and the prefill figure additionally depends on unmerged
hyperflare-recipes#114. Charter "Bring real evidence" (#210) anddesign-review.mdprinciple 12 ("Performance claims require equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements") are not met for the change actually being enabled. This also flips a merged invariant: the pre-PR text ofdocs/roce-ring.md(the removed lines at diff hunk158-170) read "Serving does not enable FlashInfer's all-gather relay", and #279's description records the same decision — reversing it is legitimate only through "an explicit maintainer decision on the design" (AGENTS.md:203-207), which is not in evidence.docs/roce-ring.md:164-169now also asserts the behaviour in the present tense with no qualification statement, contrary toAGENTS.md:52-58.Fix: either land an A/B on a served workload (
flare run, 4 ranks, relay on vs--roce-switch-only), or gate relay behind an explicit opt-in until one exists; add a qualification sentence todocs/roce-ring.mdand record the maintainer decision for the #279 reversal.
Should Fix
-
The FlashInfer pin points at an unmerged branch commit, which the new CI parity test turns into a
main-branch failure.pyproject.toml:47→524799c47fca54229c15b6db12261171854a7b7dis still-open FlashInfer #213.tests/preparation/test_roce_proxy_parity.py:35-65byte-compareshelios/native/roce_proxy.clines 10..EOF against whateveruv syncinstalled (python-cpu.yml:29-33), and there is nouv.lockin the repository (verified:list_files *lock*atmainreturns onlyCargo.lockfiles), so the rev inpyproject.tomlis the entire lock. A force-push or squash-merge of #213 breaks CI onmain, and the PR's own merge step 2 admits the repin is outstanding. Fix: repin to the mergedmainSHA before this PR merges (the author's step 2), and — while here — record the upstream commit and body SHA-256 inhelios/native/roce_proxy.c:6-8, which currently names the upstream path and ABI but no revision, unlike #643. -
The operator-facing cross-node document was not updated and now contradicts
docs/roce-ring.md.docs/multi-host.md:94,:344and:574-577still describe relays only in the ring/chain sense and never mention that mesh all-gather relay is on by default. A reader ofmulti-host.mdcannot learn that their 4-node direct-cable mesh changed collective routing, anddocs/roce-ring.md:422-424("enables the ring or mesh all-gather relay") now contradictsmulti-host.md:574.AGENTS.md:52-58requires support to be stated as present qualification. Fix: add the mesh relay-on-by-default behaviour (and the--roce-switch-onlyopt-out) to thedocs/multi-host.mdtransport sections.
Subtract / Simplify
roce_gid_indexis a dead export whose fallback arm can never execute.heliopause/src/python.rs:697-706plus its registration at:669;helios/src/execution/roce_fabric.rs:1094-1100(Fabric::gid_index, whoseunwrap_or(PREFERRED_GID_INDEX)is likewise unreachable). The only call site is the legacy fallbackignition/preparation/collectives.py:97, wheredistinctderives fromdevices = flare_heliopause.roce_devices()(:83), anddiscover_inerrors rather than returning an empty device list (roce_fabric.rs:429-431). Sodistinctis never empty and theelse flare_heliopause.roce_gid_index()arm is unreachable in production;Fabric::gid_index()survives only throughroce_fabric.rs:1242,1276,1303tests. Deleting the export, itsadd_functionline,Fabric::gid_index(), and simplifyingcollectives.py:97to{"gid_index": distinct[0]}removes ~35 lines and stops advertising a twice-documented API whose own doc comment says "Preferroce_devices".format_gid_indices's empty arm is unreachable.flare-cli/src/doctor/spark.rs:259-262: both call sites guarantee non-empty input —:189is insideif !ready.is_empty()(:183) and:246formatsfabric.gid_indices, which a successfuldiscover_inhas proven non-empty (roce_fabric.rs:429-431). Takefirst: u32, rest: &[u32](or drop the arm) so emptiness is unrepresentable, and the"index (none)"wording stops disagreeing with its"index N"/"indices [..]"siblings.relay_plan()re-plans routes the caller just planned.roce_fabric.rs:1128-1131callsplan_shape_routesand thenrelay_plan, which callspartners(:1032), which constructs a secondPlanner(:988) and issuesplanner.peer(rank, peer)for allworld × worldpairs (:996). The siblingdirect_peers(:957) already takesroutesas a parameter and reuses them — pass&routesintopartners/relay_planand drop the extraPlannerplus therails/linksparameters. Once per connect, never per collective step (I verifiedhealth()/posting never readsrelay_plan), so this is a simplification, not a hot-path defect.hcasandgid_indicesare parallel vectors whose invariant is re-checked in three places with three different policies.roce_fabric.rs:309-310→ checked at:1119-1125(error),roce.rs:214-220(error), andheliopause/src/python.rs:717-721wherezipsilently truncates instead of erroring.Fabricalready holdsendpoints: Vec<Endpoint>whoseEndpoint.nameis the HCA name (:77, populated at:459-460), sogid_indicesshadows a vector that carries its own key. Folding the pair intoVec<(String, u32)>— or intoEndpoint— deletes two validation blocks and the truncation hazard.validate_relay_planrestates a predicate the C proxy already enforces.roce.rs:102-132mirrorsroce_proxy.c:838-849clause for clause, androce_set_relayalready returns-1with a message for each condition. Only theshape != Shape::Meshandplan.len() != 2 * worldchecks are Rust-only (and earn their place by running beforeroce_createtouches the region). Consider keeping just those two and letting C own the per-entry loop; if the loop is kept deliberately for an earlier error, note why.
Nits
factorflare-cli/src/cluster.rs:96-114now splices two independently built conditional middle segments (Links::Shared => ", switch only"and the newrelay_plan.is_some()arm) into one four-placeholderformat!. Building the segments as aVec<&str>andjoining them — or aDisplayimpl shared withspark.rs:191-195— keeps the next transport flag from adding a fifth placeholder.tests/preparation/test_roce_proxy_parity.pyholds both the vendoring guard (:35-65) andcreate_roce_runtimeunit tests (:68-131); if the dead fallback above is removed, the latter half shrinks to one forwarding assertion and belongs in atest_collectives.py(not opened).- Close or credit #672, #649 and #577 before this merges, and leave a comment on each. Four sentences in the PR body does not discharge "Respect contributors" for two first-time contributors; this is process, not code, so it is recorded here rather than as a blocker.
pyproject.toml:47line is 176 characters and will diverge from any formatter; harmless, but the rev string is now the only lock.
Dropped on verification
- "FINDING 2: the mixed-GID legacy guard is keyed on a parameter name, so a legacy
AllReducedeclaringgid_indices=None/**kwargsis misclassified" — dropped as speculative. Verified: a**kwargs-only orgid_index-only signature takes theelsebranch atignition/preparation/collectives.py:90-97and does raise on mixed GIDs, so it fails loudly as claimed. The counterexample requires a legacy class that declaresgid_indicesbut silently ignores it — no such revision exists in the pinned lineage (roce_proxy.c:557roce_create_with_gidsis the revision's own API), so there is no reachable defect. Theinspect.signatureValueError-on-C-extension concern is also unevidenced:b12x.comm.roce.AllReduceis a Python class in the pinned dependency, and any such failure aborts preparation rather than silently dropping a rail. - "
docs/roce-ring.md:336and other docs cite auv.lockthat does not exist" — true but pre-existing, not introduced here:docs/core-design.md:381-384(not opened),docs/model-preparation.md:147-152(not opened) anddocs/roce-ring.md:336all predate the PR and none of them is in the diff. Kept only the part the PR actually introduces (Should Fix 1). - "Undeclared files in the diff (
docs/cli-design.mdrewrite,flare-cli/src/cli.rs(not opened),docs/api.md(not opened), orbit files) are hidden scope" — dropped.pr_fileslists 12 files and the author-side delta is those 12; the extra hunks indocs/cli-design.mdtrace to already-merged #687/#697 onmainsince the branch point. No author-side scope creep. - "
Interface::gid_index(spark.rs:277) should be removed; it is only collected straight back into aVec" — dropped as churn. It is the natural per-device record for the value the readiness pass selects, removing it costs a parallelVec<u32>and three test literals for no invariant gain. - "CI status is not observable" /
docs/TODO.txtbookkeeping — not raised by any candidate and not applicable: CI is green on the head and the PR discloses its unrun checks honestly; no TODO.txt omissions were found in the diff. - "
roce_blob_t1168 → 1176 breaks ABI-14 compatibility" — dropped as a false alarm. Verifiedroce.rs:164still accepts9 | 10 | 11 | 14,ROCE_ABI_VERSIONis unchanged (roce_proxy.c:160), the two appended fields are naturally aligned (:257-269),peer_blobsrejects a short record before connect (roce.rs:86-95, tested at:501-503), androce_connect's check is symmetric against each rank's ownRING_WINDOW/ring_bytes(:754-761). The mixed-revision constraint is real but disclosed atdocs/roce-ring.md:161-170. - "
ROCE_RESERVE_OPS 48 < ROCE_RELAY_OPS 64is arithmetically wrong / under-reserves" — dropped. VerifiedROCE_SEND_DEPTH 512,_Static_assert(48 < 64)(:158-159), and the new static asserts at:225-230(ROCE_RELAY_OPS*3 + ROCE_MAX_PEERS*RING_WINDOW = 448 ≤ 512;222 + 192 + 4*16 = 478 ≤ 512); onlyoutstanding[p][0]is read byreserve/ring_service_slot/ring_submit/post_credits(:1566,:1584,:940,:995), so lane-0 headroom holds forworld = 2..16androce_layoutrejectsworld > 16(:389). - "
drain_allreorder is a defect" — dropped; it is the correct order.drain_cqsbeforering_service(:1271-1276) is required, since the reverse can spin on a completion already reaped;run_pipe_op:1695-1701andrun_ring_bidir_op:1880-1888then polldrain_cqswhile posting, which is what the superseded-PR review asked for. - "
relay_plancan produce asymmetric plans across ranks" — dropped.endpointsincludingneighbors/mac/portare exchanged between ranks,partners()/relay_plan()are pure functions of that shared list andrank, and the new test atroce_fabric.rs:2314-2404independently recomputes every(source, peer)writer and asserts exactly one assignment plus forward-only-to-partner across 4-, 4-LLDP- and 8-rank cases — not a tautology. - "
validate_relay_planaccepts a plan the C side then rejects (partial mutation)" — dropped.roce.rs:221-223runs beforeroce_ensure_libibverbs, before the region zeroing at:241, and beforeroce_create_with_gids;via < 0short-circuits before theas usizecast; androce_set_relayrejection at:344-352returns an error beforeroce_start, with the plan held in immutableself.topologyso no leftover state exists. - "
flare doctorcan index out of bounds ongid_indices" — dropped.spark.rs:161-164treats a missing index as unresolved andcontinues, keepingready[i]aligned withendpoint.name;sufficiencyis computed over all accumulated devices viaready.is_empty()(:183).
Full report · Notes Decision to Test: no (100%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 83.9% -
triage:validation: 8.8% -
triage:design-review: 6.9% -
triage:investigate: 0.2% -
none: 0.1% -
triage:integration: 0.1% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes