feat: snark composition#975
Closed
markosg04 wants to merge 24 commits into
Closed
Conversation
markosg04
commented
Oct 6, 2025
|
|
||
| fn scale(&self, k: &Self::Scalar) -> Self { | ||
| Self(self.0.cyclotomic_exp(k.0.into_bigint())) | ||
| Self(self.0.pow(k.0.into_bigint())) |
Collaborator
Author
There was a problem hiding this comment.
cyclotomic exp is currently not implemented in our bespoke dory snark (though it could be in future, it would reduce the witness size by about half)
markosg04
commented
Oct 6, 2025
Comment on lines
+573
to
+586
| let sz_proof_fq = unsafe { | ||
| std::mem::transmute::< | ||
| &crate::subprotocols::snark_composition::RecursionProof< | ||
| F, | ||
| ProofTranscript, | ||
| 1, | ||
| >, | ||
| &crate::subprotocols::snark_composition::RecursionProof< | ||
| Fq, | ||
| ProofTranscript, | ||
| 1, | ||
| >, | ||
| >(sz_proof) | ||
| }; |
Collaborator
Author
There was a problem hiding this comment.
open to suggestions to avoid jank casts (applies prover side too)
markosg04
commented
Oct 6, 2025
Comment on lines
+959
to
+974
| let commitment_coeffs_for_recursion = if cfg!(feature = "recursion") | ||
| && std::any::TypeId::of::<PCS>() | ||
| == std::any::TypeId::of::<super::commitment::dory::DoryCommitmentScheme>() | ||
| { | ||
| Some( | ||
| rlc_map | ||
| .iter() | ||
| .map(|(polynomial, coeff)| { | ||
| (commitments.get(polynomial).unwrap().clone(), *coeff) | ||
| }) | ||
| .collect::<Vec<_>>(), | ||
| ) | ||
| } else { | ||
| None | ||
| }; | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
also jank, suggestions?
Collaborator
Author
|
Stale & there is a new PR coming soon for this feature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adds the initial recursion & snark composition proof machinery. Brings the main dory verification from 1.5B RISC-V cycles down to 330 million:
also does some miscellaneous things:
dev/twist-shoutacross dory and arkworksIn general, I am somewhat OK with the flow of the stage 6 for now. My personal main problem is with the recursion helpers being verbose in the
opening_proof.rsand some jank casts. I am still thinking for better solutions and so just flagging this during the review. Happy to take suggestions for better approaches. If no one has better ideas in this review then a subsequent PR will addressNext steps:
On the last point: we are producing about 50k polys of 4 vars. We should be able to fit everything including all the remaining witnesses from the 330M cycles into a 2^10 x 2^10 matrix, so we have 2^11 Grumpkin G1 (Fr) ops for verifier (2 MSM of 2^10), which should be really fast (few ms) to verify...