Repository navigation
Smaller circuit terms - #151
Merged
Merged
Conversation
frozenspider
marked this pull request as ready for review
November 13, 2026 15:14
xrvdg
approved these changes
Nov 17, 2026
xrvdg
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. I left one comment. Could you also review whether these tests are necessary? The project is accumulating generated unit tests that add little value. Just keep the ones that cover important behaviour and regressions.
Comment on lines
+672
to
+674
| impl SignedLimbCapacity for BigInt { | ||
| const MAX_SIGNED_LIMBS: usize = usize::MAX; | ||
| } |
Collaborator
There was a problem hiding this comment.
Do we still need BigInt or does this exist for comparison checking?
Collaborator
Author
There was a problem hiding this comment.
We no longer need dynamic size integer per se - BigInt constraint generators are test-only, and our circuits know their widest coefficient bound in advance.
However, replacing BigInt with fixed-size integer ring is outside of the scope. Might make sense to do as a follow-up though.
This was referenced Nov 24, 2026
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.
Resolves #44
Summary of changes:
BigInttoi64- this is safe to do as all coefficients areBitzSemiring: From<u64>toFrom<u32>. This does not involve any kind of performance penalty, but letsi64becomeBitzConstraintRing: BitzSemiring.check_witnessandIntegerProducts::is_satisfiednow perform check for arithmetics overflow.Result:
Measured on my machine:
cargo run --release -p bitz-cli -- circuit-e2e --circuit sha256-2kb --threads 5Synthesize constraintsPrepare integer matricescircuit-e2ecargo run --release -p bitz-cli -- circuit-e2e --circuit sha256-chain --num-blocks 600 --threads 5Synthesize constraintsPrepare integer matricescircuit-e2eOther running time numbers are unaffected.