PR #576: Pin Helios execution and RoCE proxy threads to high-capacity CPUs on asymmetric Linux topologies

Raw Markdown for agents: https://autobot.eidonix.com/api/v1/cases/3d97edb2-b5a4-4626-8f62-d2b9a9b474e2

Opened by a workflow run, Nov 28, 2026 2:31 PM EST.

screen malicious

Screen Result: All Clear

Evidence: Read the complete diff of NVIDIA/hyperflare-inference PR #576 (head 3363573; 7 files, +226/−1) end to end, plus surrounding code in every touched file. Every added hunk is genuine, functional CPU-affinity/thread-naming code consistent with the title: select_high_capacity_cpus and prefer_high_capacity_cpus in eos/src/unix.rs:167-248, an empty non-Linux stub in eos/src/windows.rs:220, a C mirror pin_high_capacity_cpus() under #ifdef __linux__ in helios/native/roce_proxy.c:1505-1570 and a pthread_setname_np("flare-roce") call at roce_proxy.c:1575, and four one-line call sites at thread entry (helios/src/execution/parallel.rs:539, execution/worker.rs:71, replay.rs:172-176, server/runtime.rs:568).

No agent-directed content was found anywhere: PR has zero comments, reviews or inline comments (pr_comments: "No comments"), so no discussion channel for injected instructions; the diff contains no imperative text, no hidden/Unicode-smuggled text, no network fetches, no exec/spawn, no encoded blobs, and no instructions to reviewers or automated agents. Greps of the changed files for ignore/disregard-instruction, assistant/agent/autobot/system-prompt, curl/wget/http(s), base64, eval and Command::new/std::process returned nothing in added code (only pre-existing test temp-file paths in eos/src/ioring.rs:337 (not opened),364,442 and eos/src/windows.rs:230,269). The file set is exactly the seven expected code files — no CI workflow, script, docs or dependency changes — so there is no second channel.

Non-security notes for reviewers: (1) roce_proxy.c:6-8 states the vendored proxy must stay identical to FlashInfer's copy (ABI 14), yet this PR edits it — upstream-drift hygiene, not security; (2) the body cites external PR local-inference-lab/flashinfer#156 as "zero wire/ABI dependency", a trust claim to verify, not an instruction; (3) first-time contributor fordbmorris (association NONE) opened #574–#577 the same day with no CI on the head commit — ordinary review-diligence context; (4) benchmark figures (GB10, +17.2%, CV reductions) are not reproducible from the repo.

Full report · Notes decide malicious: all_clear (100%): No malicious content found

explore

Author: fordbmorris (GitHub association NONE — not a member; first-time contributor with no merged commits in this repo; Discord woooflet per the PR body) Motivation: On NVIDIA GB10 (DGX Spark) the 20-core Grace CPU mixes 10 slow Cortex-A725 cores with 10 fast Cortex-X925 cores, and Linux sometimes schedules Helios's two 100%-CPU threads (the CUDA execution/WFET thread and the busy-polling RoCE proxy thread) onto the slow ones, which the author measures as slower one-shot collectives, stretched host wake gaps and launch-to-launch variance. The PR makes those threads silently re-narrow their own affinity to the high-capacity CPU tier read from /sys/devices/system/cpu/cpuN/cpu_capacity, with no env var, flag or config. Scale: +226 / −1 lines in 7 files Proposal:

Full report · Notes

Value Proposition

Verdict: worth it with changes — do not merge as written

The underlying problem is real and squarely in the project's target hardware (DGX Spark / GB10 is named in the vision), the evidence is far better than most performance PRs, and the change is small and off by default elsewhere. But as written it (1) diverges a file the docs require to stay byte-identical to the pinned FlashInfer dependency, (2) silently undermines an explicit documentation gate on CPU affinity, (3) leaks the narrowed mask onto unrelated I/O threads, and (4) has a much simpler alternative that gets the same placement. All four are fixable; none require redesigning the idea.

Why the direction is right (charter alignment)

Problems that must be fixed

  1. Vendored-proxy divergence (highest concern). helios/native/roce_proxy.c:6-8 states "Keep the source below identical so preparation and serving share the transport ABI," and docs/roce-ring.md:361-364 repeats the rule: keep the vendored source identical to the FlashInfer dependency after the provenance header. This patch adds a 71-line Flare-specific block plus a Flare-branded thread name ("flare-roce", roce_proxy.c:1575) to that file, and the PR itself leans on a paired FlashInfer PR (#156, currently open, unreviewed) for lockstep. That converts a merge-order-free change into a coupling the project has already been burned by — docs/TODO.txt:80-86 carries open preparation/serving proxy-parity debt. The proxy only needs the affinity change at thread start; it does not need a capacity scanner of its own.

  2. A duplicated implementation with no test. select_high_capacity_cpus exists twice — in Rust (eos/src/unix.rs:171-208, three tests) and again in C (roce_proxy.c:1505-1569, no test at all). Same 90% threshold, same midpoint fallback, same ≥2-CPU floor, written twice in two languages. Two copies will drift, and the copy the proxy actually uses on the hardware in question is the untested one. Also note the C version reads cpu_capacity per CPU and returns (no-op) on the first unreadable file, while the Rust version returns on the first failure too — consistent, but neither is exercised on CI hardware: CI runs the eos tests on x86 (eos/src/unix.rs tests only feed synthetic pairs), so the "no-op on x86" path is what CI actually proves.

  3. Affinity is inherited, so the mask leaks past the intended threads. prefer_high_capacity_cpus() is called at the top of the flare-model thread (helios/src/server/runtime.rs:568). The same thread later constructs the image-preparation worker (runtime.rs:721 → ImagePreparation::new, runtime.rs:1011) and, via crate::offload::open (runtime.rs:698), the Selene offload transfer threads (helios/src/offload/transfer.rs:509) and disk threads (selene/src/disk.rs:358). On Linux a child thread inherits the parent's sched_setaffinity mask, so those workers silently land on the 10 performance cores as well — exactly the cores the patch is trying to reserve for the execution and RoCE threads. That is the opposite of the documented intent: docs/prefix-cache-offload.md:863-867 deliberately keeps offload threads on SCHED_BATCH with a positive nice value over the wide CPU set. Nothing in the PR measures or acknowledges this. This is the defect I would block on.

  4. The documented policy gate on CPU affinity is not met in the docs. docs/prefix-cache-offload.md:866-867 says plainly: "Adding CPU affinity requires a serving-latency measurement that shows a benefit." The PR has measurements, but it leaves the document untouched, so main would ship code and docs that contradict each other. Either update that paragraph to describe the new critical-thread policy and how it differs from the offload rule, or the change reads as having bypassed the project's own standard.

  5. Same-process TP coverage is accidental, not designed. helios/src/execution/threaded.rs:652-654 spawns the flare-rank-N threads without calling the helper. They get the narrowed mask only by inheriting it from flare-execution. That works, but it is undocumented implicit behaviour in the one layout (docs/same-process-tp.md) where several 100%-CPU threads share one process; if someone moves the call or spawns those threads from elsewhere, the pinning silently disappears. Make it explicit or state the inheritance contract.

  6. Three magic numbers with no rationale in the code. 90% of max, the (min+max)/2 fallback, and the "never fewer than two CPUs" floor are all judgement calls. The comments explain what they do; nothing records why 90% and not 85%, or why two and not four. For a prototype this is tolerable, but "no magic defaults" is a stated rule — one short paragraph in the doc, plus a named constant, closes it.

  7. Evidence is narrower than it looks. The headline +17.2% C8 decode is a core-tier A/B on one live server (X925 vs A725 placement), not patch-vs-main. It shows the mechanism matters; it does not show the patch's serving gain. The patch-vs-main numbers are the CV (6.7×), RoceOneshotLaunch (−31.0%) and the p90 wake gap (61×) — those are real and are the ones to lead with. All of it is one SoC family, one model (Inkling 2 Small NVFP4), TP4, one governor, self-measured. docs/performance-work.md asks for baseline-matched comparisons of complete graph latency and throughput through flare run CORE; a same-server placement A/B is a good complement but should be labelled as such.

Simpler way to the same end

Pin from Rust, not from C. A new pthread_create inherits the creating thread's affinity mask across the roce_start boundary (helios/src/execution/roce.rs:295). So calling the existing prefer_high_capacity_cpus() on the Rust thread immediately before roce_start — or once in RoceTransport::connect — restricts proxy_main to the same high-capacity subset with zero change to roce_proxy.c, no duplicated C scanner, no vendored-file divergence, and no dependency on FlashInfer PR #156. The thread naming (pthread_setname_np → "flare-roce") is a diagnostic nicety; if it is wanted for nsys attribution, it can be set from Rust via libc::pthread_setname_np after start, or accepted as a separate, clearly-labelled minimal divergence. This deletes roughly 70 lines of C and the entire lockstep problem.

Two even smaller options to weigh honestly: systemd CPUAffinity=/taskset on the serving unit solves it with no code at all (but does not help operators who don't set it, so the code path has value); and a one-line SCHED_FIFO/nice adjustment would not fix placement, so it is not a substitute.

Recommendation

Worth it with changes. Keep the idea, the Rust helper, the tests, and the Rust call sites. Required before merge:

  1. Delete pin_high_capacity_cpus() from roce_proxy.c; pin the proxy by restricting the Rust thread that calls roce_start (roce.rs:295). This alone satisfies the "keep the vendored proxy identical" rule in roce_proxy.c:6-8 and docs/roce-ring.md:361-364 and removes the FlashInfer #156 coupling.
  2. Stop the mask leaking onto offload/image/selene threads: either narrow only the execution/replay threads and pin flare-model narrowly after the store and image worker are constructed, or restore the original mask on the threads that create long-lived I/O workers. At minimum, measure it — the current 2-hour soak would not have caught an offload thread landing on a P-core.
  3. Update docs/prefix-cache-offload.md:863-867 (and add a short note where critical-thread placement belongs) so code and docs agree; record why 90% and why a two-CPU floor.
  4. Make the same-process TP rank threads (threaded.rs:652) explicit rather than relying on inheritance, or document the inheritance contract.
  5. Reframe the claimed benefit to lead with the patch-vs-main measurements (CV, RoceOneshotLaunch, wake gap) and label the +17.2% C8 figure as a placement A/B, per docs/performance-work.md.

With those changes it is a small, model-agnostic, off-by-default improvement aimed exactly at the hardware in the charter's vision, backed by measurements that are better than the bar the charter sets. As written, points 1-3 are the reason I would not merge it today.

Full report · Notes Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Prose

Verdict: blocking issues

Blocking:

Should fix:

Nits: 3 — (1) eos/src/unix.rs:212-214 says the no-op covers "non-Linux targets" but the stub it means is eos/src/windows.rs:220; (2) nothing records that an unreadable/zero cpu_capacity makes the restriction silently not happen (eos/src/unix.rs:228-233, roce_proxy.c:1528-1535); (3) cold-prefill range "+2.6% to +17.3%" leaves the +2.6% endpoint unattributed by context size and "more than an order of magnitude" (Why) understates the reported 61×.

Compliant and worth stating: the description does follow AGENTS.md's four-part order (why / what changed / claimed benefit / evidence), distinguishes measured from expected, discloses the x86_64 no-op path and the uncompiled Windows stub, and carries Discord: woooflet.

Link: https://github.com/NVIDIA/hyperflare-inference/pull/576

Full report · Notes

Conventions

Verdict: should-fix issues only Blocking:

Full report · Notes

Simplicity

Verdict: should-fix issues only Blocking:

Full report · Notes

Architecture

Verdict: blocking issues

Blocking:

Should fix:

Nits: 5

Link: https://github.com/NVIDIA/hyperflare-inference/pull/576

Full report · Notes

Correctness

Verdict: should-fix issues only Blocking:

Correctness holds up otherwise. The Rust (eos/src/unix.rs:172–245) and C (roce_proxy.c:1510–1569) copies implement the same policy — same 90 % band (cap*10 >= max*9), same midpoint fallback, same "at least two CPUs" floor, 64-bit intermediates — and only ever narrow the thread's live sched_getaffinity mask, so operator cpusets and cgroups can't be widened. Absent/unreadable/zero cpu_capacity, homogeneous sets, single-tier cpusets and single-CPU sets all return early, covering x86_64 (no sysfs file), Windows (eos/src/windows.rs:219 stub) and non-Linux unix (eos/src/unix.rs:247). Every call site is the first statement on a freshly spawned thread — parallel.rs:539, worker.rs:71 ("flare-execution"), replay.rs:174 ("flare-cuda"), runtime.rs:568 ("flare-model"), roce_proxy.c:1576 in proxy_main (started in roce_start, joined in roce_stop) — so nothing races and nothing leaks to sibling same-host peer threads, which inherit the already-narrowed mask and no-op. sched_setaffinity errors are discarded on both sides, so no new failure surface, and ABI stays 14 with no format/protobuf change.

Nits: the policy is duplicated in Rust and C with no shared test or cross-reference comment (drift risk between the execution thread and the RoCE thread); the mask/sysfs half of prefer_high_capacity_cpus has no test (only the pure selector, unix.rs:254–314) and the cold one-time cost of statting up to 20 capacity files on the proxy thread before the doorbell loop is unmeasured; no documented opt-out for operators who want critical threads on efficiency cores.

Open: whether upstream flashinfer#156 lands (determines the pin fix), and whether cpu_capacity is trustworthy on every supported ARM host — both settle outside this repo.

Full report · Notes

Subtractive

Verdict: make it smaller first The change: +226 / −1 (7 files) Could remove: about 107 lines, in 4 places (≈47%), leaving ≈+119 in 6 files Biggest subtractions:

Full report · Notes

Pre Test Report

Pre-test report — PR #576: "Pin Helios execution and RoCE proxy threads to high-capacity CPUs on asymmetric Linux topologies"

Head reviewed: 3363573 (4b41ddc in some lenses). 7 files, +226 / −1. Author fordbmorris, GitHub association NONE (first-time contributor, no merged commits), Discord woooflet. No maintainer request, issue, triage label, review or CI run exists on the head.


1. Recommendation

❌ NOT REFERRED FOR HARDWARE TESTING — send back to the author

Reason: the code will change before it is worth any GPU time. Three of the review lenses call this blocking, one calls it "would not merge today", and I confirmed each of their concrete claims against the tree. This is not a case of "probably fine, let's measure it" — the change as written makes an unconfigurable, default-on scheduling decision for every Linux deployment, edits a file the repository promises is unchanged, and leaks the narrowed mask onto I/O threads it was not meant to touch. Testing it now would validate code that will not survive review.

Expected value of a hardware test today: near zero. Two independent reasons, in order of importance:

  1. The code is not test-worthy yet (quality/architecture, §2).
  2. Even a perfect test would prove little on the hardware we have (§3). The only asymmetric host (cn7) is a single GB10; the headline claim is a 4-node TP4 --roce-ring result on 4× DGX Spark with ConnectX-7. The RoCE proxy path — the untested C helper, the flare-roce thread, the −31% RoceOneshotLaunch and the 61× wake-gap figures — cannot be exercised on cn7 or cn5 at all. cn5 is x86_64, where the feature is a guaranteed no-op. And neither host carries the recipe that was measured ("Inkling 2 Small NVFP4", from local-inference-lab/hyperflare-recipes, not this repo), so the +17.2% / CV improvements are not reproducible here in principle.

A test engineer would spend hours and produce a report that says "on cn7 the threads landed on CPUs 5–9 and 15–19; on cn5 nothing changed" — which the author tells us is already true, and which proves nothing about the feature or about main versus this head.


2. What I verified myself (not taken on trust from the reviews)

Mechanism (eos/src/unix.rs:172-248, mirrored in roce_proxy.c:1505-1570): reads sched_getaffinity, then per-CPU /sys/devices/system/cpu/cpuN/cpu_capacity, keeps CPUs with cap*10 >= max*9 (unix.rs:192), falls back to cap*2 > min+max (:198-203) when fewer than two clear the band, applies only if 2 <= selected < allowed (:205), then sched_setaffinity. Four Rust call sites, one C call site, two empty stubs. Tests (unix.rs:254-314) cover only the pure selector.

The blocking problems

# Problem Evidence I confirmed
A The vendored proxy is no longer identical to its pin, and three documents still say it is. roce_proxy.c:6-8: "Keep the source below identical so preparation and serving share the transport ABI." NOTICE:16-19: "Its implementation is unchanged from that revision; Flare adds a license and provenance preamble." docs/roce-ring.md:355-364: "keep the vendored source identical to the dependency after its provenance header." The PR adds +71 Flare-only lines and updates none of the three, nor the FlashInfer pin. NOTICE:18-19 is now a false statement about main.
B The affinity mask leaks onto threads the PR never intended to narrow. Real threading bug; most lenses missed it. runtime.rs:568 is the first statement of the flare-model thread; that same thread later spawns the offload/disk/image workers (runtime.rs:698 → offload/mod.rs:105 → selene/src/offload.rs:653,676; transfer.rs:509-511; runtime.rs:721 → ImagePreparation::new → runtime.rs:1011). On Linux a child inherits the parent's mask, so all of them silently land on the 10 high-capacity cores. transfer.rs:531 and disk.rs:470 then apply SCHED_BATCH + nice to those very threads — which only helps if they are not sharing the model thread's cores. This contradicts docs/prefix-cache-offload.md:863-867 verbatim: "Both use SCHED_BATCH with a positive nice value to reduce contention with the model worker... Adding CPU affinity requires a serving-latency measurement that shows a benefit." The PR neither updates that paragraph nor measures the offload path. This is the finding I would lead with, and it is a genuine regression risk that a soak test with a vision/offload model would expose.
C A magic-numbered, unconfigurable, default-on policy in the shared eos crate. No env var, no flag, no config field, no CLI option — the policy cannot be turned off. Violates charter "Be explicit and pin everything. No magic defaults" and AGENTS.md:453 ("A setting has one of three homes: the recipe declaration, the configuration file, or a command-line flag"). The 90% band and the midpoint fallback are unexplained literals. The author frames "no environment variables" as the virtue; it is the defect.
D Errors are suppressed, so the claimed no-op semantics are unverifiable. unix.rs:228-233 returns on the first unreadable capacity file, skipping readable CPUs too; unix.rs:244 let _ = sched_setaffinity(...); roce_proxy.c:1567 (void). AGENTS.md:182-186: "Do not remove validation, suppress errors, silently substitute execution paths." Nothing in a serving log tells an operator whether the policy applied — which also makes any hardware placement test depend on external tooling rather than the runtime.
E No main-vs-head baseline. Every figure compares placements within the change (X925-placed vs A725-placed launches), not this head against main via flare run on the same exported core. Charter: "Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)." The description also never states how the A725 arm was produced (different binary? external taskset?), so the +17.2% cannot be attributed to this patch.

Should-fix (would still block referral in aggregate)

What is genuinely fine (so testing is not wasted on it)

Also worth flagging as a process fact: the head commit has zero CI checks. The workflow that runs exactly the cited eos tests exists; it simply did not run. That gap should be closed before anyone considers hardware.

Minor / ignore for the referral decision: doc-comment wording (unix.rs:212-214 points at "non-Linux targets" when the stub it means is in windows.rs), a third redundant #[cfg] stub at unix.rs:247-248, flare_eos:: used directly instead of the crate::os:: shim, the unreachable-by-design three-tier fallback, an 8 KiB stack array in the C helper, and the +2.6% cold-prefill endpoint left unattributed.


3. Why the available hardware cannot settle this (verified)

Host Capability Verdict for this PR
cn7 1 × GB10 (SM121), arm64, 10 CPUs for the job The only asymmetric SoC — but a single node. The RoCE ring needs 2–16 ranks across multiple hosts over ConnectX-7 (docs/roce-ring.md:3,19,404; helios/src/execution/roce.rs:151). The C helper, the flare-roce thread, RoceOneshotLaunch and the 61× wake-gap claim are untestable. Also: a 10-CPU job allocation may already be a single tier, which would make the policy no-op for the wrong reason — a false negative.
cn5 4 × RTX PRO 6000 (SM120), x86_64, 4 GPUs one host The feature is a guaranteed no-op here (no cpu_capacity sysfs). Useful only for the "no regression" claim. It does exercise the same-process TP path (threaded.rs:652) and the flare-model/flare-offload threads, so it is the right box for finding B — but only after the fix.
Both Models: dinov2-base, GLM-5.3-Flash-NVFP4, Qwen3.8-27B-NVFP4/DFlash2, … Neither carries "Inkling 2 Small NVFP4", the recipe behind every number in the PR. No main-vs-head A/B of the claimed figures is possible without new export work.

One genuinely cheap, high-signal observation is available on existing hardware: the PR adds thread names (flare-roce, plus existing flare-model/flare-execution/flare-offload-N/flare-rank-N), so placement is directly readable with ps -L -o comm,psr or taskset -cp. That check is worth 15 minutes — but only against fixed code, and only as a smoke check, not as evidence.


4. What the author must fix before referral

Ordered; items 1–4 are the gate.

  1. Declare or remove the vendored-file divergence. Either pin the upstream revision so the FlashInfer source contains the helper, or update roce_proxy.c:6-8, NOTICE:16-19 and docs/roce-ring.md:355-364 to name the local addition and its removal condition. NOTICE's "unchanged" sentence must change either way.
  2. Delete the C copy and pin from Rust. roce_start's only caller is RoceTransport::connect (helios/src/execution/roce.rs:295) and a new pthread inherits the creator's mask, so one call before roce_start removes ~66 lines and the entire lockstep problem. Keep pthread_setname_np if nsys attribution needs it, marked as a declared exception.
  3. Fix the mask leak (finding B). Either narrow only the execution/replay threads and pin flare-model after the store and image worker are constructed, or restore the original mask on threads that spawn long-lived I/O workers. And measure it — the author's 2-hour soak would not have caught an offload thread landing on a P-core. Update docs/prefix-cache-offload.md:863-867 so code and docs agree.
  4. Make the policy configurable or not-a-default. Give it one of the three sanctioned homes (a typed config field or a flare run/Helios CLI flag taking an explicit CPU set), which also removes the magic 90% and the midpoint fallback. If it stays a heuristic, name the constant and justify the threshold on named hardware.
  5. Stop suppressing errors — return a status/Result (or one startup diagnostic line naming the applied set) so placement is observable, and do not use let _ =.
  6. Test the code that touches the system — factor the sysfs root into a parameter, assert the applied mask with sched_getaffinity, and cover a negative case; add a host-side test for the C helper or state plainly that it is unverified by any automated check.
  7. Move or justify the worker.rs/replay.rs call sites and state the rule ("which threads are critical") rather than a file list; make the flare-rank-{n} coverage explicit.
  8. Report a paired main-vs-head flare run comparison on the same exported core, with launch counts, dispersion, and the recipe/core identity.
  9. Get CI to actually run on the head.

5. Proposed test plan — conditional, for re-review, not for now

Do not run this yet. It is provided so that when the author returns with items 1–6 addressed, testing can start immediately without re-derivation. Estimated cost if the code is fixed and a second GB10 host is made available: ~1.5 days. Without a second GB10 host: ~0.5 day on cn7 + ~2 hours on cn5, and the RoCE half stays unverified (say so in the report; do not pretend otherwise).

Stage 0 — gate (no hardware, ~30 min)

CI green on head (native-serving.yml (not opened)), including cargo test eos. Unit tests for prefer_high_capacity_cpus (mask applied + no-op) and a C helper test present. Docs consistent (NOTICE, roce_proxy.c header, roce-ring.md, prefix-cache-offload.md). Stop here if any fails.

Stage 1 — placement smoke, cn7, ~1 hour (highest value per minute)

  1. Confirm the topology the job actually sees: cat /sys/devices/system/cpu/cpu*/cpu_capacity and taskset -cp $$. If the job cpuset is already a single tier, the test is void — report and stop.
  2. Run a short native serving session on a model present on the host.
  3. ps -L -o comm,psr (or taskset -cp) and record the CPU set for flare-model, flare-execution, and any flare-rank-N.
  4. Assert: each critical thread is confined to the high-capacity tier, and the set is a subset of the original mask.
  5. Run 5 launches, not 1, and record placement per launch — the claim is about variance, so a single launch cannot confirm or refute it.
  6. Observe the leak from finding B: with an offload/vision-enabled configuration, record the CPU set of flare-offload-N and the image-preparation thread. Expected today: they are on the high-capacity tier, contradicting docs/prefix-cache-offload.md:863-867. Expected after the fix: they are not. This is the single most valuable check the PR needs.

Stage 2 — no-op / regression, cn5, ~2 hours

  1. x86_64: confirm a startup session succeeds unchanged and that thread masks equal the inherited process mask (the documented no-op). One session, not a matrix.
  2. Reuse the existing 4-GPU single-host TP path to confirm the same-process flare-rank-N threads and the offload threads still start and serve correctly; run one short standard benchmark against main to catch a regression. Do not run a throughput sweep — x86 is not the target.

Stage 3 — the actual claim (needs 2× GB10 with ConnectX-7; not available today)

  1. Paired A/B: main vs this head, same exported core, flare run --roce-ring, ≥5 launches per arm; report per-launch and dispersion.
  2. Metrics: launch-to-launch CV, RoceOneshotLaunch sum, p90 inter-graph wake gap, decode tok/s.
  3. Separately label a placement A/B (X925 vs A725 of the same binary, forced externally via taskset) — this confirms the mechanism, not the patch. Keep the two A/Bs distinct in the report; conflating them is exactly the flaw in the current evidence (finding E).
  4. One offload-enabled session with an offload/prefix-cache workload, measuring input-upload/completion-download latency and per-token latency against main — this is the measurement docs/prefix-cache-offload.md:866-867 requires before affinity on transfer threads can be justified, and it is the check for the finding-B regression on real serving.
  5. Skip: soak beyond ~1 hour (the author's 2-hour soak is adequate and reruns add little), and any re-run of unit tests already covered by CI.

Explicitly not worth testing, ever, in this PR


6. Bottom line

The problem is real and squarely inside the charter's target hardware (DGX Spark/GB10), the idea is sound, and the author's measurement work is better than the bar this project usually gets. But as submitted the change (a) edits a file three documents promise is unchanged, (b) silently narrows the mask of offload, disk and image-preparation threads against an explicit documented policy, (c) installs an unconfigurable magic-numbered default in shared code, and (d) rests on evidence that never compares against main. Items (a)–(c) will change the code; item (b) is a real regression risk that needs a before/after measurement on hardware we can actually use.

Refer to testing only after the author returns with items 1–6 of §4 addressed. At that point Stage 1 (cn7) and Stage 2 (cn5) are cheap, well-targeted, and Stage 1.6 alone would justify the trip by either confirming or refuting the mask leak. Stage 3 needs a second GB10 host that we do not currently have; flag that dependency at referral time rather than discovering it mid-test.

Full report · Notes

code review summary

Recommendation: Changes Requested

The affinity mechanism is sound and well-evidenced for its target, but it ships as a silent default-on policy with a magic constant, duplicates itself into a vendored file that must stay byte-identical upstream, and is backed by measurements that never compare head to main.

Blockers. (B1) A default-on, unconfigurable host-scheduling policy with magic 90%/midpoint constants in the shared eos crate, reached from four thread entries plus the RoCE proxy; no flag, config field, env var, return value or opt-out (eos/src/unix.rs:190-216), violating the charter's "No magic defaults" and AGENTS.md:453-457. No arch guard exists anywhere, so the "x86_64 is a no-op" promise rests only on the kernel not exposing cpu_capacity. (B2) The vendored proxy is no longer identical to its pin — 71 unmarked Flare-local lines at roce_proxy.c:1505-1577 — contradicting roce_proxy.c:6-8, NOTICE:18-19 and docs/roce-ring.md:360-364, while the same policy is reimplemented element-for-element in C; four lenses converged here. Preferred fix is subtractive: delete the C copy, keep the two-line setname, and pin from RoceTransport::connect before roce_start (with the caveat that connect runs on the process main thread, so a short-lived opener thread is the safer variant).

Should fix. No main-vs-head baseline, no reproduction command, undefined A/B arms, mixed placement denominators (S1); silent failure paths with let _ = / (void) on sched_setaffinity, making the placement claim unfalsifiable (S2); the sysfs/syscall half has no test at any layer and neither does the C helper (S3); public serve_rank now narrows the calling thread before validation, undocumented, and the Python caller reuses that thread (S4).

Subtractive. ≈107 of +226 lines (≈47%) removable: the three-tier midpoint fallback plus its test (the :205 guard already no-ops a sub-2 selection, and removing it makes the min/max loop and min==max guard redundant), and the two non-serving call sites (flare-cuda, flare-execution). eos/src/windows.rs:219-220 must be kept. Correction no lens had: the "missing threaded.rs site" objection is void — production ThreadedExecutors are built inside already-narrowed parents, so deleting those two calls costs no coverage.

Nits. Shim bypass/redundant cfg arm/pub selector/eos placement; doc-vs-code mismatches including one test passing for the wrong reason; description prose (misattributed +2.6% prefill endpoint, "order of magnitude" vs the reported 61×); 8 KiB C stack arrays and one sysfs open per CPU on the startup path.

All 13 survivors are live at head: the PR has zero reviews, zero inline comments and zero CI checks — only an autobot case-file notice.

Full report · Notes

Final review

Recommendation: Changes Requested

The core change is well-targeted at DGX Spark (GB10, explicitly in the Charter's vision), preserves operator cpusets without adding flags or environment variables, and demonstrates real placement-variance improvements. However, two concrete defects block merge: the PR silently diverges the vendored helios/native/roce_proxy.c from its pinned FlashInfer source (making NOTICE factually false while duplicating 66 lines of untested C), and calling prefer_high_capacity_cpus() at the top of flare-model leaks the P-core-only mask onto prefix-cache offload, disk, and image-preparation background threads.

Blockers

  1. Vendored helios/native/roce_proxy.c diverges from its pinned FlashInfer source, falsifies NOTICE, and duplicates 66 lines of untested C.

    • Evidence: helios/native/roce_proxy.c:6-8 ("Keep the source below identical so preparation and serving share the transport ABI"), docs/roce-ring.md:360-364 ("keep the vendored source identical to the dependency after its provenance header"), and NOTICE:16-19 ("Its implementation is unchanged from that revision; Flare adds a license and provenance preamble") all require the vendored proxy body to remain unchanged relative to the pinned FlashInfer commit.
    • This PR adds 71 lines of Flare-local C (helios/native/roce_proxy.c:1505-1577: pin_high_capacity_cpus() plus pthread_setname_np and the call in proxy_main) without updating NOTICE or docs/roce-ring.md, duplicates the Rust capacity-selection logic from eos/src/unix.rs:172-245 with zero tests (compiled only under --features roce, enabled on Linux aarch64 in flare-cli/Cargo.toml:43-44), and introduces lockstep coupling with an unmerged FlashInfer PR (#156).
    • Fix: Remove all changes to helios/native/roce_proxy.c. Because roce_start creates the proxy thread via pthread_create(&c->thread, NULL, proxy_main, c) (helios/native/roce_proxy.c:1674) with no thread-local setup (roce_proxy.c:1661-1681), a new pthread inherits its creator's CPU affinity mask on Linux. Pin the proxy from Rust around the sole roce_start call in RoceTransport::connect (helios/src/execution/roce.rs:295) — either by saving/restoring the calling thread's cpu_set_t around prefer_high_capacity_cpus() + roce_start, or by invoking roce_start on a short-lived starter thread that narrows its own affinity first. Do not simply call prefer_high_capacity_cpus() directly on connect's caller thread, as connect() runs on the process main thread (flare-cli/src/main.rs:549,613, flare-cli/src/cluster.rs:203,250) before HTTP/dashboard/offload threads are spawned. Leave "flare-roce" thread naming for an upstream FlashInfer change and normal re-vendor.
  2. Affinity mask inheritance leaks from flare-model onto offload transfer, disk, and image-preparation threads, contradicting docs/prefix-cache-offload.md.

    • Evidence: helios/src/server/runtime.rs:568 calls prefer_high_capacity_cpus() at the start of the "flare-model" thread. Later inside that same thread closure:
      • helios/src/server/runtime.rs:698 calls crate::offload::open(prepared, gpu_cubins) → helios/src/offload/mod.rs:109 → flare_selene::offload::open (selene/src/offload.rs:645,653,663,676), which spawns the "flare-offload-{rank}" transfer threads (helios/src/offload/transfer.rs:509-536) and the "flare-offload-disk" checksum/direct-I/O thread (selene/src/disk.rs:358-370);
      • helios/src/server/runtime.rs:720-721 calls ImagePreparation::new(worker_input_store) (helios/src/server/runtime.rs:1011), which spawns the image decoding/resizing worker thread.
    • Because Linux pthread_create inherits the parent thread's CPU affinity mask, all of these background CPU/I/O threads are silently confined to the same high-capacity P-cores reserved for flare-model and flare-roce, preventing the scheduler from running checksums, offload transfers, and image preparation on the efficiency cores.
    • This directly contradicts docs/prefix-cache-offload.md:863-867, which keeps offload transfer and disk threads on SCHED_BATCH + positive nice across the full allowed cpuset to reduce contention with the model worker and states: "Adding CPU affinity requires a serving-latency measurement that shows a benefit."
    • Fix: Move the prefer_high_capacity_cpus() call in helios/src/server/runtime.rs to after crate::offload::open and ImagePreparation::new (immediately before worker.run(&mut executor) at line 726), and add an explicit crate::os::prefer_high_capacity_cpus() call inside the same-process TP peer threads (helios/src/execution/threaded.rs:655, "flare-rank-N"), which currently rely on implicit inheritance from flare-model via RankExecutor::new (runtime.rs:585 → helios/src/execution/ranks.rs:34-36). This keeps background offload/disk/image threads on the full process cpuset (preserving docs/prefix-cache-offload.md:863-867) while explicitly pinning every critical execution thread.

Should Fix

  1. Benchmark evidence omits baseline identification, reproduction commands, and the complete cold-prefill ladder (AGENTS.md:103-112).
    • The GB10 measurements are substantive and the +17.2% C8 64k decode result is appropriately labeled as a controlled same-server placement A/B. However, per AGENTS.md:103-112 ("Reproduction commands must identify the required inputs and configuration directly or through a precise reference") and the Charter ("benchmarks showing an actual speedup over main on a served workload"):
      • State the exact baseline commit/binary for the 4 unpinned launches (confirming main vs PR on the same exported core) and how the same-server C8 A/B arm switched placement (e.g., taskset -cp);
      • Include the concrete reproduction commands (Orbit launch flags, decode/prefill benchmark invocations, and the nsys --cuda-graph-trace=node command);
      • List the remaining 32k/64k/128k points of the 8k–128k cold-prefill ladder (the description quotes +2.6% to +17.3% but only shows 8k +17.3% and 16k +9.2%, leaving where +2.6% occurred unstated).

Subtract / Simplify

  1. Delete pin_high_capacity_cpus() (helios/native/roce_proxy.c:1505-1570, −66 C lines) and pin the proxy from Rust around roce_start (helios/src/execution/roce.rs:295).
    • Eliminates the untested duplicate C implementation and removes the cross-repo coupling to FlashInfer PR #156 (resolving Blocker #1).

Nits

  1. Route Helios calls through crate::os:: and keep select_high_capacity_cpus private (helios/src/os.rs:8, eos/src/unix.rs:172).
    • All existing Helios OS calls use crate::os::* (helios/src/offload/transfer.rs:282, helios/src/runtime_core/protection.rs:356 (not opened), etc.) rather than flare_eos::* directly; switching the new Helios call sites to crate::os::prefer_high_capacity_cpus() keeps them consistent.
    • Change pub fn select_high_capacity_cpus (eos/src/unix.rs:172) to fn select_high_capacity_cpus. Because eos/src/lib.rs:12 re-exports pub use unix::*; only on Unix and eos/src/windows.rs defines no matching function, making this internal helper private keeps flare_eos's public API symmetric across platforms while keeping its unit tests intact.
  2. Defer prefer_high_capacity_cpus() past manifest validation in serve_rank (helios/src/execution/parallel.rs:539-550).
    • serve_rank is a pub unsafe fn that currently narrows the caller thread's affinity at line 539 before rejecting invalid manifests at lines 540–550 (including in unit tests such as helios/src/execution/parallel/tests.rs:698 (not opened)). Moving the call below validation (and adding one line to the doc comment noting the thread-affinity adjustment) avoids mutating caller affinity on rejected inputs.

Verified passes

Dropped on verification

Full report 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.

screen malicious

Screen Result: All Clear

Evidence: PR #576 (head 4b41ddc, +226/−1, 7 files) contains no prompt injection or agent-targeting content.

The diff is what the description claims, and nothing more: select_high_capacity_cpus / prefer_high_capacity_cpus in eos/src/unix.rs (216, tests ~254–314), a no-op stub at eos/src/windows.rs:220, the mirrored C helper pin_high_capacity_cpus at helios/native/roce_proxy.c:1510 called from proxy_main at 1575–1576 alongside pthread_setname_np(..., "flare-roce"), and four one-line call sites (helios/src/execution/parallel.rs:539, execution/worker.rs:71, replay.rs:174, server/runtime.rs:568). All new I/O is sysfs reads; there is no exec, network, credential, CI, hook, or agent-config change, and no hidden files.

Sweeps of the new code for ignore previous, disregard, you are an, system prompt, assistant:, curl, wget, base64 -d returned no matches; broader URL/exec sweeps hit only the SPDX header and an unrelated pre-existing comment. Added comments are ordinary prose about cpu_capacity, GB10 core tiers and WFET.

Discussion is benign: two flare-autobot automation posts and one CHANGES_REQUESTED review from maintainer original-el8 covering affinity inheritance by child threads, keeping roce_proxy.c identical to pinned FlashInfer source (FlashInfer PR #156), and commit/sign-off hygiene. None directs an agent anywhere.

One benign observation, not injection and not author-authored: the repo's flare-autobot comments link off-repo autobot.eidonix.com pages and say "Have your agent review the Full Review." I treated that as material, did not follow it, and did not fetch those pages. The description's only substantive off-repo link is the paired local-inference-lab/flashinfer/pull/156, stated to have no wire/ABI dependency.

Repo context: docs/design-review.md defines an agent Design-Signed-Off-By convention that would make a plausible coercion target, but no such coercion or fabricated trailer appears here.

Full report · Notes decide malicious: all_clear (100%): No malicious content found

explore

Author: fordbmorris (GitHub association NONE — not a member; first-time contributor with no merged commits; Discord woooflet per the PR body) Motivation: On GB10 the CPU has two tiers of cores and Linux may put Helios's two busy-spinning serving threads (CUDA execution and the native RoCE proxy) on the slow ones, which the author says hurts one-shot collective latency and adds jitter. The PR makes each of those threads, at startup, read the kernel's per-CPU capacity and silently move itself onto the fast cores only. Scale: +226 / −1 lines in 7 files Proposal:

Full report · Notes decide malicious: all_clear (100%): No malicious content found

explore

Author: fordbmorris (GitHub association NONE — not a member; first-time contributor with no merged commits; Discord woooflet per the PR body) Motivation: On NVIDIA GB10 (DGX Spark) the ten fast Cortex-X925 cores and ten slow Cortex-A725 cores are mixed, and Linux sometimes schedules Helios's busy-spinning worker and RoCE proxy threads onto the slow ones, which the author says adds startup and per-graph jitter. The PR makes those threads read each CPU's kernel-reported capacity at startup and quietly confine themselves to the fast cores. Scale: +226 / −1 lines in 7 files Proposal:


Amendment (event of 2026-11-29): the PR is unchanged, but main advanced under it. Merged #589 (ba3afb13, lukealonso, 2026-11-28 22:18) adds helios/native/roce_proxy_dlopen.c, a Flare-owned unit that #include "roce_proxy.c" at :236 and states "keeping the vendored roce_proxy.c byte-for-byte identical to FlashInfer" at :9; helios/build.rs:67-77 now compiles only that wrapper (:72, links dl/pthread :75-76). This adds a fourth, maintainer-authored witness to the invariant #576 breaks, and it is exactly the top-level seam that original-el8's blocker-2 remedy prescribes — so #576's in-vendor C helper now edits the one file meant to stay untouched. #589 also rewrote eos/src/unix.rs (new test at :207-248), so #576 needs a rebase with a possible mechanical conflict in the same mod tests block. Nothing on main competes: prefer_high_capacity_cpus does not exist there and no affinity code landed.

Full report · Notes

Classify intake

Selected: triage:review, performance

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

Applied: +triage:review, +performance

Value Proposition

Value Proposition — PR #576: Pin Helios execution and RoCE proxy threads to high-capacity CPUs

Charter alignment. The vision names SM120/SM121 workstations and DGX Spark explicitly, and the charter assigns scheduling to Helios ("Ignition writes recipes… Helios handles scheduling, caches, and requests"). A GB10 thread-placement change in eos/helios is the right layer for the right hardware — no per-model branch, no broad hardware expansion. Two real conflicts: (a) the 71-line helper inside helios/native/roce_proxy.c:1505-1570 breaks the byte-identity contract witnessed four times in-tree — roce_proxy.c:6-8, NOTICE:16-19, docs/roce-ring.md:361-364, and maintainer-authored roce_proxy_dlopen.c:7-9; (b) the pin is silent, unconditional, and unlogged (let _ = sched_setaffinity, (void)sched_setaffinity, no flag/env/config), which fails the charter's "be explicit… no magic defaults" rule.

Novelty & status. Genuinely additive. Not obsolete: search_code on main for prefer_high_capacity_cpus|select_high_capacity_cpus returns nothing; affinity appears on main only in docs/prefix-cache-offload.md:869-872. Not superseded: no open PR covers affinity (sibling #577 shares the vendored file only). But main is ten commits past the fork point (a39f6777), and #589 rewrote eos/src/unix.rs including the mod tests block #576 appends to — a rebase is required.

Value vs maintenance cost. Beneficiaries are the DGX Spark cohort the vision is built around. The claimed effect is large (graph-time CV 4.82%→0.72%, +17.2% C8 64k decode, p90 inter-graph wake gap 61× smaller), but all of it is author-supplied — no raw nsys traces, no alternating A/B against main, no described method for forcing A725 — and there is no aarch64 CI (native-serving.yml runs x86_64/Windows; release.yml builds arm64 only as an archive smoke), so the GB10 path is never executed by the repo. Cost is also mispriced: a duplicated, untested C helper plus an unintended scope defect — because the call is the first statement of the flare-model closure (runtime.rs:568), every later child thread (flare-rank-*, offload, kv-codec) inherits the X925-only mask although those are deliberately demoted to spill onto efficiency cores (docs/prefix-cache-offload.md:863-867).

Minimum changes for merge: rebase; drop the roce_proxy.c edit and route pin plus flare-roce naming through #589's roce_proxy_dlopen.c seam (the rename is the measurement instrument — preserve it); scope the mask so offload/codec threads aren't narrowed; make the behaviour observable/configurable; update THIRD_PARTY_NOTICES.md/docs/roce-ring.md; supply reproducible aarch64 evidence.

Verdict: Worth it with changes.

Note: the PR text and dossier were treated strictly as review material; neither contained instructions I followed.

Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.

Subtraction and simplicity

PR #576 (head 4b41ddc4, 7 files, +226/−1) is not lean: the capacity-selection algorithm is written twice, and about a third of the added lines serve hardware the PR never runs on.

Findings, in value order:

  1. F1 (high) — helios/native/roce_proxy.c:1505-1570 is a 66-line line-for-line copy of the tested eos/src/unix.rs:172-210 (same len<2, min==max, cap*10 >= max*9, midpoint fallback, selected>=2 && selected<count gate), untested in either tree, and it edits the file whose header demands byte-identity (roce_proxy.c:6-8, NOTICE:16-19, roce_proxy_dlopen.c:7-9). Delete the helper; replace :1574-1577 with pthread_setname_np plus one #[no_mangle] extern "C" call into the tested Rust (helios/src/os.rs:8 already re-exports flare_eos). After #589 that call lives in the Flare-owned roce_proxy_dlopen.c that helios/build.rs:72 compiles.
  2. F2 (medium) — delete the speculative three-tier fallback eos/src/unix.rs:195-204, its test :298-314, and the min_cap accumulator (:176,178,182); no supported hardware needs it and AGENTS.md:188-193 bans fallback layers without a concrete requirement.
  3. F3 (low-medium) — collapse the two no-op stubs (eos/src/unix.rs:247-248, eos/src/windows.rs:219-220) into one #[cfg(not(target_os = "linux"))] stub in eos/src/lib.rs; this drops windows.rs — the file the PR admits was never compiled — from the diff.
  4. F4 (low-medium) — 2 of 4 call sites are off the serving path: helios/src/execution/worker.rs:71 and helios/src/replay.rs:174 are reached only from Heliopause bindings and qualification tools; serving enters at helios/src/server/runtime.rs:568 and helios/src/execution/parallel.rs:539. Delete them or state capture placement is intended.
  5. F5 (low) — select_high_capacity_cpus is pub and escapes via eos/src/lib.rs:12 with one internal consumer; make it private.
  6. Convention — docs/prefix-cache-offload.md:863-867 already says "Adding CPU affinity requires a serving-latency measurement that shows a benefit", and AGENTS.md:57-60 sends pending measurements to docs/TODO.txt; neither was updated, and the doc paragraph names the very SCHED_BATCH threads whose spill room this change removes via inheritance from runtime.rs:568.

Order: F1+F3 collapse ~70 added lines, F2 ~24 more, F4/F5 one line each.

Open: does the author rebase onto #589 and use roce_proxy_dlopen.c? Is preparation/capture pinning intended? Does the test module collide with #589's map_host test on rebase (unverified)?

Full report · Notes

Correctness and contracts

Lens review of PR #576 (head 4b41ddc, 7 files, +226/−1) against all changed files, their direct callers, the vendor-contract docs, the in-tree offload policy doc and CI. Eight findings: one Blocker, four Major, three Minor.

Blocker — the 71-line in-vendor C helper falsifies four in-tree witnesses of the "keep the vendored source identical" invariant (roce_proxy.c:6-8, NOTICE:18-19, THIRD_PARTY_NOTICES.md:48-52, docs/roce-ring.md:361-364), and #589 on main already supplies the Flare-owned seam (roce_proxy_dlopen.c, build.rs:72) that makes the C edit unnecessary.

Major — runtime.rs:568 runs before every later spawn in the flare-model closure, so ranks, offload, disk, image-prep and the rayon KV-codec pool all inherit the X925-only mask despite being deliberately demoted with SCHED_BATCH/nice precisely so they can spill onto efficiency cores — contradicting docs/prefix-cache-offload.md:863-867, which requires a serving-latency measurement for exactly this. The codec pool halves on the unmeasured encode path. parallel.rs:539 mutates the caller's own mask inside an unsafe fn that documents no such side effect, with no restore. flare-rank-* threads are pinned only by inheritance, so the reviewer's suggested Rust-side move would silently unpin them.

Minor — the ≥2-CPU floor ignores how many threads are confined; affinity failures and the 0.9 threshold are silent and unobservable; neither new affinity function ever executes in CI (x86_64 + Windows only), and the Rust and C twins already differ.

Claims verified: the x86_64 no-op. The "48/48 threads pinned" evidence is measured through a thread rename added by this same PR. Open: rebase conflict with #589's test in eos/src/unix.rs; whether the author will re-vendor or move the pin into the dlopen seam.

Full report · Notes

Final review

Recommendation: Changes Requested

Pinning latency-critical execution and RoCE proxy threads to high-capacity CPUs on asymmetric ARM64 Linux hosts (DGX Spark GB10) directly addresses a real scheduling jitter problem, and the core tier-selection helper in eos/src/unix.rs cleanly respects existing operator cpusets and no-ops on homogeneous or x86_64 systems. However, two concrete blockers remain (consistent with @original-el8's review, plus critical system-level interactions verified against main): (1) editing vendored helios/native/roce_proxy.c breaks its byte-identity contract with FlashInfer and duplicates 66 untested C lines when main (#589) already provides the Flare-owned roce_proxy_dlopen.c wrapper; and (2) pinning at entry to flare-model (helios/src/server/runtime.rs:568) leaks the narrowed X925-only mask to background offload, disk, image-prep, and KV-codec threads — halving the flare-kv-codec-* rayon pool on GB10 — while moving that call alone would silently unpin same-process threaded TP ranks (flare-rank-*).

Merge Risk

Level: High

Walkthrough

Pre-merge Checks

Blockers

  1. Vendored helios/native/roce_proxy.c divergence and duplicated untested C logic (helios/native/roce_proxy.c:1505-1577)

    • Verified behavior & impact: Adding pin_high_capacity_cpus() and calls inside proxy_main modifies a vendored FlashInfer file whose own header (helios/native/roce_proxy.c:6-8), NOTICE:16-19, and docs/roce-ring.md:360-364 explicitly require keeping identical to FlashInfer's pinned source. Since this PR branched, #589 (ba3afb13) merged on main adding the Flare-owned helios/native/roce_proxy_dlopen.c:7-9,216-236 (which #include "roce_proxy.c" and explicitly states "keeping the vendored roce_proxy.c byte-for-byte identical to FlashInfer") and updated helios/build.rs:69-74 to compile only roce_proxy_dlopen.c. The 66-line C function also duplicates eos/src/unix.rs:172-245 with no test coverage.
    • Concrete fix (choose one, after rebasing onto main):
      • Preferred (zero vendored diff, zero duplicated C): Revert all edits to helios/native/roce_proxy.c. Apply affinity from Rust around roce_start(self.context) in helios/src/execution/roce.rs:295 using a scoped save-and-restore affinity guard (save sched_getaffinity, call prefer_high_capacity_cpus(), call roce_start, then immediately restore the caller's mask). Important: Do not omit the restore — RoceTransport::connect (roce.rs:295) runs on flare-cli's main thread (flare-cli/src/cluster.rs:203,250) before Bootstrap::load (flare-cli/src/main.rs:623), Server::start (:631), and peer join_peer (cluster.rs:254), so an unscoped pin there would narrow the entire process (shrinking Frontend's EncodeThreadBudget at helios/src/frontend/mod.rs:334,1121 and confining Tokio/HTTP and peer offload threads to X925). To preserve the "flare-roce" thread name (which the placement check relies on), wrap the single pthread_create call (roce_proxy.c:1674) in helios/native/roce_proxy_dlopen.c via #define pthread_create ... (matching its existing ibv_* wrapper pattern at :216-232) and call pthread_setname_np(*thread, "flare-roce") on success.
      • Alternative: Land FlashInfer PR #156 first, re-vendor roce_proxy.c verbatim from the updated pinned commit, and update NOTICE:17 to the new commit SHA.
  2. Child-thread affinity inheritance in flare-model confines demoted background threads, halves the KV-codec pool, and hides a threaded-TP coverage trap (helios/src/server/runtime.rs:568, selene/src/shared/codec.rs:41, helios/src/execution/threaded.rs:652-655)

    • Verified behavior & impact: Because flare_eos::prefer_high_capacity_cpus() is the first statement of the flare-model closure (runtime.rs:568), Linux affinity inheritance propagates the X925-only mask to every child thread spawned during startup:
      • crate::offload::open (runtime.rs:698) → flare-offload-{rank} (helios/src/offload/transfer.rs:509-535, demoted via SCHED_BATCH + NICE at :531) and flare-offload-disk (selene/src/offload.rs:676 → selene/src/disk.rs:358-360,470,489-491, also demoted via SCHED_BATCH + NICE).
      • ImagePreparation::new (runtime.rs:721 → runtime.rs:1011).
      • Downstream KV-codec regression: When flare-offload-{rank} lazily initializes selene/src/shared/codec.rs:37-60 (helios/src/offload/transfer/codec.rs:353,514,751), std::thread::available_parallelism() (selene/src/shared/codec.rs:41) honors the inherited sched_getaffinity mask. On GB10 (10 X925 + 10 A725), flare-kv-codec-* silently shrinks from 20 / 2 = 10 threads to 10 / 2 = 5 threads, and all 5 nice(10) codec workers (:52) are pinned onto X925 alongside the model worker and RoCE proxy — directly contradicting docs/prefix-cache-offload.md:863-867 ("Adding CPU affinity requires a serving-latency measurement that shows a benefit").
      • Subtle interaction with moving :568: flare-rank-{1..N} in same-process threaded TP (helios/src/execution/threaded.rs:652-655) has no direct pin call and is currently pinned only by inheriting flare-model's mask via RankExecutor::new (runtime.rs:585). Moving runtime.rs:568 down to before worker.run alone will silently unpin all threaded-TP peer ranks.
    • Concrete fix:
      1. Move flare_eos::prefer_high_capacity_cpus(); in helios/src/server/runtime.rs from :568 to right before worker.run(&mut executor) (:726), after RankExecutor::new, crate::offload::open, and ImagePreparation::new have spawned their background threads.
      2. Add an explicit flare_eos::prefer_high_capacity_cpus(); at entry to the flare-rank-* thread closure in helios/src/execution/threaded.rs:654 so same-process threaded TP ranks remain explicitly pinned without relying on parent inheritance.

Should Fix

  1. Rebase onto main (resolving #589 drift in eos/src/unix.rs and helios/build.rs)

    • main (50c876df) has 11 commits above this PR's base, including #589 (ba3afb13) which added map_host_advises_hugepages_and_prefaults_zeroed_pages to eos/src/unix.rs:207-248 and introduced helios/native/roce_proxy_dlopen.c + helios/build.rs:67-77. Rebasing is required before merge and unlocks the Flare-owned wrapper for Blocker 1.
  2. serve_rank mutates the caller's thread affinity permanently and before validation (helios/src/execution/parallel.rs:539)

    • Verified behavior & impact: Unlike the other call sites (which run on dedicated newly spawned threads), serve_rank runs on the caller's thread (flare-cli/src/main.rs:560, which exits after return, and heliopause/src/python.rs:548, which runs on the Python interpreter thread inside py.detach). Calling prefer_high_capacity_cpus() at :539 narrows the caller's affinity even if early validation rejects the manifest (:540-550), never restores it on return, and is undocumented in # Safety (:529-532). (Note: do not delete pinning from serve_rank, as it IS the peer execution loop for multi-host TP ranks 1..N.)
    • Concrete fix: Move the affinity narrowing after manifest validation (parallel.rs:550) and use the same scoped save-and-restore RAII affinity guard recommended for roce_start in Blocker 1 so any caller (especially embedded Python via heliopause) gets its original affinity mask restored on return.

Subtract / Simplify

  1. Delete the 66-line C duplicate in helios/native/roce_proxy.c:1505-1570 (covered in Blocker 1) — eliminates the entire duplicated, untested C implementation in favor of the single unit-tested Rust helper in eos/src/unix.rs.
  2. Delete the speculative three-tier fallback and its test (eos/src/unix.rs:195-204, :298-314) — 27 lines that only trigger on three-tier SoCs (1 prime + mid + little cores), which are not a supported Flare target (AGENTS.md:188-193: no speculative compatibility/fallback layers). The existing selected.len() >= 2 && selected.len() < allowed_with_capacity.len() check at :205 already guarantees the selector never collapses onto a single core.
  3. Make select_high_capacity_cpus private (eos/src/unix.rs:172) — eos/src/lib.rs:12 uses pub use unix::*;, leaking select_high_capacity_cpus into flare-eos's public crate API on Unix only (asymmetric with Windows) despite having no external callers. Change to #[cfg(any(target_os = "linux", test))] fn select_high_capacity_cpus(...) (gating avoids a dead_code warning on non-Linux Unix targets like macOS).

Nits

None. (Note: @original-el8's existing review item 3 regarding commit-message text and Design-Signed-Off-By hygiene remains to be addressed on rebase/amend.)

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes 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. decide malicious: all_clear (100%): No malicious content found

explore

Author: fordbmorris (GitHub association NONE — not a member; first-time contributor with no merged commits; Discord woooflet per the PR body) Motivation: On GB10 (DGX Spark) the CPU has 10 fast Cortex-X925 and 10 slow Cortex-A725 cores, and Linux sometimes schedules Helios' CUDA-driving threads and the busy-polling RoCE proxy onto the slow ones, which varies launch-to-launch timing and slows collectives. The PR pins those threads to the fast tier so timing becomes stable and throughput rises. Scale: +230 / −1 lines in 8 files (head ba2796c0, rebased on 3801ff1d) Proposal:

Full report · Notes

Value Proposition

Value Proposition — PR #576 (pin Helios/RoCE threads to high-capacity CPUs)

Charter alignment: direction yes, evidence no. DGX Spark (GB10) is a named charter target ("squeeze the most out of workstation and compact hardware… keeping generation snappy"), and the mechanism is a single general affinity helper in the runtime, not a per-model branch — that part fits (#267/#334). Two things do not. (a) The charter's evidence rule (#210) demands a speedup over main on a served workload; the +17.2% decode and 6.7× CV figures are author-supplied, single-sourced, measured on binary 4c82ab5b rather than head ba2796c0, with no raw nsys traces and no alternating A/B against main. (b) Wrong layer: the pin/rename is patched into helios/native/roce_proxy.c, the file roce_proxy.c:8 and NOTICE:16-19 declare must stay identical to the pinned FlashInfer revision — while merged #589 already provides the roce_proxy_dlopen.c wrapper (:7-9) that original-el8 named as the seam. A3 confirms none of the four in-tree witnesses, nor docs/TODO.txt:80-86, were amended, and zero docs changed. It also contradicts docs/prefix-cache-offload.md:919-928, which requires a serving-latency measurement before adding affinity to offload threads.

Novelty & status: additive, no competition. A5: no prefer_high_capacity_cpus on main; nothing obsolete, no canonical PR covers it. But #625 rewrites the same eos/src/unix.rs region and #628 touches the offload codec sites — rebase cost is certain.

Value vs cost. Beneficiary pool is real (DGX Spark operators) but the win has never executed in CI (A6: x86_64/Windows only; the aarch64 leg runs --version) and no-ops silently on x86_64. Cost is high: silent unlogged affinity (eos/src/unix.rs:260), five pin sites, vendored-file parity debt shared with #577, and an open correctness regression — A1's lazily built selene::shared::codec::cpu_pool() OnceLock is sized on the already-narrowed thread, yielding 5 workers inheriting 5-9,15-19 instead of 10, exactly on --prefix-cache-memory, the path the PR did not test.

Verdict: Worth it with changes. Direction is charter-aligned and no one else is doing it, but it cannot merge as-is. Required: (1) alternating A/B vs main at PR head; (2) move the pin into the #589 wrapper or re-pin NOTICE/TODO/roce-ring together; (3) fix or explicitly bypass A1; (4) log/report no-op; (5) an aarch64 execution check; (6) rebase order with #625/#628.

Full report Decide Value: yes (99%): This change is worth reviewing: it provides value to the project in line with its charter.

Classify intake

Selected: triage:review, performance

Threshold: 65%

Triage

Priority

Type

Area

Model

Apply Labels (Intake)

No label changes

Subtraction and simplicity

Review of PR #576 through the Subtraction/Simplicity/Conventions lens: the diff is lean except for one function.

  1. HIGH — eos/src/unix.rs:188-226: select_high_capacity_cpus is 39 lines that reduce to ~7. The min_cap == max_cap block (:201-203) is dead (the selected.len() < allowed.len() guard at :221 already covers it); the midpoint fallback (:211-220) is speculative and reachable only on hypothetical ≥3-tier hardware — not on GB10, where it always selects 10 CPUs; the cap == 0 guard (:195-197) is unreachable from its only producer (:240-252). Replace the body with a single max + filter + then_some, delete min_cap, and delete the test at :314-330 that pins the fallback. AGENTS.md:188-193 forbids exactly this kind of fallback.
  2. MEDIUM — helios/native/roce_proxy.c:1505-1569 duplicates the same policy, including the same dead min_cap == max_cap (:1543) and fallback (:1555-1565). Do not edit it (vendored witness: :8, NOTICE:16-19, roce_proxy_dlopen.c:7-9, docs/roce-ring.md:361-364) — but then the PR body's "verified equivalent" claim becomes false and must be amended.
  3. MEDIUM — the five pin sites (runtime.rs:724, worker.rs:86, threaded.rs:683, parallel.rs:573, replay.rs:174) are five distinct threads; no merge exists. Delete the second sentence of the comment at helios/src/server/runtime.rs:721-723, which claims background threads stay unnarrowed while the lazily built flare-kv-codec-* pool (selene/src/shared/codec.rs:37-60) inherits the narrowed mask. Simplest real fix: narrow inside that pool's start_handler (codec.rs:47-54).
  4. LOW — eos/src/unix.rs:263-264 non-Linux stub collapses into the body; select_high_capacity_cpus (:188) need not be pub. The Windows stub (eos/src/windows.rs:219-220) is required.
  5. Cleared as lean: no new flag/env/config/Cargo feature, no new dependency, no build change (helios/build.rs:69-74 already compiles the file), no existing affinity helper to reuse, tests proportionate.

Open: whether the C hunk is verbatim from flashinfer#156 (decides if S2 applies); comment-fix vs behavior-fix for the codec pool; rebase collides with open #625 on the same eos/src/unix.rs region and mod tests.

Full report · Notes

Correctness and contracts

Correctness/contracts/system-consequences review of PR #576 at head ba2796c: 1 Blocker, 3 Majors, 4 Minors.

  1. Blocker — the deferral is incomplete: prefer_high_capacity_cpus() runs at helios/src/server/runtime.rs:724, before worker.run, and selene::shared::codec::cpu_pool() is a OnceLock first built from store.poll → pump_spawns → host_compress_pool, i.e. on the already-narrowed flare-model thread. On GB10 the flare-kv-codec-* pool is sized 5 instead of 10 and every worker inherits 5-9,15-19, contradicting the comment at runtime.rs:721-723.
  2. Major — helios/native/roce_proxy.c:1572-1577 edits the region :8 calls "identical", leaving NOTICE:16-19, roce_proxy_dlopen.c:7-9, docs/roce-ring.md:361-364 and docs/TODO.txt:80-86 false; no doc file in the diff.
  3. Major — the 90% filter at eos/src/unix.rs:208 has no relative-spread guard (only exact equality is rejected at :201-203), so small-capacity-spread machines silently get a 1–2 CPU "high" set; the "x86_64 is a no-op" limitation is unreliable.
  4. Major — the selector guarantees only ≥2 CPUs (unix.rs:221, roce_proxy.c:1566) while flare-model, up to 16 flare-rank-N and the 20M-spin flare-roce poller all share that set. 5–8. Minor — silent unpinned outcome (no log/flag/metric, all six let _ = sched_setaffinity); no test for the syscall path, the sysfs root (:243) or the non-inheritance property, and zero C tests; replay.rs:174 narrows before Stream::open at :114, opposite to the documented ordering; stale rule at docs/prefix-cache-offload.md:927-928 and an undocumented flare-roce comm rename.

Verified sound: no hot-path cost, Windows stub parity, no ABI/core change, no metric-span shift, offload SCHED_BATCH policy untouched, no UB/overflow.

Open: whether the author will build the codec pool before narrowing; re-pin to flashinfer#156 instead of editing the vendored body; rebase vs #625/#628.

Full report · Notes

Re-review

Recommendation: Changes Requested

This rework resolves two of the three prior blockers cleanly: helios/native/roce_proxy.c now syncs the exact hunk merged upstream in local-inference-lab/flashinfer#156 (335459b2, satisfying @original-el8's upstream-first option), commit metadata and sign-offs are updated, and eagerly spawned background threads (RankExecutor/flare-rank-*, flare-offload-*, flare-offload-disk, ImagePreparation) now stay on the full process cpuset. One concrete regression remains from the prior Round 2 blocker: selene::shared::codec::cpu_pool() is a lazy OnceLock whose first use on --prefix-cache-memory with CPU KV compression occurs inside worker.run on the already-narrowed flare-model thread, halving the flare-kv-codec-* pool and pinning all codec workers exclusively to the P-cores. Eagerly initializing cpu_pool() during offload startup before narrowing resolves this and unblocks merge.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

  1. Lazy flare-kv-codec-* rayon pool is still sized and pinned on the narrowed flare-model thread (helios/src/server/runtime.rs:721-729, selene/src/shared/codec.rs:37-60, selene/src/memory.rs:1898-1901,2005-2013,2341-2370,3064-3075)
    • Verified behavior & impact: The comment at helios/src/server/runtime.rs:721-723 states that narrowing after crate::offload::open (:696) leaves host offload/codec/disk threads on the full process cpuset. While flare-offload-* (helios/src/offload/transfer.rs:509-536) and flare-offload-disk (selene/src/disk.rs:372,732) are spawned eagerly inside offload::open, selene::shared::codec::cpu_pool() (selene/src/shared/codec.rs:37-57) is a lazy OnceLock that is not touched during offload::open (AsyncCompressor::new at selene/src/memory.rs:1986-1998,2313 creates only channels and an empty queue).
    • When host prefix offload uses async CPU KV compression (helios/src/offload/transfer.rs:466-482, selene/src/memory.rs:2286-2314), the first outbound checkpoint store triggers Worker::run -> service_store (helios/src/server/runtime.rs:2380-2388) -> MemoryStore::poll (selene/src/memory.rs:3064-3075) -> drain_compressed (:2368-2370) -> AsyncCompressor::pump_spawns (:2005-2013) -> host_compress_pool() (:1898-1901) -> cpu_pool() on the already-narrowed flare-model thread.
    • Inside cpu_pool(), std::thread::available_parallelism() (selene/src/shared/codec.rs:41-43) reads the calling thread's sched_getaffinity mask, and rayon::ThreadPoolBuilder::build() spawns all flare-kv-codec-* workers from that thread. On GB10 (0-19 narrowed to 5-9,15-19), this both halves the codec pool (10 / 2 = 5 workers instead of 20 / 2 = 10), pins all codec compression workers exclusively to P-cores where they contend with flare-model/flare-roce instead of using efficiency cores (violating docs/prefix-cache-offload.md:919-928 and contradicting runtime.rs:721-723), and incurs pool thread-creation latency inside store.poll(). (It also creates a startup race with helios/src/offload/transfer/codec.rs:353,514,751, where whichever of flare-model or flare-offload-0 hits cpu_pool() first permanently fixes the pool size and affinity for the process.)
    • Fix: Eagerly warm crate::shared::codec::cpu_pool() during MemoryStore::open when codec_enabled / async_encoder.is_some() (e.g., inside AsyncCompressor::new or right before returning from selene/src/memory.rs:2307-2315, or inside crate::offload::open when CPU KV compression is active), which runs on the unnarrowed flare-model thread before helios/src/server/runtime.rs:724 and avoids spawning codec threads when offload compression is disabled.

Should Fix

None.

Subtract / Simplify

  1. Remove dead min_cap == max_cap check in select_high_capacity_cpus (eos/src/unix.rs:201-203): When min_cap == max_cap (with positive capacities), every CPU satisfies cap * 10 >= max_cap * 9, so selected.len() == allowed_with_capacity.len() and the final guard at :221 (selected.len() < allowed_with_capacity.len()) already returns None. Deleting :201-203 preserves exact behavioral parity with roce_proxy.c:1510-1569.
  2. Tighten visibility and collapse the Unix cfg stub (eos/src/unix.rs:188,231-264): Because eos/src/lib.rs:12 does pub use unix::*;, marking select_high_capacity_cpus as fn (private to eos/src/unix.rs, where its only caller :253 and tests :270-330 live) avoids exporting an internal helper on flare_eos's public API. Likewise, prefer_high_capacity_cpus (:231-264) can use a single signature with #[cfg(target_os = "linux")] inside the function body instead of repeating the pub fn declaration.

Nits

Dropped on verification

Full report

Classify triage

Selected: triage:review

Threshold: 65%

Triage

Apply labels

No label changes Decision to Test: no (99%): 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.