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#49 #1043

Merged
merged 9 commits into from
Apr 25, 2023
Merged

feat(hints): add NewHint#49 #1043

merged 9 commits into from
Apr 25, 2023

Conversation

MegaRedHand
Copy link
Contributor

@MegaRedHand MegaRedHand commented Apr 24, 2023

Depends on: #1030

Description

This PR adds the missing hint NewHint#49, now known as INV_MOD_P_UINT256.

It also refactors inv_mod_p_uint512, so it uses recently added Uint512 and Uint256 with their pack and split methods.

@MegaRedHand MegaRedHand self-assigned this Apr 24, 2023
@MegaRedHand MegaRedHand added the whitelisted-hint Implementation of hint on whitelist directory label Apr 24, 2023
@MegaRedHand MegaRedHand mentioned this pull request Apr 24, 2023
Base automatically changed from newhint47-u512_udiv_rem to main April 24, 2023 22:12
@MegaRedHand
Copy link
Contributor Author

Rebased to main after merge of NewHint#47

@github-actions
Copy link

github-actions bot commented Apr 25, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 2.504 ± 0.023 2.477 2.549 1.00
head blake2s_integration_benchmark 2.539 ± 0.025 2.518 2.604 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.108 ± 0.038 3.073 3.196 1.00
head compare_arrays_200000 3.154 ± 0.023 3.129 3.211 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.427 ± 0.010 2.412 2.446 1.00
head dict_integration_benchmark 2.449 ± 0.018 2.432 2.495 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 3.756 ± 0.012 3.736 3.780 1.00
head factorial_multirun 3.821 ± 0.040 3.787 3.915 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 3.060 ± 0.054 3.009 3.155 1.00
head fibonacci_1000_multirun 3.070 ± 0.015 3.049 3.091 1.00 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 127.9 ± 1.1 126.4 129.8 1.00
head field_arithmetic_get_square_benchmark 128.1 ± 0.9 127.0 129.6 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 2.956 ± 0.023 2.935 3.012 1.00
head integration_builtins 3.003 ± 0.008 2.996 3.019 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 2.671 ± 0.025 2.644 2.732 1.00
head keccak_integration_benchmark 2.716 ± 0.028 2.689 2.788 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base linear_search 3.169 ± 0.017 3.150 3.202 1.00
head linear_search 3.247 ± 0.048 3.210 3.378 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.717 ± 0.012 2.696 2.733 1.00
head math_cmp_and_pow_integration_benchmark 2.742 ± 0.016 2.720 2.773 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.482 ± 0.011 2.467 2.504 1.00
head math_integration_benchmark 2.527 ± 0.008 2.514 2.541 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.149 ± 0.011 2.134 2.170 1.00
head memory_integration_benchmark 2.187 ± 0.011 2.175 2.207 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.221 ± 0.010 2.203 2.237 1.00
head operations_with_data_structures_benchmarks 2.257 ± 0.028 2.233 2.313 1.02 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 778.2 ± 1.5 775.3 780.6 1.00
head pedersen 790.1 ± 2.4 786.8 795.7 1.02 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.516 ± 0.015 1.499 1.545 1.00
head poseidon_integration_benchmark 1.528 ± 0.019 1.510 1.578 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.372 ± 0.007 2.362 2.386 1.00
head secp_integration_benchmark 2.408 ± 0.009 2.396 2.425 1.01 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.694 ± 0.026 1.677 1.766 1.00 ± 0.02
head set_integration_benchmark 1.689 ± 0.006 1.682 1.702 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 3.935 ± 0.033 3.900 4.000 1.00
head uint256_integration_benchmark 3.981 ± 0.012 3.957 3.992 1.01 ± 0.01

@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Merging #1043 (4a97fa9) into main (4842bf1) will decrease coverage by 0.01%.
The diff coverage is 98.64%.

@@            Coverage Diff             @@
##             main    #1043      +/-   ##
==========================================
- Coverage   98.08%   98.08%   -0.01%     
==========================================
  Files          84       84              
  Lines       33459    33475      +16     
==========================================
+ Hits        32818    32833      +15     
- Misses        641      642       +1     
Impacted Files Coverage Δ
...rc/hint_processor/builtin_hint_processor/vrf/fq.rs 97.56% <97.61%> (+0.06%) ⬆️
...int_processor/builtin_hint_processor_definition.rs 98.92% <100.00%> (+<0.01%) ⬆️
...or/builtin_hint_processor/vrf/inv_mod_p_uint512.rs 100.00% <100.00%> (ø)

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

@Oppen Oppen added this pull request to the merge queue Apr 25, 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 25, 2023
@MegaRedHand MegaRedHand added this pull request to the merge queue Apr 25, 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 25, 2023
@MegaRedHand MegaRedHand added this pull request to the merge queue Apr 25, 2023
Merged via the queue into main with commit 54c8d25 Apr 25, 2023
15 checks passed
@MegaRedHand MegaRedHand deleted the newhint49-inv_mod_p_u256 branch April 25, 2023 21:32
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Add tests for new hint

* Refactor `inv_mod_p_uint512` to use new helpers

* Add NewHint#49

* Update changelog

* Trigger recompilation of fq_test.cairo

* Revert "Trigger recompilation of fq_test.cairo"

This reverts commit ae30228.
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.

None yet

3 participants