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

[DNM] Execution trace dumping with contract support. #775

Draft
wants to merge 23 commits into
base: main
Choose a base branch
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.

Copy link

github-actions bot commented Aug 28, 2024

Benchmarking results

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.490 ± 0.367 10.901 11.840 8.53 ± 0.27
cairo-native (embedded AOT) 3.569 ± 0.033 3.520 3.628 2.65 ± 0.02
cairo-native (embedded JIT using LLVM's ORC Engine) 3.393 ± 0.044 3.336 3.477 2.52 ± 0.03
cairo-native (standalone AOT with -march=native) 1.348 ± 0.001 1.346 1.349 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 11.071 ± 0.219 10.870 11.483 141.53 ± 2.83
cairo-native (embedded AOT) 3.157 ± 0.036 3.077 3.205 40.36 ± 0.47
cairo-native (embedded JIT using LLVM's ORC Engine) 3.006 ± 0.034 2.963 3.051 38.43 ± 0.44
cairo-native (standalone AOT with -march=native) 0.078 ± 0.000 0.078 0.079 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 4.513 ± 0.060 4.420 4.612 18.64 ± 0.25
cairo-native (embedded AOT) 3.369 ± 0.044 3.305 3.422 13.91 ± 0.19
cairo-native (embedded JIT using LLVM's ORC Engine) 3.282 ± 0.031 3.229 3.315 13.55 ± 0.13
cairo-native (standalone AOT with -march=native) 0.242 ± 0.000 0.242 0.243 1.00

Copy link

github-actions bot commented Sep 10, 2024

✅ Code is now correctly formatted.

azteca1998 and others added 3 commits September 10, 2024 19:16
* Impl ClassHash and SegmentArena

* Add trace dump support to compiler

* Reset workflows

* Update lock

* Implement BoundedInt

* Fix Enum trace dump

* Make gas_metadata public

* Update deps

* Fix bug

* Move deps to optional (trace dump featire)
@igaray igaray changed the title Execution trace dumping with contract support. [DNM] Execution trace dumping with contract support. Sep 12, 2024
Copy link

github-actions bot commented Oct 8, 2024

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 3.214 ± 0.032 3.170 3.274 1.00
base factorial_2M.cairo (AOT) 3.392 ± 0.026 3.365 3.458 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head factorial_2M.cairo (JIT) 3.264 ± 0.035 3.212 3.320 1.00
head factorial_2M.cairo (AOT) 3.538 ± 0.051 3.469 3.637 1.08 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 2.767 ± 0.050 2.715 2.861 1.00
base fib_2M.cairo (AOT) 2.970 ± 0.034 2.893 3.014 1.07 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head fib_2M.cairo (JIT) 2.798 ± 0.035 2.737 2.847 1.00
head fib_2M.cairo (AOT) 2.998 ± 0.020 2.969 3.026 1.07 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.132 ± 0.030 3.092 3.182 1.00
base logistic_map.cairo (AOT) 3.215 ± 0.039 3.177 3.285 1.03 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head logistic_map.cairo (JIT) 3.199 ± 0.028 3.162 3.242 1.00
head logistic_map.cairo (AOT) 3.205 ± 0.068 3.121 3.331 1.00 ± 0.02

JulianGCalderon and others added 7 commits October 21, 2024 09:38
* Add logs

* Implement Felt252Dict trace dump

* Implement nullabel for trace dump

* Print type id

* Remove print

* add convertion for Sints

* fix mispelled types

* forgot to add feature

* change Sints value to correspond to sierra-emu

* Readd feature

* Add is_infinity field to secp256 point struct (#828)

* add is_infinity to secp point

* clean

* fix

* use same deps as blockifier

* fix

* fix layout

* fix test

* remove some brittle asserts due to random initial data when adding and muling points at infinity

* fix

* remove unused dep

* fixes, missed the value entry/output

* Reset src

* Fix warnings

* Make library public

* Use debug runtime for trace dump

* fix storage's values truncations (#839)

* fix storage's values truncations

* change implementation for i8 i16 i32 i64 too

* format

* Add ptr check to felt dict entry

* Add malloc tracing and fix more memory leaks. (#833)

* Add memory tracing.

* Partial memory fixes.

* Fix arrays.

* Simplify dictionaries. Fix false positive memory leak in dictionary drops.

* Fix zero-sized allocation. Fix warnings. More mem tracing checks.

* Fix mem tracing.

* Fix memory leak in `print` libfunc.

* Fix array slice libfunc.

* Fix starknet memory leaks.

* Fix keccak syscall.

* Fix dict get double free bug.

* Lots of memory fixes.

* More fixes.

* Fix CI.

* Remove old TODOs.

* Fix CI (again).

* Remove TODOs.

* Fix test.

* Maybe fix

* Maybe fix

* Maybe fix

* Dont panic when building circuit partial outputs

* trace dump for Sha256StateHandler

* Builtin costs rework (#837)

* Update to 2.8.4, release docs, alpha

This PR updates cairo to 2.8.4, adds some release docs and updates the
version to alpha.3 to prepare for another release.

* try fix

* cleanup ci, remove panic in link

* rename from jit to from ptr, etc

* crates.io badge

* progress

* progress

* fmt2

* progress

* progress

* fix

* fix bench

* use struct

* Fix felt252 and enum deserialization bugs. (#844)

* Fix felt252 and enum deserialization bugs.

* Fix formatting.

* Also fix the runtime.

* Fix errors.

* try to fix ci

* remove unused deps

---------

Co-authored-by: Edgar Luque <[email protected]>

* Fix trace dump type conv

* fix aot contract executor not passing builtinstats (#849)

* Fix felt252 and enum deserialization bugs.

* Fix formatting.

* Also fix the runtime.

* Fix errors.

* try to fix ci

* remove unused deps

* fix aot contract executor not passing builtinstats

---------

Co-authored-by: Esteve Soler Arderiu <[email protected]>
Co-authored-by: Esteve Soler Arderiu <[email protected]>

* Fix bug (#851)

* Also fix felt bits in starknet syscall wrappers (#853)

* Also fix felt bits in starknet syscall wrappers

* style

* missed

* fix aot contract executor not passing builtinstats (#849)

* Fix felt252 and enum deserialization bugs.

* Fix formatting.

* Also fix the runtime.

* Fix errors.

* try to fix ci

* remove unused deps

* fix aot contract executor not passing builtinstats

---------

Co-authored-by: Esteve Soler Arderiu <[email protected]>
Co-authored-by: Esteve Soler Arderiu <[email protected]>

* Fix bug (#851)

* Also fix felt bits in starknet syscall wrappers (#853)

* Also fix felt bits in starknet syscall wrappers

* style

* missed

* update version to alpha 4 (#854)

* bytes31

* Better function attributes and re-enable >O1 opt (#843)

* Fix felt252 and enum deserialization bugs.

* Fix formatting.

* Also fix the runtime.

* Fix errors.

* try to fix ci

* remove unused deps

* proper function attributes

* add proper function attrs to optimize better, add some passes, run tests with atleast some opts

* dont use remi

* oops

* maybe with opt level 3 now it works

* test

* works

* readd deleted bench

* remove dbg

* Update bench-hyperfine.sh

* fixci

* comment

* Update src/ffi.rs

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

---------

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

* Resolve `CAIRO_NATIVE_RUNTIME_LIBRARY` relative path (#841)

* feat(ffi): resolve runtime relative path using current dir

* chore: remove mentions to old runtime variable

* fix: typo

---------

Co-authored-by: Bohdan Ohorodnii <[email protected]>

* Implement secp

* Fix bytes31

* try to fix ci (#858)

* update implementing libfuncs doc (#856)

* Fix bytes31 bug

* Remove unused dep

---------

Co-authored-by: FrancoGiachetta <[email protected]>
Co-authored-by: Edgar <[email protected]>
Co-authored-by: MrAzteca <[email protected]>
Co-authored-by: Esteve Soler Arderiu <[email protected]>
Co-authored-by: Esteve Soler Arderiu <[email protected]>
Co-authored-by: Rodrigo <[email protected]>
Co-authored-by: Bohdan Ohorodnii <[email protected]>
@JulianGCalderon JulianGCalderon force-pushed the add-trace-dump-contracts branch from ae6784e to 05b9971 Compare November 19, 2024 16:45
@JulianGCalderon JulianGCalderon force-pushed the add-trace-dump-contracts branch from 05b9971 to 7f37246 Compare November 19, 2024 16:47
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 82.45614% with 10 lines in your changes missing coverage. Please review.

Project coverage is 82.64%. Comparing base (2b945fc) to head (bb890c3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/compiler.rs 82.45% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #775   +/-   ##
=======================================
  Coverage   82.63%   82.64%           
=======================================
  Files         117      117           
  Lines       33505    33522   +17     
=======================================
+ Hits        27687    27703   +16     
- Misses       5818     5819    +1     

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

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.

4 participants