Skip to content

Warm copied Experiment builds before timed Trials on macOS - #1457

Merged
JacobStephens2 merged 1 commit into
mainfrom
issue-1455
Oct 27, 2026
Merged

JacobStephens2 merged 1 commit into
mainfrom
issue-1455

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

Main is red on test-macos-shard (1): timed_out_trials_keep_partial_usage_and_exportable_session_ancestry saw input_tokens: Null. The Experiment fixture copies the test binary into evals/builds/<commit>/. macOS scans each fresh copy on its first exec, which takes about 0.85s, and runs those scans one at a time. Each Trial paid that cost inside its --timeout 1 deadline, so the fake agent often hadn't printed its partial usage when the timeout fired.

 Fixture::with_session
   for commit in [baseline, candidate]
     copy thirdshift → evals/builds/<commit>/thirdshift
+    run it once with --version   # pay macOS's first-exec scan outside the Trial deadline

Test-only; no change to production code.

Closes #1455

Evidence

  • Cause: on macOS, first exec of a fresh copy of target/debug/thirdshift took 0.82s, 0.93s and 0.91s; the second exec of each took 0.01s. With the fake agent recording its start times, the two Arms' agents started 0.85s apart, and 1.8s after the test began. Linux has no such scan, which is why the earlier triage in CI red on main: test-macos-shard (1), test-macos #1455 couldn't reproduce this.
  • Before: on macOS 26 (local), the test failed alone (left: Null, right: 11 at tests/experiments.rs:400) and failed 12 of 12 times run concurrently.
    After: the test passes alone, and passes 12 of 12 when run 4 at a time over three rounds. The two agents now start 0.01s apart.
  • cargo test --test experiments -- --test-threads=3 (about a macOS runner's core count): 84 passed, 0 failed. cargo fmt --check and cargo clippy --test experiments -- -D warnings are clean.
  • The fix doesn't hold under extreme local load: at 18 threads, or 12 concurrent copies of this test, the 1s Trial timeouts in this test and two grader-timeout tests can still lapse. CI's nextest shards don't run that many at once.

Merge Danger

Door: two-way

Blast Radius: tests

Adds roughly 1s of setup per experiments Fixture on macOS (about 10ms on Linux).

macOS scans a freshly copied binary on its first exec, for about 0.85s,
and serializes those scans. Each Trial's first exec of the copied build
paid that inside its one-second deadline, so the fake agent never emitted
its partial usage before the timeout.
@JacobStephens2 JacobStephens2 added the test:macos On a PR into main: run the full 4-shard macOS suite instead of the one-job macOS gate (#893) label Oct 27, 2026
@JacobStephens2
JacobStephens2 merged commit e518cb7 into main Oct 27, 2026
12 of 17 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1455 branch October 27, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:macos On a PR into main: run the full 4-shard macOS suite instead of the one-job macOS gate (#893)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI red on main: test-macos-shard (1), test-macos

1 participant