Skip to content
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

refactor rowmajormatrix witness #842

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hero78119
Copy link
Collaborator

@hero78119 hero78119 commented Feb 28, 2025

This PR refactor mpcs api to take plonky3 rowmajormatrix as batch_commit input

in the preparation for next PR to support

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)

// 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

  • wrapped plonly3 rowmajormatrix and retain ceno original rowmajormatrix padding functionality
  • separate witness/structural_witness into different rowmajormatrix

@hero78119 hero78119 force-pushed the feat/refactor_witness branch from cf5f954 to daf7e07 Compare February 28, 2025 02:40
@hero78119
Copy link
Collaborator Author

benchmark in fibonacci e2e with 2^20

fibonacci_max_steps_1048576/prove_fibonacci/fibonacci_max_steps_1048576
                        time:   [3.9887 s 4.0009 s 4.0147 s]
                        change: [-1.6824% -0.8643% -0.0106%] (p = 0.08 > 0.05)
                        No change in performance detected.

shows no impact on current refactor before/after, which is expacted

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