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