Bump Noir toolchain to v1.0.0-beta.20 - #484
Open
BornPsych wants to merge 8 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
recmo
requested changes
Aug 19, 2026
recmo
left a comment
Contributor
There was a problem hiding this comment.
Mostly straightforward syntactic changes. Only thing substantial is the AND and XOR behavior which now includes a num_bits.
| @@ -594,20 +579,36 @@ impl NoirToR1CSCompiler { | |||
| // The inputs and outputs will have already been solved for by the ACIR solver. | |||
| // Noir blackbox AND/XOR operate on 32-bit values. We decompose into 4 bytes | |||
Contributor
There was a problem hiding this comment.
operate on 32-bit values
Is this still true?
Collaborator
Author
There was a problem hiding this comment.
nope, updated the comment
| } => { | ||
| // The byte pipeline decomposes operands into 4 bytes, which | ||
| // is sound for any width up to 32 (inputs are range-checked | ||
| // to `num_bits` by separate RANGE opcodes), but silently |
Contributor
There was a problem hiding this comment.
Are we sure about this?
// Barretenberg implementation of the AND and XOR blackbox constrain the inputs and output to be 'num_bit' bits
this flags the witness as range constraints, which allows further optimization to remove the RANGE opcodes.
Collaborator
Author
There was a problem hiding this comment.
Good catch, we can't rely on this RANGE opcode here.process_binop_opcode now adds range checks for witness operands when num_bits < 32.
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.
Moves the workspace from Noir v1.0.0-beta.11 to v1.0.0-beta.20. Most of the changes are for
cargo.toml/cargo.lock.The interesting part is what the nine compiler releases did to our circuits, measured below.Constraint counts
Measured with
provekit-cli preparefrom each toolchain:The growth has two sources, measured by changing one thing at a time on t_add_dsc_720:
Downgrading bignum is not an option: nothing below v0.10.0 compiles on beta.20, and noir_rsa pins v0.10.0.
Circuits without wide arithmetic go the other way: t_add_integrity_commit lost 44% of its opcodes and t_attest shrank slightly. SHA256 and Poseidon2 cost exactly the same on both sides.
Prover time
hyperfine, release builds of both trees, same machine. Two independent sessions, each one warmup run plus three timed runs; the table pools all six:
Flat, leaning 1-3% faster on beta.20 (complete_age_check is within noise). Two effects cancel: prover cost tracks the padded power-of-two sizes, which didn't move for any circuit, and witness generation got quicker because beta.20 makes fewer brillig calls. That speedup comes from sha256 v0.3.0 and the compiler, not bignum; the biggest drop is in a circuit with no bignum at all. On t_add_dsc_720, witgen goes from 113 ms to 88 ms with the commit phases unchanged. Proof sizes move under 1% and all proofs verify.
Notes for review
num_bits <= 32. The dsc circuit carries one 8-bit AND (on both toolchains); widths up to 32 are sound in the 4-byte decomposition, anything wider would truncate silently, so it panics instead.t_add_integrity_commit'sdg1_padded_lengthisu32now, following sha256 v0.3.0. The monolithic passport keepsu64with a cast; happy to align them if you have a preference.b4236c19byte for byte apart from the vendored stdlib, and preparing the same circuit from the git pin and from the registry build gives identical.pkp/.pkvfiles.Validation
Workspace tests, clippy and fmt are clean. The five shipped circuits prepare, prove and verify on beta.20, with the beta.11 runs above as the control. 56 of 58 example packages compile; the two failures predate this PR.
cargo bench -p provekit-benchruns, prove_poseidon_1000 median 470 ms (a second run replicated within 1%).AI Disclosure: The mechanical port and the measurement runs were done with Claude Code. I reviewed the diff, chose the library pin set and the binop-cap behavior, and checked the recomputed Barrett parameters against the moduli.