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) Implement new hints #35 and #36 #1033

Merged
merged 10 commits into from
Apr 24, 2023
Merged

Feat(hints) Implement new hints #35 and #36 #1033

merged 10 commits into from
Apr 24, 2023

Conversation

jpcenteno
Copy link
Contributor

@jpcenteno jpcenteno commented Apr 21, 2023

Feat(hints) Implement new hints #35 and #36

Description

This PR adds the missing hints NewHint#35 and NewHint#36, now known as BIGINT_PACK_DIV_MOD and BIGINT_SAFE_DIV as requested by the issue #975.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@github-actions
Copy link

github-actions bot commented Apr 21, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 2.527 ± 0.023 2.508 2.587 1.00 ± 0.02
head blake2s_integration_benchmark 2.525 ± 0.036 2.477 2.609 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.170 ± 0.038 3.117 3.240 1.03 ± 0.02
head compare_arrays_200000 3.070 ± 0.032 3.037 3.140 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.463 ± 0.029 2.422 2.516 1.03 ± 0.01
head dict_integration_benchmark 2.385 ± 0.019 2.365 2.425 1.00
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 3.814 ± 0.027 3.786 3.868 1.03 ± 0.02
head factorial_multirun 3.713 ± 0.048 3.664 3.819 1.00
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 3.084 ± 0.027 3.043 3.139 1.04 ± 0.01
head fibonacci_1000_multirun 2.955 ± 0.025 2.926 2.999 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 128.7 ± 0.9 127.6 130.6 1.00
head field_arithmetic_get_square_benchmark 130.4 ± 7.8 126.5 152.3 1.01 ± 0.06
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 3.025 ± 0.035 2.981 3.072 1.02 ± 0.02
head integration_builtins 2.954 ± 0.040 2.911 3.040 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 2.751 ± 0.067 2.683 2.907 1.03 ± 0.03
head keccak_integration_benchmark 2.664 ± 0.029 2.639 2.738 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 3.274 ± 0.043 3.228 3.362 1.04 ± 0.02
head linear_search 3.146 ± 0.020 3.118 3.179 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.803 ± 0.031 2.773 2.880 1.05 ± 0.01
head math_cmp_and_pow_integration_benchmark 2.669 ± 0.008 2.659 2.682 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.565 ± 0.027 2.527 2.606 1.03 ± 0.01
head math_integration_benchmark 2.487 ± 0.021 2.462 2.536 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.224 ± 0.021 2.193 2.265 1.05 ± 0.01
head memory_integration_benchmark 2.128 ± 0.008 2.120 2.146 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.266 ± 0.040 2.245 2.379 1.00 ± 0.03
head operations_with_data_structures_benchmarks 2.265 ± 0.046 2.224 2.374 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 794.0 ± 5.8 787.3 804.6 1.02 ± 0.01
head pedersen 779.8 ± 1.6 777.0 782.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.557 ± 0.022 1.535 1.598 1.02 ± 0.02
head poseidon_integration_benchmark 1.520 ± 0.009 1.506 1.534 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.408 ± 0.012 2.397 2.430 1.02 ± 0.01
head secp_integration_benchmark 2.366 ± 0.015 2.347 2.384 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.700 ± 0.006 1.693 1.715 1.01 ± 0.01
head set_integration_benchmark 1.677 ± 0.007 1.666 1.689 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 3.983 ± 0.029 3.947 4.040 1.02 ± 0.01
head uint256_integration_benchmark 3.920 ± 0.025 3.893 3.966 1.00

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #1033 (b3a34a2) into main (6e32e71) will decrease coverage by 0.02%.
The diff coverage is 96.53%.

@@            Coverage Diff             @@
##             main    #1033      +/-   ##
==========================================
- Coverage   98.08%   98.07%   -0.02%     
==========================================
  Files          79       80       +1     
  Lines       32802    33033     +231     
==========================================
+ Hits        32175    32398     +223     
- Misses        627      635       +8     
Impacted Files Coverage Δ
...cessor/builtin_hint_processor/secp/bigint_utils.rs 97.33% <94.89%> (-1.19%) ⬇️
...rc/hint_processor/builtin_hint_processor/bigint.rs 97.60% <97.60%> (ø)
...int_processor/builtin_hint_processor_definition.rs 98.85% <100.00%> (+0.01%) ⬆️

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

@Oppen Oppen enabled auto-merge April 21, 2023 21:43
@Oppen Oppen added this pull request to the merge queue Apr 24, 2023
Merged via the queue into main with commit 3be76c4 Apr 24, 2023
@Oppen Oppen deleted the 975_ec_bigint_hints branch April 24, 2023 18:18
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
…mbdaclass#1033)

* Implement BigInt5

* Implement hints 35 and 36

* Fix typo bug

* Add changes to CHANGELOG

* Fix broken build on WASM target

* Address Pelito's suggestion

* Fix sign check

---------

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants