Skip to content

Replace manual qm31_ops in the circuit verifier with AIR-generated - #607

Open
dancarmoz wants to merge 1 commit into
mainfrom
dancar/autogenerate_qm31_ops_in_circuits
Open

Replace manual qm31_ops in the circuit verifier with AIR-generated#607
dancarmoz wants to merge 1 commit into
mainfrom
dancar/autogenerate_qm31_ops_in_circuits

Conversation

@dancarmoz

Copy link
Copy Markdown
Collaborator

No description provided.

@cursor

cursor Bot commented Jun 25, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes core STARK constraint evaluation for qm31_ops and relation metadata; incorrect regeneration would break proof verification and multiverifier regression fixtures.

Overview
Swaps the hand-written qm31_ops circuit verifier component for an AIR-generated qm_31_ops module (same constraints, new accumulate_constraints layout and Component type). statement.rs still registers the component as "qm31_ops" but instantiates qm_31_ops::Component.

Aligns eq (and the new QM31 ops component) with AIR by using relation id "Gate" instead of "gate". Refreshes AIR version 9af567ea golden QM_31_OPS_SAMPLE_EVAL_RESULT values in sample_evaluations (cairo + circuit verifier) and updates MULTIVERIFIER_PREPROCESSED_ROOT in multiverifier regression tests to match the new constraint code.

Reviewed by Cursor Bugbot for commit 7d2ca02. Bugbot is set up for automated code reviews on this repo. Configure here.

@reviewable-StarkWare

Copy link
Copy Markdown
Collaborator

This change is Reviewable

@dancarmoz
dancarmoz force-pushed the dancar/autogenerate_qm31_ops_in_circuits branch 2 times, most recently from e2c1652 to 56dc0d5 Compare June 25, 2026 15:00
@anatgstarkware

Copy link
Copy Markdown
Collaborator

crates/circuit_multiverifier/src/verify_test.rs line 61 at r1 (raw file):

/// Constants related to the multiverifier circuit.
const MULTIVERIFIER_PREPROCESSED_ROOT: [u32; 8] =

In what way did it change?

Code quote:

MULTIVERIFIER_PREPROCESSED_ROOT

@anatgstarkware anatgstarkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@anatgstarkware reviewed 8 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on az-starkware and dancarmoz).

@dancarmoz
dancarmoz force-pushed the dancar/autogenerate_qm31_ops_in_circuits branch 2 times, most recently from 286bf0d to 8b87a07 Compare July 2, 2026 13:43

@dancarmoz dancarmoz left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@dancarmoz partially reviewed 3 files and made 1 comment.
Reviewable status: 6 of 10 files reviewed, 1 unresolved discussion (waiting on anatgstarkware and az-starkware).


crates/circuit_multiverifier/src/verify_test.rs line 61 at r1 (raw file):

Previously, anatgstarkware (anatg) wrote…

In what way did it change?

Great question :)
Amusingly enough, the circuit for the component itself is completely the same. The only thing that changed is that the relation_uses_per_row used to be
[RelationUse { relation_id: "gate", uses: 2 }]
and now it's
[RelationUse { relation_id: "Gate", uses: 2 }]
(the G became capitalized in autogeneration).
In fact almost all use cases use "Gate" rather than "gate", except eq which still used "gate".
So changed it also in this PR (to avoid having the roots and proofs changed multiple times.)

@dancarmoz
dancarmoz force-pushed the dancar/autogenerate_qm31_ops_in_circuits branch from 8b87a07 to 7d2ca02 Compare July 2, 2026 13:56
@dancarmoz
dancarmoz requested a review from yuvalsw July 2, 2026 15:43

@az-starkware az-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@az-starkware reviewed 10 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on anatgstarkware and yuvalsw).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants