#1 [high] PR #643 correctness/contracts findings (all verified in-file)
PR #643, head 9c3ea69, single file helios/native/roce_proxy.c (+311/-26).
F1 BLOCKER — WR budget is wrong: relay gate is /4, not /6. The new _Static_assert: roce_proxy.c:184-187 "_Static_assert(RING2_MAX_OUTSTANDING * RING2_SIGNAL_STRIDE * 2 + (RING2_SIGNAL_STRIDE - 1u) * 2 + (ROCE_SEND_DEPTH / 6) * 3 <= ROCE_SEND_DEPTH, "batched ring2 WRs must fit inside ROCE_SEND_DEPTH with queue slack");" and comment at :175-179 ("leaving room for up to 85 subsequent three-WR relay ops (255 WRs)") assumes relays are capped by reserve()=ROCE_SEND_DEPTH/6. They are not: relay forwarding on the SAME lane-0 QP is gated at roce_proxy.c:984 "if (c->hca[h].outstanding[next][0] >= ROCE_SEND_DEPTH / 4) return 1;" = 128 relay ops x 3 WRs = 384 WRs, plus unbounded ring ACK WRs posted by ring_complete (:880-885, increments outstanding[previous][0] with no cap). Ring2 posts go to qp[p][0] (:1316) — the same lane-0 QP a relay rank forwards on, and at world=4 the ring2 neighbours ARE the relay next-hops. Worst case 222 (ring2) + 384 (relay) + ACKs > ROCE_SEND_DEPTH 512 -> ibv_post_send returns ENOMEM -> set_err + return -1 -> drain_cq/proxy_main store failed=1 (:1864-1867), transport permanently poisoned. Also note outstanding counts SIGNALED ops, so RING2_MAX_OUTSTANDING=6 cannot bound WR count (it only bounds completions), and ring2_unsignaled is bumped once per post (:1324-1325) while posts can carry 2 WRs. Fix: derive the ring2 window from the actual relay gate (ROCE_SEND_DEPTH/4*3=384) plus ring_complete ACK headroom, or bound total WRs (not signaled ops) per QP and gate both paths on it; the assert must use the /4 constant, not /6.
F2 MAJOR — relayed-first two-pass post_op delays direct writes behind relay credit waits (undeclared, changes existing one-shot on every ring deployment): roce_proxy.c:1238-1252 "int passes = c->ring != NULL ? 2 : 1; for (int pass = 0; pass < passes; pass++) { int want_relayed = (c->ring != NULL && pass == 0); ..." post_striped -> ring_post for a relayed peer blocks in "while (__atomic_load_n(ring_ack(...)) != prior) { if (drain_all(c) != 0) ... }" (roce_proxy.c:1107-1116) waiting for mailbox credit. Before this PR direct peers were posted first. At world=4 each rank has 2 direct + 1 relayed peer, so 2/3 of one-shot payload now waits behind a 2-hop mailbox credit wait whenever the window is contended. Fix: keep posting direct peers first (the pre-PR order), or post relayed peers first only when mailbox credit is already available (non-blocking ring_post variant); and declare the behaviour change.
F3 MAJOR — undeclared scope: CPU pinning + thread naming copied from #576: roce_proxy.c:1771-1773 "#ifdef linux (void)pthread_setname_np(pthread_self(), "flare-roce"); pin_high_capacity_cpus(); #endif" with pin_high_capacity_cpus() at :1702-1766 (reads /sys/.../cpu_capacity, sched_setaffinity). Not mentioned in the PR description, unrelated to ring2, and is the identical hunk in open PR #576 (and closed duplicate #633). Same file cannot land it twice. Fix: drop it and let #576 land it, or split.
F4 MAJOR — undeclared scope: IBV_SEND_INLINE newly applied to all pre-existing one-shot/relay traffic, and max_inline_data raised 16->256 for every QP: roce_proxy.c:497-514 ("attr.cap.max_inline_data = 256; ... if (hca->qp[p][l] == NULL) { attr.cap.max_inline_data = 16; ... }") and inline flags at :915 (relay payload), :924 (relay descriptor), :1188 (one-shot data WR), :1493 (credit, pre-existing) — only :1289/:1309 are the new kinds. Description mentions only "per-HCA max_inline tracking". This changes the ordinary one-shot path on every transport, including mesh (c->ring==NULL), with no evidence in the PR. Fix: split the inline change out, or state it and measure.
F5 MAJOR — vendored-parity contract broken with no upstream citation: roce_proxy.c:6-8 "Vendored from FlashInfer's pinned preparation dependency ... Keep the source below identical so preparation and serving share the transport ABI." and docs/roce-ring.md:360-364 "Flare vendors the serving proxy in helios/native/roce_proxy.c; preparation uses the pinned FlashInfer dependency. When changing the protocol, keep the vendored source identical to the dependency after its provenance header". New wire opcodes 5/6 (:173-174) are added in-tree only; the PR cites local-inference-lab/flashinfer#192 as a KERNEL PR only, no upstream proxy revision. Fix: point at the FlashInfer proxy PR/revision that defines kinds 5/6, or re-vendor.
F6 MAJOR — new wire protocol with no negotiation and no preflight: kinds 5/6 reuse the shared ctrl slot but ROCE_ABI_VERSION stays 14 (:141) and roce_blob_t is unchanged (:233-243), and roce.rs:131 accepts 9|10|11|14. A peer proxy without kinds 5/6 hits roce_proxy.c:1860-1862 ""unknown op kind %u at seq %u"" -> rc=-1 -> :1864-1867 failed=1, whole transport dies at replay with no fallback to oneshot. Likewise post_ring2_step hard-fails (not degrades) on mesh/chain/non-4 rings: roce_proxy.c:1336-1341 "if (c->world != 4 || c->ring == NULL || c->ring_open) { ... "RoCE two-step ring op requires a 4-rank closed ring ..."". A core recording ring2 kernels served on a mesh or a chain has no check before the first collective; everything else in this file is preflighted at roce_create/roce_connect. Fix: add a capability word to roce_blob_t + a connect-time check (as #577 does), and a preflight refusal in roce.rs, so this fails before replay.
F7 MINOR — ring2 requires 32-byte payloads where one-shot accepts 16: roce_proxy.c:1342 "if (nbytes == 0 || (nbytes % 32) != 0 || nbytes > c->slot_bytes)" vs :1227 "if (nbytes == 0 || nbytes % 16 != 0 || nbytes > c->slot_bytes)". Message sizes that are legal today (multiple of 16, not 32) fail the transport instead of degrading.
F8 MINOR — post_ring2_step does not drain at the end (breaks the file's uniform convention and defers completion accounting): roce_proxy.c:1368-1369 "c->ops_posted += 1; return 0;" vs post_op :1253-1254 "c->ops_posted += 1; return drain_all(c);" and run_varlen_op :1698-1699. Also hca->writes_completed / roce hca stats now advance once per RING2_SIGNAL_STRIDE writes, so byte/completion counters no longer mean "one per RDMA write" for ring2 traffic. Not correctness (the peer flag implies the local NIC read the payload) but it removes the per-op drain the rest of the file relies on and shifts the metric.
F9 MINOR — ring idle loop now services relays on every spin (also overlaps #577's eager-drain goal): roce_proxy.c:1796-1808 "if (c->ring != NULL) { int ring2_active = ...; if (!ring2_active || (idle & 15u) == 0) { if (ring_service(c) != 0) ... } if ((idle & 15u) == 0 && drain_cqs(c) != 0) ..." — was one drain_all per 64 spins (:1809). Combined with ROCE_IDLE_SPINS=20000000 (:194) and F3's pinning, an idle ring deployment now busy-polls ring_service (4 origins x rails x 8 slots of acquire loads on remote-written lines) on a pinned high-capacity core with no nanosleep. Behaviour change for every ring user, undeclared.
F10 MAJOR — evidence standard not met (charter "Bring real evidence" #210; docs/design-review.md): the only number is the absolute "RoceRing2AllReduceLaunch averages 31.8-33.0 us/call across 88 calls/round" from an nsys trace — no main/oneshot baseline, no delta, no served-workload throughput. Also the cited cargo test --features runtime-core,server never compiles this C: it is built only under the roce feature (helios/Cargo.toml:27 "roce = ["runtime-core", "dep:cc"]", helios/build.rs:67-77), so the changed code is unbuilt by the cited evidence. Note docs/roce-ring.md:382 gives the command that does compile it (--features roce --lib execution::roce::tests) and no ring2 test was added anywhere (search for ring2 across the repo hits only roce_proxy.c).
F11 MAJOR — docs/contract not updated: docs/roce-ring.md:161-167 enumerates what "proxy ABI 14" does (eight packets in flight per sender and rail, pipelined reduce-scatter/shard-gather, four QP lanes, start-of-op credits) and :355-370 is the protocol model; neither mentions kinds 5/6 or the ring2 WR budget. Operators cannot tell a ring2 core from any other.
Sound areas verified: ring_relays_origin (:735-751) is computed after n_rail/ring/ring_open are set and correctly matches ring_next_from, including the chain case where an endpoint relays nothing; the two halves of one step go to different peers so no flag is double-written with the same value on one QP (the per-rail flag-after-payload ordering still holds); the lo/hi byte offsets (remote_off and remote_off+half_bytes) stay inside the neighbour's slot; existing kinds 0..4 and roce_blob_t are untouched, so old cores load.
#2 [high] Research summary
Reviewed PR #643 (helios/native/roce_proxy.c, +311/−26, head 9c3ea69) for correctness, contracts and system-level consequences, reading the whole modified file plus its callers (helios/src/execution/roce.rs, docs/roce-ring.md, helios/build.rs, helios/Cargo.toml) and AGENTS.md. Findings are in scratchpad entry 1 with verbatim quotes and line numbers.
Highest-signal: (1) The new _Static_assert WR budget is arithmetically inconsistent with the code — it budgets relays at ROCE_SEND_DEPTH/6 (255 WRs) while relay forwarding on the same lane-0 QP is actually gated at ROCE_SEND_DEPTH/4 (roce_proxy.c:984, 384 WRs) with uncapped ring ACKs on top (roce_proxy.c:880-885); combined with ring2's 222, the 512-deep queue overflows and the proxy permanently poisons. (2) The undeclared relayed-first post_op two-pass ordering (roce_proxy.c:1238-1252) makes 2/3 of every one-shot payload wait behind a blocking mailbox-credit loop (roce_proxy.c:1107-1116) on every 4-rank ring. (3) Undeclared scope: the verbatim #576 CPU-pinning/thread-naming hunk and IBV_SEND_INLINE + max_inline_data 16→256 applied to all pre-existing one-shot/relay/mesh traffic. (4) Contract breaches: the vendored-parity rule (roce_proxy.c:6-8, docs/roce-ring.md:360-364) with no upstream proxy citation, and new wire kinds 5/6 with no ABI bump (stays 14), no blob capability word, no preflight — so a mixed-version peer or a ring2 core on mesh/chain dies at replay (unknown op kind, roce_proxy.c:1860-1867) instead of being refused before replay. (5) Evidence: only an absolute µs/call, no main baseline or served-workload A/B (#210), and the cited cargo test --features runtime-core,server never compiles the changed C (roce feature only: helios/Cargo.toml:27, helios/build.rs:67-77); no ring2 test or doc update exists anywhere.
Verified sound: ring_relays_origin computation, the per-step flag-after-payload ordering (the two halves go to different peers), half offsets staying inside the neighbour slot, and unchanged kinds 0..4 / roce_blob_t so existing cores still load.
#3 [high] PR #643 review supplements: AGENTS.md op-contract rule, metric scope, sound areas, citations
Supplements to entry 1 (PR #643 review). All verified in-file this session.
S1 CONTRACT — captured-graph op family needs owner approval: AGENTS.md:376-381 "- Introducing a captured-graph operation family requires prior explicit approval from project owner Luke Alonso lalonso@gmail.com. Shape and capacity variants of an existing family do not constitute a new type when its operation contract stays unchanged. A new operation contract requires approval even if it reuses an existing graph kind or enum value. A design acknowledgment does not grant that approval." Kinds 5/6 are a new operation contract in the ctrl slot (a new kind value, not a shape/capacity variant), so the rule applies. Mitigating fact to state honestly: the author (lukealonso) is the named project owner, so approval is plausibly self-granted — but the PR description does not record the approval, whereas the change does introduce a new captured-graph op contract. Severity: Minor/Major (process), not a code defect.
S2 METRIC SPAN — the counters F8 shifts have no in-repo consumer: roce_stat( and roce_hca_stat( appear only in roce_proxy.c (:1907, :1930); grep over helios/src returns no matches, and roce.rs's extern block (helios/src/execution/roce.rs:35-76) does not declare either symbol. So writes_completed/bytes_posted semantics changing for ring2 traffic is an observability defect without a current downstream threshold to misprice. Do not overstate F8 as a downstream-pricing bug; state it as an unbounded metric shift plus the removed per-op drain.
S3 SOUND — max_inline fallback is safe: roce_proxy.c:497-515 creates each QP trying 256 then 16, and folds hca->max_inline down to the minimum granted across all QPs of that HCA (:513-515), so a QP left at 16 cannot be handed an inline WR larger than it advertises by the data-WR paths (:1187-1188, :1308-1309). Relay descriptor WR at :923 uses sizeof(*d) - 8 = 72 bytes, which does not hold when only 16 were granted — that is why it is guarded, and it is guarded correctly.
S4 SOUND — flag ordering within one step: the lo and hi halves of a step go to two different peers (roce_proxy.c:1353-1354), so no QP receives two distinct flag writes to the same address in one step; per-rail flag-after-payload ordering (the write.next = &flag_wr chain at :1304) is preserved. Step1/step2 do write the same flag address with the same seq value on separate doorbells, but to different neighbours per step, so the receiver is not required to observe an intermediate value.
S5 SOUND — bounds: half_bytes and half_packs derive from nbytes/2 and nbytes/32 (:1355-1356), and the hi half targets remote_off+half_bytes in the neighbour's slot, inside the slot because nbytes <= c->slot_bytes (:1342). Payload is read from send[slot] at send+half_bytes, also inside the slot.
S6 Evidence citations I actually opened (use these, not dossier line numbers): docs/roce-ring.md:161-167 (what "proxy ABI 14" does — no kinds 5/6), :349-353 (qualified matrix: GLM-5.3 Flash TP4 on four DGX Sparks, other recipes/rank counts/--roce-chain/x86_64 not qualified), :355-370 (vendored-parity rule), :378-390 (the test command that does compile the C: cargo test --manifest-path helios/Cargo.toml --features roce --lib execution::roce::tests). Charter requirement quoted from the project charter: "Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)."
S7 ORDERING OF FIXES for the report's recommendation: F1 and F2 are the ones that can corrupt/poison a live ring and should block; F3/F4 are trivially separable (drop the pinning hunk for #576; split the inline change) and would shrink the PR to its declared content; F5/F6 need the upstream FlashInfer reference plus a blob capability word and a roce.rs preflight; F10/F11 need a main baseline and a docs/roce-ring.md paragraph.