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

Implement New Executable API #2017

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

Implement New Executable API #2017

wants to merge 38 commits into from

Conversation

JulianGCalderon
Copy link
Contributor

Implement New Executable API

This PR is a really early draft of the new executable API.

I've created a new structure CairoRunner2, and have been copied code from the original runner in order to test the new executable. The idea is to get a feel of how the new API should look like.

My primary objective is to execute a simple program using the new runner. Once I get that working, I'll try to refactor the code in order to reuse code between the current API and the new API.

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.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon
Copy link

github-actions bot commented Mar 18, 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.274 s ±  0.011 s    [User: 25.510 s, System: 0.763 s]
  Range (min … max):   26.267 s … 26.282 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     26.272 s ±  0.051 s    [User: 25.505 s, System: 0.763 s]
  Range (min … max):   26.236 s … 26.308 s    2 runs
 
Summary
  hyper_threading_pr threads: 1 ran
    1.00 ± 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.605 s ±  0.073 s    [User: 25.596 s, System: 0.781 s]
  Range (min … max):   14.553 s … 14.657 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.579 s ±  0.015 s    [User: 25.627 s, System: 0.805 s]
  Range (min … max):   14.568 s … 14.590 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.00 ± 0.01 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.747 s ±  0.301 s    [User: 37.568 s, System: 0.917 s]
  Range (min … max):   10.535 s … 10.960 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.583 s ±  0.489 s    [User: 38.164 s, System: 0.966 s]
  Range (min … max):   10.238 s … 10.929 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.02 ± 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.612 s ±  0.072 s    [User: 38.159 s, System: 0.949 s]
  Range (min … max):   10.560 s … 10.663 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.569 s ±  0.284 s    [User: 38.136 s, System: 0.908 s]
  Range (min … max):   10.368 s … 10.770 s    2 runs
 
Summary
  hyper_threading_pr threads: 6 ran
    1.00 ± 0.03 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.268 s ±  0.012 s    [User: 38.397 s, System: 0.938 s]
  Range (min … max):   10.259 s … 10.276 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.402 s ±  0.028 s    [User: 38.174 s, System: 0.926 s]
  Range (min … max):   10.382 s … 10.422 s    2 runs
 
Summary
  hyper_threading_main threads: 8 ran
    1.01 ± 0.00 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.336 s ±  0.101 s    [User: 38.830 s, System: 1.023 s]
  Range (min … max):   10.264 s … 10.407 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.381 s ±  0.125 s    [User: 38.611 s, System: 1.025 s]
  Range (min … max):   10.292 s … 10.469 s    2 runs
 
Summary
  hyper_threading_main threads: 16 ran
    1.00 ± 0.02 times faster than hyper_threading_pr threads: 16


Copy link

github-actions bot commented Mar 18, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.120 ± 0.010 2.107 2.140 1.00
head big_factorial 2.157 ± 0.012 2.146 2.183 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.046 ± 0.010 2.035 2.071 1.00
head big_fibonacci 2.096 ± 0.022 2.080 2.155 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.581 ± 0.096 7.499 7.794 1.00
head blake2s_integration_benchmark 8.038 ± 0.104 7.915 8.211 1.06 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.218 ± 0.030 2.192 2.286 1.00
head compare_arrays_200000 2.231 ± 0.012 2.211 2.247 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.448 ± 0.011 1.433 1.466 1.00
head dict_integration_benchmark 1.456 ± 0.006 1.447 1.469 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.215 ± 0.008 1.207 1.232 1.00
head field_arithmetic_get_square_benchmark 1.258 ± 0.011 1.245 1.284 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.650 ± 0.162 7.561 8.101 1.00
head integration_builtins 7.991 ± 0.030 7.933 8.036 1.04 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.848 ± 0.033 7.787 7.887 1.00
head keccak_integration_benchmark 8.275 ± 0.033 8.193 8.316 1.05 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.169 ± 0.010 2.159 2.191 1.00
head linear_search 2.204 ± 0.012 2.187 2.219 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.530 ± 0.011 1.517 1.547 1.00
head math_cmp_and_pow_integration_benchmark 1.547 ± 0.014 1.534 1.574 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.473 ± 0.016 1.459 1.511 1.00
head math_integration_benchmark 1.478 ± 0.015 1.464 1.519 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.224 ± 0.005 1.218 1.236 1.00
head memory_integration_benchmark 1.231 ± 0.005 1.222 1.238 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.577 ± 0.006 1.568 1.586 1.00
head operations_with_data_structures_benchmarks 1.595 ± 0.004 1.588 1.604 1.01 ± 0.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 531.6 ± 1.3 528.7 533.7 1.00
head pedersen 538.8 ± 2.9 536.0 545.9 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 639.6 ± 3.3 634.5 644.7 1.00 ± 0.01
head poseidon_integration_benchmark 639.2 ± 4.1 635.0 647.2 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.846 ± 0.009 1.835 1.862 1.00
head secp_integration_benchmark 1.882 ± 0.007 1.871 1.892 1.02 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 678.8 ± 2.1 677.0 684.5 1.00
head set_integration_benchmark 682.6 ± 1.5 680.2 684.7 1.01 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.196 ± 0.033 4.162 4.266 1.00
head uint256_integration_benchmark 4.374 ± 0.024 4.343 4.430 1.04 ± 0.01

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.53%. Comparing base (c87b23d) to head (6727a10).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
vm/src/vm/vm_core.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2017      +/-   ##
==========================================
- Coverage   96.54%   96.53%   -0.02%     
==========================================
  Files         102      102              
  Lines       42743    42729      -14     
==========================================
- Hits        41268    41247      -21     
- Misses       1475     1482       +7     

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

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon

Verified

This commit was signed with the committer’s verified signature.
JulianGCalderon Julian Gonzalez Calderon
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.

None yet

1 participant