Skip to content

fix(benchmarks): record.py --cpu pins only the measurement, not the build (#3252) - #3274

Merged
zackees merged 2 commits into
masterfrom
build/3252-record-pin
Oct 31, 2026
Merged

zackees merged 2 commits into
masterfrom
build/3252-record-pin

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member

What

record.py --cpu N called os.sched_setaffinity(0, {N}) on itself, and every child inherited the mask: cargo, rustc and the oracle's cc build compiled on one core. A cold release oracle build took about 28 min that way (evidence on #3255). Now:

  1. soldr cargo bench ... --no-run builds first, unpinned, on every core;
  2. the smoke run and each measured run get preexec_fn=pin(N), so only the bench children are pinned. Nothing compiles at that point, because the build is already done.

RED → GREEN

  • RED (first commit): ci/test_benchmark_record.py PinTest fails on master. main() calls sched_setaffinity in-process, and its first subprocess is not a --no-run build.
  • GREEN: record.py adds build_command() and pin(); the tests pass (21 OK) and ./lint passes.

Test cost: two mocked unit tests, under 10 ms, no threads.

Fixes #3252. Refs #3249.

@zackees
zackees enabled auto-merge October 31, 2026 20:44
@zackees
zackees added this pull request to the merge queue Oct 31, 2026
Merged via the queue into master with commit 922a76c Oct 31, 2026
36 checks passed
@zackees
zackees deleted the build/3252-record-pin branch October 31, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bench: record.py --cpu pins the whole build to one core, not just the measurement

1 participant