feat(recursion): supply DECODE/global-memory-genesis roots via private input for continuation verify#844
Conversation
…e input for continuation verify Mirrors #782's monolithic mechanism for the continuation path: a caller (the recursion guest) can supply the DECODE preprocessed root and each touched data page's genesis root instead of the verifier recomputing them from the ELF, skipping the in-VM FFT + Merkle build. Supplied roots are used verbatim; the binding shifts to the consumer's recompute-and-compare of the folded identity, exactly like the monolithic path. verify_global's genesis-page classification (ELF-backed vs zero-init) is derived from ELF segment address ranges instead of materializing a full byte-level image when roots are supplied, since the real bytes are never read once a root covers that page. Page lookups are keyed by page number (page_base >> log2(page_size)) rather than the raw page-aligned address, since the low bits are always zero. verify_continuation keeps its existing signature (trustless recompute); verify_continuation_with_roots is the new supplied-roots entry point, and continuation_precomputed_commitments lets a caller derive the roots to supply for a given bundle.
|
/ai-review |
Codex Code Review
|
|
Review — supplied-roots continuation verify Reviewed for safety/soundness, bugs, performance, and readability. This is a careful, well-documented change that faithfully mirrors the monolithic supplied-roots path (PR #782) onto the continuation verifier. No critical/high issues found. Soundness (looks correct)
Minor
Nits (non-blocking)
Nothing blocking from my side. |
AI ReviewPR #844 · 2 changed files Findings
Status column reflects the verdict from the verifier: deepseek-verifier (openrouter/deepseek/deepseek-v4-pro). AI-003: Misleading instruction numbering in data_page_touch.s
Claim The numbering comments only label the four main instructions (# 1–4) and then jump to "# 5: Halt" on the Evidence Lines 12–19: comments "# 1", "# 2", "# 3", "# 4" precede 4 instructions, then Suggested fix Rename the trailing comment to AI-004: Doc comment for new `preprocessed` parameter appended to unrelated AIR-design doc block
Claim The new doc for Evidence Lines 200–214: existing AIR design doc. Lines 215–218: new Suggested fix Either start a new AI-009: No negative test for non-page-aligned entries in page_genesis_commitments
Claim
Evidence Lines 1131–1139 are new code in this PR (let-chain check) without a matching Suggested fix Add a sibling test (e.g. 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 (5) — rejected by the verifier
Raw lane outputs, candidates, final issues, and model metrics are uploaded as workflow artifacts. |
…lied-roots page path verify_global now hard-rejects a missing page_genesis_commitments entry instead of relying on a debug_assert!, and validates alignment of the caller-supplied bases the same way touched_page_bases already is. Corrects two comments that claimed genesis "cannot be prover-chosen" without qualifying the supplied-roots exception. Drops the page-number rekeying (PAGE_SIZE_LOG2/page_number) added for a HashMap that never needed it under std's SipHash; keys by raw page_base like the monolithic path instead. Adds a data_page_touch asm fixture (a real ELF .data page, unlike the stack-only fixtures used elsewhere) so the supplied-roots test actually exercises the ELF-data-page branch, with tamper/all-zero rejection cases, plus a lock test asserting classify-only and byte-level page classification agree.
…uted_commitments Mirrors the check verify_continuation_with_roots already applies: bundle is untrusted (rkyv-deserialized), and num_private_input_pages feeds a page_size multiplication downstream in is_private_input_page.
|
/ai-review |
Codex Code Review
|
|
Reviewed the full diff with a focus on the supplied-roots soundness. No significant issues found — this is a clean, well-tested change. What I verified:
Minor (optional, non-blocking): extra |
|
On Codex feedback:
|
…e input for continuation verify (#844) * feat(recursion): supply DECODE/global-memory-genesis roots via private input for continuation verify Mirrors #782's monolithic mechanism for the continuation path: a caller (the recursion guest) can supply the DECODE preprocessed root and each touched data page's genesis root instead of the verifier recomputing them from the ELF, skipping the in-VM FFT + Merkle build. Supplied roots are used verbatim; the binding shifts to the consumer's recompute-and-compare of the folded identity, exactly like the monolithic path. verify_global's genesis-page classification (ELF-backed vs zero-init) is derived from ELF segment address ranges instead of materializing a full byte-level image when roots are supplied, since the real bytes are never read once a root covers that page. Page lookups are keyed by page number (page_base >> log2(page_size)) rather than the raw page-aligned address, since the low bits are always zero. verify_continuation keeps its existing signature (trustless recompute); verify_continuation_with_roots is the new supplied-roots entry point, and continuation_precomputed_commitments lets a caller derive the roots to supply for a given bundle. * fix(recursion): reject spurious rejects/collisions and cover the supplied-roots page path verify_global now hard-rejects a missing page_genesis_commitments entry instead of relying on a debug_assert!, and validates alignment of the caller-supplied bases the same way touched_page_bases already is. Corrects two comments that claimed genesis "cannot be prover-chosen" without qualifying the supplied-roots exception. Drops the page-number rekeying (PAGE_SIZE_LOG2/page_number) added for a HashMap that never needed it under std's SipHash; keys by raw page_base like the monolithic path instead. Adds a data_page_touch asm fixture (a real ELF .data page, unlike the stack-only fixtures used elsewhere) so the supplied-roots test actually exercises the ELF-data-page branch, with tamper/all-zero rejection cases, plus a lock test asserting classify-only and byte-level page classification agree. * fix(recursion): bound num_private_input_pages in continuation_precomputed_commitments Mirrors the check verify_continuation_with_roots already applies: bundle is untrusted (rkyv-deserialized), and num_private_input_pages feeds a page_size multiplication downstream in is_private_input_page.
Summary
Mirrors #782's monolithic mechanism for the continuation path: a caller (the recursion guest) can supply the DECODE preprocessed root and each touched data page's genesis root instead of the verifier recomputing them from the ELF, skipping the in-VM FFT + Merkle build. Supplied roots are used verbatim; the binding shifts to the consumer's recompute-and-compare of the folded identity, exactly like the monolithic path.
verify_global's genesis-page classification (ELF-backed vs zero-init) is derived from ELF segment address ranges instead of materializing a full byte-level image when roots are supplied, since the real bytes are never read once a root covers that page.page_base >> log2(page_size)) rather than the raw page-aligned address, since the low bits are always zero.verify_continuationkeeps its existing signature (trustless recompute);verify_continuation_with_rootsis the new supplied-roots entry point, andcontinuation_precomputed_commitmentslets a caller derive the roots to supply for a given bundle.This PR does not change the wire format or add a guest-facing API — that's
perf/continuation-rkyv-zero-copy, stacked on top of this one.Test plan
cargo test -p lambda-vm-prover --lib(515 passed)test_verify_continuation_with_supplied_roots— supplied-roots verify matches the trustless recompute, and a tampered supplied root is rejectedcargo clippy --all-targets -- -D warnings/cargo fmt --check