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 snapshot_take for arrays. #716

Merged
merged 3 commits into from
Jul 4, 2024
Merged

Fix snapshot_take for arrays. #716

merged 3 commits into from
Jul 4, 2024

Conversation

azteca1998
Copy link
Collaborator

Currently, snapshot_take only deep-clones the first element of the array, causing segfaults in some cases and invalid data in others. This PR fixes that.

Checklist

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

@azteca1998 azteca1998 marked this pull request as ready for review July 3, 2024 20:18
Copy link

github-actions bot commented Jul 3, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.404 ± 0.072 11.280 11.495 23.56 ± 0.52
cairo-native (embedded AOT) 1.574 ± 0.007 1.562 1.584 3.25 ± 0.07
cairo-native (embedded JIT using LLVM's ORC Engine) 1.648 ± 0.014 1.626 1.673 3.40 ± 0.08
cairo-native (standalone AOT) 0.652 ± 0.001 0.651 0.655 1.35 ± 0.03
cairo-native (standalone AOT with -march=native) 0.484 ± 0.010 0.480 0.513 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.788 ± 0.045 10.725 10.857 1319.83 ± 29.50
cairo-native (embedded AOT) 1.137 ± 0.013 1.121 1.160 139.12 ± 3.45
cairo-native (embedded JIT using LLVM's ORC Engine) 1.144 ± 0.007 1.138 1.162 139.93 ± 3.20
cairo-native (standalone AOT) 0.009 ± 0.001 0.008 0.017 1.04 ± 0.08
cairo-native (standalone AOT with -march=native) 0.008 ± 0.000 0.008 0.010 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 1.951 ± 0.016 1.921 1.975 29.42 ± 0.28
cairo-native (embedded AOT) 1.276 ± 0.011 1.258 1.292 19.24 ± 0.18
cairo-native (embedded JIT using LLVM's ORC Engine) 1.462 ± 0.017 1.442 1.499 22.05 ± 0.27
cairo-native (standalone AOT) 0.107 ± 0.000 0.107 0.108 1.62 ± 0.01
cairo-native (standalone AOT with -march=native) 0.066 ± 0.000 0.066 0.068 1.00

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.82609% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.67%. Comparing base (218131f) to head (1432385).

Files Patch % Lines
src/executor.rs 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #716      +/-   ##
==========================================
+ Coverage   91.61%   91.67%   +0.06%     
==========================================
  Files         118      118              
  Lines       32520    32599      +79     
==========================================
+ Hits        29792    29886      +94     
+ Misses       2728     2713      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@edg-l edg-l added priority review-ready A PR that is ready for review labels Jul 4, 2024
Copy link
Member

@pefontana pefontana left a comment

Choose a reason for hiding this comment

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

Nice one @azteca1998 !!!!

@pefontana pefontana added this pull request to the merge queue Jul 4, 2024
Merged via the queue into main with commit 00bb1f3 Jul 4, 2024
9 checks passed
@pefontana pefontana deleted the fix-array-snapshot_take branch July 4, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority review-ready A PR that is ready for review
Projects
None yet
4 participants