Skip to content

feat: add get_current_step getter #2034

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

Merged
merged 3 commits into from
Mar 27, 2025
Merged

Conversation

dorimedini-starkware
Copy link
Collaborator

Add get_current_step getter

Description

To implement the OsLogger in the Starknet OS, access to the current step is required.

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.

Copy link

github-actions bot commented Mar 27, 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 ± σ):     26.432 s ±  0.002 s    [User: 25.591 s, System: 0.838 s]
  Range (min … max):   26.430 s … 26.433 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     26.650 s ±  0.020 s    [User: 25.798 s, System: 0.848 s]
  Range (min … max):   26.636 s … 26.664 s    2 runs
 
Summary
  hyper_threading_main threads: 1 ran
    1.01 ± 0.00 times faster than hyper_threading_pr 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.708 s ±  0.037 s    [User: 25.698 s, System: 0.851 s]
  Range (min … max):   14.682 s … 14.735 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.870 s ±  0.156 s    [User: 25.980 s, System: 0.870 s]
  Range (min … max):   14.760 s … 14.981 s    2 runs
 
Summary
  hyper_threading_main threads: 2 ran
    1.01 ± 0.01 times faster than hyper_threading_pr 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.702 s ±  0.370 s    [User: 37.996 s, System: 1.025 s]
  Range (min … max):   10.440 s … 10.964 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.367 s ±  0.347 s    [User: 38.332 s, System: 1.022 s]
  Range (min … max):   10.121 s … 10.613 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.03 ± 0.05 times faster than hyper_threading_main 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.669 s ±  0.049 s    [User: 38.147 s, System: 1.029 s]
  Range (min … max):   10.634 s … 10.704 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.781 s ±  0.527 s    [User: 38.368 s, System: 1.018 s]
  Range (min … max):   10.408 s … 11.153 s    2 runs
 
Summary
  hyper_threading_main threads: 6 ran
    1.01 ± 0.05 times faster than hyper_threading_pr 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.442 s ±  0.041 s    [User: 38.512 s, System: 1.036 s]
  Range (min … max):   10.413 s … 10.471 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.458 s ±  0.136 s    [User: 38.484 s, System: 1.045 s]
  Range (min … max):   10.361 s … 10.554 s    2 runs
 
Summary
  hyper_threading_main threads: 8 ran
    1.00 ± 0.01 times faster than hyper_threading_pr 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.379 s ±  0.093 s    [User: 39.060 s, System: 1.156 s]
  Range (min … max):   10.313 s … 10.445 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.434 s ±  0.164 s    [User: 38.913 s, System: 1.158 s]
  Range (min … max):   10.317 s … 10.550 s    2 runs
 
Summary
  hyper_threading_main threads: 16 ran
    1.01 ± 0.02 times faster than hyper_threading_pr threads: 16


Copy link

github-actions bot commented Mar 27, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.123 ± 0.012 2.113 2.152 1.00
head big_factorial 2.137 ± 0.030 2.118 2.221 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.058 ± 0.022 2.040 2.100 1.00 ± 0.01
head big_fibonacci 2.054 ± 0.017 2.039 2.091 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.521 ± 0.025 7.483 7.558 1.00
head blake2s_integration_benchmark 7.592 ± 0.124 7.459 7.744 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.196 ± 0.071 2.157 2.396 1.01 ± 0.03
head compare_arrays_200000 2.167 ± 0.006 2.158 2.178 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.436 ± 0.002 1.433 1.439 1.00
head dict_integration_benchmark 1.447 ± 0.008 1.439 1.465 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.212 ± 0.004 1.203 1.216 1.00
head field_arithmetic_get_square_benchmark 1.212 ± 0.004 1.205 1.216 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.567 ± 0.019 7.529 7.597 1.00
head integration_builtins 7.619 ± 0.113 7.562 7.938 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.884 ± 0.061 7.833 8.045 1.01 ± 0.01
head keccak_integration_benchmark 7.843 ± 0.032 7.805 7.907 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.169 ± 0.023 2.147 2.228 1.00 ± 0.01
head linear_search 2.168 ± 0.017 2.144 2.200 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.528 ± 0.008 1.519 1.544 1.00
head math_cmp_and_pow_integration_benchmark 1.530 ± 0.016 1.518 1.573 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.472 ± 0.007 1.464 1.487 1.00 ± 0.01
head math_integration_benchmark 1.469 ± 0.005 1.462 1.479 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.221 ± 0.010 1.212 1.248 1.00 ± 0.01
head memory_integration_benchmark 1.216 ± 0.003 1.212 1.220 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.583 ± 0.010 1.571 1.608 1.00
head operations_with_data_structures_benchmarks 1.584 ± 0.004 1.579 1.592 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 533.3 ± 5.5 530.2 548.7 1.00 ± 0.01
head pedersen 533.0 ± 2.2 530.2 536.8 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 632.4 ± 3.8 624.2 636.5 1.00
head poseidon_integration_benchmark 634.0 ± 2.1 630.2 636.6 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.870 ± 0.007 1.862 1.887 1.00 ± 0.00
head secp_integration_benchmark 1.861 ± 0.006 1.853 1.869 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 676.3 ± 26.7 662.1 751.5 1.00
head set_integration_benchmark 692.9 ± 55.7 660.2 823.3 1.02 ± 0.09
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.233 ± 0.027 4.199 4.293 1.01 ± 0.01
head uint256_integration_benchmark 4.207 ± 0.020 4.185 4.252 1.00

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.54%. Comparing base (7b9e1c5) to head (48278c1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2034   +/-   ##
=======================================
  Coverage   96.54%   96.54%           
=======================================
  Files         102      102           
  Lines       42788    42791    +3     
=======================================
+ Hits        41309    41312    +3     
  Misses       1479     1479           

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

Signed-off-by: Dori Medini <[email protected]>
Signed-off-by: Dori Medini <[email protected]>
Copy link
Contributor

@JulianGCalderon JulianGCalderon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue Mar 27, 2025
Merged via the queue into main with commit 4e473eb Mar 27, 2025
93 checks passed
@dorimedini-starkware dorimedini-starkware deleted the dori/current-step-getter branch March 27, 2025 18:45
gabrielbosio pushed a commit that referenced this pull request May 21, 2025
* feat: add get_current_step getter

Signed-off-by: Dori Medini <[email protected]>

* chore: changelog

Signed-off-by: Dori Medini <[email protected]>

* test: add coverage

Signed-off-by: Dori Medini <[email protected]>

---------

Signed-off-by: Dori Medini <[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.

3 participants