#1 [high] BLOCKER: narrowing precedes lazy flare-kv-codec pool creation → pool halved and pinned
The deferral comment claims background threads keep the full mask, but one pool is built lazily after narrowing, on the narrowed thread.
Chain (all verified at head ba2796c0):
- helios/src/server/runtime.rs:721-724 —
// Narrow affinity only after RankExecutor, host offload/codec/disk, and image // preparation child threads have been spawned so background workers stay free // to run on efficiency cores and observe the full process cpuset. flare_eos::prefer_high_capacity_cpus();then :729worker.run(&mut executor). - Inside run: helios/src/server/runtime.rs:1132 fn run, :1145
progress |= self.service_store()?→ :2380-2388store.poll(&mut events)?. - selene/src/memory.rs:3064-3066
fn poll→self.drain_compressed(events)→ :2368-2370compressor.pump_spawns()→ :2005-2013let Ok(pool) = host_compress_pool()→ :1898-1901crate::shared::codec::cpu_pool(). - selene/src/shared/codec.rs:37-59
OnceLockbuilt on first use:let threads = std::thread::available_parallelism() .map(|n| (n.get() / 2).clamp(1, 24)),thread_name(|i| format!("flare-kv-codec-{i}")),start_handler(|_| unsafe { libc::nice(10); }); rayonThreadPoolBuilder::build()spawns all workers from the calling thread, and pthreads inherit the creator's sched affinity;available_parallelism()reads the current mask. - AsyncCompressor is only constructed when host prefix offload uses the CPU KV codec: helios/src/offload/transfer.rs:466-482 (
if !is_gpu && profile.is_some()) and selene/src/memory.rs:2308-2315. Then selene/src/memory.rs:2046pool.spawn(move || ...)runs encode tasks on that pool. - Same pool is also entered from the offload hot path: helios/src/offload/transfer/codec.rs:24-25, 353, 514 (spawned at offload::open, helios/src/offload/transfer.rs:509-536, before narrowing).
Impact on GB10: pool sized 10→5 threads, all with Cpus_allowed_list=5-9,15-19 (efficiency cores excluded), i.e. host KV compression loses half its parallelism and loses the cores the comment promises it keeps. The PR's own /proc evidence lists only flare-model, flare-roce, serve_rank — the codec pool was never inspected.
Fix: build/normalize the pool before narrowing (call flare_selene::shared::codec::cpu_pool() during start, before :724), or have cpu_pool() explicitly restore the process-wide allowed mask for its workers, or pass an explicit thread count; and cover flare-kv-codec-* in the /proc evidence.
#2 [high] MAJOR: pinned count can exceed 2-CPU floor; hot-spinning flare-roce shares the narrowed set
eos/src/unix.rs:211-225 — the fallback only guarantees two CPUs:
if selected.len() < 2 {
// Avoid collapsing multiple busy threads onto a single prime core on
// three-tier topologies: fall back to all cores above the capacity midpoint.
let sum = u64::from(min_cap) + u64::from(max_cap);
selected = allowed_with_capacity.iter()
.filter(|&&(_, cap)| u64::from(cap) * 2 > sum) ...
}
if selected.len() >= 2 && selected.len() < allowed_with_capacity.len() { Some(selected) } else { None }
C is identical (helios/native/roce_proxy.c:1555-1568 if (selected >= 2 && selected < count)).
Every narrowing caller puts a latency-critical thread onto that same set:
- helios/src/server/runtime.rs:724 (flare-model / rank 0 launch thread)
- helios/src/execution/threaded.rs:683 (each
flare-rank-{index+1}, one per TP rank, helios/src/execution/threaded.rs:668-670) - helios/src/execution/worker.rs:86, helios/src/execution/parallel.rs:573, helios/src/replay.rs:174
- helios/native/roce_proxy.c:1576 (the proxy), which then busy-polls: :1586-1609,
#define ROCE_IDLE_SPINS 20000000(:172) withnanosleeponly after 20M idle polls.
On GB10 the high set is 10 CPUs (fine). On an operator cpuset such as taskset -c 0-3 on a 1-prime + 3-efficiency asymmetric part, the fallback can select 2 CPUs for flare-model + up to 16 rank threads + a 100%-duty spinning proxy — strictly worse than the scheduler spreading them, and it can re-create the very host wake-gap latency the PR measures, this time from CPU oversubscription rather than core tier. Nothing checks selected.len() against the number of threads that will be pinned, and nothing logs.
Fix: require the selected set to be at least the number of threads that will be pinned (or a named minimum such as 4), no-op otherwise, and consider excluding one CPU for the proxy or not pinning the poller at all.
#3 [high] MAJOR: vendored roce_proxy.c edited in-place, contradicting 4 in-tree "identical" witnesses
helios/native/roce_proxy.c:6-8 states: // Vendored from FlashInfer's pinned preparation dependency // (flashinfer/experimental/b12x/comm/roce/_roce_proxy.c, proxy ABI 14). // Keep the source below identical so preparation and serving share the transport ABI.
helios/native/roce_proxy.c:1572-1577 now adds inside that same "identical" region:
static void* proxy_main(void* arg) {
roce_ctx_t* c = (roce_ctx_t*)arg;
#ifdef __linux__
(void)pthread_setname_np(pthread_self(), "flare-roce");
pin_high_capacity_cpus();
#endif
Witnesses left unamended (no doc file in the 8-file diff):
- NOTICE:16-19 — "helios/native/roce_proxy.c was contributed by its original author from: https://github.com/local-inference-lab/flashinfer/blob/f5f5341d.../_roce_proxy.c ... Its implementation is unchanged from that revision" — now false.
- helios/native/roce_proxy_dlopen.c:7-9 — "keeping the vendored roce_proxy.c byte-for-byte identical to FlashInfer." (file is the one merged #589 wrapper, includes roce_proxy.c at :236).
- docs/roce-ring.md:361-364 — "keep the vendored source identical to the dependency after its provenance header".
- docs/TODO.txt:80-86 — parity debt entry, still describes ABI 10/11.
pyproject.toml:47 pins
flashinfer-python = { git = .../flashinfer.git, branch = "main" }(unpinned branch), so there is no revision at which "identical" is verifiable either. Severity Major: an attribution/parity contract asserted in four files is now untrue and the PR body does not say so.
#4 [high] MAJOR: non-GB10 platforms are not no-ops; 90% threshold has no relative-spread guard
PR body Limitations say "On x86_64 Linux, /sys/devices/system/cpu/cpu/cpu_capacity is absent so the helper is a no-op." That is not reliable: the file exists whenever CONFIG_ACPI_CPPC_CPUFREQ/arch_topology provides it, including x86 hybrid parts (Alder Lake/Raptor Lake/Meteor Lake), and most server kernels. Two concrete consequences the PR does not address:
- On an x86 hybrid laptop/workstation,
cpu_capacityis present with asymmetric values, so this PR would silently pin flare-model and the RoCE proxy on the first launch after merge with no benchmark, no evidence, and no flag — contrary to docs/prefix-cache-offload.md:927-928 "Adding CPU affinity requires a serving-latency measurement that shows a benefit." and the charter's opt-in/evidence rule (#210). - Even where capacities are symmetric, the
min_cap == max_capearly return (eos/src/unix.rs:201-203) only covers exact equality; GB10's own data (997..1024 within the performance tier) shows a 2.7% spread, so any x86 or ARM part whose whole allowed set has a small non-zero spread — e.g. all cores at 1023/1024 from CPPC rounding — will produce a "high" subset that is 1-2 CPUs out of 16+, and the code will then pin 6-8 hot threads there (selected.len() >= 2 && selected.len() < allowed_with_capacity.len(), eos/src/unix.rs:221-225). The 90% threshold (eos/src/unix.rs:208,u64::from(cap) * 10 >= u64::from(max_cap) * 9) filters only absolute spread, never relative — a 2% spread across a homogeneous part silently halves or worse the usable CPU set. Impact: a global behavioral default change on hardware nobody measured, and a filter that cannot distinguish "tiered" from "noisy homogeneous". Fix: gate on a minimum absolute spread (e.g.max_cap >= min_cap * 12 / 10, the ~40% gap real big.LITTLE parts show) and/or gate the whole feature behind an explicit env/flag as the docs require.
#12 [high] Research summary
I completed the correctness/contracts/system-level lens over all 8 changed files plus their callers, and recorded 11 scratchpad notes (9 findings, 1 verified-sound record, 1 ordering note).
Headline: one Blocker (the deferral at helios/src/server/runtime.rs:724 is incomplete — selene::shared::codec::cpu_pool() is a OnceLock built lazily on first use, and its first use is store.poll → drain_compressed → pump_spawns → host_compress_pool inside worker.run, i.e. on the already-narrowed flare-model thread; on GB10 the flare-kv-codec-* pool is built with 5 instead of 10 threads and every worker inherits 5-9,15-19, directly contradicting the comment at runtime.rs:721-723). Three Majors: the vendored roce_proxy.c was edited inside the region four in-tree witnesses call byte-identical (roce_proxy.c:8, NOTICE:16-19, roce_proxy_dlopen.c:7-9, docs/roce-ring.md:361-364, docs/TODO.txt:80-86) with no doc file in the diff; the "x86_64 is a no-op" limitation is not reliable (x86 hybrid parts do expose cpu_capacity, and the 90% threshold has no relative-spread guard — only exact equality is rejected at unix.rs:201-203, so a ~1% spread yields a 1-2 CPU "high" set that 6-8 hot threads are then pinned to); and the selector only guarantees ≥2 CPUs while flare-model, up to 16 flare-rank-N, and the 20M-spin flare-roce poller all share that same set. Minors cover observability (all six sites let _ = the syscall, no log/flag/metric, silent no-op on any unreadable cpu_capacity), the undocumented flare-roce rename plus the stale rule at docs/prefix-cache-offload.md:927-928, missing syscall-path/non-inheritance tests (only 3 pure-selector tests, C mirror untested, CI has no aarch64 execution), and the replay.rs:174 narrowing running before Stream::open in the opposite order to the documented design.
Areas I checked and found genuinely sound: no hot-path locks/allocation cost, Windows stub parity is total, no error-propagation change, no rate/latency/admission metric span shift, no ABI or core-format change (ABI 14 and existing cores unaffected), and offload thread priority (SCHED_BATCH/nice) untouched. I found no instruction-like or injected content.
#13 [high] Verified diff metadata + claim-vs-diff accuracy deltas (5 items, with line cites)
Verified against the diff at head ba2796c0 (pr_diff): exactly 8 files, +230 / −1, matching the dossier.
- eos/src/unix.rs +145 (selector
:188-226, syscallprefer_high_capacity_cpus :231-261, non-linux stub:263-264, 3 tests inserted at the top ofmod tests:270-330) - eos/src/windows.rs +3 (
:219-220stub, doc comment one line) - helios/native/roce_proxy.c +71 (
#ifdef __linux__helper:1506-1570, calls:1574-1577insideproxy_main:1572) - helios/src/execution/parallel.rs +1 (
:573), helios/src/execution/threaded.rs +1 (:683), helios/src/execution/worker.rs +1 (:86), helios/src/replay.rs +4/−1 (:171-176closure), helios/src/server/runtime.rs +4 (:721-724comment+call) No documentation file, no NOTICE, no CI workflow touched.
Claim-accuracy deltas I verified myself (PR text vs diff):
- Body: "no-op when cpu_capacity is absent, homogeneous, or already single-tier" + Limitations "On x86_64 Linux ... cpu_capacity is absent so the helper is a no-op" → not reliable; see note on the threshold (cpu_capacity is present on x86 hybrid parts, and only exact equality is treated as homogeneous, eos/src/unix.rs:201-203).
- Body: "Defer ... until after child-thread spawning so background threads retain the unnarrowed process affinity mask" → true for eager children (runtime.rs:585/684-707/719 all precede :724) but false for the lazily built
flare-kv-codec-*pool (note 1). - Body: evidence "inspecting /proc//task/*/status ... confirmed flare-model, flare-roce, and peer serve_rank threads had Cpus_allowed_list=5-9,15-19 while the ImagePreparation child thread ..., flare-http, tokio-rt-worker, and CUDA driver helper threads retained 0-19" → the list contains no
flare-kv-codec-*entry, i.e. the one pool that is created after narrowing was not inspected; and it was measured on binary 4c82ab5b, not this head. - Body: "no-op ... or already single-tier" / "falling back above midpoint to never collapse below 2 cores" → the fallback is accurate, but "never collapse below 2" is the only floor:
selected.len() >= 2(eos/src/unix.rs:221, roce_proxy.c:1566) with no relationship to how many threads get pinned. - Body claims RoCE proxy rename as instrument; the rename is a user-visible comm change and no doc was updated (see the undocumented-changes note).
#5 [medium] MINOR/observability: silent unpinned outcome, no log, no flag, no metric
Six changed call sites narrow with let _ = sched_setaffinity(...) (eos/src/unix.rs:260) / (void)sched_setaffinity (helios/native/roce_proxy.c:1567) and no log, metric, or flag:
- helios/src/server/runtime.rs:724, helios/src/execution/worker.rs:86, helios/src/execution/parallel.rs:573, helios/src/execution/threaded.rs:683, helios/src/replay.rs:174, helios/native/roce_proxy.c:1576.
There is no opt-out and no way for an operator to tell whether the pin applied. It also conflicts with the repo's explicit-pinning/no-magic-default rule in the charter and with docs/prefix-cache-offload.md:927-928. Concrete fix: report the chosen set once per process (stderr line or a metrics field next to
worker_metrics.scheduler(...)at runtime.rs:725), and exposeFLARE_CPU_AFFINITY=off|highreading the same selector. Also note the failure modes are all silentreturns, not errors (eos/src/unix.rs:236-249): any transient read failure on cpu{cpu}/cpu_capacity for any allowed CPU aborts the whole selection, so on a cpuset where one CPU is offline (cpu_capacity file missing, e.g. a hot-unplugged CPU still in the mask) the feature silently no-ops. That failure mode is indistinguishable from "correctly no-op" to an operator.
#6 [medium] TESTS: no test for the syscall path or for the non-inheritance property the design depends on
Only pure-function tests are added (eos/src/unix.rs:270-330: three select_high_capacity_cpus cases). Nothing tests the syscall path — prefer_high_capacity_cpus (eos/src/unix.rs:232-261) has no test, no injection point for a fake sysfs root (the path is hard-coded format!("/sys/devices/system/cpu/cpu{cpu}/cpu_capacity"), :243), and no test asserts that a narrowed thread spawns children with a wider mask. The C mirror pin_high_capacity_cpus (helios/native/roce_proxy.c:1509-1569) has no test at all and cannot be reached by the existing execution::roce::tests (those "exercise the ABI, preflight rejection, and GPU control-error interpretation without opening an RDMA device", docs/roce-ring.md:378-380 — roce_start is the only caller of proxy_main, helios/src/execution/roce.rs:300).
CI cannot run either implementation meaningfully: .github/workflows/native-serving.yml:16-22 is ubuntu-24.04 x86_64 + windows-2022 only, and the aarch64 leg (release.yml) only runs --version/--help (per dossier A6). So the two implementations of the same selector are verified by 3 Rust unit tests and 0 C tests, and the property the PR actually relies on (non-inheritance by children) is asserted only by an author-supplied /proc observation on binary 4c82ab5b, not by the PR head.
Fix: factor the path root into a parameter (env or cfg(test) override) and add a test over a temp sysfs tree, plus a test that a child thread spawned after narrowing sees a wider mask than its parent.
#7 [medium] MINOR/observability: silent outcome, no log, no flag, no metric
Six changed call sites narrow with let _ = sched_setaffinity(...) (eos/src/unix.rs:260) / (void)sched_setaffinity (helios/native/roce_proxy.c:1567) and no log, metric, or flag:
- helios/src/server/runtime.rs:724, helios/src/execution/worker.rs:86, helios/src/execution/parallel.rs:573, helios/src/execution/threaded.rs:683, helios/src/replay.rs:174, helios/native/roce_proxy.c:1576.
No opt-out and no way for an operator to tell whether the pin applied. Conflicts with the repo's explicit-pinning/no-magic-default rule in the charter and with docs/prefix-cache-offload.md:927-928. Fix: report the chosen set once per process (stderr line or a metrics field next to
worker_metrics.scheduler(...)at runtime.rs:725) and exposeFLARE_CPU_AFFINITY=off|high. Also: every failure mode is a silentreturn, not an error (eos/src/unix.rs:236-249). Any single unreadablecpu<N>/cpu_capacityamong the allowed CPUs aborts the whole selection, so on a cpuset containing an offline/hot-unplugged CPU (file missing but bit still set) the feature silently no-ops, indistinguishable from "correctly no-op".
#8 [medium] MINOR: undocumented operator-visible changes (thread rename, affinity on proxy) + stale doc rule
Developer/operator-visible behavior change with no docs anywhere in the 8-file diff (pr_files: only eos/src/*.rs, helios/native/roce_proxy.c, helios/src/**.rs).
pthread_setname_np(pthread_self(), "flare-roce")(helios/native/roce_proxy.c:1575) renames the proxy thread from the process/executable name toflare-roce. Anyone (or anything, e.g. theflare agent/ Orbit monitor, top/htop, apgrep flarewrapper, systemd accounting) that identifies proxy threads by comm, or that samples per-thread CPU by comm, now sees a different name. This is also the instrument the PR's placement evidence relies on, so the rename is load-bearing and should be documented (docs/roce-ring.md, docs/prefix-cache-offload.md:919-928 CPU bullet) rather than only appearing in the diff.- The CPU bullet at docs/prefix-cache-offload.md:919-928 is now stale in a second way: it enumerates exactly how offload threads get priority (
SCHED_BATCH+ positive nice) and ends with "Adding CPU affinity requires a serving-latency measurement that shows a benefit." After this PR, one offload-adjacent thread (the RoCE proxy) does carry CPU affinity and no measurement for that path is supplied. Either supply the measurement the doc demands or amend the doc to scope the rule to the offload transfer/disk threads. - What is not changed, verified: SCHED_BATCH/nice behaviour (helios/src/offload/transfer.rs:281
fn lower_priority, called at :531) and selene's disk-thread policy (selene/src/disk.rs:631) are untouched, so the "offload threads lower priority" contract still holds for the threads that keep the full mask.
#9 [medium] MINOR/observability: silent outcome, no log, no flag, no metric
Six changed call sites narrow with let _ = sched_setaffinity(...) (eos/src/unix.rs:260) / (void)sched_setaffinity (helios/native/roce_proxy.c:1567) and no log, metric, or flag:
- helios/src/server/runtime.rs:724, helios/src/execution/worker.rs:86, helios/src/execution/parallel.rs:573, helios/src/execution/threaded.rs:683, helios/src/replay.rs:174, helios/native/roce_proxy.c:1576.
No opt-out; an operator cannot tell whether the pin applied. Conflicts with the charter's explicit-pinning/no-magic-default rule and docs/prefix-cache-offload.md:927-928. Fix: report the chosen set once per process (stderr or a metrics field next to
worker_metrics.scheduler(...)at runtime.rs:725) and exposeFLARE_CPU_AFFINITY=off|high. Also: every failure mode is a silentreturn(eos/src/unix.rs:236-249). A single unreadablecpu<N>/cpu_capacityamong the allowed CPUs aborts the whole selection, so a cpuset containing an offline/hot-unplugged CPU (bit set, file missing) silently no-ops, indistinguishable from "correctly no-op".
#10 [medium] Areas verified SOUND (no finding): no hot-path cost, Windows stub parity, no metric-span shift, no ABI change
Verified NOT a problem, so no finding (state plainly in the report):
- No new locks, channels, buffers, or allocations on any hot path.
prefer_high_capacity_cpusruns once per thread at start (6 sites) andpin_high_capacity_cpusonce per proxy thread (roce_proxy.c:1576); steady-state poll/loop code (roce_proxy.c:1578-1650, Worker::run path) is untouched. - Ordering/synchronisation: each narrowing call happens strictly after the executor/worker it affects is constructed (runtime.rs:585 vs :724; worker.rs:75-86; parallel.rs:563-573; threaded.rs:672-683; replay.rs:114-124 closure body vs the narrowed call at the closure's first statement, spawn at :171-176 which happens before Stream::open at :114 in the moved closure — narrowing at :174 therefore precedes
Stream::openat :114 inrun. Checked:Stream::open(bundle.context, bundle.device)at replay.rs:114 is a raw stream open, no thread spawn, so nothing inherits the narrowed mask from it.catch_unwindwrappers still enclose the loops, not the narrowing, so a panic in narrowing is not possible (allunsafecalls are plain libc, return values ignored). - Error propagation: none of the changes return errors, so no new failure path; the shutdown/drain code below each call site (runtime.rs:728-756, worker.rs:88-122, threaded.rs:684-694, parallel.rs:574+) is untouched.
- Windows parity: eos/src/windows.rs:219-220 adds
pub fn prefer_high_capacity_cpus() {}, style-matching the neighbouring stubs (raise_open_file_limit at :216). Both are total no-ops, sohelios/src/replay.rs:174etc. compile and behave identically on Windows. The C helper is#ifdef __linux__-gated (roce_proxy.c:1506/1570), so the aarch64 Linux-only RoCE build is unaffected on other targets. No parity bug found. - Metric/rate span check: this PR changes no rate/latency/admission metric.
worker_metrics.scheduler(...)(runtime.rs:725) andmetrics.engram(:555-558) are untouched;graph_durationscalibration (helios/src/scheduler.rs:1136-1148) consumes graph descriptors, not timing, so calibration is unaffected by placement. The PR's own claimed win is a reduction in the variance of the timings the scheduler observes (self.costs.observe, scheduler.rs:1155-1161) — no sampling span shrank. - Charter/contracts: no wire/proto/core-format/ABI change.
ROCE_ABI_VERSION 14(roce_proxy.c:134) is unchanged and the sync(2)-ABI affinities in helios/src/execution/roce.rs:72/300 are unaffected, so existing ABI-14 cores still load.
#11 [medium] MINOR: flare-cuda narrows before Stream::open, unlike the documented after-children ordering
helios/src/replay.rs:171-176:
let thread = thread::Builder::new()
.name("flare-cuda".into())
.spawn(move || {
flare_eos::prefer_high_capacity_cpus();
run(receiver, completion_sender, ready_sender)
})
and run's closure body begins helios/src/replay.rs:113-123 with let stream = match Stream::open(bundle.context, bundle.device) { ... }.
So unlike the flare-model path — where the comment at helios/src/server/runtime.rs:721-723 explicitly promises narrowing happens only after child threads are spawned — the flare-cuda thread narrows before it calls Stream::open, which is the point at which any CUDA-runtime-internal threads for that stream/context would be created. The PR body's non-inheritance evidence ("CUDA driver helper threads retained 0-19", measured on the updated binary) cannot cover this case, because in the flare-model path RankExecutor::new (runtime.rs:585) runs before the narrowing at :724 — a different ordering.
Impact is bounded: Stream::open takes a pre-existing bundle.context (ReplayWorker::new / GraphBundle), so it is not creating the context; but if it does spawn per-stream driver threads, those now inherit the narrowed mask, and no evidence in the PR shows either way. Severity Minor — it is an evidence/ordering asymmetry, not a proven defect.
Fix: move prefer_high_capacity_cpus() into run after Stream::open succeeds (i.e. after :123, before the command loop at :125), matching the runtime.rs ordering and the stated design rule.
#14 [medium] Sound: no UB/overflow/out-of-bounds in the new Rust and C selectors (cites checked)
Checked the unsafe / boundary surface of the new code; no UB, no overflow, no out-of-bounds — record so it is not re-derived.
- Bit-set bounds. Rust:
let max_cpus = std::mem::size_of::<libc::cpu_set_t>() * 8;(eos/src/unix.rs:239) thenlibc::CPU_SET(cpu, &mut next)forcpuvalues drawn only from that same0..max_cpusrange that were tested withCPU_ISSET(:242).cpu_set_tis exactly that many bits, so set/test indices cannot exceed the array. C:int cpus[CPU_SETSIZE]; uint32_t caps[CPU_SETSIZE];andfor (int cpu = 0; cpu < CPU_SETSIZE; cpu++)(roce_proxy.c:1516-1521) —countcan never exceedCPU_SETSIZEbecause it only increments for CPUs inside the same loop, socpus[count]/caps[count]are in range.CPU_ZEROis called on bothallowedandnextbefore use (:1511, :1543). - Arithmetic. Rust widens before multiplying:
u64::from(cap) * 10 >= u64::from(max_cap) * 9(eos/src/unix.rs:208) andu64::from(min_cap) + u64::from(max_cap)(:214); C casts the same way,(uint64_t)caps[i] * 10 >= (uint64_t)max_cap * 9(roce_proxy.c:1550) anduint64_t sum = (uint64_t)min_cap + (uint64_t)max_cap(:1557), plus aval > UINT32_MAXguard before narrowing the fscanfunsigned long(:1539). No u32 overflow in either language. unsafeblocks. All are plain libc FFI with zeroedcpu_set_t(eos/src/unix.rs:233, 256) — layout-correct and fully initialised byzeroed(); the SAFETY contract ofsched_getaffinity/sched_setaffinity(pointer + size ofcpu_set_t) is satisfied. No raw pointer arithmetic in Rust.- Behaviour on a mask larger than the kernel's nr_cpu_ids:
sched_getaffinityfails with EINVAL only if the supplied size is too small;size_of::<cpu_set_t>()is the maximum, so it succeeds.CPU_ISSETon high, non-existent CPU ids is simply clear. - Difference Rust vs C worth knowing (not a bug): Rust reads the capacity of every allowed CPU and aborts the whole selection on the first read/parse failure (
returnat eos/src/unix.rs:245, :248), whereas C also returns on the firstfopen/fscanffailure (roce_proxy.c:1529-1537). Both are "all or nothing", so the two implementations stay behaviourally identical — the concern is only the silence, covered in the observability note.