cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

Update cairo-lang to 2.7.0

Open FrancoGiachetta opened this issue 1 year ago • 4 comments

This PR updates cairo-lang to version 2.7.0.

Checklist

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

FrancoGiachetta avatar Jul 17 '24 19:07 FrancoGiachetta

✅ Code is now correctly formatted.

github-actions[bot] avatar Jul 17 '24 19:07 github-actions[bot]

Current Status

All cairo-lang dependencies have been updated, including corelib's and scarb's version. The code has also been adapted to the new implementations.

Still to be solved

  • Changes introduce new libfuncs, which cases were left with todo!() for now.
  • extract_location_from_stable_loc should be adapted to receive a Vec<StableLocation>. Line code.
  • A new struct TestsCompilationConfig has an attribute add_statement_functions which should be check whether it needs to be true or false Line code.
  • There's a change in the Cairo1HintProcessor's constructor which adds a new parameter segment_arena_validations: bool. It represents whether it should use a single segment for dictionaries to aid in segment arena validations. In case of true, The program must call the RelocateAllDictionaries Cheatcode. Line code
  • alexandria's version is incompatible now (2.6.3). Luckily there's a PR which should be merged soon.

FrancoGiachetta avatar Jul 18 '24 21:07 FrancoGiachetta

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.256 ± 0.093 10.107 10.415 21.33 ± 0.19
cairo-native (embedded AOT) 3.597 ± 0.036 3.539 3.636 7.48 ± 0.08
cairo-native (embedded JIT using LLVM's ORC Engine) 3.631 ± 0.030 3.581 3.686 7.55 ± 0.06
cairo-native (standalone AOT) 0.654 ± 0.001 0.651 0.656 1.36 ± 0.00
cairo-native (standalone AOT with -march=native) 0.481 ± 0.001 0.480 0.482 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 10.203 ± 0.056 10.115 10.289 1240.21 ± 20.12
cairo-native (embedded AOT) 3.125 ± 0.021 3.082 3.167 379.81 ± 6.33
cairo-native (embedded JIT using LLVM's ORC Engine) 3.175 ± 0.034 3.141 3.242 385.92 ± 7.19
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) 5.431 ± 0.058 5.344 5.519 81.41 ± 1.89
cairo-native (embedded AOT) 3.298 ± 0.033 3.244 3.352 49.44 ± 1.13
cairo-native (embedded JIT using LLVM's ORC Engine) 3.467 ± 0.039 3.401 3.536 51.98 ± 1.22
cairo-native (standalone AOT) 0.107 ± 0.000 0.107 0.108 1.61 ± 0.03
cairo-native (standalone AOT with -march=native) 0.067 ± 0.001 0.066 0.073 1.00

github-actions[bot] avatar Jul 22 '24 14:07 github-actions[bot]

Codecov Report

Attention: Patch coverage is 75.35531% with 815 lines in your changes missing coverage. Please review.

Project coverage is 88.56%. Comparing base (0d91a8a) to head (d337209). Report is 224 commits behind head on main.

Files with missing lines Patch % Lines
src/libfuncs/bounded_int.rs 0.00% 498 Missing :warning:
src/libfuncs/cast.rs 45.41% 113 Missing :warning:
src/types.rs 60.24% 33 Missing :warning:
src/types/circuit.rs 78.80% 32 Missing :warning:
src/debug.rs 0.00% 26 Missing :warning:
src/bin/cairo-native-run.rs 0.00% 18 Missing :warning:
src/starknet_stub.rs 0.00% 16 Missing :warning:
src/libfuncs/circuit.rs 98.64% 15 Missing :warning:
src/executor.rs 26.31% 14 Missing :warning:
src/bin/cairo-native-test.rs 0.00% 9 Missing :warning:
... and 12 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #734      +/-   ##
==========================================
- Coverage   91.03%   88.56%   -2.47%     
==========================================
  Files         117      120       +3     
  Lines       32671    35375    +2704     
==========================================
+ Hits        29741    31330    +1589     
- Misses       2930     4045    +1115     

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

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Aug 14 '24 17:08 codecov-commenter