Skip to content

Conversation

@4l0n50
Copy link
Contributor

@4l0n50 4l0n50 commented Oct 16, 2025

In order to use the recursive version of the verify_batch function, we need to open the commitment to multiple leaves (I used “leaves” everywhere, but writing this now I realize it may not be the right term).

On the other hand, in the recursive verification of FRI proofs, the bit decomposition of the index is already available. Therefore, the MMCS gate might avoid this conversion and work directly with the index bits.

This PR updates the MMCS gate to support multiple openings. To enable this, non-primitive operations now expose witness_exprs as Vec<Vec<ExprId>>. In the MMCS case, the last two vectors hold directions and root; the preceding |directions| vectors contain the openings for each matrix (previously referred to as “leaves,” possibly incorrectly), or an empty vector if there's no matrix at the respective level.

Copy link
Contributor

@sai-deng sai-deng left a comment

Choose a reason for hiding this comment

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

Can we also enable packing (it can be a separate PR)? As we only observe ext field elements now (make use of p3-multi-stark).

@sai-deng
Copy link
Contributor

Previously: we’d call MmcsVerify multiple times, bottom→up, ending a segment whenever we hit a new leaf layer. I am wondering how current method is better than the old method?

@4l0n50
Copy link
Contributor Author

4l0n50 commented Oct 28, 2025

Can we also enable packing (it can be a separate PR)?

It was initially supposed to work with packing, so it should be already working. I'll take a look.

Previously: we’d call MmcsVerify multiple times, bottom→up, ending a segment whenever we hit a new leaf layer. I am wondering how current method is better than the old method?

I’m not sure I understand what you mean by a segment. Before, we used to call MmcsVerify once for each batch of openings. However, openings for smaller matrices could only be passed as private inputs, which meant they couldn’t be reused elsewhere in the circuit.
Now, both the largest and the smaller matrix openings are provided as public inputs. Also, instead of using the index directly, we now use its bit decomposition, since that information is already available when MmcsVerify is called.

@github-project-automation github-project-automation bot moved this from Todo to Ready to be merged in Plonky3 Recursion Oct 28, 2025
@4l0n50 4l0n50 merged commit 9999dcf into main Oct 29, 2025
8 checks passed
@4l0n50 4l0n50 deleted the alonso/mmcs_with_leaves branch October 29, 2025 10:19
@github-project-automation github-project-automation bot moved this from Ready to be merged to Done in Plonky3 Recursion Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants