Key findings
Reviewed PR #576 (7 files, +226/−1, head 4b41ddc) through lens D, simplicity — what can be deleted. Two findings, both should fix, no blockers.
- The tier-selection policy is written twice (
eos/src/unix.rs:172-245andhelios/native/roce_proxy.c:1505-1570), and the second copy puts 66 lines of local policy into a file the repo requires to stay byte-identical to its vendored upstream. A single implementation, in the creating thread, deletes all 66 C lines. - Two of the four Rust call sites only narrow preparation/qualification threads (
helios/src/execution/worker.rs:71,helios/src/replay.rs:174), while a genuinely latency-critical serving thread (helios/src/execution/threaded.rs:652,flare-rank-{n}) gets no call. The set of narrowed threads looks arbitrary and is stated as a file list rather than a rule.
Rules this review judges against:
AGENTS.md:188-189: "Reject unsupported abstractions and churn. Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement."docs/design-review.md:16(principle 1): "Keep Helios as simple as possible."docs/design-review.md:112: "ignition debug-servetimings are diagnostic only."docs/roce-ring.md:360-364: "Flare vendors the serving proxy inhelios/native/roce_proxy.c… keep the vendored source identical to the dependency after its provenance header" — echoed in the file itself athelios/native/roce_proxy.c:6-8..agents/skills/repo-prose/SKILL.md(not opened): comments state invariants and non-obvious constraints, not history.
Coverage: every changed hunk was read in context, and every call site was followed (eos/src/unix.rs 150-336 and 250-336 incl. tests; eos/src/lib.rs:10-16; eos/src/windows.rs:220; helios/native/roce_proxy.c 1-25, 1495-1580 and the diff; helios/src/execution/worker.rs:55-90; helios/src/replay.rs:160-190; helios/src/execution/threaded.rs:630-680; plus grep of all four Rust call sites and of every ReplayWorker::new / ExecutionWorker::new_threaded construction).
Finding 1 — should fix: the tier-selection policy is implemented twice, and one copy is in a file that must stay identical to vendored upstream
Files/lines: eos/src/unix.rs:172-210 (select_high_capacity_cpus) + eos/src/unix.rs:215-245 (prefer_high_capacity_cpus) vs helios/native/roce_proxy.c:1505-1570 (pin_high_capacity_cpus), called from helios/native/roce_proxy.c:1576.
What is wrong. Both copies encode the same non-obvious policy, number for number:
| step | Rust | C |
|---|---|---|
| read own mask | unix.rs:218 |
roce_proxy.c:1513 |
per-CPU cpu_capacity |
unix.rs:227 |
roce_proxy.c:1526 |
| abort on read/parse/zero | unix.rs:228-233 (return) |
roce_proxy.c:1528-1536 (return) |
< 2 CPUs or min == max → no-op |
unix.rs:173-187 |
roce_proxy.c:1543 |
keep cap*10 >= max*9 (the magic 0.9) |
unix.rs:192 |
roce_proxy.c:1550 |
<2 survivors → keep cap*2 > min+max |
unix.rs:195-204 |
roce_proxy.c:1555-1565 |
apply only if 2 <= selected < count |
unix.rs:205 |
roce_proxy.c:1566 |
The 90% threshold exists nowhere but in these two expressions. Any future tuning (0.9 → 0.95, a different three-tier rule) has to be made twice, by hand, in two languages, and only the Rust copy has tests (eos/src/unix.rs:254-314); nothing in CI or the PR compares the two behaviours. That satisfies the "fallback layers / parallel paths" prohibition in AGENTS.md:188-189 and principle 1 of docs/design-review.md:16 only if the duplication is genuinely forced. It is not obviously forced — and, worse, the C copy directly contradicts docs/roce-ring.md:362-364 and roce_proxy.c:6-8, which require the vendored proxy to stay identical to the pinned FlashInfer source after its provenance header. This PR makes it diverge, so the repo's own provenance invariant now has a silent exception.
Why the C copy exists (so the fix is not naive deletion): the proxy thread is created by pthread_create(&c->thread, NULL, proxy_main, c) at roce_proxy.c:1674 inside roce_start, reached from RoceTransport::connect (helios/src/execution/roce.rs:295), which flare-cli calls from cluster::peer (flare-cli/src/main.rs:549) and cluster::rank_zero (main.rs:613) — i.e. before serve()/serve_peer() ever reach the narrowed threads (helios/src/execution/parallel.rs:539, helios/src/server/runtime.rs:568). The child therefore inherits the un-narrowed main-thread mask, which is the only reason proxy_main narrows itself.
Fix (smaller version). Narrow the creating thread immediately before roce_start, so the proxy inherits the mask through pthread_create:
// helios/src/execution/roce.rs, in RoceTransport::connect, before roce_start
flare_eos::prefer_high_capacity_cpus();
and delete roce_proxy.c:1505-1570 (66 lines including the #ifdef) plus the pin_high_capacity_cpus() call at roce_proxy.c:1576. Total: −66 C lines, −1 Rust line, one implementation, one tested copy, and the vendored file stays identical to upstream so docs/roce-ring.md:362-364 keeps holding. If narrowing the calling thread is unacceptable (e.g. connect runs on a thread that must keep its full mask for other work), the alternative is to spawn a short-lived transport-opener thread that narrows itself and then calls roce_start — still no C changes.
If the C copy must stay for some reason I could not see from the code, then the PR must say so explicitly and record why the vendored-identical rule is being broken; today neither the PR description nor roce_proxy.c:6-8 is updated to acknowledge the divergence.
Finding 2 — should fix: two of the four Rust call sites narrow only preparation/qualification threads, and a genuinely critical serving thread is missing
Files/lines: helios/src/execution/worker.rs:71, helios/src/replay.rs:174 (added, arguably unnecessary) versus helios/src/execution/threaded.rs:652-678 (missing).
What is wrong. The four added call sites are not the same population:
- Serving, correctly narrowed: the
flare-modelthread athelios/src/server/runtime.rs:568, which ownsRankExecutor; andserve_rankathelios/src/execution/parallel.rs:539, the peer-rank process main thread reached fromflare-cli/src/main.rs:560. - Not serving: the
flare-executionthread athelios/src/execution/worker.rs:71(ExecutionWorker) and theflare-cudathread athelios/src/replay.rs:174(ReplayWorker). A tree-wide grep showsExecutionWorker::new_threadedis constructed only inheliopause/src/python.rs:410-411andhelios/tests/tools/tp4_collective.rs:122 (not opened),134;ReplayWorker::newonly inheliopause/src/python.rs:86,helios/src/runtime_core/*_tests.rs:17 (not opened),24,51andhelios/tests/tools/test_runtime_core.rs:71(not opened),test_fixed_runtime_core.rs:53(not opened). Both are theignition-side preparation/qualification path (ignition debug-serve, graph qualification), where the PR reports no measurement and wheredocs/design-review.md:112andAGENTS.md:283say timings are diagnostic only. They also change replay-thread placement during preparation, a path the PR's ARM64 evidence never covers.
Since the calls are unconditional on entry to the worker closure (worker.rs:70-71, replay.rs:173-174), they are silent behaviour changes in paths with no stated benefit — exactly the "churn" AGENTS.md:188-189 asks reviewers to reject.
Missing site, which makes the set look arbitrary. The same-process TP rank threads format!("flare-rank-{}", index + 1) at helios/src/execution/threaded.rs:652-653 own GraphExecutor (threaded.rs:656) and launch CUDA graphs in rank_loop (threaded.rs:668) — precisely the "execution thread" the PR says it is pinning — yet they get no call. So threaded TP narrows neither its rank threads; only the process-TP path (parallel.rs:539) and the numeric-path executor (server/runtime.rs:568) are narrowed.
Fix. Either
- narrow serving threads only: keep
server/runtime.rs:568andexecution/parallel.rs:539, delete the two lines atworker.rs:71andreplay.rs:174; or - narrow all execution threads: also add the call at
threaded.rs:654(first statement in the spawned closure), and say in the PR which threads are "critical" and by what rule.
Either way, state the rule — "the thread that owns the CUDA execution/WFET worker, the RoCE proxy, and the same-process TP rank threads" — instead of listing files, so the next execution-thread type knows whether it qualifies. That is both smaller prose and a smaller diff than the current file list.
Nits
None. The doc comments on select_high_capacity_cpus (unix.rs:167-171), prefer_high_capacity_cpus (unix.rs:212-214) and pin_high_capacity_cpus (roce_proxy.c:1506-1509) are 2-4 lines, state the no-op invariants, and contain no history; the eos/src/windows.rs:220 stub is one line and matches the file's existing style. The unit tests at unix.rs:254-314 each assert a distinct behaviour the PR claims (two-tier split, homogeneous/single-tier/zero-capacity no-op, three-tier collapse avoidance) and are not redundant — with the caveat in open questions below.
Open questions / what could not be settled
- Is the C divergence permitted?
docs/roce-ring.md:362-364requires the vendored proxy to stay identical to the pinned upstream, and this PR edits it. Whether Flare intends to carry local serving-side patches in the vendored file (and updateNOTICE:16-17/THIRD_PARTY_NOTICES.md:49(not opened) provenance notes accordingly) is a maintainer call I cannot settle from the code; either answer resolves Finding 1. - Does the sysfs path get exercised by any check?
eos/src/unix.rs:254-314tests only the pureselect_high_capacity_cpusover synthetic(cpu, capacity)pairs. The real entry point —sched_getaffinity, theformat!("/sys/devices/system/cpu/cpu{cpu}/cpu_capacity")read and parse atunix.rs:225-236, and thesched_setaffinityat:244— is covered by no automated check, only the manual 4-Spark run. UnderAGENTS.md's "Tests must exercise the affected behavior or contract", a GB10-only test callingprefer_high_capacity_cpus()against a real cpuset would settle it; a host withoutcpu_capacitycannot. - Silent no-op versus an explicit startup line. Both implementations discard the
sched_setaffinityresult (unix.rs:244let _ = unsafe { … };roce_proxy.c:1567(void)sched_setaffinity), so the operator cannot tell from logs whether the narrowing happened, while the PR's entire claim is "48/48 threads on X925". I could not finish checking whether Helios already prints thread placement at startup, so I make no finding here; if the maintainers treat an affinity decision as a diagnosable event, one log line naming the selected set would be the smaller alternative to per-PR benchmark evidence — but against lens D it is also one more line to delete, so I lean against adding it.