Skip to content

[DNM] Starkware Development #2076

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

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft

Conversation

JulianGCalderon
Copy link
Contributor

A draft PR to track progress on the starkware-development branch.

JulianGCalderon and others added 18 commits March 27, 2025 16:36
* Fix flow notation

* Fix dependency
* Add Commit Signing section

* Clarify that this only affects to internal branches

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

---------

Co-authored-by: Julian Gonzalez Calderon <[email protected]>
Co-authored-by: Franco Giachetta <[email protected]>
# TITLE

Cherry-pick all the commits from main 

Description of the pull request changes and motivation.

## Checklist
- [ ] Linked to Github Issue
- [ ] Unit tests added
- [ ] Integration tests added.
- [ ] This change requires new documentation.
  - [ ] Documentation has been added/updated.
  - [ ] CHANGELOG has been updated.
# TITLE

## Description

Description of the pull request changes and motivation.

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

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/lambdaclass/cairo-vm/2036)
<!-- Reviewable:end -->
# TITLE

## Description

Description of the pull request changes and motivation.

## Checklist
- [ ] Linked to Github Issue
- [ ] Unit tests added
- [ ] Integration tests added.
- [ ] This change requires new documentation.
  - [ ] Documentation has been added/updated.
  - [ ] CHANGELOG has been updated.
This PR is an as-is copy of AlonT's PR pushed to a fork repo.
Set disable trace padding flag if prover input info is required.
+ add 'proof mode' as required for prover_input_info
Copy link

github-actions bot commented Apr 25, 2025

**Hyper Thereading Benchmark results**




hyperfine -r 2 -n "hyper_threading_main threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_main' -n "hyper_threading_pr threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 1
  Time (mean ± σ):     25.770 s ±  0.063 s    [User: 24.970 s, System: 0.796 s]
  Range (min … max):   25.725 s … 25.814 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     24.772 s ±  0.063 s    [User: 23.927 s, System: 0.841 s]
  Range (min … max):   24.727 s … 24.816 s    2 runs
 
Summary
  hyper_threading_pr threads: 1 ran
    1.04 ± 0.00 times faster than hyper_threading_main threads: 1




hyperfine -r 2 -n "hyper_threading_main threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_main' -n "hyper_threading_pr threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 2
  Time (mean ± σ):     14.458 s ±  0.050 s    [User: 25.175 s, System: 0.830 s]
  Range (min … max):   14.423 s … 14.494 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     13.516 s ±  0.007 s    [User: 24.099 s, System: 0.861 s]
  Range (min … max):   13.511 s … 13.521 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.07 ± 0.00 times faster than hyper_threading_main threads: 2




hyperfine -r 2 -n "hyper_threading_main threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_main' -n "hyper_threading_pr threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 4
  Time (mean ± σ):     10.228 s ±  0.137 s    [User: 37.311 s, System: 0.984 s]
  Range (min … max):   10.131 s … 10.325 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.242 s ±  0.156 s    [User: 36.018 s, System: 1.031 s]
  Range (min … max):   10.131 s … 10.352 s    2 runs
 
Summary
  hyper_threading_main threads: 4 ran
    1.00 ± 0.02 times faster than hyper_threading_pr threads: 4




hyperfine -r 2 -n "hyper_threading_main threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_main' -n "hyper_threading_pr threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 6
  Time (mean ± σ):     10.348 s ±  0.200 s    [User: 37.516 s, System: 0.967 s]
  Range (min … max):   10.207 s … 10.490 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):      9.959 s ±  0.061 s    [User: 36.260 s, System: 1.026 s]
  Range (min … max):    9.916 s … 10.002 s    2 runs
 
Summary
  hyper_threading_pr threads: 6 ran
    1.04 ± 0.02 times faster than hyper_threading_main threads: 6




hyperfine -r 2 -n "hyper_threading_main threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_main' -n "hyper_threading_pr threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 8
  Time (mean ± σ):     10.249 s ±  0.008 s    [User: 37.755 s, System: 1.001 s]
  Range (min … max):   10.244 s … 10.255 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):      9.889 s ±  0.113 s    [User: 36.788 s, System: 1.069 s]
  Range (min … max):    9.809 s …  9.969 s    2 runs
 
Summary
  hyper_threading_pr threads: 8 ran
    1.04 ± 0.01 times faster than hyper_threading_main threads: 8




hyperfine -r 2 -n "hyper_threading_main threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_main' -n "hyper_threading_pr threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 16
  Time (mean ± σ):     10.119 s ±  0.098 s    [User: 38.310 s, System: 1.078 s]
  Range (min … max):   10.050 s … 10.188 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):      9.922 s ±  0.010 s    [User: 36.940 s, System: 1.142 s]
  Range (min … max):    9.914 s …  9.929 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.02 ± 0.01 times faster than hyper_threading_main threads: 16


Copy link

github-actions bot commented Apr 25, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.150 ± 0.016 2.136 2.192 1.00
head big_factorial 2.177 ± 0.006 2.170 2.190 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.063 ± 0.014 2.049 2.098 1.00
head big_fibonacci 2.145 ± 0.028 2.113 2.192 1.04 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.602 ± 0.032 7.540 7.633 1.00
head blake2s_integration_benchmark 7.881 ± 0.055 7.772 7.956 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.265 ± 0.028 2.231 2.329 1.00
head compare_arrays_200000 2.288 ± 0.017 2.259 2.317 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.458 ± 0.008 1.449 1.474 1.00
head dict_integration_benchmark 1.492 ± 0.023 1.464 1.542 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.245 ± 0.015 1.228 1.265 1.00
head field_arithmetic_get_square_benchmark 1.269 ± 0.015 1.254 1.307 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.753 ± 0.036 7.689 7.793 1.00
head integration_builtins 7.977 ± 0.060 7.913 8.119 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.017 ± 0.032 7.971 8.072 1.00 ± 0.02
head keccak_integration_benchmark 7.996 ± 0.150 7.880 8.370 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.234 ± 0.022 2.193 2.263 1.00 ± 0.01
head linear_search 2.233 ± 0.018 2.206 2.260 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.551 ± 0.011 1.537 1.567 1.00
head math_cmp_and_pow_integration_benchmark 1.565 ± 0.006 1.557 1.572 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.486 ± 0.011 1.474 1.507 1.00
head math_integration_benchmark 1.505 ± 0.008 1.495 1.521 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.256 ± 0.026 1.238 1.313 1.00
head memory_integration_benchmark 1.260 ± 0.012 1.247 1.290 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.607 ± 0.009 1.599 1.632 1.00
head operations_with_data_structures_benchmarks 1.614 ± 0.031 1.588 1.695 1.00 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 541.8 ± 2.4 537.8 546.8 1.00
head pedersen 544.2 ± 4.7 538.9 552.8 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 646.1 ± 7.4 635.1 658.7 1.02 ± 0.02
head poseidon_integration_benchmark 635.8 ± 6.5 624.1 643.6 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.882 ± 0.021 1.865 1.938 1.01 ± 0.01
head secp_integration_benchmark 1.872 ± 0.013 1.860 1.906 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 633.5 ± 3.4 630.7 641.3 1.00
head set_integration_benchmark 637.5 ± 2.8 634.0 641.9 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.240 ± 0.061 4.175 4.390 1.00
head uint256_integration_benchmark 4.339 ± 0.021 4.307 4.378 1.02 ± 0.02

Stavbe added 2 commits April 28, 2025 17:53
Added another flag to allow fast serialization of 'prover_input_info'
into a binary file
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 96.90083% with 15 lines in your changes missing coverage. Please review.

Project coverage is 96.63%. Comparing base (0038711) to head (bdf604f).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
vm/src/vm/vm_core.rs 87.50% 7 Missing ⚠️
vm/src/vm/runners/cairo_runner.rs 95.29% 4 Missing ⚠️
cairo-vm-cli/src/main.rs 81.25% 3 Missing ⚠️
vm/src/cairo_run.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2076      +/-   ##
==========================================
+ Coverage   96.55%   96.63%   +0.08%     
==========================================
  Files         102      104       +2     
  Lines       42872    43864     +992     
==========================================
+ Hits        41394    42388     +994     
+ Misses       1478     1476       -2     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Stavbe and others added 2 commits May 22, 2025 14:57
* Remove duplicated `get_val` (#2065)

* avoid installing gmp if it is already installed

* revert part of the last commit

* changelog

* remove unwanted file

* CI: Make cache keys depend on Cairo version (#2056)

* Add Makefile and requirements.txt to cache key

* Don't fetch cairo stwo exclusive programs

* Remove empty file

* Restrict caching Cairo programs

Revert how the Rust workflow uses the Cairo program paths to
calculate the cache keys.
This change would imply the branch only adds Makefile and
requirements.txt to the cache key computation.

---------

Co-authored-by: gabrielbosio <[email protected]>
Co-authored-by: Gabriel Bosio <[email protected]>

* dev: make Memory::get `pub` (#2039)

* dev: make Memory::get `pub`

* edit changelog

* dev: expose get_maybe_relocatable instead

* add comment on borrowed variant

* add tests

* feat(breaking): add support for hint accessible scopes (#2042)

* feat: add support for hint accessible scopes

update changelog

* Update vm/src/hint_processor/hint_processor_definition.rs

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

---------

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

* feat: add support for alias identifiers destination in program serde (#2071)

* feat: add support for aliases destination in program serde

* add changelog

---------

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

* fix: Add boundary tests for SecpSplitOutOfRange in secp_utils (#2062)

* fix: Add boundary tests for SecpSplitOutOfRange in secp_utils

* Update secp_utils.rs

* Update CHANGELOG.md

* Update secp_utils.rs

* remove optimizations

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* empty commit to fix CI

---------

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

* docs: add --run_from_cairo_pie documentation for Cairo 0 and Cairo 1 (#2077)

* docs: add --run_from_cairo_pie flag usage documentation for Cairo 0

* docs: add --run_from_cairo_pie flag usage documentation for Cairo 1

* Update README.md

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

* Update README.md

* Update README.md

* Update README.md

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

* Update README.md

Co-authored-by: Gabriel Bosio <[email protected]>

* Update README.md

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

---------

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

* Fix WRITE_DIVMOD_SEGMENT hint (#2078)

* Minor fixes - use CAIRO_PRIME

* Add error handling

* Update CHANGELOG.md

* Bump cairo-lang to 0.13.5 (#1959)

* Update cairo-lang versin

* Update changelog

* Add new hints

* Specify prime in new hints

* Only apply mod floor if prime is not CAIRO_PRIME

* Properly implement pack for a different prime

* Fix pack in compute_doubling_slope

* Add negative_points.cairo test

* Add try_get_point_from_x for negative points

* Add double_x test for negative points

* Allow to many arguments

* Add codecov to cairo-0-secp-hints feature

* Prepare for Release v3.0.0-rc.1 (#2092)

* Update version

* Update lock

* Update toolchain

* Update changelog

* Fix clippy

* Update toolchain in CI

* fix: correct cache keys for no-std test coverage in CI (#2093)

* Update rust.yml

* Update rust.yml

* Update rust toolchain to 1.87.0 (#2100)

* update rust toolchain to 1.87.0

* remove uneeded file

* update rust in workflows

* update changelog

* clippy

* clippy

* remove unneeded clippy allow

* fix Changelog link (#2104)

* Improve memory_segments coverage (#2110)

* Add tests for .gen_arg() and .write_arg()

* Add test for .is_valid_memory_value()

* Assert contents of memory segments

---------

Co-authored-by: Franco Giachetta <[email protected]>
Co-authored-by: Julian Gonzalez Calderon <[email protected]>
Co-authored-by: Mathieu <[email protected]>
Co-authored-by: VolodymyrBg <[email protected]>
Co-authored-by: GarmashAlex <[email protected]>
Co-authored-by: crStiv <[email protected]>
Co-authored-by: DiegoC <[email protected]>
Copy link

github-actions bot commented Jun 4, 2025

Benchmark Results for modified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
head big_factorial 2.094 ± 0.016 2.073 2.133 1.00
Command Mean [s] Min [s] Max [s] Relative
head big_fibonacci 2.017 ± 0.009 2.008 2.037 1.00
Command Mean [s] Min [s] Max [s] Relative
head blake2s_integration_benchmark 7.405 ± 0.065 7.328 7.496 1.00
Command Mean [s] Min [s] Max [s] Relative
head compare_arrays_200000 2.151 ± 0.015 2.140 2.192 1.00
Command Mean [s] Min [s] Max [s] Relative
head dict_integration_benchmark 1.408 ± 0.009 1.398 1.427 1.00
Command Mean [s] Min [s] Max [s] Relative
head field_arithmetic_get_square_benchmark 1.213 ± 0.010 1.202 1.228 1.00
Command Mean [s] Min [s] Max [s] Relative
head integration_builtins 7.505 ± 0.066 7.408 7.590 1.00
Command Mean [s] Min [s] Max [s] Relative
head keccak_integration_benchmark 7.608 ± 0.099 7.493 7.832 1.00
Command Mean [s] Min [s] Max [s] Relative
head linear_search 2.108 ± 0.008 2.097 2.125 1.00
Command Mean [s] Min [s] Max [s] Relative
head math_cmp_and_pow_integration_benchmark 1.486 ± 0.003 1.480 1.491 1.00
Command Mean [s] Min [s] Max [s] Relative
head math_integration_benchmark 1.443 ± 0.010 1.428 1.458 1.00
Command Mean [s] Min [s] Max [s] Relative
head memory_integration_benchmark 1.196 ± 0.010 1.186 1.221 1.00
Command Mean [s] Min [s] Max [s] Relative
head operations_with_data_structures_benchmarks 1.522 ± 0.011 1.511 1.549 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
head pedersen 523.9 ± 0.9 522.3 525.8 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
head poseidon_integration_benchmark 597.9 ± 1.8 595.5 600.7 1.00
Command Mean [s] Min [s] Max [s] Relative
head secp_integration_benchmark 1.787 ± 0.007 1.779 1.801 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
head set_integration_benchmark 666.0 ± 8.6 650.3 673.4 1.00
Command Mean [s] Min [s] Max [s] Relative
head uint256_integration_benchmark 4.169 ± 0.024 4.143 4.203 1.00

gabrielbosio and others added 2 commits June 4, 2025 19:10
* Update cairo-lang versin

* Update changelog

* Add new hints

* Specify prime in new hints

* Only apply mod floor if prime is not CAIRO_PRIME

* Properly implement pack for a different prime

* Fix pack in compute_doubling_slope

* Add negative_points.cairo test

* Add try_get_point_from_x for negative points

* Add double_x test for negative points

* Allow to many arguments

* Add codecov to cairo-0-secp-hints feature

Co-authored-by: Julian Gonzalez Calderon <[email protected]>
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