#1 [high] Rules: charter + AGENTS + design-review excerpts relevant to lens
PR #576 "Pin Helios execution and RoCE proxy threads to high-capacity CPUs on asymmetric Linux topologies" (fork: fordbmorris, head 4b41ddc, 7 files +226/-1).
Charter (NVIDIA/hyperflare-inference):
- "Solve the right problem in the right place... smallest footprint in shared code, or a way to solve it without new code at all."
- "Stay focused... not interested in piling on extra model aliases, random switches, or broad hardware support."
- "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)."
- "Be explicit and pin everything. No magic defaults."
- Non-goals incl. "CPU or non-NVIDIA backends" (require maintainer sign-off).
- Code Review Standards: "Supported matrix & compatibility", "No per-model special cases or flags", "PR descriptions: why / what changed / claimed result / evidence".
AGENTS.md:
- l.165-169 every contribution must address maintainer request / demonstrated defect / measured perf problem / docs.
- l.171-181 reject unapproved scope expansion; reject "unsupported abstractions and churn": "Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement."
- l.188-193 refactoring must support requested behavior.
- l.194-199 focused validation, one coherent outcome, name missing hardware/unrun checks.
- l.447-469 Configuration: "Flare, Helios, recipes, and components never read an environment variable to choose behavior"; a setting has one of three homes: recipe declaration, configuration file, or CLI flag.
- l.494-510 validation/performance: compare against exported core via
flare run; keep raw measurements; disclose unrun. - docs/design-review.md principle 1 (keep Helios simple, model-agnostic), principle 10 ("Use explicit configuration... explicit user values win over defaults"), principle 12 (validate real path & report evidence honestly; perf claims require equivalent baselines, actual Helios service measurements), principle 15 (reject scope expansion), 16 (prose), 17 (Discord line — present: "Discord: woooflet").
- design-review l.180-193 testing hierarchy layer 1: cargo test on eos and helios.
#2 [high] PR 576 diff summary (all 7 files)
eos/src/unix.rs (+145): new pub fn select_high_capacity_cpus(&[(usize,u32)]) -> Option<Vec> (threshold cap10 >= max9; fallback cap*2 > min+max; returns None when <2 cpus, any cap==0, min==max, or selected>=len); new pub fn prefer_high_capacity_cpus() cfg(target_os="linux") reading sched_getaffinity then /sys/devices/system/cpu/cpu/cpu_capacity for each allowed cpu (returns early on any read/parse failure), then sched_setaffinity with let _ = (error ignored). Plus 3 unit tests (gb10 tiers, homogeneous/single-tier/zero caps no-op, three-tier avoid collapse).
eos/src/windows.rs (+3): no-op stub pub fn prefer_high_capacity_cpus() {}.
helios/native/roce_proxy.c (+71): #ifdef linux static pin_high_capacity_cpus() re-implementing same policy in C (CPU_SETSIZE arrays, fopen/fscanf per allowed cpu, 90% threshold, midpoint fallback, sched_setaffinity result ignored); called at top of proxy_main together with pthread_setname_np(pthread_self(), "flare-roce").
helios/src/execution/parallel.rs (+1): prefer_high_capacity_cpus() first line of pub unsafe fn serve_rank(manifest, ..., rank, world).
helios/src/execution/worker.rs (+1): first stmt inside spawn closure of "flare-execution" thread.
helios/src/replay.rs (+4/-1): wraps run(...) in closure calling prefer_high_capacity_cpus() first; thread name "flare-cuda".
helios/src/server/runtime.rs (+1): first stmt inside spawn closure of "flare-model" thread.
#3 [high] Blocking: unrequested, unconfigurable host-scheduling default (magic 90% constant) in the serving path
Severity: blocking.
eos/src/unix.rs:212-248 (prefer_high_capacity_cpus) and helios/native/roce_proxy.c:1504-1570 (pin_high_capacity_cpus) install one hard-coded host scheduling policy into the default serving path of every Linux build: threads are restricted to CPUs with capacity*10 >= max*9 (Rust eos/src/unix.rs:192, C roce_proxy.c:1547), with an undocumented midpoint fallback (unix.rs:195-204), no configuration input, and no way to turn it off.
Rules it breaks:
- AGENTS.md l.188-193: "Do not add frameworks, extension points, speculative compatibility, fallback layers, or configuration switches without a concrete requirement"; l.204-207 charter "Be explicit and pin everything. No magic defaults."
- AGENTS.md l.452-457 / docs/design-review.md principle 10: "A setting has one of three homes: the recipe declaration, the configuration file, or a command-line flag." This is a setting with none of the three; the only escape hatch is an external
taskset/systemd cpuset, which the PR presents as the reason no flag is needed ("without environment variables, systemd overrides"). That inverts the rule: the workaround for a code-level default is handed to the operator. - docs/prefix-cache-offload.md:863-867 is the repository's only prior statement on CPU affinity: those threads use SCHED_BATCH and "Adding CPU affinity requires a serving-latency measurement that shows a benefit." The critical threads this PR pins do have measurements, but the policy statement shows the project's standard: affinity is admitted only per-thread with evidence, not as a blanket default.
- The same 120-line heuristic is duplicated in Rust and C (unix.rs:172-210 vs roce_proxy.c:1510-1570) and must be kept in sync by hand; two implementations of one policy in two build systems.
Fix: make it an explicit setting (config file / CLI flag carried into Helios, per AGENTS.md l.452-457) with the CPU set stated by the operator, or drop the change and document the taskset/systemd cpuset recommendation in docs/multi-host.md or docs/runtime-core-design.md. A default-on heuristic cannot be justified by "no environment variables are introduced".
#4 [high] Blocking: performance claims have no main-vs-head baseline as the charter requires
Severity: blocking.
No measurement of this branch against main is reported. Every number in the description compares CPU placements within the change:
- "Controlled A/B on the same live server": Cortex-X925 placement 144.88 tok/s vs Cortex-A725 123.66 tok/s — that is a comparison of where the OS happened to place threads, not pinned-vs-unpinned.
- "48/48 vs 4/4" placement counts, CV 4.82%→0.72%, RoceOneshotLaunch 2.77→1.91 ms, p90 wake gap 1880→31 us, cold prefill +2.6..17.3% — all stated as pinned vs unpinned launches of the same tree on 4x DGX Spark; none is
flare runof the same exported core onmainvs on this head.
Rules: charter "Bring real evidence. Performance PRs need benchmarks showing an actual speedup over main on a served workload (#210)"; AGENTS.md l.165-169; docs/design-review.md principle 12 ("Performance claims require equivalent baselines, complete GPU steps across all ranks, and actual Helios service measurements").
Also unstated: whether both arms used the same exported core (the description mentions "Cold prefill (same core, no re-export)" for one experiment only), how many launches and their spread for the headline CV numbers, and that the workload uses "Inkling 2 Small NVFP4", a recipe that lives outside this repository (AGENTS.md l.9-13, local-inference-lab/hyperflare-recipes), so the serving path is not reproducible from this repo alone.
Fix: report a paired flare run comparison of main vs head on the same exported core and host, with run counts, and state the recipe/core identity and configuration.
#5 [high] Should fix / Nit: silent failure paths, untested C helper, public-API side effect, eos placement
Smaller verified items.
-
Should fix — error handling is silent in both implementations:
- eos/src/unix.rs:228-233:
let Ok(text) = std::fs::read_to_string(&path) else { return; }and the parseelse { return; }abort the whole selection on the first unreadable/invalid cpu; helios/native/roce_proxy.c:1513-1520return;does the same, and roce_proxy.c:1567 ignores sched_setaffinity's result, as does unix.rs:244 (let _ =). A partial failure leaves the thread on the full mask with no diagnostic, while the PR claims "no-op when cpu_capacity is absent, unreadable, zero". AGENTS.md l.182-186 "Do not ... suppress errors". Fix: treat an unreadable CPU as "no policy" deliberately and log once (a single startup line, as #280 does with "frame completion wait: WFET"), or propagate the failure. - The per-CPU loop does one file open per allowed CPU at thread start (20 opens on GB10) on the latency-critical startup path, and
prefer_high_capacity_cpusis called before the thread validates anything (parallel.rs:539 precedes the persistent-worker rejection andmanifest.validate(); runtime.rs:568 precedes the offload/rank checks), so rejected ranks still pay it. - Silent behavior change for a diagnostic caller:
serve_rankis public API (helios/src/execution.rs:25), used by flare-cli/src/main.rs:560 and heliopause/src/python.rs:548 for the diagnostic qualification path (docs/same-process-tp.md:128-134). It now permanently narrows the calling thread's affinity as a side effect, though its contract (parallel.rs:527-533) documents only resource lifetime. Needs a behavior note.
- eos/src/unix.rs:228-233:
-
Nit — policy edge cases (unix.rs:172-210):
selected.len() < allowed_with_capacity.len()(l.205) is what makes an already-single-tier cpuset a no-op; the test at l.287-292 passes for a different reason than the doc comment claims.- A two-tier set whose high tier is one CPU falls back to the midpoint rule and can select only that one CPU, then returns None — the comment at l.196-197 ("Avoid collapsing multiple busy threads onto a single prime core") is not what the code guarantees.
- Duplicated constant and duplicated heuristic in Rust and C (unix.rs:172-210 vs roce_proxy.c:1510-1570) is a maintenance defect on its own.
-
Nit — placement: AGENTS.md l.20-21 defines
eos/as "the host operating-system operations that Helios and Selene use"; this is a Helios serving policy, not a generic host OS operation, and Selene would inherit it. A Helios module would also remove the Windows stub (eos/src/windows.rs:216-219). -
Verified as fine: no env var, no Protobuf/core/ABI change, proxy ABI stays 14 (roce_proxy.c:134), existing cores load unchanged, and the cpuset intersection preserves operator restrictions (the new mask is a subset of the thread's own affinity). Tests unix.rs:254-314 cover only the pure selector:
prefer_high_capacity_cpusitself (sysfs read + sched_setaffinity) and the whole C helper have no test and are only claimed qualified on GB10; the Windows stub was never compiled (the description does disclose this).