perf(verifier): verify STARK proofs in place via rkyv#769
Conversation
|
Benchmark Results for modified programs 🚀
|
There was a problem hiding this comment.
Moved out of the main workspace due to rkyv/unaligned feature bubbling up to lambda_vm. Not actually deleted.
a5515d1 to
65f990f
Compare
crypto/stark: StarkProof, MultiProof, FriDecommitment, BusPublicInputs, Table, PolynomialOpenings, and DeepPolynomialOpening dual-derive rkyv alongside serde. The verifier operates over a StarkProofView (owned or an rkyv-archived buffer read in place); multi_verify and multi_verify_archived both build the matching view and share one verification implementation, so neither the owned nor the archived path pays a serialization cost. prover: the recursion guest verifies its inner proof straight from the mmapped private-input region via a 12-byte aligning magic/version prefix, with no deserialization pass. Continuation and CLI verification go through the same proof-view path. executor/syscalls: get_private_input_slice() borrows the private input in place instead of copying it into a Vec. bin/cli: proof file persistence uses rkyv instead of bincode. tooling/ethrex-tests: ethrex's guest tests move into their own detached workspace, since ethrex pulls in rkyv's "unaligned" feature which cannot coexist with the root workspace's "aligned" feature in one resolved dependency graph.
ea14eeb to
2e68711
Compare
|
/ai-review |
|
/bench |
Codex Code ReviewFindings
No build or tests run, per the static-review constraints. |
Benchmark — ethrex 20 transfers (median of 3)Table parallelism: auto (cores / 3)
Commit: 2e68711 · Baseline: cached · Runner: self-hosted bench |
Review:
|
AI ReviewPR #769 · 39 changed files
FindingsNo non-rejected structured findings were reported. Reviewer 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. |
Verifies STARK proofs in place via rkyv, without dropping serde or duplicating the verifier.
Design
crypto/stark/src/proof/view.rsadds a borrowedStarkProofView(and nestedTable/FriDecommitment/DeepPolynomialOpening/PolynomialOpeningsviews), each constructibleOwned(&T)orArchived(&ArchivedT). Scalars are copied out (to_native()vs. a plain copy); field-element/commitment arrays stay borrowed either way (slice_as_nativeon the archived side). The verifier (crypto/stark/src/verifier.rs) is written once against this view.multi_verify(owned) andmulti_verify_archived(archived) are thin constructors that build the matching view and share every check — no serialize-then-delegate step, no duplicated logic.StarkProof,MultiProof,FriDecommitment,BusPublicInputs,Table,PolynomialOpenings, andDeepPolynomialOpeningdual-deriveserdealongsiderkyv, so existing serde-based call sites (examples CLI, disk-spill table serialization) are unaffected. Only the STARK proof wire format used by the prover/CLI/recursion guest moved from bincode to rkyv.program_iddesign (this branch's approach, not a vkey digest). The private-input blob gets a 12-byteLVMRmagic/version prefix so the rkyv archive lands 16-aligned in guest memory (the mapped payload itself is only 4-aligned); this prefix is local to the recursion blob and does not change the global private-input ABI (PRIVATE_INPUT_START + 4is unchanged for every other guest). The guest borrows the blob in place (get_private_input_slice) and verifies straight from the archive — no deserialization pass.unalignedfeature, which cannot coexist with this workspace'salignedfeature in one resolved dependency graph. Its host-reference tests move to a detached workspace,tooling/ethrex-tests(owncargo test), isolating Cargo.lock resolution.Numbers
Recursion verifier guest, inner
emptyproof (make test-profile-recursion-single/-multi), measured against this branch's pre-rkyv commit (db2bfa8b):Regression check: regular (non-recursion) verify path
multi_verify's owned path no longer serializes to reach the shared implementation (it used to archive-then-delegate); checked this isn't a wash or regression viacargo bench -p stark --bench prover_benchmark --features test-utils -- quick, comparing this branch againstmain:No regression on the regular verify path — dropping the serialization step is a small net win there too.
provetimes are unchanged (within noise) on all three configs, as expected (prove was never touched).Verification
Full workspace suite green:
cargo test -p stark --lib(188, +193 withdisk-spill),cargo test -p lambda-vm-prover --lib(509, incl. continuation and recursion smoke tests),cargo test -p executor,tooling/ethrex-tests.cargo clippy -D warningsclean on both stark feature configurations.cargo build --workspaceclean.