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

Implement hint from get_felt_bitlength (Garaga) #993

Merged
merged 20 commits into from
Apr 20, 2023

Conversation

jpcenteno
Copy link
Contributor

@jpcenteno jpcenteno commented Apr 14, 2023

Implement hint from get_felt_bitlength (Garaga)

ISSUE: #977

Description

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.

@pefontana
Copy link
Member

Can you add some unit tests?

@github-actions
Copy link

github-actions bot commented Apr 17, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 2.529 ± 0.038 2.498 2.627 1.00
head blake2s_integration_benchmark 2.587 ± 0.018 2.565 2.627 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.124 ± 0.030 3.077 3.183 1.00
head compare_arrays_200000 3.244 ± 0.032 3.208 3.321 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.433 ± 0.014 2.412 2.456 1.00
head dict_integration_benchmark 2.497 ± 0.014 2.478 2.519 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 3.816 ± 0.019 3.792 3.853 1.00
head factorial_multirun 3.910 ± 0.010 3.897 3.924 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 3.033 ± 0.021 3.005 3.085 1.00
head fibonacci_1000_multirun 3.147 ± 0.031 3.121 3.220 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 3.110 ± 0.025 3.091 3.176 1.00
head integration_builtins 3.193 ± 0.056 3.149 3.335 1.03 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 2.714 ± 0.051 2.668 2.824 1.00
head keccak_integration_benchmark 2.758 ± 0.031 2.730 2.839 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 3.212 ± 0.014 3.195 3.238 1.00
head linear_search 3.328 ± 0.041 3.297 3.441 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.742 ± 0.013 2.726 2.766 1.00
head math_cmp_and_pow_integration_benchmark 2.824 ± 0.019 2.803 2.866 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.514 ± 0.009 2.498 2.529 1.00
head math_integration_benchmark 2.581 ± 0.010 2.567 2.599 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.187 ± 0.014 2.168 2.204 1.00
head memory_integration_benchmark 2.231 ± 0.010 2.212 2.249 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.235 ± 0.008 2.222 2.246 1.00
head operations_with_data_structures_benchmarks 2.305 ± 0.027 2.280 2.377 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base pedersen 3.203 ± 0.007 3.198 3.218 1.00
head pedersen 3.208 ± 0.007 3.201 3.222 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.510 ± 0.009 1.497 1.526 1.00
head poseidon_integration_benchmark 1.526 ± 0.006 1.521 1.538 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.395 ± 0.013 2.381 2.423 1.00
head secp_integration_benchmark 2.440 ± 0.010 2.427 2.453 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.697 ± 0.023 1.679 1.744 1.00
head set_integration_benchmark 1.709 ± 0.008 1.701 1.723 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 3.938 ± 0.017 3.916 3.978 1.00
head uint256_integration_benchmark 4.037 ± 0.013 4.018 4.056 1.03 ± 0.01

@codecov
Copy link

codecov bot commented Apr 17, 2023

Codecov Report

Merging #993 (707c4d0) into main (11b6c37) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #993   +/-   ##
=======================================
  Coverage   98.04%   98.04%           
=======================================
  Files          76       77    +1     
  Lines       31880    31927   +47     
=======================================
+ Hits        31256    31303   +47     
  Misses        624      624           
Impacted Files Coverage Δ
...int_processor/builtin_hint_processor_definition.rs 98.81% <100.00%> (+<0.01%) ⬆️
...rc/hint_processor/builtin_hint_processor/garaga.rs 100.00% <100.00%> (ø)

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

@jpcenteno
Copy link
Contributor Author

Can you add some unit tests?

Done

@Oppen Oppen added this pull request to the merge queue Apr 19, 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 19, 2023
@jpcenteno jpcenteno added this pull request to the merge queue Apr 19, 2023
Merged via the queue into main with commit 4bc5541 Apr 20, 2023
@jpcenteno jpcenteno deleted the get_felt_bitlength-garaga branch April 20, 2023 00:28
@pefontana pefontana added the whitelisted-hint Implementation of hint on whitelist directory label Apr 20, 2023
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Implement hint from `get_felt_bitlength` (Garaga)

* Update changelog

* Fix format

* Use WASM-compatible `HashMap`

* Fix broken imports

* Import WASM-compatible `String`

* Add a unit test for bit lenght hint

* Fix typo

* Add test cases

* Refactor tests

* Add a wraparound test

* Fix missing import for wasm-tests

* Remove unused match clause.

---------

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