bench(recursion): measure the verifier at real query counts, over real blocks#846
bench(recursion): measure the verifier at real query counts, over real blocks#846Oppen wants to merge 5 commits into
Conversation
|
Benchmark Results for modified programs 🚀
|
|
/ai-review |
Codex Code Review
|
|
Reviewed as a static diff review (working tree is at main, so Verified correct
FYI (not blocking, out of scope for this PR) Minor
|
|
Note: |
|
Benchmark Results for unmodified programs 🚀
|
9e9f790 to
995f971
Compare
6d8c4dd to
23a96ae
Compare
|
/ai-review |
Codex Code Review
|
Review — no significant issues foundReviewed the diff (safety/security, correctness, performance, readability). This PR is almost entirely benchmark/test/build plumbing on top of the existing recursion verifier, and it's carefully done and well-documented. Verified as correct:
Note (not a finding): the Nothing blocking. |
AI ReviewPR #846 · 10 changed files Findings
Status column reflects the verdict from the verifier: deepseek-verifier (openrouter/deepseek/deepseek-v4-pro). AI-001: continuation guest calls non-existent verify_continuation_and_attest_blob (compile error)
Claim The Evidence main.rs line 100 calls Suggested fix Rename the call (and the line-19 doc-comment reference) from AI-003: test_dump_recursion_input allows blowup8 with continuation but no guest ELF exists
Claim The test accepts RECURSION_DUMP_PRESET=blowup8 with RECURSION_DUMP_EPOCH_LOG2 (continuation mode) but there's no recursion-cont-blowup8.elf built (missing from Cargo.toml [[bin]] and Makefile RECURSION_CONT_PRESETS). This creates a blob that cannot be executed. Evidence Line 978-985: test accepts any preset from Preset::ALL (includes Blowup8). Lines 1001-1020: when RECURSION_DUMP_EPOCH_LOG2 is set, it encodes a continuation blob for that preset. Cargo.toml has no recursion-cont-blowup8-bench bin. Makefile RECURSION_CONT_PRESETS := min blowup2 blowup4 (excludes blowup8). Suggested fix Either add blowup8 to RECURSION_CONT_PRESETS and the corresponding Cargo.toml bin, OR reject blowup8 in test_dump_recursion_input when RECURSION_DUMP_EPOCH_LOG2 is set (since benchmarks don't measure it). AI-005: bench_recursion_scaling.sh writes empty inner_cycles/epochs to results on failure
Claim The script uses Evidence Line 75: Suggested fix Validate ic and epochs are non-empty before writing results, or use a sentinel value like 'unknown' instead of empty string. AI-006: Preset::ALL includes Blowup8 but no continuation variant exists
Claim Preset::ALL array includes Blowup8 (line 115) but RECURSION_CONT_PRESETS and Cargo.toml bins only cover min/blowup2/blowup4. This inconsistency allows test_dump_recursion_input to accept blowup8 for continuation mode (finding #2) and could confuse users. Evidence recursion.rs lines 112-117: Preset::ALL = [Min, Blowup2, Blowup4, Blowup8]. Makefile line 74: RECURSION_CONT_PRESETS := min blowup2 blowup4. Cargo.toml lines 48-61: no recursion-cont-blowup8-bench bin. Suggested fix Either add Blowup8 continuation support (bin + build rule) or remove Blowup8 from Preset::ALL and document that continuation is only for min/blowup2/blowup4. The latter matches the comment 'Kept to the presets the recursion benchmarks actually measure'. AI-007: `bench_recursion_scaling.sh` doc claims `ethrex_bench_{1,4,8,16}.bin` are committed; only `_4` is
Claim The script's usage doc says fixtures are "read from Evidence
Suggested fix Change "(committed for 1/4/8/16)" to "(committed for 4; other sizes are generated on demand via Reviewer Lanes
Verification Lanes
Native Codex and Claude reviews run separately and post their own comments. They are not included in this structured provenance report. Discarded candidates (1) — rejected by the verifier
Raw lane outputs, candidates, final issues, and model metrics are uploaded as workflow artifacts. |
…l blocks The recursion cycle benchmark only measured MIN_PROOF_OPTIONS (blowup=2, 1 FRI query) verifying a proof of the empty program - a diagnostic floor, not the production verifier cost (blowup=2 at 128-bit is 219 queries, and real inner proofs are multi-epoch continuation bundles of real blocks). Presets and guests: - Preset::Blowup2 (219 q) / Blowup4 (110 q) - the realistic base-layer regimes - alongside the existing Min/Blowup8; one guest ELF per preset. - bench_vs/lambda/recursion's `continuation` guest feature: verify a whole ContinuationProof bundle in-VM (recursion-cont-<preset>.elf), built on the continuation supplied-roots verify path and the zero-copy continuation guest API from the prior two PRs. Benchmark plumbing: - test_dump_recursion_input gains env knobs: RECURSION_DUMP_PRESET, RECURSION_DUMP_INNER_ELF/INPUT (any inner program, e.g. ethrex blocks), RECURSION_DUMP_EPOCH_LOG2 (continuation mode). - scripts/bench_recursion_cycles.sh: preset-aware dump, --release test invocations, per-preset regime labels; /bench-verify now posts min + blowup2 + blowup4 tables. - scripts/bench_recursion_scaling.sh: block-size x preset ladder over the committed ethrex fixtures (1/4/8/16 transfers). - A real-block detailed profile test (blowup=4, 4 transfers) plus a `make test-profile-recursion-block` target, since cycle counts across every preset/block size are already covered by the scripts above.
Address PR review feedback:
- build_guest_elf: pass --bin so a continuation build's superset
features (`continuation min`) don't also rebuild the plain preset's
bin into the same shared target-dir path a concurrent `make -j` job
is writing to.
- drop redundant ethrex_bench_{1,8,16}.bin fixtures (only _4 is read
by tests); bench_recursion_scaling.sh regenerates them on demand.
- bench_recursion_scaling.sh: don't let one failed cycle-count/grep
abort the whole sweep under `set -e`; clean up its temp dir.
- recursion.rs docs: list blowup4 among the fixed-preset ELFs.
- recursion profile tests: check the guest's actual committed
attestation against a trusted host recompute, not just that it ran
without crashing — covers both the monolithic and continuation
(real ethrex block) profile paths.
0bab2ac to
ed9d34f
Compare
Summary
Stacked on #845. The recursion cycle benchmark only measured
MIN_PROOF_OPTIONS(blowup=2, 1 FRI query) verifying a proof of the empty program — a diagnostic floor, not the production verifier cost (blowup=2 at 128-bit is 219 queries, and real inner proofs are multi-epoch continuation bundles of real blocks).Presets and guests:
Preset::Blowup2(219 q) /Blowup4(110 q) — the realistic base-layer regimes — alongside the existing Min/Blowup8; one guest ELF per preset.bench_vs/lambda/recursion'scontinuationguest feature: verify a wholeContinuationProofbundle in-VM (recursion-cont-<preset>.elf), built on feat(recursion): supply DECODE/global-memory-genesis roots via private input for continuation verify #844/perf(prover): verify continuation proofs in place via rkyv #845's continuation supplied-roots verify path and zero-copy guest API.Benchmark plumbing:
test_dump_recursion_inputgains env knobs:RECURSION_DUMP_PRESET,RECURSION_DUMP_INNER_ELF/INPUT(any inner program, e.g. ethrex blocks),RECURSION_DUMP_EPOCH_LOG2(continuation mode).scripts/bench_recursion_cycles.sh: preset-aware dump,--releasetest invocations, per-preset regime labels;/bench-verifynow posts min + blowup2 + blowup4 tables.scripts/bench_recursion_scaling.sh: block-size × preset ladder over the committed ethrex fixtures (1/4/8/16 transfers).make test-profile-recursion-blocktarget, since cycle counts across every preset/block size are already covered by the scripts above.Note: this branch currently includes a cherry-picked copy of #843's commit (
fix(syscalls): raise the private-input clamp to 512 MiB) so the real-block tests are runnable now (real blocks exceed the old 64 MiB cap). That commit will disappear from this diff once #843 merges and this branch is rebased onto the updated base.Test plan
cargo test -p lambda-vm-prover --lib(516 passed)test_recursion_profile_blowup4_blockrun end-to-end against a real 4-tx ethrex block (not just compiled) — produced the full cycle/step/function breakdowncargo clippy --all-targets -- -D warnings/cargo fmt --checkmake -n test-profile-recursion-blockresolves the full build graph correctly