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.
Related Issues
Updating test cases and improving the handling of BigInt operations. The most important changes involve modifying test cases to use random values and ensuring that operations can handle overflow or underflow well.
Key takeaway
log_limb_size
andnum_limb
will affect the accuracy of carry handling during add/sub. Need to adjust according to the optimal limb size of Montgomery Multiplication choice. In this case,mont_mul_cios
withlog_limb_size = 16
for BN254 basefield.Test Case Improvements:
mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_unsafe.rs
: Updated thetest_bigint_add_unsafe
function to use random values for BigInt operations and ensure no overflow occurs during addition. [1] [2]mopro-msm/src/msm/metal_msm/tests/bigint/bigint_add_wide.rs
: Renamed and updated thetest_bigint_add
function totest_bigint_add_no_overflow
, and added a new test functiontest_bigint_add_overflow
to handle overflow scenarios. Both functions now use random values for BigInt operations. [1] [2] [3]mopro-msm/src/msm/metal_msm/tests/bigint/bigint_sub.rs
: Renamed and updated thetest_bigint_sub
function totest_bigint_sub_no_underflow
, and added a new test functiontest_bigint_sub_underflow
to handle underflow scenarios. Both functions now use random values for BigInt operations. [1] [2] [3]Misc File Updates:
mopro-msm/.gitignore
: Updated the ignore pattern for Metal shader constants file to be more specific.mopro-msm/src/msm/metal_msm/shader/constants.metal
: Removed autogenerated constants, as they are no longer needed.