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(hints): add NewHint#50 #1045

Merged
merged 16 commits into from
Apr 26, 2023
Merged

feat(hints): add NewHint#50 #1045

merged 16 commits into from
Apr 26, 2023

Conversation

MegaRedHand
Copy link
Contributor

@MegaRedHand MegaRedHand commented Apr 24, 2023

Depends on: #1030

Description

This PR adds the missing hint NewHint#50, now known as UINT256_GET_SQUARE_ROOT. Also, allow trailing commas in non_continuous_ids_data macro.

@github-actions
Copy link

github-actions bot commented Apr 24, 2023

Benchmark Results for modified programs 🚀

Command Mean [ms] Min [ms] Max [ms] Relative
head field_arithmetic_get_square_benchmark 152.8 ± 2.7 150.6 159.9 1.00

@MegaRedHand MegaRedHand added the whitelisted-hint Implementation of hint on whitelist directory label Apr 24, 2023
@MegaRedHand MegaRedHand self-assigned this Apr 24, 2023
@github-actions
Copy link

github-actions bot commented Apr 24, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 2.787 ± 0.020 2.764 2.820 1.01 ± 0.01
head blake2s_integration_benchmark 2.750 ± 0.017 2.731 2.777 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.415 ± 0.071 3.362 3.561 1.02 ± 0.02
head compare_arrays_200000 3.361 ± 0.041 3.317 3.443 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.548 ± 0.014 2.529 2.573 1.01 ± 0.01
head dict_integration_benchmark 2.534 ± 0.013 2.509 2.554 1.00
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 4.135 ± 0.028 4.110 4.194 1.00
head factorial_multirun 4.239 ± 0.303 4.068 4.846 1.03 ± 0.07
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 3.327 ± 0.082 3.265 3.482 1.02 ± 0.03
head fibonacci_1000_multirun 3.255 ± 0.015 3.241 3.289 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 3.308 ± 0.151 3.241 3.734 1.03 ± 0.05
head integration_builtins 3.210 ± 0.017 3.194 3.247 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 3.035 ± 0.008 3.020 3.049 1.01 ± 0.01
head keccak_integration_benchmark 3.014 ± 0.013 2.997 3.037 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 3.512 ± 0.020 3.484 3.560 1.01 ± 0.02
head linear_search 3.487 ± 0.053 3.453 3.605 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.926 ± 0.013 2.906 2.944 1.00 ± 0.01
head math_cmp_and_pow_integration_benchmark 2.922 ± 0.032 2.901 3.006 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.644 ± 0.011 2.631 2.663 1.01 ± 0.01
head math_integration_benchmark 2.629 ± 0.011 2.616 2.649 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.342 ± 0.020 2.330 2.396 1.01 ± 0.01
head memory_integration_benchmark 2.312 ± 0.008 2.302 2.324 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.366 ± 0.016 2.351 2.404 1.00
head operations_with_data_structures_benchmarks 2.379 ± 0.091 2.338 2.634 1.01 ± 0.04
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 798.9 ± 16.4 786.2 831.9 1.02 ± 0.02
head pedersen 786.0 ± 4.0 782.5 796.5 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.489 ± 0.006 1.480 1.502 1.01 ± 0.01
head poseidon_integration_benchmark 1.473 ± 0.004 1.466 1.479 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.644 ± 0.018 2.626 2.681 1.01 ± 0.01
head secp_integration_benchmark 2.613 ± 0.006 2.605 2.623 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.912 ± 0.005 1.905 1.923 1.06 ± 0.01
head set_integration_benchmark 1.811 ± 0.018 1.794 1.858 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.151 ± 0.011 4.133 4.168 1.01 ± 0.01
head uint256_integration_benchmark 4.119 ± 0.043 4.094 4.238 1.00

@MegaRedHand MegaRedHand mentioned this pull request Apr 25, 2023
@MegaRedHand MegaRedHand force-pushed the newhint50-u256_get_square_root branch from 35bf536 to fe34649 Compare April 25, 2023 13:56
@MegaRedHand
Copy link
Contributor Author

Rebased onto main after the merge of NewHint#47

@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Merging #1045 (71dc08f) into main (ef35f61) will increase coverage by 0.00%.
The diff coverage is 98.68%.

@@           Coverage Diff            @@
##             main    #1045    +/-   ##
========================================
  Coverage   98.09%   98.09%            
========================================
  Files          84       84            
  Lines       33670    33810   +140     
========================================
+ Hits        33027    33165   +138     
- Misses        643      645     +2     
Impacted Files Coverage Δ
src/utils.rs 99.43% <ø> (ø)
...ocessor/builtin_hint_processor/field_arithmetic.rs 98.91% <98.64%> (-0.22%) ⬇️
...int_processor/builtin_hint_processor_definition.rs 98.97% <100.00%> (+<0.01%) ⬆️

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

CHANGELOG.md Show resolved Hide resolved
Copy link
Collaborator

@juanbono juanbono left a comment

Choose a reason for hiding this comment

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

See comments

@Oppen
Copy link
Contributor

Oppen commented Apr 26, 2023

See comments

Comments addressed. They are part of the verbatim hint and need to be kept in.

@MegaRedHand MegaRedHand added this pull request to the merge queue Apr 26, 2023
@MegaRedHand MegaRedHand removed this pull request from the merge queue due to a manual request Apr 26, 2023
@MegaRedHand MegaRedHand enabled auto-merge April 26, 2023 14:46
@MegaRedHand MegaRedHand added this pull request to the merge queue Apr 26, 2023
Merged via the queue into main with commit 86f233c Apr 26, 2023
@MegaRedHand MegaRedHand deleted the newhint50-u256_get_square_root branch April 26, 2023 15:08
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Add NewHint#50

* Update changelog

* Add TODO

* Fix changelog PR number

* Trigger recompilation for field_arithmetic.cairo

* Fix: insert success_gx

* Add border case tests

* Change some assert_matches + Ok for assert + is_ok

* Remove TODOs in field_arithmetic.cairo

---------

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.

3 participants