Skip to content
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

feat: Implement hints on uint384 lib (Part 1) #960

Merged
merged 32 commits into from
Apr 14, 2023
Merged

feat: Implement hints on uint384 lib (Part 1) #960

merged 32 commits into from
Apr 14, 2023

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Apr 11, 2023

lib where these hints come from can be found here (https://github.com/NethermindEth/research-basic-Cairo-operations-big-integers/blob/main/lib/uint384.cairo)
Contains 5 hints:
UINT384_UNSIGNED_DIV_REM
UINT384_SPLIT_128
ADD_NO_UINT384_CHECK
UINT384_UNSIGNED_DIV_REM_EXPANDED
UINT384_SQRT

@fmoletta fmoletta added the whitelisted-hint Implementation of hint on whitelist directory label Apr 11, 2023
@fmoletta fmoletta changed the title Implement hints on 348_prime_field whitelist Implement hints on 384_prime_field whitelist Apr 12, 2023
@fmoletta fmoletta changed the title Implement hints on 384_prime_field whitelist Implement hints on uint384 lib Apr 13, 2023
@fmoletta fmoletta changed the title Implement hints on uint384 lib feat: Implement hints on uint384 lib Apr 13, 2023
@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #960 (6861479) into main (5d861c9) will increase coverage by 0.00%.
The diff coverage is 97.91%.

@@           Coverage Diff            @@
##             main     #960    +/-   ##
========================================
  Coverage   97.75%   97.75%            
========================================
  Files          74       75     +1     
  Lines       30538    30970   +432     
========================================
+ Hits        29851    30274   +423     
- Misses        687      696     +9     
Impacted Files Coverage Δ
...c/hint_processor/builtin_hint_processor/uint384.rs 97.86% <97.86%> (ø)
...int_processor/builtin_hint_processor_definition.rs 98.69% <100.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

Why are all the hint functions public?

src/hint_processor/builtin_hint_processor/uint384.rs Outdated Show resolved Hide resolved
src/hint_processor/builtin_hint_processor/uint384.rs Outdated Show resolved Hide resolved
src/hint_processor/builtin_hint_processor/uint384.rs Outdated Show resolved Hide resolved
@fmoletta
Copy link
Member Author

Why are all the hint functions public
No real reason, they have all been public since the start, we can create an issue to change all of them to pub(crate)

fmoletta and others added 3 commits April 13, 2023 16:09
Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
@fmoletta fmoletta requested a review from Oppen April 13, 2023 19:15
@pefontana pefontana added this pull request to the merge queue Apr 14, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Apr 14, 2023
@fmoletta fmoletta enabled auto-merge April 14, 2023 15:45
@fmoletta fmoletta added this pull request to the merge queue Apr 14, 2023
Merged via the queue into main with commit 1a188e7 Apr 14, 2023
8 checks passed
@fmoletta fmoletta deleted the uint348-hints branch April 14, 2023 16:31
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Add hint code for UINT348_UNSIGNED_DIV_REM

* Add file for uint348 files

* Add pack & split for uint348

* Move comment

* Implement uint348_unsigned_div_rem hint

* Add integration test

* Add integration test

* Add unit tests

* Add hint on split_128

* Test split_128 hint

* Add add_no_uint384_hint

* Fix hint + add tests

* Add hint code for UINT348_UNSIGNED_DIV_REM_EXPAND

* Msc fixes

* Add integration test

* Reduce Uint384_expand representation to the 3 used limbs

* Add unit test

* Add hint code for UINT384_SQRT

* Add implementation for hint on sqrt

* Integration test

* Add unit tests

* Fix missing directive

* Run cairo-format

* Add changelog entry

* Spelling

* Update src/hint_processor/builtin_hint_processor/uint384.rs

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Update src/hint_processor/builtin_hint_processor/uint384.rs

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Update src/hint_processor/builtin_hint_processor/uint384.rs

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>

* Make hint code more readable

* fix fmt

---------

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whitelisted-hint Implementation of hint on whitelist directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Hint] UINT348_UNSIGNED_DIV_REM_EXPANDED [New Hint] UINT348_UNSIGNED_DIV_REM
3 participants