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

fix: Program cmp depends on hints_ranges ordering #1351

Merged
merged 5 commits into from
Jul 28, 2023
Merged

Conversation

MegaRedHand
Copy link
Contributor

Description

This PR fixes the comparison of Program instances. If the same program was deserialized by two different cairo-vm builds, the resulting Programs' hints attributes would differ, even though both had the same functionality.

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.

@MegaRedHand MegaRedHand marked this pull request as ready for review July 26, 2023 21:23
@MegaRedHand MegaRedHand added the bug Something isn't working label Jul 26, 2023
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #1351 (c58f359) into main (31bf0f4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1351   +/-   ##
=======================================
  Coverage   97.49%   97.49%           
=======================================
  Files          93       93           
  Lines       37852    37853    +1     
=======================================
+ Hits        36902    36903    +1     
  Misses        950      950           
Files Changed Coverage Δ
vm/src/utils.rs 99.50% <ø> (ø)
vm/src/serde/deserialize_program.rs 97.33% <100.00%> (ø)
vm/src/types/program.rs 99.53% <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 Jul 26, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 3.667 ± 0.037 3.634 3.758 1.00
head big_factorial 3.683 ± 0.018 3.660 3.718 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 3.164 ± 0.016 3.138 3.191 1.00 ± 0.01
head big_fibonacci 3.152 ± 0.007 3.142 3.167 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 9.009 ± 0.097 8.926 9.179 1.00
head blake2s_integration_benchmark 9.036 ± 0.109 8.927 9.280 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.176 ± 0.026 3.151 3.228 1.00
head compare_arrays_200000 3.187 ± 0.019 3.162 3.222 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.186 ± 0.007 2.179 2.199 1.00
head dict_integration_benchmark 2.211 ± 0.008 2.197 2.226 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.717 ± 0.053 1.684 1.864 1.01 ± 0.03
head field_arithmetic_get_square_benchmark 1.704 ± 0.008 1.691 1.723 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 9.054 ± 0.068 8.968 9.190 1.00
head integration_builtins 9.057 ± 0.148 8.946 9.444 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 9.148 ± 0.089 9.063 9.373 1.00 ± 0.02
head keccak_integration_benchmark 9.138 ± 0.198 9.021 9.665 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 3.240 ± 0.016 3.219 3.271 1.01 ± 0.01
head linear_search 3.222 ± 0.011 3.208 3.242 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.319 ± 0.010 2.306 2.340 1.00
head math_cmp_and_pow_integration_benchmark 2.332 ± 0.005 2.324 2.341 1.01 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.113 ± 0.008 2.105 2.126 1.00 ± 0.00
head math_integration_benchmark 2.111 ± 0.005 2.105 2.121 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.865 ± 0.009 1.857 1.882 1.00
head memory_integration_benchmark 1.869 ± 0.008 1.858 1.888 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.107 ± 0.006 2.096 2.116 1.00
head operations_with_data_structures_benchmarks 2.115 ± 0.008 2.103 2.127 1.00 ± 0.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 818.9 ± 1.4 817.3 821.8 1.01 ± 0.00
head pedersen 814.2 ± 1.2 812.7 817.0 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.501 ± 0.006 1.495 1.515 1.00
head poseidon_integration_benchmark 1.505 ± 0.002 1.502 1.508 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.473 ± 0.007 2.469 2.492 1.00 ± 0.00
head secp_integration_benchmark 2.464 ± 0.006 2.455 2.474 1.00
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.264 ± 0.013 1.254 1.299 1.00
head set_integration_benchmark 1.266 ± 0.002 1.264 1.272 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 6.008 ± 0.031 5.980 6.074 1.00
head uint256_integration_benchmark 6.040 ± 0.031 6.015 6.099 1.01 ± 0.01

@pefontana pefontana added this pull request to the merge queue Jul 28, 2023
Merged via the queue into main with commit e959f56 Jul 28, 2023
@pefontana pefontana deleted the fix-program-cmp branch July 28, 2023 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants