fix: civc wasm memory regression#15722
Merged
Merged
Conversation
Contributor
Author
iakovenkos
commented
Jul 15, 2025
| // Zero univariates are used to pad the proof to the fixed size virtual_log_n. | ||
| auto zero_univariate = bb::Univariate<FF, Flavor::BATCHED_RELATION_PARTIAL_LENGTH>::zero(); | ||
| for (size_t idx = multivariate_d; idx < virtual_log_n; idx++) { | ||
| if constexpr (!IsGrumpkinFlavor<Flavor>) { |
Contributor
Author
There was a problem hiding this comment.
This loop is never triggered when IsGrumkinFlavor<Flavor> == true
Contributor
There was a problem hiding this comment.
Maybe it's worth adding something like an ASSERT(!IsGrumpkinFlavor<Flavor>); to make sure.
Collaborator
There was a problem hiding this comment.
note you can do static_assert() also
iakovenkos
commented
Jul 15, 2025
| SubrelationSeparators alphas; | ||
| // pow_β(X₀, ..., X_{d−1}) = ∏ₖ₌₀^{d−1} (1 − Xₖ + Xₖ ⋅ βₖ) | ||
| bb::GateSeparatorPolynomial<FF> gate_separators; | ||
| std::vector<FF> gate_challenges; |
Contributor
Author
There was a problem hiding this comment.
the size of gate_challenges is ~ log of the circuit size
iakovenkos
commented
Jul 15, 2025
| // Given gate challenges β = (β₀, ..., β_{d−1}) and d = `multivariate_d`, compute the evaluations of | ||
| // GateSeparator_β (X₀, ..., X_{d−1}) = ∏ₖ₌₀^{d−1} (1 − Xₖ + Xₖ · βₖ) | ||
| // on the boolean hypercube. | ||
| GateSeparatorPolynomial<FF> gate_separators(gate_challenges, multivariate_d); |
Contributor
Author
There was a problem hiding this comment.
GateSeparator is a poly of circuit size, so should be created locally
johnathan79717
approved these changes
Jul 15, 2025
| // Zero univariates are used to pad the proof to the fixed size virtual_log_n. | ||
| auto zero_univariate = bb::Univariate<FF, Flavor::BATCHED_RELATION_PARTIAL_LENGTH>::zero(); | ||
| for (size_t idx = multivariate_d; idx < virtual_log_n; idx++) { | ||
| if constexpr (!IsGrumpkinFlavor<Flavor>) { |
Contributor
There was a problem hiding this comment.
Maybe it's worth adding something like an ASSERT(!IsGrumpkinFlavor<Flavor>); to make sure.
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jul 16, 2025
See [merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md). BEGIN_COMMIT_OVERRIDE feat!: Merge with degree check (#15562) fix: Fix the docker build action for fuzzing (#15719) fix: restore accidentally deleted files (#15724) fix: civc wasm memory regression (#15722) feat: mmap backed polynomials (#15531) feat(bbapi): CLI uses bbapi CIVC (#15702) fix(ci): brittle benchmark behavior (#15771) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com> Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com> Co-authored-by: ludamad <adam.domurad@gmail.com> Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com> Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com> Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com> Co-authored-by: Raju Krishnamoorthy <krishnamoorthy@gmail.com> Co-authored-by: notnotraju <raju@aztec-labs.com> Co-authored-by: Lucas Xia <lucasxia01@gmail.com> Co-authored-by: Khashayar Barooti <khashayar@aztecprotocol.com> Co-authored-by: Jean M <132435771+jeanmon@users.noreply.github.com> Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com> Co-authored-by: Santiago Palladino <spalladino@users.noreply.github.com> Co-authored-by: Santiago Palladino <santiago@aztec-labs.com> Co-authored-by: ludamad <domuradical@gmail.com> Co-authored-by: maramihali <mara@aztecprotocol.com> Co-authored-by: Sarkoxed <75146596+Sarkoxed@users.noreply.github.com>
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.

In my previous PR, I moved the
GateSeparatorPolynomialinto the SumcheckProver class as a member, which extended its lifetime and increased memory usage in CIVC by the size of this polynomial, e.g. by 21 MB inecdsar1+transfer_0_recursions+sponsored_fpcbench