feat(verifier-ray): vanishing query check using codegen#3271
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a Zig-side vanishing quotient (“global constraint”) verifier in verifier-ray, backed by Go code generation that extracts prover-ray’s compiled global.Verifier metadata into a compact vanishing.System (comptime) representation, plus fixture generation and Zig tests to keep verifier behavior aligned with prover-ray.
Changes:
- Add
verifier-ray/src/query/vanishing.zigimplementing vanishing quotient identity verification over generated metadata (including static vs dynamic module sizing). - Add Go
verifier-ray/codegenpackage to extract/render vanishing systems to Zig, and extend the testdata generator to emit vanishing fixtures. - Add Zig unit tests and build/test wiring to compile and run vanishing fixture scenarios.
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| verifier-ray/testdata/generate/main.go | Extends generator to build vanishing fixtures and emit testdata/generated/vanishing.zig. |
| verifier-ray/testdata/generate/go.mod | Adds dependency on verifier-ray/codegen via local replace, bumps prover-ray version. |
| verifier-ray/testdata/generate/go.sum | Updates sums after prover-ray bump and new codegen dependency. |
| verifier-ray/test/vanishing_test.zig | Adds fixture-driven tests for honest/invalid vanishing quotient scenarios and dynamic module-size validation. |
| verifier-ray/test/all.zig | Registers the new vanishing test file. |
| verifier-ray/src/query/vanishing.zig | New Zig verifier implementation for vanishing quotient checks over a generated comptime System. |
| verifier-ray/src/lib.zig | Exposes query.vanishing from the public library module tree. |
| verifier-ray/src/field/koalabear_ext.zig | Adds powComptime to support compile-time specialized exponentiation. |
| verifier-ray/Makefile | Updates verify-testdata to cover all generated Zig fixtures (including new vanishing fixtures). |
| verifier-ray/docs/vanishing-pcs-integration-notes.md | Documents current fixture trust assumptions and PCS integration follow-ups. |
| verifier-ray/docs/system-codegen.md | Documents how codegen extracts prover-ray metadata and why comptime traversal matters. |
| verifier-ray/docs/global-constraint.md | Documents the quotient identity and the verifier-side checking steps. |
| verifier-ray/codegen/vanishing.go | New extractor building a VanishingSystem from compiled global.Verifier actions. |
| verifier-ray/codegen/vanishing_zig.go | New Zig renderer for extracted vanishing systems using templates. |
| verifier-ray/codegen/vanishing_test.go | Adds unit tests for extraction and Zig rendering behavior. |
| verifier-ray/codegen/go.mod | Introduces a dedicated Go module for codegen with pinned prover-ray dependency. |
| verifier-ray/codegen/go.sum | Adds sums for the new codegen module’s dependency graph. |
| verifier-ray/build.zig | Wires generated vanishing fixtures into the Zig test build via a new module import. |
YaoJGalteland
left a comment
There was a problem hiding this comment.
The core implementation is correct and the architecture is solid. we can work on the coin separation in a separate PR.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ivo Kubjas <tsimmm@gmail.com>
dd9b0d7 to
5967d8f
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ivo Kubjas <tsimmm@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ivo Kubjas <tsimmm@gmail.com>
|
I rebased on top of main now (as this PR depended on the absorb commitment PR). |
This reverts commit 5967d8f.
This PR adds code generation to extract the data necessary for generating the Zig-side verifier structure. It also implements the vanishing query check, tests, fixture generation.
Right now the transcript advancing is embedded inside the vanishing query verification -- in an upcoming PR we will clearly separate Transcript into separate structure so it would be better reusable and we have direct separation of steps.
Checklist
PR.
Note
Medium Risk
New proof-checking logic on quotient identities and Fiat-Shamir coin derivation must stay aligned with prover-ray; witness/quotient claims and dynamic sizes are still trusted fixture inputs until PCS is wired in.
Overview
Adds Go codegen that walks prover-ray
global.Verifieractions and emits comptimevanishing.SystemZig data, plus a newquery/vanishingchecker that replays the transcript, evaluates vanishing expressions, and asserts the PLONK quotient identity P_agg(r) = (r^n − 1) · Q(r).The Zig path uses comptime system metadata and
inline forover modules/buckets/expressions so static module sizes specializer^nand cancellation roots; dynamic modules read sizes from proof input.powComptimeon extension fields supports that static path.Fixture generation extends
testdata/generateto run full compiler pipelines onwioptestscenarios, writetestdata/generated/vanishing.zig, and wiretest_vanishinginto the build. Go tests cover extraction and Zig rendering; Zig tests check honest proofs, invalid quotient failures, and dynamic size validation. Docs describe the global constraint, codegen flow, and PCS integration assumptions (trusted claims/sizes for now; transcript still embedded in vanishing verify).Reviewed by Cursor Bugbot for commit a877719. Bugbot is set up for automated code reviews on this repo. Configure here.