Skip to content

Feat/add u256 - #30

Merged
Hrom131 merged 21 commits into
devfrom
feat/add-u256
Aug 14, 2026
Merged

Feat/add u256#30
Hrom131 merged 21 commits into
devfrom
feat/add-u256

Conversation

@aritkulova

@aritkulova aritkulova commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator
  • This PR suggests a bug fix and I've added the necessary tests.
  • This PR introduces a new feature and I've discussed the update in an Issue or with the team.
  • This PR is just a minor change like a typo fix.

refactored normalize_to_threshold to calculate_normalizer_base_64;
made algorithm_d function private
@aritkulova
aritkulova requested a review from Hrom131 August 1, 2026 13:50
@aritkulova aritkulova self-assigned this Aug 1, 2026
@Hrom131
Hrom131 changed the base branch from master to dev August 3, 2026 09:26

@LesterEvSe LesterEvSe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have the eq_128 function, but I couldn't find eq_256. So it would be better to add it as well

Comment thread simf/lib/u256.simf
Comment thread tests/common/helper.rs Outdated
Comment thread simf/lib/u256.simf Outdated
Comment thread tests/u256_test_arithmetic_2.rs Outdated
@LesterEvSe

Copy link
Copy Markdown
Collaborator

The u256_test_arithmetic_N naming makes it hard to tell which operations a file covers and where a given check lives. Let's split the tests by operation instead. Rather than the current naming, I suggest:

u256_test_compareis_zero / lt / le / eq
u256_test_addsplit / add / add_128
u256_test_mulsub / mul
u256_test_divdiv_mod_256_64 / div_mod_256_128 / div_mod_256 / div_256

Comment thread tests/common/helper.rs
Comment thread simf/u128_test_arithmetic.simf Outdated
@aritkulova

Copy link
Copy Markdown
Collaborator Author

We also have the eq_128 function, but I couldn't find eq_256. So it would be better to add it as well

We have a jet for eq_256, which is missing for u128

@LesterEvSe
LesterEvSe self-requested a review August 10, 2026 11:38
Comment thread simf/lib/u256.simf Outdated
Comment thread simf/lib/u256.simf Outdated
Comment thread simf/lib/u256.simf Outdated
Comment thread simf/lib/u256.simf Outdated
Comment thread tests/u128_test_arithmetic.rs Outdated
@aritkulova
aritkulova requested a review from LesterEvSe August 10, 2026 15:49

@LesterEvSe LesterEvSe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7ae47db; tested locally with simplex test --test-threads 8

@Hrom131 Hrom131 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Hrom131
Hrom131 merged commit 497d410 into dev Aug 14, 2026
1 check passed
@Hrom131
Hrom131 deleted the feat/add-u256 branch August 14, 2026 13:01
Arvolear added a commit that referenced this pull request Aug 24, 2026
* Convert functions for u8 (#34)

* added convert functions for u8

* commented out eq_256 (will be available with pr#30)

* added split and safe_convert functions

* refactored widening functions

* linting

* refactored u8 functions

* typo

* removed unused import

* Convert functions for u1 (#35)

* added assert_eq_bool

* added convert functions for u1

* Convert functions for u16 (#36)

* added convert functions for u16

* typo

* added convert functions for u32 (#37)

* Feat/add u256 (#30)

* added full_add_128;
refactored normalize_to_threshold to calculate_normalizer_base_64;
made algorithm_d function private

* added functions for uint256

* added U256Wrapper for u256 tests;
added tests for u256

* fixed typo

* splitted u256 arithmetic tests into two batches for faster tests

* refactored split_256_into_64

* added full_sub_128

* linting

* splitted u256 arithmetic tests into more batches

* typo

* removed unnecessary eq_256

* linting

* review fixes: typos, helper optimization

* renamed arithmetic tests files into more specific ones

* linting for consistency

* refactoring and typos

* added missing check for division algorithm

* added mul_128_64, mul_256_64 and mul_256_128 for optimization

* doc fixes and small refactoring

* Сonvert functions for u64 (#41)

* added convert functions for u64

* typo

* returned u32 typo back, it will be fixed in upcoming pr;
 renamed to -> into for u64

* added missing split_u64_into_u8

* fixed typo: `split to` -> `split into` (#43)

* Convert functions for u128 (#42)

* moved u128 to math file

* added convert functions for u128

* typo

* fixed typo

* added missing split_u128 functions

* resolved todo;
utilized assert_eq in tests

* fixed path

* splitted math file into comparison and bit

* renamed arithmetic test to basic math test for avoid ambiguity

* Convert functions for u256 (#47)

* added convert functions for u256;
splitted u256_math into bit and comparison

* updated readme

* bumped simplex version

* Update README

* Bump Simplex version (#49)

* quick reame fix

---------

Co-authored-by: Yuliia Aritkulova <94910987+aritkulova@users.noreply.github.com>
Co-authored-by: Artem Chystiakov <artem.ch31@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants