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 BLAKE2S_FINALIZE hint variant #1072

Merged
merged 18 commits into from
Apr 28, 2023
Merged

Conversation

fmoletta
Copy link
Contributor

TITLE

Description

Description of the pull request changes and motivation.

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.

@fmoletta fmoletta linked an issue Apr 26, 2023 that may be closed by this pull request
@fmoletta fmoletta marked this pull request as ready for review April 26, 2023 17:58
@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #1072 (dc7b214) into main (f19cc88) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1072   +/-   ##
=======================================
  Coverage   98.10%   98.11%           
=======================================
  Files          84       84           
  Lines       34179    34205   +26     
=======================================
+ Hits        33533    33559   +26     
  Misses        646      646           
Impacted Files Coverage Δ
..._processor/builtin_hint_processor/blake2s_utils.rs 99.78% <100.00%> (+0.01%) ⬆️
...int_processor/builtin_hint_processor_definition.rs 99.04% <100.00%> (+<0.01%) ⬆️

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

@github-actions
Copy link

github-actions bot commented Apr 26, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 3.551 ± 0.051 3.512 3.654 1.00
head blake2s_integration_benchmark 3.650 ± 0.079 3.541 3.781 1.03 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.278 ± 0.101 4.168 4.513 1.00
head compare_arrays_200000 4.287 ± 0.088 4.179 4.464 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 3.175 ± 0.046 3.096 3.252 1.00
head dict_integration_benchmark 3.177 ± 0.057 3.119 3.319 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 5.157 ± 0.138 5.052 5.521 1.00
head factorial_multirun 5.199 ± 0.077 5.113 5.358 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 4.133 ± 0.064 4.040 4.256 1.00 ± 0.02
head fibonacci_1000_multirun 4.128 ± 0.049 4.061 4.215 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base field_arithmetic_get_square_benchmark 141.1 ± 2.6 138.8 147.5 1.00
head field_arithmetic_get_square_benchmark 141.2 ± 5.1 135.2 150.6 1.00 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 3.997 ± 0.049 3.924 4.109 1.00
head integration_builtins 4.047 ± 0.047 3.989 4.137 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 3.866 ± 0.078 3.762 4.012 1.00
head keccak_integration_benchmark 3.890 ± 0.042 3.837 3.980 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.304 ± 0.031 4.253 4.369 1.00
head linear_search 4.360 ± 0.074 4.287 4.548 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.545 ± 0.052 3.475 3.641 1.00
head math_cmp_and_pow_integration_benchmark 3.585 ± 0.046 3.523 3.639 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 3.220 ± 0.037 3.148 3.262 1.00
head math_integration_benchmark 3.244 ± 0.109 3.152 3.513 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.870 ± 0.037 2.827 2.935 1.00
head memory_integration_benchmark 2.916 ± 0.114 2.813 3.179 1.02 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.862 ± 0.100 2.761 3.123 1.00
head operations_with_data_structures_benchmarks 2.902 ± 0.060 2.827 2.980 1.01 ± 0.04
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 993.0 ± 20.9 961.5 1024.4 1.01 ± 0.03
head pedersen 981.5 ± 15.4 962.3 1009.7 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.829 ± 0.040 1.771 1.904 1.00
head poseidon_integration_benchmark 1.849 ± 0.036 1.807 1.920 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.300 ± 0.032 3.254 3.351 1.00
head secp_integration_benchmark 3.352 ± 0.045 3.305 3.430 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.441 ± 0.046 2.371 2.545 1.00
head set_integration_benchmark 2.443 ± 0.028 2.399 2.487 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.790 ± 0.083 4.668 4.897 1.01 ± 0.02
head uint256_integration_benchmark 4.741 ± 0.026 4.694 4.779 1.00

Copy link
Contributor

@MegaRedHand MegaRedHand left a comment

Choose a reason for hiding this comment

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

Missing a call in the integration test. Otherwise LGTM 👍

cairo_programs/blake2s_finalize_v3.cairo Outdated Show resolved Hide resolved
@fmoletta fmoletta marked this pull request as draft April 27, 2023 15:15
@fmoletta fmoletta marked this pull request as ready for review April 27, 2023 17:29
@fmoletta fmoletta changed the title feat(hints): Add alternative hint code for BLAKE2S_FINALIZE feat(hints): Add BLAKE2S_FINALIZE hint variant Apr 27, 2023
@fmoletta fmoletta marked this pull request as draft April 27, 2023 20:47
@fmoletta fmoletta marked this pull request as ready for review April 27, 2023 21:24
@fmoletta fmoletta added this pull request to the merge queue Apr 28, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 28, 2023
@fmoletta fmoletta added this pull request to the merge queue Apr 28, 2023
Merged via the queue into main with commit d41c959 Apr 28, 2023
@fmoletta fmoletta deleted the blake2s-finalize-v3 branch April 28, 2023 15:16
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jun 23, 2023
* Add alternative hint code for BLAKE2S_FINALIZE

* Add changelog entry

* Add integration test

* Update cairo_run_test.rs

* Fix memory hole value in test

* Call finalize_blake2s in test

* Simplify integration test

* fmt

* Implement BLAKE2S_FINALIZE_V3 hint

* fmt

* Fix changelog description

* Remove test file, use proper one

* Fix test

* fmt
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.

NewHint#11 shouldn't appear in issue #1031
3 participants