Skip to content

Prune multiple profiles in the Rust workspace cache - #29

Merged
zanieb merged 1 commit into
zb/workspace-cache-binfrom
zb/workspace-cache-profiles
Oct 22, 2026
Merged

zanieb merged 1 commit into
zb/workspace-cache-binfrom
zb/workspace-cache-profiles

Conversation

@zanieb

@zanieb zanieb commented Oct 21, 2026

Copy link
Copy Markdown
Member

Allow rust-workspace-cache's profile input to accept newline-separated directories so jobs that build several profiles can prune each one before saving a single cache entry. When pruning runs, require active Cargo fingerprints in every selected profile.

@zanieb
zanieb force-pushed the zb/workspace-cache-profiles branch from 46b2fc6 to bbc6597 Compare October 21, 2026 23:19
@zanieb
zanieb marked this pull request as ready for review October 22, 2026 04:20
@zanieb
zanieb added this pull request to stack #32 October 22, 2026 04:21
@zanieb
zanieb merged commit 3c9fe5d into main Oct 22, 2026
6 checks passed
@zanieb
zanieb deleted the zb/workspace-cache-profiles branch October 22, 2026 04:21
astral-automations-bot Bot added a commit to astral-sh/uv that referenced this pull request Oct 22, 2026
Retain workspace artifacts for the walltime and simulated benchmark jobs
with `rust-workspace-cache`. Enable Cargo's checksum freshness and prune
superseded workspace artifacts within the `debug` and `profiling`
profiles before saving.

Depends on astral-sh/github-actions#29.

**Warm-cache comparison: 20 paired rounds per job (20 runs per
version).** Both jobs use the same 20 paired rounds. Timing values are
means in seconds. Means, changes, and speedups are calculated from
unrounded values and rounded independently. Speedup is the before mean
divided by the after mean; above 1× means faster and below 1× means
slower. Parentheses show the 90% confidence interval for the
after-minus-before mean change; negative changes mean faster.

| Job execution | Before | After | Speedup | Change (90% CI) |
| --- | ---: | ---: | ---: | ---: |
| Walltime benchmark build | 723.4 | 606.4 | 1.19× | −117.0 (−161.1 to
−72.9) |
| Simulated benchmarks | 934.0 | 815.5 | 1.15× | −118.5 (−204.6 to
−32.5) |

Job execution is the elapsed span from the first successful step
starting to the last successful step finishing, including gaps between
steps, setup, and post steps. Waiting for runners and prerequisite jobs
is excluded.

These measurements compare dependency-only caches with
workspace-artifact caching and checksum freshness on fixed source
revisions. They describe repeated exact cache hits during this
measurement window; source edits and cache misses can change the result.
Initial baseline seeds restored existing fallback caches; initial
workspace seeds started empty. These different cache histories may
affect the comparison.

<details>
<summary>Step timings and restored cache sizes</summary>

**Walltime benchmark build** — means and changes in seconds.

| Timing | Before | After | Speedup | Change (90% CI) |
| --- | ---: | ---: | ---: | ---: |
| Rust toolchain + cache restore | 88.0 | 48.0 | 1.83× | −40.0 (−41.3 to
−38.6) |
| Install requirements and prime cache | 104.0 | 88.5 | 1.18× | −15.6
(−20.8 to −10.4) |
| Build benchmarks | 451.4 | 391.1 | 1.15× | −60.4 (−97.8 to −23.0) |

**Simulated benchmarks** — means and changes in seconds.

| Timing | Before | After | Speedup | Change (90% CI) |
| --- | ---: | ---: | ---: | ---: |
| Rust toolchain + cache restore | 74.1 | 48.3 | 1.53× | −25.8 (−27.2 to
−24.4) |
| Install requirements and prime cache | 108.3 | 91.8 | 1.18× | −16.5
(−23.0 to −10.0) |
| Build benchmarks | 481.2 | 402.3 | 1.20× | −79.0 (−132.1 to −25.8) |
| Run benchmarks | 256.7 | 259.9 | 0.99× | +3.2 (−25.9 to +32.3) |

Toolchain setup and cache restore are summed because a toolchain setup
step is added or moved relative to restore; the first toolchain query
may also trigger installation. The cache action’s post step is included
in job execution time.

**Restored archives** — mean MiB across the sampled runs.

| Job | Before | After | Change |
| --- | ---: | ---: | ---: |
| Walltime benchmark build | 3631 | 1809 | -50% |
| Simulated benchmarks | 3081 | 1854 | -40% |

Each job and version restored the same cache key and reported archive
size in all 20 runs. These are repeated measurements of seeded entries,
not independently created archives.

</details>

<details>
<summary>Method and source runs</summary>

Measurement window: 2026-10-21 17:29:04 to 2026-10-21 23:16:12 UTC.

Both versions use the same workload commands and runner labels from the
shared base
[`e32cc50`](astral-sh@e32cc50).
The after version changes cache and toolchain setup. Both versions are
launched in each paired round, with launch order alternating between
rounds. An initial setup run for each version is excluded. Each job uses
its first 20 successful paired rounds with exact cache hits on both
versions. A cache miss excludes only the affected job’s pair. No samples
are excluded based on their timings.

Initial cache population restored existing dependency caches through
fallback keys for the baseline and started empty for the workspace-cache
version. These archive histories may affect the comparison; repeated
hits do not measure long-term cache growth.

A common inert comment in `.cargo/config.toml` selects measurement cache
keys, and cache saving is enabled throughout the measurement workflow,
including the seed. The measurement workflow runs the selected jobs
directly, without the normal change-detection gates. The walltime row
covers the build job; the separate walltime benchmark execution job does
not use this cache and is outside this comparison.

Both benchmark jobs use `depot-ubuntu-24.04-4`, whose cache API uses
[Depot Cache](https://depot.dev/docs/cache/integrations/github-actions).

Intervals use the [paired Student t
method](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_rel.html),
with a round as the sampling unit, assuming independent rounds and
approximately normal within-pair differences. They are per-metric 90%
intervals, without adjustment for multiple comparisons. GitHub step
timestamps have one-second resolution. The intervals estimate
uncertainty in mean changes during this window; they do not bound
individual run times or future production performance.

A prespecified sensitivity analysis uses 90% [BCa bootstrap
intervals](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.bootstrap.html)
from 100,000 resamples of paired differences. Both interval methods
agree on whether zero is included for every reported timing metric with
two estimable intervals. This does not establish independence or make
the window representative of all production traffic.

Before revision:
[`f7270ddab1ec5bf0959d42453fa06106285583c4`](astral-sh@f7270dd).
After revision:
[`1923a396073e22e1800a59d35573bc9480ccce38`](astral-sh@1923a39).

The last column identifies which jobs contribute to the reported means
in each round. Later samples are not used once a job reaches 20 eligible
pairs.

| Round | Before run | After run | Used for |
| ---: | --- | --- | --- |
| 1 | [attempt
2](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/2)
| [attempt
2](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/2)
| Both jobs |
| 2 | [attempt
3](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/3)
| [attempt
3](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/3)
| Both jobs |
| 3 | [attempt
4](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/4)
| [attempt
4](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/4)
| Both jobs |
| 4 | [attempt
5](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/5)
| [attempt
5](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/5)
| Both jobs |
| 5 | [attempt
6](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/6)
| [attempt
6](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/6)
| Both jobs |
| 6 | [attempt
7](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/7)
| [attempt
7](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/7)
| Both jobs |
| 7 | [attempt
8](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/8)
| [attempt
8](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/8)
| Both jobs |
| 8 | [attempt
9](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/9)
| [attempt
9](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/9)
| Both jobs |
| 9 | [attempt
10](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/10)
| [attempt
10](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/10)
| Both jobs |
| 10 | [attempt
11](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/11)
| [attempt
11](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/11)
| Both jobs |
| 11 | [attempt
12](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/12)
| [attempt
12](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/12)
| Both jobs |
| 12 | [attempt
13](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/13)
| [attempt
13](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/13)
| Both jobs |
| 13 | [attempt
14](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/14)
| [attempt
14](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/14)
| Both jobs |
| 14 | [attempt
15](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/15)
| [attempt
15](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/15)
| Both jobs |
| 15 | [attempt
16](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/16)
| [attempt
16](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/16)
| Both jobs |
| 16 | [attempt
17](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/17)
| [attempt
17](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/17)
| Both jobs |
| 17 | [attempt
18](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/18)
| [attempt
18](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/18)
| Both jobs |
| 18 | [attempt
19](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/19)
| [attempt
19](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/19)
| Both jobs |
| 19 | [attempt
20](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/20)
| [attempt
20](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/20)
| Both jobs |
| 20 | [attempt
21](https://github.com/astral-sh/uv-dev/actions/runs/39640729069/attempts/21)
| [attempt
21](https://github.com/astral-sh/uv-dev/actions/runs/39640734741/attempts/21)
| Both jobs |

</details>

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
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.

2 participants