-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added barrett_reduction implementation into uintx #6768
Conversation
Benchmark resultsMetrics with a significant change:
Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Proof generationEach column represents the number of threads used in proof generation.
L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.
Stats on running time collected for app circuits
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method | Metric | | |
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-package: 0.46.5</summary> ## [0.46.5](aztec-package-v0.46.4...aztec-package-v0.46.5) (2024-07-14) ### Miscellaneous * **aztec-package:** Synchronize aztec-packages versions </details> <details><summary>barretenberg.js: 0.46.5</summary> ## [0.46.5](barretenberg.js-v0.46.4...barretenberg.js-v0.46.5) (2024-07-14) ### Miscellaneous * **barretenberg.js:** Synchronize aztec-packages versions </details> <details><summary>aztec-packages: 0.46.5</summary> ## [0.46.5](aztec-packages-v0.46.4...aztec-packages-v0.46.5) (2024-07-14) ### Features * Added barrett_reduction implementation into uintx ([#6768](#6768)) ([abced57](abced57)) * Databus allows arbitrarily many reads per index ([#6524](#6524)) ([f07200c](f07200c)) * Let LSP always work in a Noir workspace if there's any (noir-lang/noir#5461) ([8403e84](8403e84)) * Multiple trace structuring configurations ([#7408](#7408)) ([e4abe1d](e4abe1d)) * Verify ClientIVC proofs through Bb binary ([#7407](#7407)) ([3760c64](3760c64)) ### Bug Fixes * Lagrange interpolation ([#7440](#7440)) ([76bcd72](76bcd72)) * Move BigInt modulus checks to runtime in brillig (noir-lang/noir#5374) ([8403e84](8403e84)) * Run macro processors in the elaborator (noir-lang/noir#5472) ([8403e84](8403e84)) ### Miscellaneous * Keccak256 in Noir (noir-lang/noir#5316) ([8403e84](8403e84)) * Redo typo PR by omahs (noir-lang/noir#5487) ([8403e84](8403e84)) * Replace relative paths to noir-protocol-circuits ([e89bfd8](e89bfd8)) * Replace relative paths to noir-protocol-circuits ([fae353e](fae353e)) ### Documentation * Minor comments for private refunds/partial notes ([#7447](#7447)) ([9bcbb6c](9bcbb6c)) </details> <details><summary>barretenberg: 0.46.5</summary> ## [0.46.5](barretenberg-v0.46.4...barretenberg-v0.46.5) (2024-07-14) ### Features * Added barrett_reduction implementation into uintx ([#6768](#6768)) ([abced57](abced57)) * Databus allows arbitrarily many reads per index ([#6524](#6524)) ([f07200c](f07200c)) * Multiple trace structuring configurations ([#7408](#7408)) ([e4abe1d](e4abe1d)) * Verify ClientIVC proofs through Bb binary ([#7407](#7407)) ([3760c64](3760c64)) ### Bug Fixes * Lagrange interpolation ([#7440](#7440)) ([76bcd72](76bcd72)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-package: 0.46.5</summary> ## [0.46.5](AztecProtocol/aztec-packages@aztec-package-v0.46.4...aztec-package-v0.46.5) (2024-07-14) ### Miscellaneous * **aztec-package:** Synchronize aztec-packages versions </details> <details><summary>barretenberg.js: 0.46.5</summary> ## [0.46.5](AztecProtocol/aztec-packages@barretenberg.js-v0.46.4...barretenberg.js-v0.46.5) (2024-07-14) ### Miscellaneous * **barretenberg.js:** Synchronize aztec-packages versions </details> <details><summary>aztec-packages: 0.46.5</summary> ## [0.46.5](AztecProtocol/aztec-packages@aztec-packages-v0.46.4...aztec-packages-v0.46.5) (2024-07-14) ### Features * Added barrett_reduction implementation into uintx ([#6768](AztecProtocol/aztec-packages#6768)) ([abced57](AztecProtocol/aztec-packages@abced57)) * Databus allows arbitrarily many reads per index ([#6524](AztecProtocol/aztec-packages#6524)) ([f07200c](AztecProtocol/aztec-packages@f07200c)) * Let LSP always work in a Noir workspace if there's any (noir-lang/noir#5461) ([8403e84](AztecProtocol/aztec-packages@8403e84)) * Multiple trace structuring configurations ([#7408](AztecProtocol/aztec-packages#7408)) ([e4abe1d](AztecProtocol/aztec-packages@e4abe1d)) * Verify ClientIVC proofs through Bb binary ([#7407](AztecProtocol/aztec-packages#7407)) ([3760c64](AztecProtocol/aztec-packages@3760c64)) ### Bug Fixes * Lagrange interpolation ([#7440](AztecProtocol/aztec-packages#7440)) ([76bcd72](AztecProtocol/aztec-packages@76bcd72)) * Move BigInt modulus checks to runtime in brillig (noir-lang/noir#5374) ([8403e84](AztecProtocol/aztec-packages@8403e84)) * Run macro processors in the elaborator (noir-lang/noir#5472) ([8403e84](AztecProtocol/aztec-packages@8403e84)) ### Miscellaneous * Keccak256 in Noir (noir-lang/noir#5316) ([8403e84](AztecProtocol/aztec-packages@8403e84)) * Redo typo PR by omahs (noir-lang/noir#5487) ([8403e84](AztecProtocol/aztec-packages@8403e84)) * Replace relative paths to noir-protocol-circuits ([e89bfd8](AztecProtocol/aztec-packages@e89bfd8)) * Replace relative paths to noir-protocol-circuits ([fae353e](AztecProtocol/aztec-packages@fae353e)) ### Documentation * Minor comments for private refunds/partial notes ([#7447](AztecProtocol/aztec-packages#7447)) ([9bcbb6c](AztecProtocol/aztec-packages@9bcbb6c)) </details> <details><summary>barretenberg: 0.46.5</summary> ## [0.46.5](AztecProtocol/aztec-packages@barretenberg-v0.46.4...barretenberg-v0.46.5) (2024-07-14) ### Features * Added barrett_reduction implementation into uintx ([#6768](AztecProtocol/aztec-packages#6768)) ([abced57](AztecProtocol/aztec-packages@abced57)) * Databus allows arbitrarily many reads per index ([#6524](AztecProtocol/aztec-packages#6524)) ([f07200c](AztecProtocol/aztec-packages@f07200c)) * Multiple trace structuring configurations ([#7408](AztecProtocol/aztec-packages#7408)) ([e4abe1d](AztecProtocol/aztec-packages@e4abe1d)) * Verify ClientIVC proofs through Bb binary ([#7407](AztecProtocol/aztec-packages#7407)) ([3760c64](AztecProtocol/aztec-packages@3760c64)) ### Bug Fixes * Lagrange interpolation ([#7440](AztecProtocol/aztec-packages#7440)) ([76bcd72](AztecProtocol/aztec-packages@76bcd72)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This PR adds a
barrett_reduction
method intounitx
, a fast division algorithm when the divisor is known ahead of time such that precomputed factors can be determined.barrett_reduction
is used to speed updivmod
for some important hardcoded moduli. Or particular relevance is the prime field associated with BN254 curve arithmetic, as expensive 1024-bitdivmod
operations are performed when computing witnesses withinstdlib::bitfield
- commonly used to perform non-native BN254 curve arithmetic.Speeds up biggroup batch_mul 4x