-
Notifications
You must be signed in to change notification settings - Fork 40
WIP basefold to p3 library #857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
hero78119
wants to merge
31
commits into
scroll-tech:ming/feat/opt_basefold
from
hero78119:feat/basefold_p3
Closed
WIP basefold to p3 library #857
hero78119
wants to merge
31
commits into
scroll-tech:ming/feat/opt_basefold
from
hero78119:feat/basefold_p3
Conversation
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
hero78119
commented
Mar 11, 2025
mpcs/src/basefold/commit_phase.rs
Outdated
| .zip(<Spec::EncodingScheme as EncodingScheme<E>>::prover_folding_coeffs_level(pp, level)) | ||
| .map(|(ys, coeff)| { | ||
| let (lo, hi) = ((ys[0] + ys[1]).halve(), (ys[0] - ys[1]) * *coeff); | ||
| lo + (hi - lo) * challenge |
Collaborator
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is directly fold on evaluation (lagrange domain).
TODO need to add document for explain this formula
013cafc to
0b80c96
Compare
This PR refactor mpcs api to take [plonky3 rowmajormatrix](https://github.com/Plonky3/Plonky3/blob/main/matrix/src/dense.rs#L26 ) as batch_commit input in the preparation for next PR to support - use [plonly3 dft](https://github.com/Plonky3/Plonky3/blob/72e85a3377a9d5b4d1419ac0605b057e0ba30996/dft/src/radix_2_dit_parallel.rs#L106) to encode RS code from lagrange domain - use [plonky3 mmcs](https://github.com/Plonky3/Plonky3/blob/72e85a3377a9d5b4d1419ac0605b057e0ba30996/commit/src/mmcs.rs#L27) to commit merkle tree Example of new basefold.commit via plonky3 lib > in this case, we can skip monomial basis entirely by changing respective codeword fold in (1-alpha), (alpha) ```rust // rmm is row major matrix witness in lagrange basis (evaluation basis) let mut m = rmm.bit_reverse_rows().to_row_major_matrix(); // dft(reverse_row_bit(message)) == basefold::rs_encode(message) // run fft, which is equivalent to interbolate binary field m.pad_to_height(expansion_factor, E::Basefield::ZERO); let codeword = self.fft.dft_batch(m).to_row_major_matrix(); let (comm, _) = let mmcs.commit_matrix(codewords); // merkle tree commitment ``` ### change scopes - [x] wrapped plonly3 rowmajormatrix and retain ceno original rowmajormatrix padding functionality - [x] separate witness/structural_witness into different rowmajormatrix
Collaborator
Author
|
Will combine this work with #843 |
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.
Built on top of #843