From 7a73be397f785780328d4f7ce1f5fb47151855fa Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 16 Nov 2026 16:33:35 +0000 Subject: [PATCH] ci: shard the CodSpeed simulation benchmarks across two jobs The simulation job ran every benchmark one after another under Valgrind, which is single-threaded: about 4m20s of a 6-minute run, the critical path of CI. The tpch train_and_compress benchmarks now run in one job and the tpch parse/decompress_all and clickbench benchmarks in another, at the same time. CodSpeed merges the uploads of one workflow run. A "Benchmark with Codspeed" job still exists, as the required status check, and fails unless both shards succeed. Superseded pull request runs are now cancelled; runs on develop are not. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UeniBDYexjeUHTsV3EvkrG --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dbfc0a..7e43677 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: pull_request: {} workflow_dispatch: {} +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: actions: read contents: read @@ -48,13 +52,23 @@ jobs: - name: Rust Check run: cargo +${{ steps.msrv.outputs.version }} check --lib --all-features - bench-codspeed: - name: Benchmark with Codspeed + bench-codspeed-shard: + name: Benchmark with Codspeed (${{ matrix.shard.name }}) + # Simulation runs single-threaded under Valgrind, so the suite is split + # across jobs; CodSpeed merges the uploads of one workflow run. + strategy: + fail-fast: false + matrix: + shard: + - name: train_and_compress + filter: "tpch\\.rs::train_and_compress" + - name: parse, decompress, clickbench + filter: "tpch\\.rs::(parse|decompress_all)|clickbench\\.rs::" runs-on: - runs-on=${{ github.run_id }} - family=c7i.8xlarge - image=ubuntu24-full-x64 - - tag=bench-codspeed + - tag=bench-codspeed-${{ strategy.job-index }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - uses: ./.github/actions/setup-rust @@ -76,9 +90,22 @@ jobs: CODSPEED_PROCESS_ISOLATION: "false" uses: CodSpeedHQ/action@af75f77f17a054769abefaa42fe8dc2975469b5f # v5.6.3 with: - run: cargo codspeed run + run: cargo codspeed run '${{ matrix.shard.filter }}' mode: simulation + bench-codspeed: + name: Benchmark with Codspeed + needs: bench-codspeed-shard + if: always() + runs-on: ubuntu-latest + steps: + - name: Check shards + run: | + [ "${{ needs.bench-codspeed-shard.result }}" = "success" ] || { + echo "Benchmark shards result: ${{ needs.bench-codspeed-shard.result }}" + exit 1 + } + bench-codspeed-walltime: name: Benchmark with Codspeed (Walltime) runs-on: