Skip to content

auto-gen files#425

Merged
Stavbe merged 1 commit intomainfrom
stav/sync_air_infra
Apr 15, 2026
Merged

auto-gen files#425
Stavbe merged 1 commit intomainfrom
stav/sync_air_infra

Conversation

@Stavbe
Copy link
Copy Markdown
Collaborator

@Stavbe Stavbe commented Mar 25, 2026

auto-gen files

manual change


Note

Medium Risk
Touches auto-generated AIR constraint evaluation and prover logup aggregation for Blake-related components; any mismatch can break proving/verification or change constraint soundness. Logic changes are localized but impact cryptographic circuit correctness.

Overview
Updates the auto-generated Blake circuit AIR code to remove enabler-gating from several subroutine lookups (e.g., bitwise_xor_num_bits_*, xor_rot_*, create_blake_round_input, triple_sum_32) and adjusts call sites in blake_g, blake_gate, and triple_xor_32 accordingly.

Aligns the Rust component evaluators and prover witness generation with this new behavior by using constant 1 relation numerators and simplifying the verify_bitwise_xor_8 logup pairing in circuit_prover (no longer multiplying by the Blake gate enabler). Sample evaluation constants are regenerated/updated, including renaming the Blake round sample to CIRCUIT_BLAKE_ROUND_SAMPLE_EVAL_RESULT and updating Blake gate expected outputs.

Written by Cursor Bugbot for commit 67a19ea. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link
Copy Markdown
Collaborator

This change is Reviewable

Copy link
Copy Markdown
Collaborator Author

Stavbe commented Mar 25, 2026

@Stavbe Stavbe force-pushed the stav/sync_air_infra branch 5 times, most recently from 59641ab to d400784 Compare March 26, 2026 12:49
Copy link
Copy Markdown
Collaborator Author

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

revision 4: auto-generated
revision 5: manual changes

I checked, and the log size is the same for all the components in 'test_verify_privacy_with_recursion' and test_privacy_recursion_with_preprocessed_context after this change.

@Stavbe made 3 comments.
Reviewable status: 0 of 25 files reviewed, 2 unresolved discussions.


crates/circuit_air/src/sample_evaluations.rs line 3 at r1 (raw file):

// AIR version 5731579f
use stwo::core::fields::{cm31::CM31, m31::M31, qm31::QM31};
pub const BLAKE_GATE_SAMPLE_EVAL_RESULT: QM31 =

Not used


crates/circuit_air/src/sample_evaluations.rs line 11 at r1 (raw file):

pub const BLAKE_ROUND_SIGMA_SAMPLE_EVAL_RESULT: QM31 =
    QM31(CM31(M31(512577297), M31(1730381685)), CM31(M31(592485643), M31(1900393320)));
pub const CIRCUIT_BLAKE_ROUND_SAMPLE_EVAL_RESULT: QM31 =

Not used

@Stavbe Stavbe marked this pull request as ready for review March 26, 2026 13:00
@Stavbe Stavbe requested a review from anatgstarkware March 26, 2026 13:00
@Stavbe Stavbe self-assigned this Mar 26, 2026
@Stavbe Stavbe force-pushed the stav/sync_air_infra branch from d400784 to 831e98d Compare March 26, 2026 14:43
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread crates/cairo_air/src/mod.rs Outdated
@Stavbe Stavbe force-pushed the stav/sync_air_infra branch 2 times, most recently from 6fb2fc2 to 5bf133c Compare March 29, 2026 13:48
@Stavbe Stavbe force-pushed the stav/sync_air_infra branch from 5bf133c to 38e1b48 Compare March 31, 2026 07:51
Copy link
Copy Markdown
Collaborator

@anatgstarkware anatgstarkware left a comment

Choose a reason for hiding this comment

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

@anatgstarkware made 3 comments.
Reviewable status: 0 of 27 files reviewed, 5 unresolved discussions (waiting on Stavbe).


crates/circuit_prover/src/witness/components/blake_gate.rs line 199 at r9 (raw file):

        );
        for inputs in sub_component_inputs.verify_bitwise_xor_8 {
            verify_bitwise_xor_8_state.add_packed_inputs(&inputs[..n_rows / N_LANES], 0);

Why did you change this file?


crates/circuit_air/src/circuit_eval_components/blake_gate.rs line 1 at r9 (raw file):

// This file was created by the AIR team.

please remove

Code quote:

// This file was created by the AIR team.

crates/circuit_air/src/circuit_eval_components/subroutines/create_blake_round_input.rs line 1 at r9 (raw file):

// This file was created by the AIR team.

please remove

Code quote:

// This file was created by the AIR team.

@anatgstarkware
Copy link
Copy Markdown
Collaborator

crates/circuit_air/src/circuit_eval_components/subroutines/create_blake_round_input.rs line 1 at r9 (raw file):

Previously, anatgstarkware (anatg) wrote…

please remove

Actually, I don't understand why this is manual. Can we please talk about this f2f?

@Stavbe Stavbe force-pushed the stav/sync_air_infra branch 2 times, most recently from 1abdbf2 to bf52c9b Compare March 31, 2026 11:00
Copy link
Copy Markdown
Collaborator Author

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

@Stavbe made 4 comments.
Reviewable status: 0 of 27 files reviewed, 6 unresolved discussions (waiting on anatgstarkware).


crates/circuit_air/src/circuit_eval_components/blake_gate.rs line 1 at r9 (raw file):

Previously, anatgstarkware (anatg) wrote…

please remove

Done.


crates/circuit_air/src/circuit_eval_components/subroutines/create_blake_round_input.rs line 1 at r9 (raw file):

Previously, anatgstarkware (anatg) wrote…

Actually, I don't understand why this is manual. Can we please talk about this f2f?

You're right, it can be auto-gen (it wasn't the goal, and I didn't notice the last change because the cursor bot made it possible).
Done


crates/circuit_prover/src/witness/components/blake_gate.rs line 199 at r9 (raw file):

Previously, anatgstarkware (anatg) wrote…

Why did you change this file?

This change: " verify_bitwise_xor_8_state.add_packed_inputs(&inputs, 0);" is because with the enabler, padding rows had enabler = 0 so they contributed nothing to the logup sum — the slice [..n_rows / N_LANES] was used to pass only the real rows to verify_bitwise_xor_8.
Without the enabler, the AIR constraint evaluator includes all rows (including padding) in the logup.
Note that this is a lookup into const-size components and thus it doesn't add any rows.


crates/circuit_prover/src/witness/components/blake_gate.rs line 1962 at r9 (raw file):

            .enumerate()
            .for_each(|(i, (writer, values0, values1))| {
                let blake_gate_enabler = blake_gate_enabler_col.packed_at(i);

This change is becausecircuit_eval_components/create_blake_round_input.rs, which is inline in blake_gate, was changed to not use the enabler in the lookup to verify_bitwise_xor (const size components - no extra rows). The prover's interaction trace must match what the Verifier's constraint evaluator computes.

@Stavbe Stavbe force-pushed the stav/sync_air_infra branch 2 times, most recently from 8b04e92 to 67a19ea Compare March 31, 2026 16:11
Copy link
Copy Markdown
Collaborator

@anatgstarkware anatgstarkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@anatgstarkware made 1 comment and resolved 6 discussions.
Reviewable status: 0 of 27 files reviewed, all discussions resolved (waiting on Stavbe).

Copy link
Copy Markdown
Collaborator

@anatgstarkware anatgstarkware left a comment

Choose a reason for hiding this comment

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

@anatgstarkware reviewed 24 files and all commit messages.
Reviewable status: 24 of 27 files reviewed, all discussions resolved (waiting on Stavbe).

Copy link
Copy Markdown
Collaborator

@anatgstarkware anatgstarkware left a comment

Choose a reason for hiding this comment

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

@anatgstarkware reviewed 3 files.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Stavbe).

@Stavbe Stavbe force-pushed the stav/sync_air_infra branch from 67a19ea to 348d51a Compare April 12, 2026 09:51
Copy link
Copy Markdown
Collaborator Author

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

waiting on https://reviewable.io/reviews/starkware-industries/stwo-air-infra/937

@Stavbe made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Stavbe).

@Stavbe Stavbe force-pushed the stav/sync_air_infra branch from 348d51a to 8389048 Compare April 14, 2026 13:49
@Stavbe Stavbe force-pushed the stav/sync_air_infra branch from 8389048 to 4539be8 Compare April 15, 2026 10:13
Copy link
Copy Markdown
Collaborator Author

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

@Stavbe reviewed 27 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Stavbe).

@Stavbe Stavbe merged commit a05c74e into main Apr 15, 2026
10 checks passed
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.

3 participants