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 integer casting #605

Merged
merged 3 commits into from
May 23, 2024
Merged

Fix integer casting #605

merged 3 commits into from
May 23, 2024

Conversation

JulianGCalderon
Copy link
Contributor

@JulianGCalderon JulianGCalderon commented May 16, 2024

closes #604

Checklist

  • Linked to Github Issue

Fixes

  • The MLIR type was used to check if two types were equal, but the Cairo type should be used as sometimes two types are represented as the same MLIR type (such as how i8 and u8 are represented as i8)
  • The upper limit in a range is not included in the corresponding type, so we should use upper limit - 1 when creating upper range constants to avoid errors.

Copy link

github-actions bot commented May 16, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.577 ± 0.174 11.395 11.970 24.06 ± 0.36
cairo-native (embedded AOT) 1.566 ± 0.016 1.534 1.589 3.25 ± 0.03
cairo-native (embedded JIT using LLVM's ORC Engine) 1.698 ± 0.067 1.650 1.883 3.53 ± 0.14
cairo-native (standalone AOT) 0.653 ± 0.002 0.651 0.655 1.36 ± 0.00
cairo-native (standalone AOT with -march=native) 0.481 ± 0.001 0.480 0.483 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.754 ± 0.060 10.680 10.829 1313.66 ± 16.61
cairo-native (embedded AOT) 1.122 ± 0.010 1.106 1.142 136.99 ± 1.96
cairo-native (embedded JIT using LLVM's ORC Engine) 1.168 ± 0.019 1.139 1.192 142.62 ± 2.83
cairo-native (standalone AOT) 0.009 ± 0.000 0.008 0.009 1.04 ± 0.02
cairo-native (standalone AOT with -march=native) 0.008 ± 0.000 0.008 0.009 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 1.958 ± 0.027 1.922 2.004 29.48 ± 0.44
cairo-native (embedded AOT) 1.298 ± 0.021 1.264 1.330 19.54 ± 0.34
cairo-native (embedded JIT using LLVM's ORC Engine) 1.502 ± 0.019 1.464 1.527 22.62 ± 0.32
cairo-native (standalone AOT) 0.107 ± 0.000 0.107 0.108 1.61 ± 0.01
cairo-native (standalone AOT with -march=native) 0.066 ± 0.000 0.066 0.068 1.00

@codecov-commenter
Copy link

codecov-commenter commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.33%. Comparing base (0b3fe0a) to head (2b822c2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #605   +/-   ##
=======================================
  Coverage   92.33%   92.33%           
=======================================
  Files         109      109           
  Lines       34099    34101    +2     
=======================================
+ Hits        31485    31488    +3     
+ Misses       2614     2613    -1     

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

@edg-l edg-l added the review-ready A PR that is ready for review label May 21, 2024
@edg-l edg-l added this pull request to the merge queue May 23, 2024
Merged via the queue into main with commit b9bf1b4 May 23, 2024
9 checks passed
@edg-l edg-l deleted the fix-integer-tests branch May 23, 2024 06:18
Gerson2102 pushed a commit to Gerson2102/cairo_native that referenced this pull request May 26, 2024
* Separate variables for better legibility

* Fix proper_cast test
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: cast from i8 to u8 always fails
4 participants