Skip to content

Commit

Permalink
Update cairo-lang to 2.7.0 (#734)
Browse files Browse the repository at this point in the history
* update dependencies

* compatibility

* compatibility

* fixing tests

* fix test with sqrt op

* fix test with wide_mul op

* fix checks

* update cairo-vm version

* fix u128 wide mul tests

* fix debug info test

* fix ImplId missing variant

* possible fix gas test

* remove unused cairo-felt

* fix all tests, remember checking the assert on compiler.rs

* update scarb in ci

* fix alexandria scarb version

* add cargo component

* fix cargo command in ci

* revert

* fix assert

* formatting

* fix alexandria scarb version

* update cairo version in /alexandria

* cargo not found

* update cairo-vm to 1.0.0-rc6

* sha256 syscalls (#741)

* progress with sha256 syscalls

* progress

* progress works

* sha256 works

* remove dbgs

* fix unused

* dont treat the doc as rust

* Implement new array libfuncs. (#743)

* Implement libfunc `tuple_from_span`.

* Add exected return type to tuple_from_span test

* Fix clippy

* Add todo! function for multipop front

* Add basic test

* Implement basic multi pop front (no update)

* Remove from original span

* Add test for failed case

* Use assert instead of panic

* Add error handling

* Add multi pop back skeleton

* Add failed multi pop back test

* Pop elements from back

* Return from back

* Add multi pop back and front test

* Fix clippy

* Add test for failed suple_from_span

* Add null ptr assert and remove comments

* Add realloc metadata

* Add comments

* Clean up function

---------

Co-authored-by: Julián González Calderón <[email protected]>
Co-authored-by: Edgar <[email protected]>

* update to 2.7.0 (non-rc)

* temporary ignore circuits for tests

* Update version of `starknet-types-core` and remove unused dependencies   (#750)

* fix: deps

* fix: remove unused deps

* update to the latest changes in cairo-native

* remove unused dep: `cairo-lang-runner` from `cairo-native-runtime` (#753)

* [2.7.0] bounded int libfuncs (#752)

* 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.

* Fix CI.

* Apply suggestions from code review

Co-authored-by: Julian Gonzalez Calderon <[email protected]>

---------

Co-authored-by: Esteve Soler Arderiu <[email protected]>
Co-authored-by: MrAzteca <[email protected]>
Co-authored-by: Julian Gonzalez Calderon <[email protected]>

* Implement circuit libfuncs (#759)

* 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 <[email protected]>
Co-authored-by: Esteve Soler Arderiu <[email protected]>
Co-authored-by: FrancoGiachetta <[email protected]>

* update deps

* parallelize coverage CI (#765)

Co-authored-by: pefontana <[email protected]>

* Update docs

* use unimplemented

* remove path workaround

* fix cairo run

* remove dbg

* change for cairo-native-test too

* clippy

* update EC code and dependencies (#766)

---------

Co-authored-by: Pedro Fontana <[email protected]>
Co-authored-by: Edgar <[email protected]>
Co-authored-by: MrAzteca <[email protected]>
Co-authored-by: Julián González Calderón <[email protected]>
Co-authored-by: Bohdan Ohorodnii <[email protected]>
Co-authored-by: Esteve Soler Arderiu <[email protected]>
Co-authored-by: pefontana <[email protected]>
  • Loading branch information
8 people authored Aug 23, 2024
1 parent 0d91a8a commit 9d34f50
Show file tree
Hide file tree
Showing 85 changed files with 5,335 additions and 1,449 deletions.
82 changes: 69 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ jobs:
run: make test-ci
- name: test-cairo
run: make test-cairo

test_macos:
name: Test (macOS, Apple silicon)
runs-on: macos-14
Expand All @@ -179,7 +180,7 @@ jobs:
- name: Install scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.6.4"
scarb-version: "2.7.1"
- name: Install deps
run: make deps
- name: Build cairo-native-runtime library.
Expand All @@ -192,6 +193,18 @@ jobs:
coverage:
name: coverage
runs-on: ubuntu-latest
strategy:
matrix:
partition: [1, 2, 3, 4]
include:
- partition: 1
output: lcov-1.info
- partition: 2
output: lcov-2.info
- partition: 3
output: lcov-3.info
- partition: 4
output: lcov-4.info
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
MLIR_SYS_180_PREFIX: /usr/lib/llvm-18/
Expand Down Expand Up @@ -231,37 +244,80 @@ jobs:
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install testing tools
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest,cargo-llvm-cov
- name: Install scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.6.4"
scarb-version: "2.7.1"
- name: Install deps
run: make deps
run: make deps
- name: Build runtime and alexandria
run: make runtime && make check-llvm && make needs-cairo2 && make build-alexandria
- name: Build cairo-native-runtime library.
run: cargo build --profile=ci --package=cairo-native-runtime
- name: test and generate coverage
run: make coverage
- name: save coverage data
run: export PATH=$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin:$PATH && cargo build --profile=ci --package=cairo-native-runtime

- name: Run tests and generate coverage partition ${{ matrix.partition }}
run: cargo llvm-cov nextest --verbose --all-features --workspace --lcov --output-path ${{ matrix.output }} --partition count:${{ matrix.partition }}/4

- name: test and generate coverage corelib
if: ${{ matrix.partition == '1' }}
run: cargo llvm-cov nextest --verbose --all-features --lcov --output-path lcov-test.info run --bin cairo-native-test -- corelib

- name: save coverage data with corelib
if: ${{ matrix.partition == '1' }}
uses: actions/upload-artifact@v4
with:
name: coverage_data
name: coverage-data-1
path: |
./lcov.info
./${{ matrix.output }}
./lcov-test.info
- name: save coverage data
if: ${{ matrix.partition != '1' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.partition }}
path: ./${{ matrix.output }}


upload-coverage:
name: Upload Coverage
runs-on: ubuntu-latest
needs: [coverage]
steps:
- name: Setup rust env
uses: dtolnay/[email protected]
- name: Retreive cached dependencies
uses: Swatinem/rust-cache@v2
- name: Install testing tools
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest,cargo-llvm-cov
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
- name: Download artifacts partition 1
uses: actions/download-artifact@v4
with:
name: coverage-data-1
- name: Download artifacts partition 2
uses: actions/download-artifact@v4
with:
name: coverage-data-2
- name: Download artifacts partition 3
uses: actions/download-artifact@v4
with:
name: coverage-data-3
- name: Download artifacts partition 4
uses: actions/download-artifact@v4
with:
name: coverage_data
name: coverage-data-4
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Merge the reports
run: lcov -a lcov-1.info -a lcov-2.info -a lcov-3.info -a lcov-4.info -o lcov.info
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
Expand Down
Loading

0 comments on commit 9d34f50

Please sign in to comment.