Skip to content

Update docs. #961

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

Closed
wants to merge 11 commits into from
Closed

Update docs. #961

wants to merge 11 commits into from

Conversation

azteca1998
Copy link
Collaborator

Checklist

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

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@b92123c). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #961   +/-   ##
=======================================
  Coverage        ?   80.19%           
=======================================
  Files           ?      112           
  Lines           ?    29981           
  Branches        ?        0           
=======================================
  Hits            ?    24042           
  Misses          ?     5939           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Copy link

github-actions bot commented Dec 11, 2024

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 5.101 ± 0.054 5.033 5.160 1.01 ± 0.01
base dict_insert.cairo (AOT) 5.040 ± 0.035 4.996 5.112 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 5.076 ± 0.028 5.033 5.127 1.02 ± 0.01
head dict_insert.cairo (AOT) 4.986 ± 0.031 4.954 5.055 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 4.991 ± 0.045 4.922 5.060 1.03 ± 0.01
base dict_snapshot.cairo (AOT) 4.841 ± 0.029 4.795 4.874 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 5.013 ± 0.029 4.967 5.051 1.02 ± 0.01
head dict_snapshot.cairo (AOT) 4.909 ± 0.031 4.851 4.947 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 5.284 ± 0.033 5.233 5.330 1.01 ± 0.01
base factorial_2M.cairo (AOT) 5.253 ± 0.031 5.216 5.310 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 5.369 ± 0.037 5.299 5.402 1.01 ± 0.01
head factorial_2M.cairo (AOT) 5.316 ± 0.030 5.275 5.360 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 4.838 ± 0.027 4.802 4.890 1.01 ± 0.01
base fib_2M.cairo (AOT) 4.798 ± 0.017 4.775 4.830 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 4.900 ± 0.033 4.860 4.972 1.01 ± 0.01
head fib_2M.cairo (AOT) 4.854 ± 0.034 4.816 4.926 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 5.017 ± 0.019 4.982 5.047 1.03 ± 0.01
base linear_search.cairo (AOT) 4.885 ± 0.020 4.843 4.907 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 5.123 ± 0.052 5.061 5.207 1.03 ± 0.01
head linear_search.cairo (AOT) 4.986 ± 0.050 4.919 5.070 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 5.100 ± 0.032 5.031 5.139 1.03 ± 0.01
base logistic_map.cairo (AOT) 4.936 ± 0.022 4.913 4.970 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 5.197 ± 0.039 5.132 5.273 1.03 ± 0.01
head logistic_map.cairo (AOT) 5.030 ± 0.038 4.973 5.087 1.00

Copy link

github-actions bot commented Dec 11, 2024

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.365 ± 0.076 11.260 11.497 2.31 ± 0.02
cairo-native (embedded AOT) 4.911 ± 0.025 4.869 4.950 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 5.011 ± 0.028 4.977 5.063 1.02 ± 0.01

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 791.0 ± 3.0 784.9 794.9 1.00
cairo-native (embedded AOT) 4814.4 ± 27.7 4776.3 4854.4 6.09 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 4907.9 ± 32.3 4863.3 4968.3 6.20 ± 0.05

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.242 ± 0.029 5.190 5.271 1.00 ± 0.01
cairo-native (embedded AOT) 5.224 ± 0.033 5.168 5.265 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 5.262 ± 0.031 5.223 5.308 1.01 ± 0.01

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.076 ± 0.027 5.032 5.112 1.07 ± 0.01
cairo-native (embedded AOT) 4.760 ± 0.023 4.732 4.795 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 4.803 ± 0.033 4.762 4.859 1.01 ± 0.01

Benchmark for program linear_search

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 819.8 ± 4.9 810.4 825.3 1.00
cairo-native (embedded AOT) 4854.0 ± 28.7 4816.4 4902.4 5.92 ± 0.05
cairo-native (embedded JIT using LLVM's ORC Engine) 4997.3 ± 36.3 4948.5 5054.0 6.10 ± 0.06

Benchmark for program logistic_map

Open benchmarks
Command Mean [ms] Min [ms] Max [ms] Relative
Cairo-vm (Rust, Cairo 1) 532.9 ± 3.5 528.0 540.2 1.00
cairo-native (embedded AOT) 4894.4 ± 21.3 4866.6 4945.8 9.18 ± 0.07
cairo-native (embedded JIT using LLVM's ORC Engine) 5060.4 ± 24.6 5036.4 5121.9 9.50 ± 0.08

@DiegoCivi DiegoCivi marked this pull request as ready for review June 13, 2025 21:22
@DiegoCivi DiegoCivi force-pushed the update-docs branch 2 times, most recently from 2715661 to 66f002d Compare June 13, 2025 22:27
@gabrielbosio gabrielbosio force-pushed the update-docs branch 3 times, most recently from c26412c to 8f50de6 Compare June 13, 2025 22:50
azteca1998 and others added 9 commits June 13, 2025 19:51
* Remove useless argument.

* Add some libfuncs.

* Implement `?_try_from_felt252`.

* More stuff.

* More stuff.

* More stuff.

* Add testing for integer operations.

* Add square root and testing.

* Add test for integer conversions to felt252.

* Add test for wide mul.

* Change uint impls to unified.

* Remove unused code and fix stuff.

* Actually delete those files.

* Add i?_diff implementation and test.

* Fix stuff and replace sint libfuncs.

* Remove unused sint code.

* Add u128 libfuncs and tests.

* Fix stuff.

* Remove dead code.

Don't clone old value on dict_entry_get (#962)

* Document dict_entry

* Document felt252_dict_entry_get side effect

* Improve comments

* Don't clone on get

* Refactor to use scf instead of cf

* Rename variables to clarify

* Refactor to use scf instead of cf

* Improve comment

* Add comment exaplining UB

* Make clippy happy

* Update src/libfuncs/felt252_dict_entry.rs

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* Update src/libfuncs/felt252_dict_entry.rs

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* Update src/libfuncs/felt252_dict_entry.rs

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* Update src/libfuncs/felt252_dict_entry.rs

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* Fix comment

---------

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

Improve array documentation (and minor bug) (#965)

* Improve legibility of array drop build

* Improve array_new signature doc

* Improve span_from_tuple build signature doc

* Improve legibility of array span_from_tuple

* Improve tuple_from_span signature doc

* Improve legibility of tuple_from_span

* Fix bug: freeing middle of array

* Rename variable

* Add note on possible null free

* Remove panic

Fix empty array slicing. (#966)

* Fix empty array slicing.

* Fix test.

fix daily ci (#967)

* fix daily

* fix

* path

Update rust to 1.83.0 (#975)

* rust 1.83.0

* clippy

Make daily blocks run sequentially (#976)

* make daily blocks to run sequentially by parts

* compare only when the last part finished

* fix compare

* use max-parallel instead

* use max-parallel 10

Avoid memory allocations per each entry in a dictionary. (#963)

* Update the runtime.

* Non-runtime changes and fixes.

* Revert slab, not necessary. More progress.

* Progress.

* Fix stuff.

* Minor fix.

* Document `dup_fn` and `drop_fn` callbacks.

* Fix suggestions.

---------

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

add workshop to docs (#974)

Cairo 2.9.2 (#948)

* update to 2.9.0

* ci

* rust 1.83.0

* fix

* 2.9.1

* update

* update alexandria

* scarb

* version

* fix

* rc1

* fix

* Update Makefile

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* update replay

* fix alexandria

* looks like runtime is needed always due to build.rs

* fix patch

* typo

---------

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

Add more dict benches (#977)

* Add more benches

* Rename tests

* Fix hyperfine benches

* Add segment arena builtin

* Add RangeCheck as first argument to `run_bench`

* Increase bench size

Fix `--no-default-features` library-only builds. (#984)

Improve daily workflow (#982)

* Increase max-parallel

* Change long blocks

Fix compare block matrix (#987)

Add version check for cached AOT contracts. (#981)

Co-authored-by: Edgar <git@edgarluque.com>

Decrease paralelism and number of blocks (#1014)

Co-authored-by: Edgar <git@edgarluque.com>

Fix `array_snapshot_pop_front` CoW clones. (#1022)

Unify daily run issues (#1004)

* Decrease paralelism and number of blocks

* Unify issue message

update cairo to 2.10rc-0 (#986)

* update cairo to 2.10rc-0 and the vm

* cairo-vm 2.0.0rc3, implement redeposit_gas (not finished)

* implement redeposit_gas libfunc and ignore alexandria temporarily

* remove ignore alexandria

* remove ignore alexandria

* remove ignore alexandria

* add tests

* Fix `bounded_int_trim` libfunc implementation.

* remove unwanted files

* clippy

* clippy

* fix test

* document new libfuncs

* document new libfuncs

* fix typo

* Fix `bounded_int_trim` for signed types.

* Remove unnecessary `if` expression.

* prepare for release

* handle positive signed values

* document 'is_signed' method

* typo

* document better redeposit gas

* better check in bounded int trim

---------

Co-authored-by: Esteve Soler Arderiu <soler.arderiu@gmail.com>

Fix daily run dependencies (#1023)

* Checkout all repos

* Improve cache

* Update replay dependencies

* Update sequencer deps

version v0.2.6 (#1025)

daily blocks workflow runs 1000 blocks (#1027)

fix runtime version check (#1029)

* fix runtime version check

* format

* try a better approach

* forgot to add \0 at the end of target buffer

* Revert "forgot to add \0 at the end of target buffer"

This reverts commit 51d23e3.

* add '\0' at the end

---------

Co-authored-by: Edgar <git@edgarluque.com>

fix possible segfault when checking runtime's version (#1032)

update replay version blocks workflow ci (#1033)

bump version (#1031)

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

Make dicts clone on write. (#964)

* Update the runtime.

* Non-runtime changes and fixes.

* Revert slab, not necessary. More progress.

* Progress.

* Fix stuff.

* Make it clone-on-write.

* Finish the PR.

* Try to fix `src/arch/x86_64.rs`.

* Fix `x86_64.rs`.

* Fix suggestions.

* Add comment according to suggestions.

---------

Co-authored-by: Edgar <git@edgarluque.com>
Co-authored-by: Franco Giachetta <francogiachetta27@gmail.com>

increase concurrency in blocks (#1034)

update rust to 1.84.0 (#1039)

replace blocks 1000000 and 1001000 (#1043)

bump version to 0.2.8 (#1046)

Dont remove submodule (#1044)

as it no longer exists

Update starknet-blocks workflow (#1042)

* Update starknet-blocks workflow

* Add RPC Cache

* Rename to Starknet Blocks

* Rename jobs

* Use debug build

* Update refs

* Update ref

* Remove matrix in compare job

Fix cache (#1052)

Cache RPC calls (#1048)

Co-authored-by: Edgar <git@edgarluque.com>

Pin cairo-lang to 2.10.0-rc0 (#1056)

Upload daily comparison results as an artifact (#1049)

* upload comparison results in daily workflow as an artifact

* typo

---------

Co-authored-by: Edgar <git@edgarluque.com>

Update cairo to 2.10.0-rc1 (#1059)

* Update cairo to 2.10.0-rc1

* update ci blocks

* upd emu

* fix alexandria

* upd refs

* deps

* downgrade scarb

* ci

* fix test

Fix `array_snapshot_pop_front`'s clone-on-write's clone implementation. (#1063)

* Fix `array_snapshot_pop_front`'s clone-on-write's clone implementation.

* Add testing.

bump version to 0.2.9 for release (#1062)

Update melior (#1061)

fix bench comment (#1060)

Remove missing todos (#1055)

* Remove missing todos

* Update src/compiler.rs

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* Update src/types/circuit.rs

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* Update src/libfuncs/int.rs

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

* fmt

* clippy

* fix

---------

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

Implement runtime with dynamic dispatch (#1051)

* Load dynamic runtime globals

* Implement dynamic runtime bindings

* Use dynamic runtime set_costs_builtin

* Remove phantom data from RuntimeBindingsMeta

* Remove symbol register in JIT executor

* Remove runtime linking in AOT executor

* Remove cairo_native__get_version check

* Use original name for runtime globals

* Remove no_mangle attribute

* Remove AOT standalone benchmarks

---------

Co-authored-by: Edgar <git@edgarluque.com>

add id to identify the step (#1066)

Fix gas diffs. (#1071)

Adjust circuit usage (#1070)

* adjust circuit usage

* comment

* fmt

Fix daily (#1074)

Specify sierra version in Contract Executor (#1078)

* Add sierra version tu contract executor

* Adapt tests

* Update starknet-block refs

* Update cmp script

* Add major version check

Fix `array_snapshot_pop_back` and add test. (#1080)

Remove runtime crate, bump version, fix gh release ci (#1085)

* Remove runtime crate, bump version, fix gh release ci

Removes the runtime crate completly and cleans ups any references to it on scripts, etc.
Bumps the version to 0.3.0 (to be able to push a tag for release later when wanted)
Fix the github ci release.
Updates rust to 1.84.1

* fix

* fix

Add lockfile support for the `AotContractExecutor`. (#1075)

* Add lockfile support for the `AotContractExecutor`.

* Remove some unwraps.

* Fix clippy.

* update replay and sequencer versions in blocks workflow

* update replay's version in blocks workflow

* format

* update sequencer and replay versions in blocks workflow

---------

Co-authored-by: FrancoGiachetta <francogiachetta27@gmail.com>
Co-authored-by: Edgar <git@edgarluque.com>

fix github release (#1086)

Fix circuit gas diff: Implement u96_limbs_less_than_guarantee_verify (#1084)

* Fix circuit implementation

* Add circuit compare test (#1076)

* Add more tests

* Add compiler assert message

* Adapt CircuitOutputs so that it can contain the modulo

Instead of an array, now its a struct<array, array>, where the second
array is the modulo

* Save circuit output in struct representation, instead of integer

It is ultimately returned in struct representation, so now it is
converted sooner (useful for guarantee representation)

* Save modulus to circuit output

* Implement limbs_guarantee type with gate value and circuit modulus

* Implement guarantee verify

* Add function build_aggregate_slice

* Use always struct for limbs

* Fix comment

* Improve documentation

* Remove single_limb implementation and use generic noop

Fix theoretical lockfile data race. (#1087)

Update actions/cache to recommended version (#1088)

* update actions/cache to recommended version

* update actions/cache to recommended version

---------

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

Use lock file instead of tmp file for compiling contract (#1092)

Add cli for sierra to native compilation in Starknet blockifier (ci permissions) (#1094)

* Add cli for sierra to native compilation in Starknet blockifier

* Fix clippy

---------

Co-authored-by: Avi Cohen <avi.cohen@starkware.co>

bump version to 0.3.1 (#1095)

Add segfault catcher. (#1053)

* Add `SafeRunner` for catching segfaults.

* Add API to manually abort.

* Fix MacOS build.

* Hide everything behind a feature. Fix various bugs triggered on early returns.

* Add some documentation.

try to fix upload on release (#1098)

Co-authored-by: Iñaki Garay <igarai@gmail.com>

Add Sierra test generator. (#1050)

* Add basic Sierra generator.

* Add multi-return support.

* Refactor and complete the Sierra generator.

* Fix API for template types.

* Fix type declarations.

* Fix branch align generation.

* Fix bug.

* Fix duplicated type generation.

---------

Co-authored-by: Edgar <git@edgarluque.com>

Bump Cairo version to 2.10.0 (#1102)

* Update cairo version

* Update starknet-blocks refs

* Update scarb

* Update alexandria

* Update scarb version

Refactor arrays to avoid clones according to the cost model. (#1100)

* Partial array refactor.

* More progress.

* Implement `array_pop_*`.

* Some fixes.

* Implement `array_slice`.

* Fix contract executor.

* Fix other bugs.

* Fix AOT contract runner.

* Fix array from_ptr drops.

* Fix starknet module.

* Fix stuff.

* Fix bug.

* Restore makefile.

* Fix libfunc name mistype.

---------

Co-authored-by: Edgar <git@edgarluque.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

bump version to 0.3.2 (#1105)

* bump version to 0.3.2

* typo

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

Bump version (#1117)

Remove panics (#1103)

* Remove panics in values.rs

* Remove panics when finding builtins

* Remove unwrap when aligning

* Remove unwrap when removing lockfile

* Remove panics with DropOverridesMeta

Fix daily workflow (#1112)

* Decrease range

* Add support for cache updating

* Decrease paralelism

* Add more blocks

Remove panic (#1113)

Remove panics from libfuncs directory (#1116)

* Remove panics in starknet libfuncs

* Remove panics in poseidon libfuncs

* Remove panics in pedersen libfuncs

* Remove panic in int libfuncs

* Remove gas libfuncs panics

* Remove felt252_dict panics

* Remove panic un enum libfuncs

* Remove panic in debug libfuncs

* Remove panics in bool libfuncs

* Remove panics in array libfuncs

Improves documentation on unreachable panics (#1115)

* Improve error messages

* Apply suggestions from code review

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Fix format

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

Fix dictionary clones. (#1121)

* Fix dictionary clones.

* Add test.

* Fix clippy.

Replace asserts with errors (#1119)

* Improve asserts

* Improve more asserts

* Improve more asserts

* Fix fmt

Add old ubuntu 20.04 focal to ci (#1097)

* Add old ubuntu 20.04 focal to ci

* add zstd

* fix

---------

Co-authored-by: Iñaki Garay <igarai@gmail.com>

Bump version to 0.3.3 (#1124)

* Bump native version

* Update readme

* Update lock

Update release docs (#1123)

* Update release docs

* Update the release docs

---------

Co-authored-by: MrAzteca <azteca1998@users.noreply.github.com>

Fix dictionary clone implementation (#1132)

* Fix clone implementation

We were creating the cloned dictionary using the previous dictionary
length, rather than the previous dictionary capacity

* Add test to avoid regresion

Remove dictionary CoW mechanism (#1130)

* Remove Rc::make_mut

* Remove the clone impl

* Remove dup_fn field from FeltDict struct

This commits builds correctly, but tests won't pass because we must
adapt the compilation sierra compilation to take it into account

* Adapt compiler to new signature

* Add comment

* Remove dup from Felt252DictOverrides

---------

Co-authored-by: Edgar Luque <git@edgl.dev>

Prepare for release v0.3.4 (#1135)

* prepare for release

* fix cargo.lock

* pin cairo-vm version

Try to fix release ci binary generation again (#1140)

Remove dict double pointer in `cairo_native__dict_get` (#1134)

* Remove Rc::make_mut

* Remove the clone impl

* Remove dup_fn field from FeltDict struct

This commits builds correctly, but tests won't pass because we must
adapt the compilation sierra compilation to take it into account

* Adapt compiler to new signature

* Add comment

* Remove dup from Felt252DictOverrides

* remove doble pointer from dict

---------

Co-authored-by: Julián González Calderón <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Edgar Luque <git@edgl.dev>
Co-authored-by: Edgar <git@edgarluque.com>

Update cairo-lang to 2.11.1 (#1136)

* update cairo-lang and prepare for adding the new features

* format

* replace enum for struct in contract result

* update some cairo code from tests

* update cairo code in tests

* fix execution result branching

* fix branching

* fix branching

* remove cairo program

* Prepare for release v0.3.4 (#1135)

* prepare for release

* fix cargo.lock

* pin cairo-vm version

* Try to fix release ci binary generation again (#1140)

* Remove dict double pointer in `cairo_native__dict_get` (#1134)

* Remove Rc::make_mut

* Remove the clone impl

* Remove dup_fn field from FeltDict struct

This commits builds correctly, but tests won't pass because we must
adapt the compilation sierra compilation to take it into account

* Adapt compiler to new signature

* Add comment

* Remove dup from Felt252DictOverrides

* remove doble pointer from dict

---------

Co-authored-by: Julián González Calderón <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Edgar Luque <git@edgl.dev>
Co-authored-by: Edgar <git@edgarluque.com>

* pin vm

* Update alexandria

* Fix int_range_try_new test

* Revert execution_result.rs

* Find correct entrypoint

* Remove duplicated comment

* Update imports to user starknet directly

* Update gas usage

As the gas change is small, and non of the tests comparing to the cairo
vm failed, we can safely assume that the gas changes can be attributed
to the code generation

* Remove deprecated usage

* Update starknet-blocks refs

* Update leftover references to 2.11.1

* Update patch command for starknet-blocks CI

* pin some cairo-lang dependencies

* Prepare for release v0.3.4 (#1135)

* prepare for release

* fix cargo.lock

* pin cairo-vm version

* Implement compilation filter for failing tests (#1146)

* Replace todos with errors (#1147)

---------

Co-authored-by: Edgar <git@edgarluque.com>
Co-authored-by: Julián González Calderón <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Edgar Luque <git@edgl.dev>

[2.11.1] Add `meta_tx_v0` syscall. (#1141)

* Add `meta_tx_v0` syscall.

* change sequencer commit

---------

Co-authored-by: FrancoGiachetta <francogiachetta27@gmail.com>

Bump cairo lang to 2.11.2 (#1162)

* update cairo lang to 2.11.2

* Update starknet blocks dependencies

* Add missing bumps

---------

Co-authored-by: Julián González Calderón <gonzalezcalderonjulian@gmail.com>

Remove Ubuntu 20.04 CI workflow (#1166)

Update to 0.4.0 (#1165)

Improve gas documentation (#1159)

* Add GasCost and BuiltinCost documentation

* Add utility function for obtaining builtin cost index

* Add doc comment explaining the content of the GasCost metadata entry

* Add utility function `build_actual_gas_cost` to remove duplicated code

* Improve gas builtin doc

* Update mentions to gas builtin, that actually refer to costs builtin

* Rename function to calculate_gas_cost

---------

Co-authored-by: Franco Giachetta <francogiachetta27@gmail.com>

Improve meta_tx_v0 syscall documentation (#1163)

* Add `meta_tx_v0` syscall.

* change sequencer commit

* Add documentation

---------

Co-authored-by: Esteve Soler Arderiu <esteve.soler@lambdaclass.com>
Co-authored-by: FrancoGiachetta <francogiachetta27@gmail.com>

Bump Cairo to 2.12.0-dev.0 (#1164)

* Bump cairo to 2.12.0-dev.0

* Bump cairo-vm to 2.0.1

* Update gas usage in test

Probably related to a change in the sierra generation

* Remove unused imports in Alexandria

* Add QM31 variants (unimplemented)

* Remove is_zero libfunc

It has been removed in the new Cairo version

* Update lock

* Skip compilation of failing tests

* Update starknet-blocks workflow deps

* Remove is_zero tests

* Apply suggestions from code review

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Update cairo-vm commit

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

Update Native to 0.5.0-rc.1 (#1169)

Add pad_to_align to syscall payload value (#1175)

From Layout::extend documentation:

In order to match C representation layout repr(C), you should call
pad_to_align after extending the layout with all fields. (There is no
way to match the default Rust representation layout repr(Rust), as it is
unspecified.)

Fix into_u96_guarantee not handling other types (#1171)

* Add track_caller

* Fix into u96 guarantee

Now it handles both:
- BoundedInts with non zero lower range
- Smaller integers

* Add tests

* Document and refactor implementation

Prepare for release 0.5.0-rc.3 (#1181)

Reuse cairo-lang GasMetadata calculations (#1183)

* Add cairo-lang-sierra-to-casm dependency

* Reuse cairo-lang metadata construction

* Adapt users across the repository

Add sierra-emu as a debug utility (#1180)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* Sync sierra-emu with last changes in repo

See added changes https://github.com/lambdaclass/sierra-emu/commits/main/?since=2025-04-15&until=2025-04-16

* Lock cairo-lang-sierra-to-casm dependency

* Format sierra-emu files

* Remove unneccesary ampersand when passing gas as argument

Refactor DebugUtils with support for both AOT and JIT executors (#1174)

* Refactor debug utils

* Update function register for debug bindings

* Rename debug print binding

* Move debug_breakpoint_trap

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

Enable sierra-emu checks (#1195)

* Fix clippy warning with profiles

* Run clippy in whole workspace

Bump to Cairo v2.12.0-dev.1 (#1197)

* Bump toolchain

* Bump deps

* Add unsafe_panic to libfunc enums

* Add unsafe_panic to sierra emu enums

* Update starknet-blocks refs

* Fix clippy lint

* Fix clippy lint

* Update corelib version

* Add bounded-int-utils cairo feature on sierra-emu

* Fix gas usage in tests

* Add bounded-int-utils cairo feature on cairo-native tests

* Declare extern for downcast and upcast, to avoid using bounded-ints cast

* Fix gas usage in starknet tests

Prepare for release (#1198)

[Sierra-Emu] Run corelib's tests (#1188)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* remove debug_name in enums

* refactor

* remove unused dependency

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* print progress as the test runs

* fmt

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

Add sierra2casm-dbg debug utility (#1196)

* Add sierra2casm-dbg

* Sync cairo version between sierra2casm-dbg and root

* Bump Cairo VM version in sierra2casm-dbg

* Fix compilation and linter errors

* Bump Cairo in sierra2casm-dbg

* Remove unused serde dep in sierra2casm-dbg

* Remove Rust toolchain in sierra2casm-dbg

* Add sierra2casm-dbg CI job (#1201)

[Sierra-Emu] Remove todos in src/value.rs (#1189)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* fix is() method for span

* fmt

* typo

* clippy

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>

Prepare (#1207)

Minor improvements to Sierra Emu crate (#1202)

* Move cairo-lang dependencies to workspace

* Remove sierra-emu/.gitignore

* Update lock

* Add fibonacci.cairo example for sierra emulator

* Simplify Makefile

* Simplify README and improve documentation on how to use the binary

* Add make check

* Improve examples

* Document make check

* Remove unused script

* Add fibonacci_contract.cairo

* Fix typo in Makefile

* Fix CI

* Use cairo2/corelib instead of corelib for symlinking in sierra emu

* Improve Sierra Emulator descritopn

* Move more dependencies to workspace

* Fix whitespace

* Fix whitespace (again)

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

Add Trace Dump feature (#1199)

* Add trace dump support in compiler

* Add sierra emu dependency with trace-dump feature

* Add trace dump metadata

* Register trace dump symbols on executors

* Use trace dump feature in cairo-native-run

* Remove unused feature

* Rename trace_id symbol

* Don't generate trace dump on return when no tail recursion target has been found

* Update lock

* Derive Eq,PartialEq on TraceDump

* Substract initial required gas in sierra emu

* Print error when trace dump is not found, but ignore

* Add trace dump test

* Fix clippy

* Remove `get_layout` from trace dump

* Rename variables

* Minor improvements

* Add documentation

* Improve documentation

* Improve documentation on trace dump runtime functions

* Fix typo

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Fix warning

* Update usage docs

* Document trace dump feature for programs

* Add txt to blockquote to avoid executing in doc test

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

[Sierra-Emu] Implement missing syscall and nullable libfuncs (#1205)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* remove debug_name in enums

* refactor

* remove unused dependency

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* print progress as the test runs

* fmt

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* add starknet missing libfuncs

* cargo.lock

* add null, nullable_from_box and match_nullable libfuncs

* clippyt

* add forward_snapshot libfunc + fix is() for nullable

* refactor syscall handler

* add some felt types to match

* remove type_to_name() call in is() function

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

[Sierra-Emu] implement some todos from `const` and `cast` libfuncs (#1191)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* add enum in const::inner

* remove todos and fix some failures

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* ignore test

* fmt

* remove debug_name in enums

* refactor

* remove unused dependency

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* print progress as the test runs

* fmt

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* fix clippy

* clippy

* remove unnecesary pubs

* better docs

* better panic message in get_numberic_args_as_bigints()

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* reviews

* remove unnecessary comment

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* use slices in get_numeric_args_as_bigints

* fmt

* remove unnecesary to_vec

* fmt

* use iter instead of into_iter

* reviews changes

* better error message

* fix typo

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

[Sierra-Emu] implement `get_available_gas` libfunc (#1210)

* implement las gas libfunc

* remove unnecesary pubs

Improve sierra2casm-dbg (#1206)

* Add sierra2casm-dbg

* Sync cairo version between sierra2casm-dbg and root

* Bump Cairo VM version in sierra2casm-dbg

* Fix compilation and linter errors

* Bump Cairo in sierra2casm-dbg

* Remove unused serde dep in sierra2casm-dbg

* Remove Rust toolchain in sierra2casm-dbg

* Add sierra2casm-dbg CI job (#1201)

* Move cairo-lang dependencies to workspace

* Remove sierra-emu/.gitignore

* Update lock

* Add fibonacci.cairo example for sierra emulator

* Simplify Makefile

* Simplify README and improve documentation on how to use the binary

* Add make check

* Improve examples

* Document make check

* Remove unused script

* Add fibonacci_contract.cairo

* Fix typo in Makefile

* Fix CI

* Use cairo2/corelib instead of corelib for symlinking in sierra emu

* Improve Sierra Emulator descritopn

* Move more dependencies to workspace

* Rename to casm-data-flow

* Add Makefile

* Add basic run-contract example

* Add fibonacci_starknet.cairo

* Fix hint format

* Add basic README.md

* Update dependencies

* Print gas usage

* Finish README.md

* Add .PHONY

* Fix paragraph

* Move deps to workspace

* Fix whitespace

* Fix whitespace

* Fix README.md

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

[Sierra-Emu] implement missing libfuncs from `int_range` and `array` (#1200)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* remove debug_name in enums

* refactor

* remove unused dependency

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* print progress as the test runs

* fmt

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* implement int_range libfuncs

* implement missing array libfuncs

* fmt

* add is() for IntRange

* remove unnecesary pubs

* reviews

* reviews

* fix branching in int_range_try_new

* clippy

* reviews

* fmt

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

[Sierra-Emu] Implement missing libfuncs from int (#1192)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* remove debug_name in enums

* refactor

* remove unused dependency

* implement missing libfuncs from int

* fmt

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* add general libfuncs: const, equal, to_felt, from_felt

* add diff libfunc

* print progress as the test runs

* fmt

* fix from_felt

* remove unused files + fix issue with non-integer

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* try fix from_felt

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* simplify a little apply_wrapping_op

* merge test-corelib

* remove unnecesary pubs

* also match builtins instead of filtering them

* format

* use slices in get_numeric_args_as_bigints

* fmt

* remove unnecesary to_vec

* fmt

* use iter instead of into_iter

* clippy

* reviews + remove uint128 file

* rename uint252 file to uint256

* fix clippy

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

implement circuit_single_limb_less_than_guarantee_verify (#1212)

* implement circuit_single_limb_less_than_guarantee_verify

* fmt

* clippy

* Fix comment

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

---------

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

[Sierra-Emu] Fix felt-dict's overflow, circuits libfuncs and implement missing EcPoint libfunc (#1208)

* change initial gas due to overflows

* fix some libfuncs in circuits

* fix is() for circuits

* remove Value::Unit from return values in get_output

* match U96LimbsLessThanGuarantee correctly

* some corrections to circuits

* some corrections to circuits

* fix failure_guarantee_verify to avoid panicking

* fix circuits

* more fixes to circuits + implement ec_zero libfunc

* clippy

* remove unnecesary tests

* remove unnecesary file

* fix branch index

* add comment

* fix eval_u96_limbs_less_than_guarantee_verify

* remove circuit failure test

* update trace dump with new Value::CircitOutputs

* fmt

* reviews + fix modulus in trace dump

* remove unnecesary file

* fix clippy

* implement circuit_single_limb_less_than_guarantee_verify

* fix trace dump for circuit outputs

* fix felt_dict_get

* fix felt_dict_get

* implement U96LimbsLessThanGuarantee for trace dump

* remove unnecessary code

* fmt

* fix felt_dict_entry_get

* revert change in circuits.rs

* remove unwanted file

* revert unwanted change

* revert unwanted change

* make trace dump for circuit outputs cleaner

* remove unwanted code

* increase felt dict count always during get()

* doc function + merge main

* reviews

* use elemts stride for offseting u384 structs

* forgot to update one stride

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

cherry: Use dynamic arrays instead of static arrays for circuit data (#1233) (#1237)

[Serra-Emu] Fix some libfuncs (#1223)

* change initial gas due to overflows

* fix some libfuncs in circuits

* fix is() for circuits

* remove Value::Unit from return values in get_output

* match U96LimbsLessThanGuarantee correctly

* some corrections to circuits

* some corrections to circuits

* fix failure_guarantee_verify to avoid panicking

* fix circuits

* more fixes to circuits + implement ec_zero libfunc

* clippy

* remove unnecesary tests

* remove unnecesary file

* fix branch index

* add comment

* fix eval_u96_limbs_less_than_guarantee_verify

* remove circuit failure test

* update trace dump with new Value::CircitOutputs

* fmt

* reviews + fix modulus in trace dump

* remove unnecesary file

* fix clippy

* implement circuit_single_limb_less_than_guarantee_verify

* fix trace dump for circuit outputs

* fix felt_dict_get

* fix felt_dict_get

* implement U96LimbsLessThanGuarantee for trace dump

* remove unnecessary code

* fmt

* fix felt_dict_entry_get

* revert change in circuits.rs

* remove unwanted file

* revert unwanted change

* revert unwanted change

* fix cast and int range libfuncs

* make trace dump for circuit outputs cleaner

* remove unwanted code

* increase felt dict count always during get()

* doc function + merge main

* fix some libfuncs

* implement CouponCall not working

* all tests passing

* remove WIP for corelib tests in sierra-emu's ci

* remove WIP for corelib tests in sierra-emu's ci

* fmt!

* pop unused argument in coupon_call

* better error messages in utils

Gather compilation statistics (#1236)

* Add basic Statistics struct and its builder

* Add Serialzie to Statistics

* Generate basic sierra statistics

* Add stats argument to compile

* Save sierra to mlir and mlir passes time

* Add stats argument to object_to_shared_lib

* Save linking time

* Add stats argument to module_to_object

* Save llvm time

* Save total compilation time

* Save object size in statistics

* Remove StatisticsBuilder

* Add libfunc frequency

* Remove work

* Assert frequency map is not empty

* Save mlir operation count

* Save llvmir instructions and opcode frequency

* Save llvmir virtual register count

* Adapt trace_dump.rs

* Don't rely on transmute

* Move MLIR walking logic to walk_ir module

* Move LLVMIR walking to walk_ir module

* Improve comments

* Pass statistics to compile stats

* Save MLIR operations by libfunc

* Add clone_option_mut macro

* Validate statistics

* Use clone_option_mut

* Document statistics

* Document walk_ir module

* Add API to statistics

* Add support for saving stats on `starknet-native-compile`

* Add documentation

* Fix clippy

* Update starknet-blocks.yml ref

* Rephrase docs

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Update script for comparing state dumps

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

Don't fail on empty programs (#1248)

Update version (#1249)

Unifiy versioning for workspace (#1250)

* Use workspace version

* Specify version for sierra emu

* Fix typo

* Move keywords

* Use workspace package

* Update casm-data-flow also

* Update lock

* Update sierra emu version

* Reorder

* Try

* Publish sierra emu before cairo native

* Revert reorg of Cargo.toml

Add documentation on to_ptr catchall pattern (#1228)

* Add comment

* Remove todo

---------

Co-authored-by: Franco Giachetta <francogiachetta27@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>
* Review TODO comments

* Minor improvements to Sierra Emu crate (#1202)

* Move cairo-lang dependencies to workspace

* Remove sierra-emu/.gitignore

* Update lock

* Add fibonacci.cairo example for sierra emulator

* Simplify Makefile

* Simplify README and improve documentation on how to use the binary

* Add make check

* Improve examples

* Document make check

* Remove unused script

* Add fibonacci_contract.cairo

* Fix typo in Makefile

* Fix CI

* Use cairo2/corelib instead of corelib for symlinking in sierra emu

* Improve Sierra Emulator descritopn

* Move more dependencies to workspace

* Fix whitespace

* Fix whitespace (again)

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Add Trace Dump feature (#1199)

* Add trace dump support in compiler

* Add sierra emu dependency with trace-dump feature

* Add trace dump metadata

* Register trace dump symbols on executors

* Use trace dump feature in cairo-native-run

* Remove unused feature

* Rename trace_id symbol

* Don't generate trace dump on return when no tail recursion target has been found

* Update lock

* Derive Eq,PartialEq on TraceDump

* Substract initial required gas in sierra emu

* Print error when trace dump is not found, but ignore

* Add trace dump test

* Fix clippy

* Remove `get_layout` from trace dump

* Rename variables

* Minor improvements

* Add documentation

* Improve documentation

* Improve documentation on trace dump runtime functions

* Fix typo

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Fix warning

* Update usage docs

* Document trace dump feature for programs

* Add txt to blockquote to avoid executing in doc test

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* [Sierra-Emu] Implement missing syscall and nullable libfuncs (#1205)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* remove debug_name in enums

* refactor

* remove unused dependency

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* print progress as the test runs

* fmt

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* add starknet missing libfuncs

* cargo.lock

* add null, nullable_from_box and match_nullable libfuncs

* clippyt

* add forward_snapshot libfunc + fix is() for nullable

* refactor syscall handler

* add some felt types to match

* remove type_to_name() call in is() function

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* [Sierra-Emu] implement some todos from `const` and `cast` libfuncs (#1191)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* add enum in const::inner

* remove todos and fix some failures

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* ignore test

* fmt

* remove debug_name in enums

* refactor

* remove unused dependency

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* print progress as the test runs

* fmt

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* fix clippy

* clippy

* remove unnecesary pubs

* better docs

* better panic message in get_numberic_args_as_bigints()

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* reviews

* remove unnecessary comment

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* use slices in get_numeric_args_as_bigints

* fmt

* remove unnecesary to_vec

* fmt

* use iter instead of into_iter

* reviews changes

* better error message

* fix typo

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* [Sierra-Emu] implement `get_available_gas` libfunc (#1210)

* implement las gas libfunc

* remove unnecesary pubs

* Improve sierra2casm-dbg (#1206)

* Add sierra2casm-dbg

* Sync cairo version between sierra2casm-dbg and root

* Bump Cairo VM version in sierra2casm-dbg

* Fix compilation and linter errors

* Bump Cairo in sierra2casm-dbg

* Remove unused serde dep in sierra2casm-dbg

* Remove Rust toolchain in sierra2casm-dbg

* Add sierra2casm-dbg CI job (#1201)

* Move cairo-lang dependencies to workspace

* Remove sierra-emu/.gitignore

* Update lock

* Add fibonacci.cairo example for sierra emulator

* Simplify Makefile

* Simplify README and improve documentation on how to use the binary

* Add make check

* Improve examples

* Document make check

* Remove unused script

* Add fibonacci_contract.cairo

* Fix typo in Makefile

* Fix CI

* Use cairo2/corelib instead of corelib for symlinking in sierra emu

* Improve Sierra Emulator descritopn

* Move more dependencies to workspace

* Rename to casm-data-flow

* Add Makefile

* Add basic run-contract example

* Add fibonacci_starknet.cairo

* Fix hint format

* Add basic README.md

* Update dependencies

* Print gas usage

* Finish README.md

* Add .PHONY

* Fix paragraph

* Move deps to workspace

* Fix whitespace

* Fix whitespace

* Fix README.md

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* [Sierra-Emu] implement missing libfuncs from `int_range` and `array` (#1200)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* remove debug_name in enums

* refactor

* remove unused dependency

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* print progress as the test runs

* fmt

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* implement int_range libfuncs

* implement missing array libfuncs

* fmt

* add is() for IntRange

* remove unnecesary pubs

* reviews

* reviews

* fix branching in int_range_try_new

* clippy

* reviews

* fmt

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* [Sierra-Emu] Implement missing libfuncs from int (#1192)

* Add sierra-emu as a debug utility

* Change working dir in sierra-emu job

* Remove repeated lines in sierra-emu gitignore

* Exclude debug_utils from coverage job

* remove some todos from value and implement Coupon libfunc

* start adding corelib test

* run tests from corelib

* remove unwanted file

* remove not related things

* get return_value from trace

* replace ids for debug info

* add common folder for integration tests

* fix tests

* remove todo

* ignore test for now

* filter ignored tests

* Update debug_utils/sierra-emu/tests/common/mod.rs

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* run ignored test from the ci

* better ignoring

* remove debug_name in enums

* refactor

* remove unused dependency

* implement missing libfuncs from int

* fmt

* More expressive naming for the workflow

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* reviews

* reviews

* fmt

* fmt ci

* revert last commit

* fmt

* accidentally removed rayon usage

* avoid map's short-circuiting

* catch panics the avoid loosing the test name

* log ignored tests

* clippy

* Add "(WIP)" to corelib's test job

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* add general libfuncs: const, equal, to_felt, from_felt

* add diff libfunc

* print progress as the test runs

* fmt

* fix from_felt

* remove unused files + fix issue with non-integer

* format makefile

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

* try fix from_felt

* fix name test in ci

* add dependencies removed in merge

* dependencies

* clippy

* remove unused import

* better indent in makefile

* uppercase tests summary comment for better sight

* simplify a little apply_wrapping_op

* merge test-corelib

* remove unnecesary pubs

* also match builtins instead of filtering them

* format

* use slices in get_numeric_args_as_bigints

* fmt

* remove unnecesary to_vec

* fmt

* use iter instead of into_iter

* clippy

* reviews + remove uint128 file

* rename uint252 file to uint256

* fix clippy

---------

Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Update arch.rs

* Update main.rs

* Update arch.rs

* Update enum.rs

* Update arch.rs

* Update executor.rs

* Update contract.rs

* Update bytes31.rs

* Update felt252.rs

* Update starknet.rs

* Update starknet.rs

* implement circuit_single_limb_less_than_guarantee_verify (#1212)

* implement circuit_single_limb_less_than_guarantee_verify

* fmt

* clippy

* Fix comment

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>

---------

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* [Sierra-Emu] Fix felt-dict's overflow, circuits libfuncs and implement missing EcPoint libfunc (#1208)

* change initial gas due to overflows

* fix some libfuncs in circuits

* fix is() for circuits

* remove Value::Unit from return values in get_output

* match U96LimbsLessThanGuarantee correctly

* some corrections to circuits

* some corrections to circuits

* fix failure_guarantee_verify to avoid panicking

* fix circuits

* more fixes to circuits + implement ec_zero libfunc

* clippy

* remove unnecesary tests

* remove unnecesary file

* fix branch index

* add comment

* fix eval_u96_limbs_less_than_guarantee_verify

* remove circuit failure test

* update trace dump with new Value::CircitOutputs

* fmt

* reviews + fix modulus in trace dump

* remove unnecesary file

* fix clippy

* implement circuit_single_limb_less_than_guarantee_verify

* fix trace dump for circuit outputs

* fix felt_dict_get

* fix felt_dict_get

* implement U96LimbsLessThanGuarantee for trace dump

* remove unnecessary code

* fmt

* fix felt_dict_entry_get

* revert change in circuits.rs

* remove unwanted file

* revert unwanted change

* revert unwanted change

* make trace dump for circuit outputs cleaner

* remove unwanted code

* increase felt dict count always during get()

* doc function + merge main

* reviews

* use elemts stride for offseting u384 structs

* forgot to update one stride

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* cherry: Use dynamic arrays instead of static arrays for circuit data (#1233) (#1237)

* [Serra-Emu] Fix some libfuncs (#1223)

* change initial gas due to overflows

* fix some libfuncs in circuits

* fix is() for circuits

* remove Value::Unit from return values in get_output

* match U96LimbsLessThanGuarantee correctly

* some corrections to circuits

* some corrections to circuits

* fix failure_guarantee_verify to avoid panicking

* fix circuits

* more fixes to circuits + implement ec_zero libfunc

* clippy

* remove unnecesary tests

* remove unnecesary file

* fix branch index

* add comment

* fix eval_u96_limbs_less_than_guarantee_verify

* remove circuit failure test

* update trace dump with new Value::CircitOutputs

* fmt

* reviews + fix modulus in trace dump

* remove unnecesary file

* fix clippy

* implement circuit_single_limb_less_than_guarantee_verify

* fix trace dump for circuit outputs

* fix felt_dict_get

* fix felt_dict_get

* implement U96LimbsLessThanGuarantee for trace dump

* remove unnecessary code

* fmt

* fix felt_dict_entry_get

* revert change in circuits.rs

* remove unwanted file

* revert unwanted change

* revert unwanted change

* fix cast and int range libfuncs

* make trace dump for circuit outputs cleaner

* remove unwanted code

* increase felt dict count always during get()

* doc function + merge main

* fix some libfuncs

* implement CouponCall not working

* all tests passing

* remove WIP for corelib tests in sierra-emu's ci

* remove WIP for corelib tests in sierra-emu's ci

* fmt!

* pop unused argument in coupon_call

* better error messages in utils

* Fix format

* Gather compilation statistics (#1236)

* Add basic Statistics struct and its builder

* Add Serialzie to Statistics

* Generate basic sierra statistics

* Add stats argument to compile

* Save sierra to mlir and mlir passes time

* Add stats argument to object_to_shared_lib

* Save linking time

* Add stats argument to module_to_object

* Save llvm time

* Save total compilation time

* Save object size in statistics

* Remove StatisticsBuilder

* Add libfunc frequency

* Remove work

* Assert frequency map is not empty

* Save mlir operation count

* Save llvmir instructions and opcode frequency

* Save llvmir virtual register count

* Adapt trace_dump.rs

* Don't rely on transmute

* Move MLIR walking logic to walk_ir module

* Move LLVMIR walking to walk_ir module

* Improve comments

* Pass statistics to compile stats

* Save MLIR operations by libfunc

* Add clone_option_mut macro

* Validate statistics

* Use clone_option_mut

* Document statistics

* Document walk_ir module

* Add API to statistics

* Add support for saving stats on `starknet-native-compile`

* Add documentation

* Fix clippy

* Update starknet-blocks.yml ref

* Rephrase docs

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Update script for comparing state dumps

---------

Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>

* Don't fail on empty programs (#1248)

* Update version (#1249)

---------

Co-authored-by: Julian Gonzalez Calderon <gonzalezcalderonjulian@gmail.com>
Co-authored-by: Gabriel Bosio <38794644+gabrielbosio@users.noreply.github.com>
Co-authored-by: Franco Giachetta <francogiachetta27@gmail.com>
Co-authored-by: gabrielbosio <gabrielbosio95@gmail.com>
@gabrielbosio
Copy link
Collaborator

Closing in favor of #1254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants