Replace combinational-loop analysis with sparse SSA #4772
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CodSpeed | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| pull_request: | |
| # `workflow_dispatch` allows CodSpeed to trigger backtest | |
| # performance analysis in order to generate initial data. | |
| workflow_dispatch: | |
| jobs: | |
| benchmarks: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # veryl-tests (parse/format/analyze) is LTO-sensitive, so keep the | |
| # fat-LTO `bench` default. | |
| - package: veryl-tests | |
| build_args: "" | |
| # The simulator's hot loop is JIT-compiled native code that LTO | |
| # barely touches; build it lto=false (release-verylup) to skip the | |
| # fat-LTO link that OOM-kills the 2-core runner via wasmtime+cranelift. | |
| - package: veryl-simulator | |
| build_args: "--profile release-verylup" | |
| name: Run benchmarks | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTC_WRAPPER: sccache | |
| CARGO_INCREMENTAL: "0" | |
| # ~0.5G holds one full build closure; 1G adds a generation of headroom. | |
| # Bigger only hoards stale object versions and pushes the repo over the | |
| # 30GB cache quota, evicting the rust-cache generations that let cargo | |
| # skip dependency compilation entirely. | |
| SCCACHE_CACHE_SIZE: "1G" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup rust toolchain, cache and cargo-codspeed binary | |
| uses: moonrepo/setup-rust@v1 | |
| with: | |
| channel: stable | |
| cache: false | |
| bins: cargo-codspeed | |
| # rust-cache caches ~/.cargo and target/ (dependency compilation) so cargo | |
| # skips deps; sccache (content-addressed) then serves the workspace crates, | |
| # which rust-cache alone cannot reuse across runs (cargo's mtime fingerprints | |
| # break after checkout). The key is distinct because building under sccache | |
| # changes every crate's fingerprint. Master saves; PRs restore read-only. | |
| - uses: Swatinem/rust-cache@v2 | |
| continue-on-error: true | |
| with: | |
| shared-key: "${{ runner.os }}-codspeed-${{ matrix.package }}-sccache" | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - uses: mozilla-actions/sccache-action@v0.0.10 | |
| with: | |
| # stats stay in the job log via the explicit step below; keep them off | |
| # the run-summary annotations | |
| disable_annotations: true | |
| - uses: actions/cache/restore@v4 | |
| continue-on-error: true | |
| with: | |
| path: ~/.cache/sccache | |
| key: sccache-codspeed-${{ matrix.package }}-${{ github.sha }} | |
| restore-keys: sccache-codspeed-${{ matrix.package }}- | |
| - name: Build the benchmark target(s) | |
| run: cargo codspeed build -p ${{ matrix.package }} --bench benchmark ${{ matrix.build_args }} | |
| - name: sccache stats | |
| if: always() | |
| run: sccache --show-stats | |
| - uses: actions/cache/save@v4 | |
| if: github.ref == 'refs/heads/master' | |
| continue-on-error: true | |
| with: | |
| path: ~/.cache/sccache | |
| key: sccache-codspeed-${{ matrix.package }}-${{ github.sha }} | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| run: cargo codspeed run -p ${{ matrix.package }} | |
| mode: "simulation" | |
| token: ${{ secrets.CODSPEED_TOKEN }} | |
| # heliodor 1-core Linux boot benchmark (CodSpeed walltime). Runs on a CodSpeed | |
| # Macro Runner (codspeed-macro, ARM64) — walltime is not available on standard | |
| # GitHub-hosted runners. Needs a C compiler (the simulator cc backend). | |
| # Run locally with: cargo bench -p veryl-simulator --bench heliodor_boot | |
| boot-benchmark: | |
| name: Run heliodor boot benchmark (walltime) | |
| runs-on: codspeed-macro | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Setup rust toolchain, cache and cargo-codspeed binary | |
| uses: moonrepo/setup-rust@v1 | |
| with: | |
| channel: stable | |
| cache: false | |
| bins: cargo-codspeed | |
| # rust-cache handles dependency compilation (cargo skips deps on a hit). | |
| # sccache is intentionally not used here: on this Macro Runner its per-sha | |
| # cache re-uploads ~0.5GB every master run (~270s) for only marginal | |
| # workspace-crate reuse, which rust-cache already covers via the deps. | |
| - uses: Swatinem/rust-cache@v2 | |
| continue-on-error: true | |
| with: | |
| shared-key: "${{ runner.os }}-${{ runner.arch }}-codspeed-boot" | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| # The simulator stores compiled aot_c .so files content-addressed under | |
| # ~/.cache/veryl/aot_c; without this cache every run pays the full gcc | |
| # compile of the emitted C (~10 min on this runner). The lookup inside | |
| # the dir is content-addressed, so the cache key only needs to pick the | |
| # newest snapshot: restore by prefix, save under the unique commit sha. | |
| - uses: actions/cache/restore@v4 | |
| id: aot-cache | |
| continue-on-error: true | |
| with: | |
| path: ~/.cache/veryl/aot_c | |
| key: ${{ runner.os }}-${{ runner.arch }}-aot-c-${{ github.sha }} | |
| restore-keys: ${{ runner.os }}-${{ runner.arch }}-aot-c- | |
| # release-verylup (lto=false) avoids the slow fat-LTO link the `bench` | |
| # profile forces; the JIT'd simulation loop is unaffected by LTO. Matches | |
| # the simulator build in the benchmarks job above. | |
| - name: Build the benchmark target | |
| run: cargo codspeed build -p veryl-simulator --bench heliodor_boot --profile release-verylup | |
| - name: Run the benchmark | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| run: cargo codspeed run -p veryl-simulator | |
| mode: "walltime" | |
| token: ${{ secrets.CODSPEED_TOKEN }} | |
| # Save only on master (like rust-cache above): PR-scoped caches are | |
| # invisible to other refs and just eat the 10GB quota. | |
| - uses: actions/cache/save@v4 | |
| if: github.ref == 'refs/heads/master' | |
| continue-on-error: true | |
| with: | |
| path: ~/.cache/veryl/aot_c | |
| key: ${{ steps.aot-cache.outputs.cache-primary-key }} |