feat: enable recursion#742
Conversation
|
/ai-review |
Codex Code ReviewFound 2 issues:
|
b628a1d to
619e262
Compare
|
/bench |
619e262 to
fcf20ef
Compare
Codex Code ReviewFindings
Notes I reviewed only the PR diff and nearby dependencies. I did not build or run tests per the static-review constraints. |
|
Benchmark Results for modified programs 🚀
|
Review: feat: enable recursionReviewed the non-generated changes (skipping Verified as correct (called out because they looked risky at first glance)
Medium — build/CI coupling worth confirming is intentional
Low — stale/misleading comments (inline)
Minor
Nice touch: switching the guest |
Benchmark — ethrex 20 transfers (median of 3)Table parallelism: auto (cores / 3)
Commit: 90a942f · Baseline: cached · Runner: self-hosted bench |
AI ReviewPR #742 · 17 changed files Findings
Status column reflects the verdict from the verifier: deepseek-verifier (openrouter/deepseek/deepseek-v4-pro). AI-001: MAX_PRIVATE_INPUT_SIZE 10x bump dramatically increases executor/prover memory footprint
Claim The bump from 6.7 MiB to 64 MiB makes Evidence executor/src/vm/memory.rs:48 sets MAX_PRIVATE_INPUT_SIZE=6410241024; memory.rs:258-273 set_bytes_aligned inserts one HashMap entry per 4-byte chunk (16M for 64 MiB); prover/src/tables/trace_builder.rs:1856 build_initial_image builds a HashMap<u64,u8> with one entry per byte; prover/src/paged_mem.rs:43-46 PagedMem stores (u64, Page<T>) with Page.data sized DEFAULT_PAGE_SIZE. Suggested fix Document expected memory usage, gate recursion on a runtime/CI knob, or process private input page-by-page through set_bytes_aligned instead of inserting all 16M cells into one HashMap. AI-002: Magic-number expected output in test_random
Claim The test now hard-codes Evidence executor/programs/rust/random/src/main.rs calls Suggested fix Either add a brief comment explaining that 116 is the first byte of StdRng with the documented seed (and pin the rand version + StdRng algorithm in a comment), or replace the magic number with AI-003: FORCE dependency forces cargo re-run for every make invocation
Claim All three guest build rules (rust programs, bench, recursion-elfs) declare Evidence Makefile lines 119, 123, 145-149 all use Suggested fix This is a deliberate trade-off — flagging only because it adds ~cargo-startup seconds to every CI invocation that runs AI-004: Misleading comment about default-features dropping sysinfo
Claim The comment says Evidence prover/Cargo.toml lines 8 and 24: Suggested fix Correct the comment to state that only AI-005: commit_public_output reports CommitSizeExceeded on u64 length overflow
Claim
Evidence executor/src/vm/memory.rs:206-211: Suggested fix Either drop the AI-006: test_random asserts a hard-coded byte that depends on rand internals
Claim
Evidence executor/tests/rust.rs:203 expects vec![116]; syscalls/src/random.rs:53 fills via Suggested fix Either assert a property (e.g., the same value across two runs) or pin a comment marking the value as rand-version-dependent and re-verify on upgrades; better, replace the deterministic backend with a counter-based one whose output the test can read directly. AI-007: num_private_input_pages max bound formula is off by ~2
Claim The verifier's bound Evidence prover/src/lib.rs:966-975 uses Suggested fix Use the exact page count ( AI-008: Dead/unused getrandom_v2 dependency in syscalls
Claim
Evidence Grep across syscalls/src/*.rs finds no Suggested fix Delete the getrandom_v2 line from syscalls/Cargo.toml. If it was kept intentionally as scaffolding for a future v0.2 backend, leave a TODO comment — but as written it is just dead weight in the dep graph. AI-009: Custom getrandom backend assumes single-threaded + std::sync::Mutex under lower-atomic
Claim
Evidence syscalls/src/random.rs line 51 locks Suggested fix Add a brief comment noting that the lock is only sound because the target is single-threaded and atomics are lowered; or use a 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. Raw lane outputs, candidates, final issues, and model metrics are uploaded as workflow artifacts. |
fcf20ef to
c8c440d
Compare
|
/ai-review |
c8c440d to
a74abf7
Compare
Codex Code ReviewFinding
I did not run builds or tests, per the static-review constraints. |
Review: feat: enable recursionSolid, well-documented experimental enablement PR. No safety/memory-safety issues found in the Rust/ FindingsBuild cost (Medium) — see inline on Design / soundness note (Low, expected for "naive" recursion) Stale comment (Low) — Comment accuracy (Low) — see inline on Looked at and OK
|
- Introduces smoke test with verification of empty program - Implements `__getrandom_v03_custom` to avoid panics when accessing hashmaps - Updated test to expect deterministic output by inspecting the current output
a74abf7 to
90a942f
Compare
|
/ai-review |
|
/bench |
Codex Code ReviewFindings Medium - Security: syscalls/src/random.rs now makes Medium - Performance/CI: Makefile adds Low - Performance: Makefile changes all existing Rust guest artifact rules to depend on I did not run builds or tests per the static-review constraints. |
Review: feat: enable recursion (#742)Reviewed the full diff plus surrounding code ( Low
Verified clean
The recursion tests are all |
- Collapse the three byte-identical guest-ELF pattern recipes (rust, bench, recursion) into a single `build_guest_elf` canned recipe parameterized by source dir ($1) and built-binary name suffix ($2). The cargo invocation was identical across all three; only the directory and the `-bench` copy suffix differed. Verified with `make -n` that the rust/bench rules still copy `release/<stem>` and the recursion rule copies `release/<stem>-bench`. - Clarify the compile-programs NOTE: the recursion smoke tests are #[ignore]d (not run by `make test`/`test-executor`, only `test-prover-all`), but their guest ELFs are still compiled on every build so they keep building. - recursion_smoke_test: the pre-check asserted `blob.len() < MAX_PRIVATE_INPUT_SIZE` while the executor rejects only `len > MAX` (memory.rs:228), so a blob exactly at the cap is accepted by the VM but would have failed the test guard. Use `<=`.
Makefile cleanup + recursion test guard fix (follow-ups to #742)
Summary
bench_vs/lambda/:empty(no_std halt, inner program under test) andrecursion(std verifier guest that deserializes a postcard-encoded(VmProof, elf, ProofOptions)and callsverify_with_options).compile-recursion-elfs/clean-recursion-elfstargets;test-prover-alldepends oncompile-recursion-elfs.MAX_PRIVATE_INPUT_SIZEfrom 6.7 MB → 64 MiB to fit a realVmProofas private input.ProofOptionsfrom the prover crate so the verifier guest can name it without a directstarkdep.prover/src/tests/recursion_smoke_test.rswith ignored tests at two tiers: execute-only (in-VM verify, skips outer STARK prove) and full-prove (outer proof + host verify).HashMapaccess in the guestHow to test
Build the guest ELFs first:
Run the cheapest regression guard (host-only encode/decode + verify, seconds):
Execute-only tier (in-VM verify, no outer prove, tens of GB RAM):
Full pipeline (outer STARK prove + verify, ~125 GB RAM):
Or via make (builds ELFs + runs all ignored prover tests):