Skip to content

refactor: add function_runner feature flag and CairoFunctionRunner alias#2377

Open
naor-starkware wants to merge 2 commits intomainfrom
naor/refactor/rename-feature-flag
Open

refactor: add function_runner feature flag and CairoFunctionRunner alias#2377
naor-starkware wants to merge 2 commits intomainfrom
naor/refactor/rename-feature-flag

Conversation

@naor-starkware
Copy link
Copy Markdown
Collaborator

@naor-starkware naor-starkware commented Mar 29, 2026

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 change is Reviewable

- Add lean `function_runner = []` feature flag (zero extra deps)
- `test_utils` now implies `function_runner`
- Gate `function_runner` module on new flag instead of `test_utils`
- Make module and `run_from_entrypoint`/`get_function_pc` `pub`
- Add `CairoFunctionRunner` type alias for `CairoRunner`
- Remove spurious `#[allow(dead_code)]` from `EntryPoint`
- Update module doc comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

**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 ± σ):     20.582 s ±  0.014 s    [User: 19.450 s, System: 1.128 s]
  Range (min … max):   20.572 s … 20.592 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     20.564 s ±  0.046 s    [User: 19.416 s, System: 1.146 s]
  Range (min … max):   20.532 s … 20.596 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 ± σ):     11.088 s ±  0.031 s    [User: 19.521 s, System: 1.176 s]
  Range (min … max):   11.067 s … 11.110 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     11.068 s ±  0.012 s    [User: 19.518 s, System: 1.167 s]
  Range (min … max):   11.059 s … 11.077 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.00 ± 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.567 s ±  0.029 s    [User: 38.294 s, System: 1.271 s]
  Range (min … max):   10.547 s … 10.588 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.662 s ±  0.154 s    [User: 38.478 s, System: 1.313 s]
  Range (min … max):   10.553 s … 10.771 s    2 runs
 
Summary
  hyper_threading_main threads: 4 ran
    1.01 ± 0.01 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.848 s ±  0.242 s    [User: 38.725 s, System: 1.234 s]
  Range (min … max):   10.677 s … 11.019 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.489 s ±  0.065 s    [User: 39.084 s, System: 1.200 s]
  Range (min … max):   10.443 s … 10.535 s    2 runs
 
Summary
  hyper_threading_pr threads: 6 ran
    1.03 ± 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.455 s ±  0.008 s    [User: 39.511 s, System: 1.146 s]
  Range (min … max):   10.449 s … 10.461 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.491 s ±  0.101 s    [User: 39.416 s, System: 1.156 s]
  Range (min … max):   10.420 s … 10.563 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.593 s ±  0.034 s    [User: 39.585 s, System: 1.217 s]
  Range (min … max):   10.569 s … 10.618 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.755 s ±  0.045 s    [User: 39.661 s, System: 1.228 s]
  Range (min … max):   10.724 s … 10.787 s    2 runs
 
Summary
  hyper_threading_main threads: 16 ran
    1.02 ± 0.01 times faster than hyper_threading_pr threads: 16


@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.07%. Comparing base (f7ac327) to head (5831ff3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2377   +/-   ##
=======================================
  Coverage   96.07%   96.07%           
=======================================
  Files         105      105           
  Lines       37737    37737           
=======================================
  Hits        36254    36254           
  Misses       1483     1483           

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

Copy link
Copy Markdown
Collaborator

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

@OmriEshhar1 reviewed 3 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on efrat-starkware and YairVaknin-starkware).

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.230 ± 0.017 2.212 2.262 1.00
head big_factorial 2.237 ± 0.028 2.213 2.304 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.159 ± 0.009 2.145 2.172 1.01 ± 0.01
head big_fibonacci 2.139 ± 0.007 2.129 2.151 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.591 ± 0.209 7.368 7.990 1.02 ± 0.03
head blake2s_integration_benchmark 7.463 ± 0.091 7.376 7.622 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.203 ± 0.016 2.179 2.233 1.01 ± 0.01
head compare_arrays_200000 2.185 ± 0.012 2.166 2.203 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.425 ± 0.015 1.414 1.466 1.00 ± 0.01
head dict_integration_benchmark 1.422 ± 0.011 1.411 1.449 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.230 ± 0.006 1.223 1.240 1.00
head field_arithmetic_get_square_benchmark 1.234 ± 0.006 1.227 1.245 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.489 ± 0.026 7.448 7.527 1.00
head integration_builtins 7.490 ± 0.025 7.467 7.555 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.644 ± 0.190 7.565 8.181 1.01 ± 0.03
head keccak_integration_benchmark 7.592 ± 0.032 7.557 7.660 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.168 ± 0.013 2.150 2.191 1.00 ± 0.01
head linear_search 2.159 ± 0.012 2.141 2.188 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.498 ± 0.005 1.492 1.507 1.00
head math_cmp_and_pow_integration_benchmark 1.501 ± 0.005 1.497 1.513 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.460 ± 0.007 1.448 1.469 1.00 ± 0.01
head math_integration_benchmark 1.455 ± 0.005 1.449 1.461 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.210 ± 0.008 1.203 1.231 1.00
head memory_integration_benchmark 1.210 ± 0.009 1.203 1.236 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.546 ± 0.016 1.533 1.578 1.01 ± 0.01
head operations_with_data_structures_benchmarks 1.538 ± 0.009 1.530 1.554 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 532.2 ± 1.4 530.4 534.6 1.00
head pedersen 533.0 ± 1.5 531.1 535.2 1.00 ± 0.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 622.9 ± 5.0 618.8 636.5 1.00
head poseidon_integration_benchmark 624.6 ± 7.1 619.1 644.1 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.811 ± 0.015 1.799 1.845 1.00
head secp_integration_benchmark 1.820 ± 0.030 1.803 1.903 1.01 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 662.4 ± 1.4 660.4 664.4 1.00
head set_integration_benchmark 664.1 ± 2.5 660.7 668.7 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.236 ± 0.023 4.206 4.285 1.00
head uint256_integration_benchmark 4.247 ± 0.024 4.216 4.284 1.00 ± 0.01

Copy link
Copy Markdown
Collaborator

@OmriEshhar1 OmriEshhar1 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on efrat-starkware and YairVaknin-starkware).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants