Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Guest-only build flags: the key is scoped to the guest target, so host builds
# read this file and take nothing from it. Cargo joins `rustflags` across
# ancestor configs, so each guest crate keeps its own flags and gains this one.
[target.riscv64im-lambda-vm-elf]
# `compiler_builtins` turns `mem-unaligned` on for x86, aarch64 and bpf only, so
# on RISC-V `memcpy`/`memmove` reassemble every misaligned word by hand; this VM
# does unaligned scalar accesses natively (#864). The cfg reaches every crate in
# the guest graph, but only `compiler-builtins` reads that name, and it declares
# the value in its own check-cfg. It lives in that crate's `build.rs` with no
# stability guarantee: bumping the `nightly-2026-02-01` pin in the Makefile can
# turn this into a silent no-op.
rustflags = ["--cfg", "feature=\"mem-unaligned\""]
Comment thread
jotabulacios marked this conversation as resolved.
8 changes: 8 additions & 0 deletions .github/workflows/benchmark-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ on:
# listed: CI never runs it, so changing it cannot change the bytes proven
# here.
- 'Makefile'
# The guest's cargo config carries the rustflags every guest ELF is built with, so
# a change confined to it changes the bytes proven — the same reason 'syscalls/**'
# is here. Without it a config-only commit would leave main's baseline built from
# the previous flags, and every /bench until the next prover change would compare
# against it. hyperfine.yaml and pr_main.yaml hash this file into their guest-ELF
# cache keys for the same reason.
- '.cargo/config.toml'
# Uncomment to auto-run on PRs:
# pull_request:
# branches: [main]
Expand All @@ -36,6 +43,7 @@ on:
# - 'executor/**'
# - 'bin/cli/**'
# - 'syscalls/**'
# - '.cargo/config.toml'

permissions:
contents: read
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/hyperfine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
# hashes it; both lists must agree on what rebuilds the guest, or a syscalls-only
# change (a guest allocator swap, say) never gets benchmarked at all.
- 'syscalls/**'
# Same rule for the guest's cargo config: it carries the rustflags every guest
# ELF is built with, so a change confined to it recompiles the programs this job
# measures. The cache key below already hashes it.
- '.cargo/config.toml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -40,7 +44,7 @@ jobs:
id: cache
with:
path: ${{ matrix.branch }}_programs/*.elf
key: benchmarks-${{ matrix.branch }}-${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**' ) }}
key: benchmarks-${{ matrix.branch }}-${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**', '.cargo/config.toml' ) }}
restore-keys: benchmarks-${{ matrix.branch }}-

- name: Setup Rust Environment
Expand All @@ -56,7 +60,7 @@ jobs:

- name: Export benchmark hashes
id: export-hashes
run: echo "benchmark-hashes-${{ matrix.branch }}=${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**' ) }}" >> "$GITHUB_OUTPUT"
run: echo "benchmark-hashes-${{ matrix.branch }}=${{ hashFiles( 'executor/programs/bench/**', 'syscalls/**', '.cargo/config.toml' ) }}" >> "$GITHUB_OUTPUT"

build-binaries:
strategy:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pr_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
rust-elf-artifacts-

Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
rust-elf-artifacts-

Expand Down Expand Up @@ -391,7 +391,7 @@ jobs:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
rust-elf-artifacts-

Expand All @@ -409,7 +409,7 @@ jobs:
uses: actions/cache@v4
with:
path: executor/program_artifacts/recursion
key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile') }}
key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
recursion-elf-artifacts-

Expand Down Expand Up @@ -480,7 +480,7 @@ jobs:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
rust-elf-artifacts-

Expand Down Expand Up @@ -508,7 +508,7 @@ jobs:
uses: actions/cache@v4
with:
path: executor/program_artifacts/recursion
key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile') }}
key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
recursion-elf-artifacts-

Expand Down Expand Up @@ -564,7 +564,7 @@ jobs:
path: |
executor/program_artifacts/rust
executor/shared_target
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile') }}
key: rust-elf-artifacts-${{ hashFiles('executor/programs/rust/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'syscalls/**', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
rust-elf-artifacts-

Expand All @@ -581,7 +581,7 @@ jobs:
uses: actions/cache@v4
with:
path: executor/program_artifacts/recursion
key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile') }}
key: recursion-elf-artifacts-${{ hashFiles('bench_vs/lambda/**', 'prover/src/**', 'prover/Cargo.toml', 'crypto/**/src/**', 'crypto/**/Cargo.toml', 'executor/src/**', 'executor/Cargo.toml', 'syscalls/**', 'executor/programs/riscv64im-lambda-vm-elf.json', 'Makefile', '.cargo/config.toml') }}
restore-keys: |
recursion-elf-artifacts-

Expand Down
Loading