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: cairo_native swaps the high and low fields of U256 compared to Cairo's u256 #720

Merged
merged 8 commits into from
Jul 8, 2024

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Jul 5, 2024

Fixes #715

I introduced this when i added the corelib tests, instead of changing the field order of the u256, instead i swapped the tests and starknet syscall impl, but that was wrong, now its fixed

Checklist

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

Copy link

github-actions bot commented Jul 5, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.300 ± 0.063 11.234 11.425 23.46 ± 0.26
cairo-native (embedded AOT) 1.541 ± 0.010 1.522 1.554 3.20 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 1.617 ± 0.009 1.605 1.632 3.36 ± 0.04
cairo-native (standalone AOT) 0.654 ± 0.002 0.651 0.656 1.36 ± 0.01
cairo-native (standalone AOT with -march=native) 0.482 ± 0.005 0.480 0.495 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.726 ± 0.030 10.686 10.774 1317.98 ± 23.74
cairo-native (embedded AOT) 1.110 ± 0.006 1.103 1.123 136.35 ± 2.53
cairo-native (embedded JIT using LLVM's ORC Engine) 1.118 ± 0.003 1.111 1.123 137.40 ± 2.48
cairo-native (standalone AOT) 0.008 ± 0.000 0.008 0.012 1.04 ± 0.03
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.909 ± 0.013 1.893 1.937 28.88 ± 0.21
cairo-native (embedded AOT) 1.257 ± 0.006 1.251 1.266 19.01 ± 0.10
cairo-native (embedded JIT using LLVM's ORC Engine) 1.431 ± 0.013 1.414 1.451 21.64 ± 0.20
cairo-native (standalone AOT) 0.107 ± 0.000 0.107 0.107 1.62 ± 0.00
cairo-native (standalone AOT with -march=native) 0.066 ± 0.000 0.066 0.066 1.00

@edg-l edg-l added the review-ready A PR that is ready for review label Jul 5, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.68%. Comparing base (ccbd2da) to head (0e9d0e4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #720   +/-   ##
=======================================
  Coverage   91.68%   91.68%           
=======================================
  Files         118      118           
  Lines       32644    32644           
=======================================
  Hits        29931    29931           
  Misses       2713     2713           

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

@pefontana pefontana mentioned this pull request Jul 5, 2024
5 tasks
azteca1998
azteca1998 previously approved these changes Jul 5, 2024
src/starknet_stub.rs Outdated Show resolved Hide resolved
juanbono
juanbono previously approved these changes Jul 8, 2024
pefontana
pefontana previously approved these changes Jul 8, 2024
@edg-l edg-l dismissed stale reviews from pefontana and juanbono via ef7f397 July 8, 2024 11:21
@pefontana pefontana enabled auto-merge July 8, 2024 12:03
@pefontana pefontana added this pull request to the merge queue Jul 8, 2024
Merged via the queue into main with commit 9527cc9 Jul 8, 2024
9 checks passed
@pefontana pefontana deleted the fix_u256_swapped branch July 8, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready A PR that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: cairo_native swaps the high and low fields of U256 compared to Cairo's u256
5 participants