chore: deduplicate batch affine addition trick#19788
Merged
iakovenkos merged 53 commits intomerge-train/barretenbergfrom Jan 23, 2026
Merged
chore: deduplicate batch affine addition trick#19788iakovenkos merged 53 commits intomerge-train/barretenbergfrom
iakovenkos merged 53 commits intomerge-train/barretenbergfrom
Conversation
…i/pippenger-audit-0
- Rename get_nonzero_scalar_indices to transform_scalar_and_get_nonzero_scalar_indices - Perform lazy Montgomery conversion during zero filtering (once per scalar) - Remove redundant conversion loop in msm() function - Restores baseline performance (743.149G vs 742.837G cycles, 0.04% difference) - Eliminates 6-9% regression from eager conversion approach Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Revert from recursive back to iterative implementation - Iterative version is cleaner and more readable with explicit loops - Fix addition_result_bucket_destinations type from uint64_t to uint32_t - Eliminates unnecessary type casts throughout - Keep BB_BENCH profiling markers for performance tracking - Performance remains identical to recursive version Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…i/pippenger-audit-0
iakovenkos
commented
Jan 21, 2026
| ```` | ||
|
|
||
| When making barretenberg changes, ensure these tests still pass. | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Claude would often try to create a custom benching script, or bench perf critical primitives locally.
federicobarbacovi
approved these changes
Jan 22, 2026
| using AffineElement = typename Curve::AffineElement; | ||
| using BaseField = typename Curve::BaseField; | ||
|
|
||
| // Use interleaved array policy: pairs are (points[2i], points[2i+1]), output in points[num_pairs:] |
Contributor
There was a problem hiding this comment.
Refuse: output in points[num_pairs + i]
Base automatically changed from
si/pippenger-audit-0
to
merge-train/barretenberg
January 23, 2026 15:37
…i/unify-batch-affine-add
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 27, 2026
BEGIN_COMMIT_OVERRIDE feat: support JSON input files for bb verify command (#19800) fix: update bootstrap.sh to use new JSON field names chore: Update `index.js` so that `HAS_ZK` and `PUBLIC_INPUTS` variables must always be set in tests (#19884) chore: pippenger int audit (#19302) chore: deduplicate batch affine addition trick (#19788) chore: transcript+codec+poseidon2 fixes (#19419) chore!: explicitly constrain inputs and intermediate witnesses (#19826) fix: exclude nlohmann/json from WASM builds in json_output.hpp chore: translator circuit builder and flavor audit (#19798) Revert "fix: exclude nlohmann/json from WASM builds in json_output.hpp" Revert "feat: support JSON input files for bb verify command (#19800)" Revert "fix: update bootstrap.sh to use new JSON field names" END_COMMIT_OVERRIDE
danielntmd
pushed a commit
that referenced
this pull request
Jan 27, 2026
Montgomery batch inversion trick was implemented in 3 different places, now all of them are using generic impl that has a policy abstraction allowing to support different memory requirements (e.g. pippenger vs scaling a vector of commitments by the same field element) Closes AztecProtocol/barretenberg#826 --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.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.
Montgomery batch inversion trick was implemented in 3 different places, now all of them are using generic impl that has a policy abstraction allowing to support different memory requirements (e.g. pippenger vs scaling a vector of commitments by the same field element)
Closes AztecProtocol/barretenberg#826