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: add check against cache overflow #1285

Merged
merged 6 commits into from Jun 29, 2023
Merged

fix: add check against cache overflow #1285

merged 6 commits into from Jun 29, 2023

Conversation

MegaRedHand
Copy link
Contributor

Closes #1283

Description

This PR adds a check before resizing the cache, to avoid a panic when jumping to a high and inexistent pc.

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 changed the title Add check against cache overflow fix: add check against cache overflow Jun 27, 2023
vm/src/vm/vm_core.rs Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Jun 27, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 13.187 ± 0.052 13.120 13.268 1.00
head blake2s_integration_benchmark 13.245 ± 0.046 13.146 13.316 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 4.540 ± 0.012 4.523 4.557 1.00
head compare_arrays_200000 4.556 ± 0.015 4.537 4.588 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.999 ± 0.013 2.978 3.022 1.00
head dict_integration_benchmark 3.032 ± 0.021 3.005 3.076 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base factorial_multirun 4.859 ± 0.018 4.824 4.892 1.00
head factorial_multirun 4.915 ± 0.027 4.868 4.953 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fibonacci_1000_multirun 4.167 ± 0.017 4.145 4.191 1.00
head fibonacci_1000_multirun 4.199 ± 0.038 4.170 4.302 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 2.276 ± 0.009 2.264 2.291 1.00
head field_arithmetic_get_square_benchmark 2.287 ± 0.022 2.269 2.344 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 11.736 ± 0.052 11.667 11.846 1.00 ± 0.01
head integration_builtins 11.728 ± 0.029 11.688 11.779 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 13.486 ± 0.709 13.218 15.496 1.01 ± 0.05
head keccak_integration_benchmark 13.373 ± 0.046 13.312 13.462 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 4.561 ± 0.022 4.535 4.611 1.00
head linear_search 4.573 ± 0.012 4.557 4.593 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 3.248 ± 0.012 3.225 3.265 1.00
head math_cmp_and_pow_integration_benchmark 3.249 ± 0.022 3.228 3.306 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.943 ± 0.009 2.931 2.958 1.00
head math_integration_benchmark 2.951 ± 0.013 2.936 2.970 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.565 ± 0.015 2.544 2.594 1.00
head memory_integration_benchmark 2.594 ± 0.040 2.573 2.706 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.901 ± 0.003 2.897 2.906 1.00
head operations_with_data_structures_benchmarks 2.928 ± 0.040 2.889 3.036 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base pedersen 1.009 ± 0.012 1.003 1.042 1.00 ± 0.01
head pedersen 1.008 ± 0.003 1.002 1.012 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.838 ± 0.002 1.836 1.841 1.00 ± 0.00
head poseidon_integration_benchmark 1.833 ± 0.006 1.824 1.840 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.474 ± 0.037 3.445 3.575 1.00
head secp_integration_benchmark 3.488 ± 0.015 3.465 3.508 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.772 ± 0.010 1.764 1.796 1.00
head set_integration_benchmark 1.778 ± 0.014 1.768 1.814 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 8.413 ± 0.024 8.370 8.446 1.00
head uint256_integration_benchmark 8.482 ± 0.031 8.439 8.527 1.01 ± 0.00

@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #1285 (0f9b8c1) into main (d46d2b6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1285   +/-   ##
=======================================
  Coverage   97.90%   97.90%           
=======================================
  Files          89       89           
  Lines       35465    35469    +4     
=======================================
+ Hits        34723    34727    +4     
  Misses        742      742           
Impacted Files Coverage Δ
vm/src/vm/vm_core.rs 97.80% <100.00%> (+<0.01%) ⬆️

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

@MegaRedHand MegaRedHand added this pull request to the merge queue Jun 29, 2023
Merged via the queue into main with commit 7e1df87 Jun 29, 2023
34 checks passed
@MegaRedHand MegaRedHand deleted the fix-overflow branch June 29, 2023 14:38
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jul 4, 2023
* Add check against cache overflow

* Fix off-by-one error

* Update changelog
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jul 4, 2023
* Add check against cache overflow

* Fix off-by-one error

* Update changelog
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jul 25, 2023
* Add check against cache overflow

* Fix off-by-one error

* Update changelog
kariy pushed a commit to dojoengine/cairo-rs that referenced this pull request Jul 25, 2023
* Add check against cache overflow

* Fix off-by-one error

* Update changelog
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.

Memory overflow bug
3 participants