cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

Fix felt252 and enum deserialization bugs.

Open azteca1998 opened this issue 1 year ago • 1 comments

Some types, including at least felt252 and most enum's tags, have a deserialization bug where the bytes that are not part of the type in MLIR are also parsed as part of the value in Rust. This PR filters out those bits.

Checklist

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

azteca1998 avatar Oct 10 '24 17:10 azteca1998

✅ Code is now correctly formatted.

github-actions[bot] avatar Oct 10 '24 17:10 github-actions[bot]

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 3.359 ± 0.032 3.309 3.399 1.01 ± 0.01
base factorial_2M.cairo (JIT) 3.351 ± 0.027 3.303 3.385 1.00 ± 0.01
head factorial_2M.cairo (AOT) 3.338 ± 0.031 3.307 3.406 1.00
base factorial_2M.cairo (AOT) 3.352 ± 0.025 3.320 3.401 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 2.953 ± 0.054 2.879 3.045 1.03 ± 0.02
base fib_2M.cairo (JIT) 2.890 ± 0.038 2.839 2.943 1.01 ± 0.02
head fib_2M.cairo (AOT) 2.860 ± 0.041 2.777 2.937 1.00
base fib_2M.cairo (AOT) 2.874 ± 0.024 2.830 2.916 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 3.383 ± 0.024 3.340 3.416 1.07 ± 0.01
base logistic_map.cairo (JIT) 3.364 ± 0.028 3.317 3.406 1.07 ± 0.01
head logistic_map.cairo (AOT) 3.182 ± 0.023 3.150 3.215 1.01 ± 0.01
base logistic_map.cairo (AOT) 3.159 ± 0.020 3.124 3.189 1.00

github-actions[bot] avatar Oct 11 '24 14:10 github-actions[bot]

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.418 ± 0.380 11.025 11.830 24.20 ± 0.81
cairo-native (embedded AOT) 3.345 ± 0.058 3.272 3.453 7.09 ± 0.12
cairo-native (embedded JIT using LLVM's ORC Engine) 3.341 ± 0.027 3.316 3.400 7.08 ± 0.06
cairo-native (standalone AOT) 0.681 ± 0.004 0.678 0.691 1.44 ± 0.01
cairo-native (standalone AOT with -march=native) 0.472 ± 0.001 0.471 0.473 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.444 ± 0.295 10.868 11.705 1448.77 ± 112.68
cairo-native (embedded AOT) 2.817 ± 0.022 2.776 2.859 356.56 ± 26.32
cairo-native (embedded JIT using LLVM's ORC Engine) 2.859 ± 0.029 2.812 2.902 361.97 ± 26.81
cairo-native (standalone AOT) 0.009 ± 0.000 0.009 0.009 1.10 ± 0.08
cairo-native (standalone AOT with -march=native) 0.008 ± 0.001 0.008 0.014 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.449 ± 0.057 4.375 4.542 61.27 ± 0.82
cairo-native (embedded AOT) 3.239 ± 0.039 3.165 3.294 44.61 ± 0.56
cairo-native (embedded JIT using LLVM's ORC Engine) 3.347 ± 0.022 3.307 3.386 46.10 ± 0.36
cairo-native (standalone AOT) 0.114 ± 0.000 0.113 0.115 1.57 ± 0.01
cairo-native (standalone AOT with -march=native) 0.073 ± 0.000 0.072 0.074 1.00

github-actions[bot] avatar Oct 11 '24 14:10 github-actions[bot]

Codecov Report

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

Project coverage is 82.43%. Comparing base (f862ec3) to head (6be70fc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #844      +/-   ##
==========================================
+ Coverage   82.40%   82.43%   +0.02%     
==========================================
  Files         120      120              
  Lines       34799    34856      +57     
==========================================
+ Hits        28676    28732      +56     
- Misses       6123     6124       +1     

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

codecov-commenter avatar Oct 11 '24 14:10 codecov-commenter