kimchi: merge witness commitment and interpolation into single pass#3486
Closed
dannywillems wants to merge 1 commit intomasterfrom
Closed
kimchi: merge witness commitment and interpolation into single pass#3486dannywillems wants to merge 1 commit intomasterfrom
dannywillems wants to merge 1 commit intomasterfrom
Conversation
Combine the witness column commitment and polynomial interpolation into one parallel loop, eliminating: - The full witness array clone (15 columns * domain_size elements) - 15 redundant Evaluations constructions - 15 redundant iFFTs (interpolations) Before: clone all 15 columns for commitment, then clone each column again for interpolation, performing 30 total column copies and 15 iFFTs for commitment + 15 for interpolation. After: clone each column once, commit, then interpolate in-place, performing 15 total column copies and 15 iFFTs.
Member
Author
|
This was vibe-coded, PR opened by Claude automatically. |
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.
Summary
Evaluationsconstructions and 15 redundant iFFTsBefore
Two separate parallel loops:
witness.clone().into_par_iter()— clones all 15 columns, commits each(0..COLUMNS).into_par_iter()— clones each column again, interpolates eachTotal: 30 column copies, 30 iFFTs (15 for Lagrange-basis commit + 15 for interpolation)
After
One parallel loop using
witness.par_iter()(borrows):from_vec_and_domaincommit_evaluations_non_hiding(borrows&Evaluations)interpolate(self)(arkworksifft_in_place)Total: 15 column copies, 15 iFFTs
Benchmark results
cargo bench --bench proof_criterion -p kimchi(Apple M-series, sample size 10):Improvement scales with circuit size — larger witness columns benefit more from eliminating redundant clones and iFFTs.
Test plan
cargo clippy -p kimchi --all-targets --all-featurespasses clean