Skip to content

Conversation

@hero78119
Copy link
Collaborator

Built on top of #843

@hero78119 hero78119 marked this pull request as draft March 11, 2025 08:57
.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
Copy link
Collaborator Author

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

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
@hero78119
Copy link
Collaborator Author

Will combine this work with #843

@hero78119 hero78119 closed this Mar 19, 2025
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.

1 participant