Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0dfb9d9
bench: the benchmark CLI moves to bench/ as leanvm-bench, its harness…
TomWambsgans Nov 17, 2026
4ac4144
thread count: set in code, LEANVM_NUM_THREADS removed
TomWambsgans Nov 17, 2026
7a784f0
sidecar: leanvm-sidecar proves `aggregate` for local clients over a U…
TomWambsgans Nov 17, 2026
d0380fa
sidecar: a verify operation, for clients without the library, taken f…
TomWambsgans Nov 17, 2026
176446d
sidecar: warm up before serving, taken from #768
TomWambsgans Nov 17, 2026
cbe67fc
review fixes: bench.sh runs from the repo root again, and doc touch-ups
TomWambsgans Nov 17, 2026
97b5184
AGENTS.md: the verifier's Keccak under Zen 4 tuning
TomWambsgans Nov 17, 2026
9e31e9e
sidecar: a client that builds no prover, proving and verifying throug…
TomWambsgans Nov 17, 2026
0f4bd54
sidecar: warm up at rate 1/4, the README's hello as the client checks…
TomWambsgans Nov 18, 2026
c6e8de3
review fixes: the no-prover lint over every target, the thread count …
TomWambsgans Nov 18, 2026
a435328
final review fixes: the child count refused before decoding, AGENTS.m…
TomWambsgans Nov 18, 2026
3fa4f3b
thread count: the help texts lose the experimental caveat, now that b…
TomWambsgans Nov 18, 2026
64f05f4
sidecar: the max request is a constant, 64 MiB, and --max-request-mib…
TomWambsgans Nov 18, 2026
79133ac
sidecar: no --tracing, which the benchmark CLI covers
TomWambsgans Nov 18, 2026
a6e83f3
allocator: jemalloc and its configuration in a crate of their own, so…
TomWambsgans Nov 18, 2026
f24a7d0
sidecar README
TomWambsgans Nov 18, 2026
e70f14d
sidecar: at most 16 connections at once, so the memory requests hold …
TomWambsgans Nov 18, 2026
ee2dff3
sidecar README: the connection cap without its memory, and no supervi…
TomWambsgans Nov 18, 2026
9ed3b2c
lean_vm: two exclusive modes, `prover` (the default) or `sidecar`
TomWambsgans Nov 18, 2026
eb678f5
add todo
TomWambsgans Nov 18, 2026
787f09d
lean_vm: stable by default, `experimental_prover` or `sidecar`; the s…
TomWambsgans Nov 18, 2026
b3d8694
sidecar: `serve` takes the socket and the thread count, no Config dup…
TomWambsgans Nov 18, 2026
1ddcb3e
sidecar client: `connect` takes only the socket, waiting as long as t…
TomWambsgans Nov 18, 2026
55e5a0a
sidecar test: verify only through the sidecar, as a client does
TomWambsgans Nov 18, 2026
b72bbcb
doc
TomWambsgans Nov 18, 2026
43c8628
lean_vm: prover.rs is in_process.rs, the counterpart of the sidecar mode
TomWambsgans Nov 18, 2026
00be740
final review fixes: the experimental pool test tests again, no progra…
TomWambsgans Nov 18, 2026
5be8c39
simplify
TomWambsgans Nov 18, 2026
cdd01ee
guest-export: machete ignores `claims`, used by the aggregation sourc…
TomWambsgans Nov 18, 2026
00892e1
sidecar: the lock file is opened without following a symlink or waiti…
TomWambsgans Nov 18, 2026
afe13b0
sidecar client: one 16 MiB room for every response, beyond the reques…
TomWambsgans Nov 18, 2026
0cb3ac8
docs: AGENTS.md's x86 check and allocator row hold again, the sidecar…
TomWambsgans Nov 18, 2026
0143ec2
lean_vm: MAX_RECURSIONS in every mode, so a sidecar client building a…
TomWambsgans Nov 18, 2026
0650637
Merge remote-tracking branch 'origin/main' into sidecar
TomWambsgans Nov 18, 2026
1822b56
sidecar: a Go client, tested in CI against the sidecar
TomWambsgans Nov 18, 2026
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
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
testall = ["test", "--release", "--workspace"]
clippyall = ["clippy", "--release", "--workspace", "--all-targets", "--", "-D", "warnings"]
docall = ["doc", "--release", "--workspace", "--no-deps"]
leanvm = ["run", "--release", "-p", "leanvm-cli", "--"]
leanvm-bench = ["run", "--release", "-p", "leanvm-bench", "--"]

[build]
rustdocflags = ["-D", "warnings"]
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ jobs:
run: cargo test --release -p keccak256
env:
RUSTFLAGS: -C target-cpu=x86-64
- uses: actions/setup-go@v5
with:
go-version-file: bins/leanvm-sidecar/clients/go/go.mod
# Against the sidecar `cargo testall` built.
- name: Test (the sidecar's Go client)
working-directory: bins/leanvm-sidecar/clients/go
run: |
test -z "$(gofmt -l .)"
go vet ./...
socket=$RUNNER_TEMP/sidecar.sock
../../../../target/release/leanvm-sidecar --socket "$socket" &
until [ -S "$socket" ]; do kill -0 $! && sleep 1; done
LEANVM_SIDECAR_SOCKET=$socket go test -count=1 ./...

# The NEON kernels, as bench.yml's arm64 testbed builds them: the x86 job's haswell reaches none of them.
test-arm64:
Expand All @@ -64,8 +77,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippyall
- name: Clippy (the API on the experimental prover)
run: cargo clippy --release -p lean_vm --all-targets --features experimental_prover -- -D warnings
- name: Clippy (the API and the sidecar on the experimental prover)
run: cargo clippy --release -p lean_vm -p leanvm-sidecar --all-targets --features experimental_prover -- -D warnings
- name: Clippy (the API in its sidecar mode)
run: cargo clippy --release -p lean_vm --all-targets --features sidecar -- -D warnings

# Clippy type-checks every arm the ISA selects, so it also does `cargo check`'s work.
# Nothing runs: GitHub's x86-64 runners do not reliably have AVX-512.
Expand Down
34 changes: 18 additions & 16 deletions AGENTS.md

Large diffs are not rendered by default.

68 changes: 59 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
[workspace]
members = [
"crates/verifier",
"crates/bench",
"crates/allocator",
"crates/bench_harness",
"crates/keccak256",
"crates/fiat_shamir_prover",
"crates/isa",
"crates/zkdsl_compiler",
"crates/lean_xmss",
"crates/lean_sphincs",
"crates/lean_da",
"crates/claims",
"crates/aggregation",
"crates/lean_vm",
"crates/sidecar",
"crates/stable_prover/*",
"crates/experimental_prover/*",
"bench",
"bins/*",
]
resolver = "3"
Expand All @@ -26,8 +30,13 @@ edition = "2024"
needless_range_loop = "allow"
too_many_arguments = "allow"

# With its `sidecar` feature, `lean_vm` still builds its prover, unused; CI's `cargo machete` finds unused dependencies.
[workspace.lints.cargo]
unused_dependencies = "allow"

[workspace.dependencies]
bench = { path = "crates/bench" }
allocator = { path = "crates/allocator" }
bench_harness = { path = "crates/bench_harness" }
verifier = { path = "crates/verifier" }
keccak256 = { path = "crates/keccak256" }
fiat_shamir_prover = { path = "crates/fiat_shamir_prover" }
Expand All @@ -36,7 +45,9 @@ zkdsl_compiler = { path = "crates/zkdsl_compiler" }
lean_xmss = { path = "crates/lean_xmss" }
lean_sphincs = { path = "crates/lean_sphincs" }
lean_da = { path = "crates/lean_da" }
claims = { path = "crates/claims" }
aggregation = { path = "crates/aggregation" }
sidecar = { path = "crates/sidecar" }
libc = "0.2"
rand = "0.9"
sha3 = "0.11"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ In the short term, we provide two Rust implementations of the prover, `stable` (
The leanXMSS parameters are specified in [leanXMSS.pdf](https://github.com/leanEthereum/leanVM/releases/download/doc-latest/leanXMSS.pdf), with a [security proof in Lean 4](formal/statement.tex). **This is not the definitive parameter set.**

```bash
cargo leanvm --prover experimental aggregate --xmss 1400 --log-inv-rate 2 --repeat 3
cargo leanvm-bench --prover experimental aggregate --xmss 1400 --log-inv-rate 2 --repeat 3
```

```
Expand All @@ -87,7 +87,7 @@ aggregation, 1,400 leanXMSS signatures
The leanSPHINCS parameters are specified in [leanSPHINCS.pdf](https://github.com/leanEthereum/leanVM/releases/download/doc-latest/leanSPHINCS.pdf), with a [security proof in Lean 4](formal/statement.tex). **This is not the definitive parameter set.**

```bash
cargo leanvm --prover experimental aggregate --sphincs 500 --log-inv-rate 1 --repeat 3
cargo leanvm-bench --prover experimental aggregate --sphincs 500 --log-inv-rate 1 --repeat 3
```

```
Expand All @@ -103,7 +103,7 @@ aggregation, 500 leanSPHINCS signatures
### data availability

```bash
cargo leanvm --prover experimental aggregate --blobs 32 --log-inv-rate 1 --repeat 3
cargo leanvm-bench --prover experimental aggregate --blobs 32 --log-inv-rate 1 --repeat 3
```

```
Expand All @@ -119,7 +119,7 @@ aggregation, 32 blobs
### recursion

```bash
cargo leanvm --prover experimental recursion --n 2 --xmss-per-leaf 1400 --leaf-log-inv-rate 2 --log-inv-rate 1 --repeat 3
cargo leanvm-bench --prover experimental recursion --n 2 --xmss-per-leaf 1400 --leaf-log-inv-rate 2 --log-inv-rate 1 --repeat 3
```

```
Expand Down Expand Up @@ -154,7 +154,7 @@ Keccak GKR batch proving, 1,048,576 permutations, a state committed every 12 rou
### Fibonacci

```bash
cargo leanvm --prover experimental fibonacci --n 2000000 --log-inv-rate 1 --repeat 3
cargo leanvm-bench --prover experimental fibonacci --n 2000000 --log-inv-rate 1 --repeat 3
```

```
Expand Down
11 changes: 6 additions & 5 deletions bins/leanvm/Cargo.toml → bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "leanvm-cli"
name = "leanvm-bench"
version.workspace = true
edition.workspace = true
publish = false

[[bin]]
name = "leanvm"
name = "leanvm-bench"
path = "src/main.rs"
# A binary, nothing to document.
doc = false
Expand All @@ -21,9 +21,10 @@ lean_da.workspace = true
zkdsl_compiler.workspace = true
lean_xmss.workspace = true
lean_sphincs.workspace = true
stable_lean_vm_core = { path = "../../crates/stable_prover/lean_vm_core" }
experimental_lean_vm_core = { path = "../../crates/experimental_prover/lean_vm_core" }
bench.workspace = true
stable_lean_vm_core = { path = "../crates/stable_prover/lean_vm_core" }
experimental_lean_vm_core = { path = "../crates/experimental_prover/lean_vm_core" }
allocator.workspace = true
bench_harness.workspace = true
rand.workspace = true
tracing.workspace = true
clap = { version = "4", features = ["derive"] }
16 changes: 8 additions & 8 deletions bins/leanvm/bench.sh → bench/bench.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
# Runs leanXMSS aggregation and 16-to-1 recursion at 4 and 8 threads and at the default pool ("full"), and prints a table of
# proving time and peak RSS per benchmark and thread count.
# Usage: [BENCH_THREADS="4 8 full"] bins/leanvm/bench.sh stable|experimental [log file] (default: .build/bench-<timestamp>.log)
# Usage: [BENCH_THREADS="4 8 full"] bench/bench.sh stable|experimental [log file] (default: .build/bench-<timestamp>.log)
set -uo pipefail

PROVER=${1:-}
case $PROVER in stable | experimental) ;; *) echo "usage: bins/leanvm/bench.sh stable|experimental [log file]" >&2; exit 2 ;; esac
case $PROVER in stable | experimental) ;; *) echo "usage: bench/bench.sh stable|experimental [log file]" >&2; exit 2 ;; esac

cd "$(dirname "$0")/../.."
cd "$(dirname "$0")/.."
mkdir -p .build
LOG="${2:-$PWD/.build/bench-$(date +%Y%m%d-%H%M%S).log}"
RESULTS=$(mktemp)
Expand All @@ -27,17 +27,17 @@ measure() {

run() {
local label=$1 threads=$2; shift 2
local pool=(env LEANVM_NUM_THREADS="$threads")
[ "$threads" = full ] && pool=(env -u LEANVM_NUM_THREADS)
echo "=== ${pool[*]:1} leanvm --prover $PROVER $* --cooldown 5 ===" | tee -a "$LOG"
"${pool[@]}" "${CARGO_TARGET_DIR:-target}/release/leanvm" --prover "$PROVER" "$@" --cooldown 5 2>&1 | tee "$OUT" | tee -a "$LOG"
local count=$threads
[ "$threads" = full ] && count=0
echo "=== leanvm-bench --prover $PROVER $* --threads $count --cooldown 5 ===" | tee -a "$LOG"
"${CARGO_TARGET_DIR:-target}/release/leanvm-bench" --prover "$PROVER" "$@" --threads "$count" --cooldown 5 2>&1 | tee "$OUT" | tee -a "$LOG"
printf '%s\t%s\t%s\n' "$label" "$threads" "$(measure)" >>"$RESULTS"
echo | tee -a "$LOG"
}

read -ra THREADS <<<"${BENCH_THREADS:-4 8 full}"

cargo build --release -p leanvm-cli || exit 1
cargo build --release -p leanvm-bench || exit 1

for t in "${THREADS[@]}"; do
run "aggregate, 1400 leanXMSS, rate 2" "$t" aggregate --xmss 1400 --log-inv-rate 2 --repeat 3
Expand Down
Loading
Loading