-
Notifications
You must be signed in to change notification settings - Fork 609
chore: bigfield todo fixes #15202
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
Merged
Merged
chore: bigfield todo fixes #15202
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7d1176a
remove (unused) modulus from non_native_field_witnesses.
suyash67 a3c1001
simplify condition for l and r constant_to_fixed_wit.
suyash67 89b8811
remove redundant static casts (prob were there because we didn't have…
suyash67 6fdf16a
modify the input to queue_partial_non_native_field_multiplication as …
suyash67 f8415b7
fix bigfield use of queue_partial_non_native_field_multiplication
suyash67 d5b089d
rename non_native_field_witnesses to non_native_multiplication_witnes…
suyash67 d1909f9
define a fn to get witness indices of limbs, and use it in evaluate_n…
suyash67 697cb21
remove TODO: this one suggests auditing the `evaluate_linear_identity…
suyash67 ad1dc83
use is_constant.
suyash67 b9e816a
make sure all limbs is_constant is the same in is_constant fn.
suyash67 20808fd
remove todo issue#14662 on ap.
suyash67 d1fff0b
add todo in ultra circuit builder: decompose_into_default_range. pote…
suyash67 aaa7fa8
remove == todo, not necessary. resolves bb#999.
suyash67 60f8c98
simplification (no logic change) in assert_less_than.
suyash67 b1aeba0
resolves ap#14660, we don't allow some limbs to be const and some not…
suyash67 1a75786
remove todo from reduction check, not necessary to pursue. resolve ap…
suyash67 3a203e3
use efficient div to calculate constant to add, should not change cir…
suyash67 f507703
change the dummy gate TODO to a NOTE.
suyash67 86ff6db
get rid of old TODO.
suyash67 7c3a678
resolved TODO related to redundant multiplication ==> we cannot simpl…
suyash67 8c5b189
closed the issue re assert_equal when `other` is constant. changed it…
suyash67 9084982
change TODO in sqr to NOTE.
suyash67 d9668dd
TODO in pow: avoid squaring for last bit, low hanging fruit 1.
suyash67 58afe6f
add is_constant conditional for pow.
suyash67 0de6540
change TODO to NOTE in pow.
suyash67 3ea68cf
remove old plookup tests, no more req.
suyash67 dececd5
remove commented out lines in tests: cleanup.
suyash67 8678713
add div_with_constant test and remove old commented out one.
suyash67 e5d431b
add ASSERT on numerator size < 16.
suyash67 0a94476
Assert that inp is constant in lambda fn.
suyash67 283684b
kesha suggestion: avoid redundant is_constant() calls.
suyash67 4dda0ef
kesha suggestion: add const/witness test case.
suyash67 3a13040
kesha suggestion 3: assert that atleast one multiplicand is witness.
suyash67 c11a828
enable madd test, add mult_madd with constant test.
suyash67 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -556,6 +556,7 @@ TEST(UltraCircuitBuilder, SortWidgetNeg) | |
|
|
||
| TEST(UltraCircuitBuilder, ComposedRangeConstraint) | ||
| { | ||
| // even num bits - not divisible by 3 | ||
| UltraCircuitBuilder builder = UltraCircuitBuilder(); | ||
| auto c = fr::random_element(); | ||
| auto d = uint256_t(c).slice(0, 133); | ||
|
|
@@ -564,6 +565,14 @@ TEST(UltraCircuitBuilder, ComposedRangeConstraint) | |
| builder.create_add_gate({ a_idx, builder.zero_idx, builder.zero_idx, 1, 0, 0, -fr(e) }); | ||
| builder.decompose_into_default_range(a_idx, 134); | ||
|
|
||
| // odd num bits - divisible by 3 | ||
| auto c_1 = fr::random_element(); | ||
| auto d_1 = uint256_t(c_1).slice(0, 126); | ||
| auto e_1 = fr(d_1); | ||
| auto a_idx_1 = builder.add_variable(fr(e_1)); | ||
| builder.create_add_gate({ a_idx_1, builder.zero_idx, builder.zero_idx, 1, 0, 0, -fr(e_1) }); | ||
| builder.decompose_into_default_range(a_idx_1, 127); | ||
|
|
||
| bool result = CircuitChecker::check(builder); | ||
| EXPECT_EQ(result, true); | ||
| } | ||
|
|
@@ -612,8 +621,8 @@ TEST(UltraCircuitBuilder, NonNativeFieldMultiplication) | |
| const auto q_indices = get_limb_witness_indices(split_into_limbs(uint256_t(q))); | ||
| const auto r_indices = get_limb_witness_indices(split_into_limbs(uint256_t(r))); | ||
|
|
||
| non_native_field_witnesses<fr> inputs{ | ||
| a_indices, b_indices, q_indices, r_indices, modulus_limbs, fr(uint256_t(modulus)), | ||
| non_native_multiplication_witnesses<fr> inputs{ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renaming, and removed |
||
| a_indices, b_indices, q_indices, r_indices, modulus_limbs, | ||
| }; | ||
| const auto [lo_1_idx, hi_1_idx] = builder.evaluate_non_native_field_multiplication(inputs); | ||
| builder.range_constrain_two_limbs(lo_1_idx, hi_1_idx, 70, 70); | ||
|
|
@@ -670,8 +679,8 @@ TEST(UltraCircuitBuilder, NonNativeFieldMultiplicationSortCheck) | |
| const auto q_indices = get_limb_witness_indices(split_into_limbs(uint256_t(q))); | ||
| const auto r_indices = get_limb_witness_indices(split_into_limbs(uint256_t(r))); | ||
|
|
||
| non_native_field_witnesses<fr> inputs{ | ||
| a_indices, b_indices, q_indices, r_indices, modulus_limbs, fr(uint256_t(modulus)), | ||
| non_native_multiplication_witnesses<fr> inputs{ | ||
| a_indices, b_indices, q_indices, r_indices, modulus_limbs, | ||
| }; | ||
| const auto [lo_1_idx, hi_1_idx] = builder.evaluate_non_native_field_multiplication(inputs); | ||
| builder.range_constrain_two_limbs(lo_1_idx, hi_1_idx, 70, 70); | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added test case for
decompose_into_default_rangewith odd num of bits.