cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

Fix integer casting

Open JulianGCalderon opened this issue 1 year ago • 2 comments

closes #604

Checklist

  • [x] 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.

JulianGCalderon avatar May 16 '24 11:05 JulianGCalderon

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

github-actions[bot] avatar May 16 '24 12:05 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 17 '24 19:05 codecov-commenter