Skip to content

feat(synthesizer): infer byte-write-enable RAM, folding a masked-write retention read into the write port (1R1W) #4368

feat(synthesizer): infer byte-write-enable RAM, folding a masked-write retention read into the write port (1R1W)

feat(synthesizer): infer byte-write-enable RAM, folding a masked-write retention read into the write port (1R1W) #4368

Workflow file for this run

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"
SCCACHE_CACHE_SIZE: "3G"
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:
RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: "0"
SCCACHE_CACHE_SIZE: "3G"
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
# Same rust-cache + sccache split as the benchmarks job above (deps via
# rust-cache; workspace crates via sccache, under a distinct -sccache key).
- uses: Swatinem/rust-cache@v2
continue-on-error: true
with:
shared-key: "${{ runner.os }}-${{ runner.arch }}-codspeed-boot-sccache"
save-if: ${{ github.ref == 'refs/heads/master' }}
- uses: mozilla-actions/sccache-action@v0.0.10
with:
disable_annotations: true
- uses: actions/cache/restore@v4
continue-on-error: true
with:
path: ~/.cache/sccache
key: sccache-codspeed-boot-${{ github.sha }}
restore-keys: sccache-codspeed-boot-
# 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: 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-boot-${{ github.sha }}
- 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 }}