Skip to content

feat(verifier-ray): vanishing query check using codegen#3271

Merged
ivokub merged 13 commits into
mainfrom
feat/vanishing-codegen
Jun 6, 2026
Merged

feat(verifier-ray): vanishing query check using codegen#3271
ivokub merged 13 commits into
mainfrom
feat/vanishing-codegen

Conversation

@ivokub
Copy link
Copy Markdown
Contributor

@ivokub ivokub commented Jun 4, 2026

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

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this
    PR.
  • I have informed the team of any breaking changes if there are any.

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.Verifier actions and emits comptime vanishing.System Zig data, plus a new query/vanishing checker 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 for over modules/buckets/expressions so static module sizes specialize r^n and cancellation roots; dynamic modules read sizes from proof input. powComptime on extension fields supports that static path.

Fixture generation extends testdata/generate to run full compiler pipelines on wioptest scenarios, write testdata/generated/vanishing.zig, and wire test_vanishing into 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.

@ivokub ivokub added this to the RV recursion - M1 milestone Jun 4, 2026
@ivokub ivokub self-assigned this Jun 4, 2026
@ivokub ivokub changed the title Feat/vanishing codegen feat(verifier-ray): vanishing query check using codegen Jun 4, 2026
@ivokub ivokub requested a review from Tabaie June 4, 2026 11:06
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 4, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​consensys/​linea-monorepo/​prover-ray@​v0.0.0-20260521063207-ab0f753372c8 ⏵ v0.0.0-20260604100845-588fd53a8c0f99 +1100100100100

View full report

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.zig implementing vanishing quotient identity verification over generated metadata (including static vs dynamic module sizing).
  • Add Go verifier-ray/codegen package 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.

Comment thread verifier-ray/src/query/vanishing.zig
Comment thread verifier-ray/src/query/vanishing.zig
Comment thread verifier-ray/codegen/vanishing.go
YaoJGalteland
YaoJGalteland previously approved these changes Jun 4, 2026
Copy link
Copy Markdown
Contributor

@YaoJGalteland YaoJGalteland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core implementation is correct and the architecture is solid. we can work on the coin separation in a separate PR.

Base automatically changed from feat/verifier-commitment-absorbing to main June 5, 2026 10:07
@ivokub ivokub dismissed YaoJGalteland’s stale review June 5, 2026 10:07

The base branch was changed.

@ivokub ivokub force-pushed the feat/vanishing-codegen branch from dd9b0d7 to 5967d8f Compare June 5, 2026 10:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.

Comment thread verifier-ray/src/query/vanishing.zig Outdated
Comment thread verifier-ray/src/query/vanishing.zig
ivokub and others added 2 commits June 5, 2026 12:31
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>
@ivokub
Copy link
Copy Markdown
Contributor Author

ivokub commented Jun 5, 2026

I rebased on top of main now (as this PR depended on the absorb commitment PR).

Copy link
Copy Markdown
Contributor

@arijitdutta67 arijitdutta67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ivokub ivokub merged commit b8a0942 into main Jun 6, 2026
18 of 23 checks passed
@ivokub ivokub deleted the feat/vanishing-codegen branch June 6, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants