fix: address LA Suggestion 3 review on v1#406
Merged
Merged
Conversation
Apply the v1-applicable parts of the c87f1a5 follow-up review: - binops.rs: drop the redundant 32-bit check in `cow_to_digit`. Constants reaching this helper have already been byte-decomposed by `process_binop_opcode` (each value is one byte of a 32-bit operand), so the assertion was unreachable. Document the byte-decomposition invariant in a comment. - binops.rs: drop the helper-level `cow_to_digit_rejects_oversized_constant` test. With the unreachable assertion removed there is nothing to exercise, and the test was previously panicking on a code path the real compiler flow could never produce. - noir_to_r1cs.rs: clarify the three inline 32-bit assertion messages in `process_binop_opcode` to say "exceeds the 32-bit binop limit", and add a comment at the lhs site explaining why: v1's binop pipeline is hardcoded to 32-bit operands (`(value as u32).to_le_bytes()`), so a wider constant would otherwise be silently truncated. The assertions themselves stay — they are correct for v1's 32-bit-only pipeline. The user-visible u64/u128 bug Bisht13 reported on main does not apply to v1: the width-parameterized binop refactor (cfcd5da) has not been ported, so v1 simply does not accept wider operands. Porting that refactor + the c87f1a5 fix together would be a separate, larger change.
dcbuild3r
pushed a commit
that referenced
this pull request
May 16, 2026
fix: address LA Suggestion 3 review on v1
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.
Summary
binops.rs: drop the redundant 32-bit check in
cow_to_digit. Constants reaching this helper have already been byte-decomposed byprocess_binop_opcode(each value is one byte of a 32-bit operand), so the assertion was unreachable. Document the byte-decomposition invariant in a comment.drop the helper-level
cow_to_digit_rejects_oversized_constanttest.