You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bench: record.py --cpu pins the whole build to one core, not just the measurement #3252
rust/tools/benchmarks/record.py --cpu N calls os.sched_setaffinity(0, {N}) on itself (:276-279) before it starts soldr cargo bench (:284, :294). Every child inherits that one-CPU affinity, so whenever the bench needs a rebuild, the whole Rust and C build runs on a single core. cargo sees available_parallelism() == 1, and the cc crate gets NUM_JOBS=1.
soldr warns about this in every such run: this build will use 10 concurrent compiles (from default), not the 1 you asked for. For example, the 2026-10-31 runs for #3187, #3197 and #3212 showed it, and a 3-repeat run took 5-7 min of mostly building. The pinned process can also start a fresh soldr daemon that inherits the pin (forge-ci/soldr#4000), so the slowdown can leak into later, unpinned builds.
--cpu 7 is the documented way to record (record.py:4, and the baselines in docs/rust-port/benchmarks/), so every recording pays this.
Proposed change
Build unpinned first: soldr cargo bench -p obs-c-oracle --bench port_comparison --no-run (or let the existing --test smoke run without the pin).
Apply the affinity only to the measurement runs: subprocess.run(..., preexec_fn=lambda: os.sched_setaffinity(0, {cpu})), or taskset -c N on the measurement command. Leave the parent process unpinned.
Keep recording affinity in the report from the measurement child, not the parent.
Acceptance criteria
With --cpu, the build runs at full parallelism and only the Criterion runs are pinned.
ci/test_benchmark_record.py covers it. RED: the bench command runs while the parent is already pinned. GREEN: the parent stays unpinned and the pin goes to the measurement subprocess.
Activity
fix(benchmarks): record.py --cpu pins only the measurement, not the b…