Skip to content

probe, do not land: what a test run reuses on a fresh runner - #2172

Closed
ashhart wants to merge 3 commits into
mainfrom
lead/ci-test-times
Closed

ashhart wants to merge 3 commits into
mainfrom
lead/ci-test-times

Conversation

@ashhart

@ashhart ashhart commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

A measurement only, closed when it reports. It's out of draft only because queued runs on draft pull requests get cancelled. See #2140.

@ashhart
ashhart force-pushed the lead/ci-test-times branch from b6ecbed to 3df36dc Compare November 5, 2026 09:32
@ashhart
ashhart marked this pull request as ready for review November 5, 2026 09:37
@ashhart ashhart changed the title probe, not for landing: which test binaries take CI's time probe, do not land: what a test run reuses, and what tests read while they run Nov 5, 2026
@ashhart
ashhart force-pushed the lead/ci-test-times branch from 3df36dc to d03dd6f Compare November 5, 2026 11:11
@ashhart ashhart changed the title probe, do not land: what a test run reuses, and what tests read while they run probe, do not land: what a test run reuses on a fresh runner Nov 5, 2026
@ashhart
ashhart force-pushed the lead/ci-test-times branch 3 times, most recently from 8cdba5d to d858e75 Compare November 5, 2026 12:27
…ts every runner

A compile's cache key carries its CPU, and host code compiles for the runner's own.
GitHub's runners differ, so a restored cache missed nearly every compile unless the
runner drew the CPU main's last save ran on. In one probe on a small target, with
four different CPUs among the Linux runners, 1 of 4 restored jobs hit on Linux and 0
of 4 on Windows. With -Dfixed-cpu, which compiles host code for x86_64_v3, all 8 hit,
in 2-7 s instead of 108-263 s.

This removes the ZIG_GLOBAL_CACHE_DIR setting #2140 added. It does nothing on CI:
setup-zig already puts the global cache inside .zig-cache and overrides it, so the
reason that commit gave for the misses was wrong.

The key moves to v3, so main starts from an empty cache rather than keeping builds for
each runner's own CPU alongside the new one.
These two jobs only compile, so a warm cache saves most of their time. Pull requests
saved their own caches, which no other pull request can read and which filled the
budget, and setup-zig emptied any past 2 GiB. macOS waited longest for a runner: 10
minutes at the median and 39 at p90, then 13 to run (5 Nov, 63 pull request runs).

They now do as zig and zig-windows do: main saves, and a pull request restores main's
newest and saves nothing.
@ashhart
ashhart force-pushed the lead/ci-test-times branch 2 times, most recently from 8862f0a to 7c4e957 Compare November 5, 2026 14:24
@ashhart
ashhart force-pushed the lead/ci-test-times branch from 7c4e957 to b090bae Compare November 5, 2026 14:36
@ashhart

ashhart commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Done: results are on #2242. This was only ever a measurement.

@ashhart ashhart closed this Nov 5, 2026
@ashhart
ashhart deleted the lead/ci-test-times branch November 5, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant