1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Benchmark regression tracking
# Runs on pushes to main and PRs to detect performance regressions
name: Benchmarks
on:
push:
branches:
pull_request:
branches:
concurrency:
group: bench-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
# PMAT-237: what can this change break? The release gate is untouched and
# still runs everything; this decides only what a PR pays for what it
# changed. The decision is scripts/ci/changed-class.sh, driven in both
# directions by tests/falsification_pr_lane_runs_what_the_change_can_break.rs.
classify:
runs-on:
outputs:
code: ${{ steps.class.outputs.code }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- id: class
uses: ./.github/actions/changed-class
benchmark:
if: needs.classify.outputs.code == 'true'
needs: classify
runs-on:
# infra#430: sixteen clean-room runners share one ~/.cargo, and an hourly
# reaper deletes registry/src entries by mtime -- under a live build, which
# makes rustc read a source file that has just vanished:
# couldn't read .../registry/src/.../<crate>/src/<file>.rs: No such file
# error: could not parse/generate dep info at: .../deps/<crate>.d
# MEASURED on this branch: msrv and coverage both died that way the first
# time PMAT-547 moved them off GitHub-hosted runners, where each job had a
# private ~/.cargo by construction. A registry private to this runner takes
# the job off the shared surface. The path is outside the workspace, so it
# survives the checkout clean and is a cache rather than a cold download.
# The host-side fix is paiml/infra's.
env:
CARGO_HOME: ${{ github.workspace }}/../cargo-home-${{ github.job }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
run: rustup show
- name: Cache cargo
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: bench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Run benchmarks
run: cargo bench --bench core_bench --bench store_bench --bench copia_bench -- --output-format bencher 2>/dev/null | tee bench-output.txt
- name: Check for regressions
run: |
echo "Benchmark results:"
cat bench-output.txt
echo "Benchmark suite completed successfully"