PR #707: helios,ignition,flare-cli: unify ABI-14 RoCE proxy sync, wire roce_set_relay, and enforce CI parity

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/5b22549f-81f2-4a65-a83d-b0e5c1f7e84e

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:

Full report · Notes

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

Priority

Type

Area

Model

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

Gate 2 — Vendored upstream dependencies & cross-PR conflicts: VIOLATION (Major)

  1. Pin points at an unmerged upstream branch commit. pyproject.toml:47 moves flashinfer-python to 524799c47fca54229c15b6db12261171854a7b7d, the commit of the still-open local-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-9 documents 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.
  2. No uv.lock exists in the repository (verified: list_files *lock* at main returns only Cargo.lock files). docs/roce-ring.md:336 still instructs readers to check out "the revision pinned in uv.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 whatever git rev resolve to at install time; a force-push or squash of the FlashInfer branch breaks main CI with no repository-side lock to fall back on.
  3. 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.
  4. Cross-PR collision on the same vendored file. items_touching helios/native/roce_proxy.c shows #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 through flare 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:

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)

  1. 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-102 requires distinguishing an expectation from a measured result (done) — but the charter "Bring real evidence … performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)" and design-review.md principle 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.
  2. It reverses a documented decision from merged #279. main's docs/roce-ring.md said "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 every Shape::Mesh + even world >= 4 fabric 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 under AGENTS.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").
  3. Documentation now asserts unqualified support, and the contradicted doc is left stale. AGENTS.md:52-56 requires 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-170 now states serving "enables FlashInfer's two-shot all-gather relay" with no qualification statement and no hardware run behind it. Meanwhile docs/multi-host.md — the operator-facing cross-node document — is not updated: :94, :344, :574-577 still describe relays only in the ring/chain sense and never mention that mesh all-gather relay is now on by default. A reader of multi-host.md cannot learn that their 4-node direct-cable mesh changed collective routing. The PR's own docs/roce-ring.md:422-424 component table ("enables the ring or mesh all-gather relay") and multi-host.md:574 now 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:

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.

Full report · Notes

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:

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

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.

Full report · Notes

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):

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)

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).

Full report

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

Walkthrough

Pre-merge Checks

Blockers

  1. 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) maps KIND_TWOSHOT(1) and KIND_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_1hop at :1524; CREDIT_RS 1u/CREDIT_AG 2u at :185-186. Verified consumers: run_pipe_op gates RS at :1668, AG at :1676, relay forward at :1684; run_ring_bidir_op gates AG forwarding at :1823, RS at :1846, AG step 0 at :1867. So for prev = KIND_GATHER_SHARDS, cur = KIND_RING_RSAG the function returns CREDIT_RS only and every AG post in run_ring_bidir_op runs 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 rows dir (:1855) and 1-hop AG uses rows W + dir (:1834, :1872) — so a peer's pipe AG rows are shared with the previous 1-hop AG rows (at W = 4, pipe rows 1/3/5 are 1-hop AG rows 3/4/5). pipe_recv shows the same aliasing: pipe rows are s*2 + phase wide shard_cap (:1452-1454) while 1-hop slots are shard_cap/2 (:1749-1752, slot 2(W-1)+dir(W-1)+(s-1) ≤ 11 at W=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 in local-inference-lab/flashinfer and 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-746 only tests roce_set_relay rejection), but the author's own merge step 4 lands hyperflare-recipes#114, which enables KIND_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.

  2. 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 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 … Disclosing busy or unavailable GPUs does not waive this requirement."

    This PR reorders exactly that path: 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). 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 with roce_set_relay were 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 run with relay enabled (and one with --roce-switch-only as the baseline), plus the written before/after happens-before analysis.

  3. roce_set_relay is 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 at docs/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) and design-review.md principle 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 of docs/roce-ring.md (the removed lines at diff hunk 158-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-169 now also asserts the behaviour in the present tense with no qualification statement, contrary to AGENTS.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 to docs/roce-ring.md and record the maintainer decision for the #279 reversal.

Should Fix

  1. The FlashInfer pin points at an unmerged branch commit, which the new CI parity test turns into a main-branch failure. pyproject.toml:47 → 524799c47fca54229c15b6db12261171854a7b7d is still-open FlashInfer #213. tests/preparation/test_roce_proxy_parity.py:35-65 byte-compares helios/native/roce_proxy.c lines 10..EOF against whatever uv sync installed (python-cpu.yml:29-33), and there is no uv.lock in the repository (verified: list_files *lock* at main returns only Cargo.lock files), so the rev in pyproject.toml is the entire lock. A force-push or squash-merge of #213 breaks CI on main, and the PR's own merge step 2 admits the repin is outstanding. Fix: repin to the merged main SHA before this PR merges (the author's step 2), and — while here — record the upstream commit and body SHA-256 in helios/native/roce_proxy.c:6-8, which currently names the upstream path and ABI but no revision, unlike #643.

  2. The operator-facing cross-node document was not updated and now contradicts docs/roce-ring.md. docs/multi-host.md:94, :344 and :574-577 still describe relays only in the ring/chain sense and never mention that mesh all-gather relay is on by default. A reader of multi-host.md cannot learn that their 4-node direct-cable mesh changed collective routing, and docs/roce-ring.md:422-424 ("enables the ring or mesh all-gather relay") now contradicts multi-host.md:574. AGENTS.md:52-58 requires support to be stated as present qualification. Fix: add the mesh relay-on-by-default behaviour (and the --roce-switch-only opt-out) to the docs/multi-host.md transport sections.

Subtract / Simplify

  1. roce_gid_index is a dead export whose fallback arm can never execute. heliopause/src/python.rs:697-706 plus its registration at :669; helios/src/execution/roce_fabric.rs:1094-1100 (Fabric::gid_index, whose unwrap_or(PREFERRED_GID_INDEX) is likewise unreachable). The only call site is the legacy fallback ignition/preparation/collectives.py:97, where distinct derives from devices = flare_heliopause.roce_devices() (:83), and discover_in errors rather than returning an empty device list (roce_fabric.rs:429-431). So distinct is never empty and the else flare_heliopause.roce_gid_index() arm is unreachable in production; Fabric::gid_index() survives only through roce_fabric.rs:1242,1276,1303 tests. Deleting the export, its add_function line, Fabric::gid_index(), and simplifying collectives.py:97 to {"gid_index": distinct[0]} removes ~35 lines and stops advertising a twice-documented API whose own doc comment says "Prefer roce_devices".
  2. format_gid_indices's empty arm is unreachable. flare-cli/src/doctor/spark.rs:259-262: both call sites guarantee non-empty input — :189 is inside if !ready.is_empty() (:183) and :246 formats fabric.gid_indices, which a successful discover_in has proven non-empty (roce_fabric.rs:429-431). Take first: u32, rest: &[u32] (or drop the arm) so emptiness is unrepresentable, and the "index (none)" wording stops disagreeing with its "index N"/"indices [..]" siblings.
  3. relay_plan() re-plans routes the caller just planned. roce_fabric.rs:1128-1131 calls plan_shape_routes and then relay_plan, which calls partners (:1032), which constructs a second Planner (:988) and issues planner.peer(rank, peer) for all world × world pairs (:996). The sibling direct_peers (:957) already takes routes as a parameter and reuses them — pass &routes into partners/relay_plan and drop the extra Planner plus the rails/links parameters. Once per connect, never per collective step (I verified health()/posting never reads relay_plan), so this is a simplification, not a hot-path defect.
  4. hcas and gid_indices are 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), and heliopause/src/python.rs:717-721 where zip silently truncates instead of erroring. Fabric already holds endpoints: Vec<Endpoint> whose Endpoint.name is the HCA name (:77, populated at :459-460), so gid_indices shadows a vector that carries its own key. Folding the pair into Vec<(String, u32)> — or into Endpoint — deletes two validation blocks and the truncation hazard.
  5. validate_relay_plan restates a predicate the C proxy already enforces. roce.rs:102-132 mirrors roce_proxy.c:838-849 clause for clause, and roce_set_relay already returns -1 with a message for each condition. Only the shape != Shape::Mesh and plan.len() != 2 * world checks are Rust-only (and earn their place by running before roce_create touches 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

Dropped on verification

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

Apply labels

No label changes