chore: use fixed lookup tables in recursive IPA verifier#22320
Open
suyash67 wants to merge 6 commits intomerge-train/barretenbergfrom
Open
chore: use fixed lookup tables in recursive IPA verifier#22320suyash67 wants to merge 6 commits intomerge-train/barretenbergfrom
suyash67 wants to merge 6 commits intomerge-train/barretenbergfrom
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
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.
The dominant cost of recursive IPA verifier (used in the root rollup circuit) is the$\mathcal{O}(N)$ MSM of the SRS elements (of Grumpkin curve) and the scalar vector $\vec{s}$ . Currently, we use 4-bit ROM tables to store multiples of each SRS element and break down each scalar into 4-bit slices to perform scalar multiplication using Strauss' algorithm. Using ROM tables costs gates to initiate the ROM tables.
Instead of using ROM tables SRS points, we can use fixed lookup tables and perform lookups from them. There is no overhead of fixed lookup tables on gate count. This reduces the total gate count of the recursive IPA verifier massively, with a 2× reduction in dyadic circuit size of the root rollup circuit. Here's the summary:
batch_mul(baseline)Minor note: we process the first element in SRS separately to avoid total lookup rows to jump over$2^{23}$ .$2^{15}$ SRS points and 8-bit tables, lookup table rows = 32,768 × 256 = 2^23 exactly.
With
The 5 mandatory protocol overhead rows (
NUM_DISABLED_ROWS_IN_SUMCHECK + NUM_ZERO_ROWS) pushthe total to 2^23 + 5, forcing dyadic size to 2^24.
Handling one point via the standard
operator*(ROM, 0 plookup table rows) reduces lookuptable rows to 32,767 × 256 = 8,388,352 < 2^23, giving total_num_gates = 8,388,357 < 2^23
and dyadic size = 2^23.