feat: reduce CRS and polynomial memory for non-ZK proofs#20731
Open
johnathan79717 wants to merge 2 commits intomerge-train/barretenbergfrom
Open
feat: reduce CRS and polynomial memory for non-ZK proofs#20731johnathan79717 wants to merge 2 commits intomerge-train/barretenbergfrom
johnathan79717 wants to merge 2 commits intomerge-train/barretenbergfrom
Conversation
Size the CRS at max_end_index (actual data extent) rather than dyadic_size for non-ZK proofs. The Shplonk quotient polynomial round_up_power_2 is now conditional on having non-dyadic claims (Libra/sumcheck), which only exist in the ZK path. Also size PolynomialBatcher's temporary polynomials (batched_unshifted, batched_to_be_shifted, A_0_pos, A_0_neg) at actual_data_size rather than full_batched_size, reducing transient memory allocations. Measured ~16-18 MiB peak RSS savings on Chonk AMM flow (max_end_index=278,429 vs dyadic_size=524,288).
The previous commit accidentally changed get_polynomial_size() from virtual_size() to size(), which breaks relation correctness checks that iterate over the full dyadic circuit size.
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
max_end_index(actual data extent) rather thandyadic_sizefor non-ZK proofsround_up_power_2conditional on having non-dyadic claims (Libra/sumcheck), which only exist in the ZK pathbatched_unshifted,batched_to_be_shifted,A_0_pos,A_0_neg) atactual_data_sizerather thanfull_batched_sizeBenchmark results
Chonk AMM flow (
ecdsar1+amm_add_liquidity_1_recursions+sponsored_fpc),max_end_index=278,429vsdyadic_size=524,288:Test plan
ultra_honk_benchat 2^20 passes (no crash)ultra_honk_tests: 260 passed, 5 skippedcommitment_schemes_tests: 82 passed, 2 skipped