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

Update cairo-lang to 2.7.1 #734

Merged
merged 51 commits into from
Aug 23, 2024
Merged

Update cairo-lang to 2.7.1 #734

merged 51 commits into from
Aug 23, 2024

Conversation

FrancoGiachetta
Copy link
Contributor

@FrancoGiachetta FrancoGiachetta commented Jul 17, 2024

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.

Copy link

github-actions bot commented Jul 17, 2024

✅ Code is now correctly formatted.

@FrancoGiachetta FrancoGiachetta changed the title update dependencies update cairo-lang Jul 17, 2024
@FrancoGiachetta FrancoGiachetta changed the title update cairo-lang Update cairo-lang Jul 17, 2024
@FrancoGiachetta
Copy link
Contributor Author

FrancoGiachetta commented Jul 18, 2024

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.

Copy link

github-actions bot commented Jul 22, 2024

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-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 19, 2024
@edg-l edg-l added this pull request to the merge queue Aug 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 20, 2024
pefontana and others added 2 commits August 21, 2024 12:26
* implement bounded int libfuncs

* progress

* progress

* progress

* fix cast

* clippy

* ship modified corelib for tests

* debug

* allow jit return bounded

* Fix stuff.

* Fix bounded int division.

* Fix `bounded_int_constrain`.

* Refactor lots of stuff.

* Fix stuff.

* Make bounded int divisions work.

* Fix stuff.

* Fix stuff.

* Fix stuff.

* Add workaround for segfault in canonicalization.

* Fix upcasts.

* Fix downcasts.

* Fix stuff.

* Fix stuff.

* Fix `bounded_int_sub` destination offset.

* Cleaning up

* Clean up.

* Add type placeholder

* Add dummy init_circuit_data impl

* Add dummy build_into_u96_impl

* Add remaining dummy libfuncs

* Fix CI.

* Remove corelib copy

* Add types/circuit.rs

* add build structure for circuits, and fill variants for RangeCheck96

* circuts layouts, is_complex, is_zst

* build circuit_outpus, input_data, accumulator

* Update is_builtin

* Use unreachable

* Add todo! comment

* Add todo!()

* Fix clippy

* Implement CircuitData and CircuitInputAccumulator layouts

* Implement init_circuit_data

* Implement into_u96_guarantee

* Implement build_add_input

* Implement try_into_circuit_modulus

* Implement get_descriptor

* Use array instead of struct

* Reimplement add_circuit_input

* Use 348 size with hardcoded layout

* Fix clippy

* Implement eval structure

* Implement get output

* Use all limbs when reading struct

* Use all limbs when reading integer

* Rename variables

* Add todo!

* Implement basic circuit operations

* Implement basic egcd

* Add inverse error handling

* Add auxiliary function for building circuit evaluation

* Add comment

* Fix typo

* Add tests and consider mul overflow

* Take overflow into account

* Use correct values in test

* Add docs

* Take overflow into account in egdc

* Add error handling to circuit

* Add error handling to circuit libfuncs

* Add error handling an inline integer size

* Increment rc in init_circuit

* Increment builtins in eval circuit

* Increment builtins in failure guarantee verify

* Increment rc in u96 guarantee verify

* Add comment

* Add comment

* Add better todo!

* Better comment

* Add comment

* Fix layout bug

---------

Co-authored-by: Edgar Luque <git@edgarluque.com>
Co-authored-by: Esteve Soler Arderiu <soler.arderiu@gmail.com>
Co-authored-by: FrancoGiachetta <francogiachetta27@gmail.com>
@edg-l edg-l dismissed stale reviews from pefontana and themself via 906bcdb August 22, 2024 10:35
pefontana
pefontana previously approved these changes Aug 22, 2024
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/erc20.rs Outdated Show resolved Hide resolved
src/libfuncs.rs Show resolved Hide resolved
tests/alexandria/Scarb.toml Outdated Show resolved Hide resolved
edg-l
edg-l previously approved these changes Aug 23, 2024
@pefontana pefontana added this pull request to the merge queue Aug 23, 2024
Merged via the queue into main with commit 9d34f50 Aug 23, 2024
12 checks passed
@pefontana pefontana deleted the cairo-lang2.7.0-rc.3 branch August 23, 2024 19:07
@pefontana pefontana changed the title Update cairo-lang to 2.7.0 Update cairo-lang to 2.7.1 Aug 23, 2024
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.

7 participants