Skip to content

feat: configurable limit to number of traceback entries#2358

Open
dorimedini-starkware wants to merge 1 commit intomainfrom
dori-configurable-max-traceback-entries
Open

feat: configurable limit to number of traceback entries#2358
dorimedini-starkware wants to merge 1 commit intomainfrom
dori-configurable-max-traceback-entries

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

@dorimedini-starkware dorimedini-starkware commented Mar 17, 2026

Configurable limit to number of traceback entries

Description

Previously, the number of error traceback entries was limited to a hard-coded constant; this PR makes this limit configurable, to allow users of the Runner to run with a different limit.
No behavior change (all current usages use the previous constant), but it does change API of constructors and adds a field to runner configs.

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

@dorimedini-starkware dorimedini-starkware self-assigned this Mar 17, 2026
@dorimedini-starkware dorimedini-starkware force-pushed the dori-configurable-max-traceback-entries branch 4 times, most recently from a21c1e4 to ef936b3 Compare March 17, 2026 18:49
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 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 ± σ):     22.733 s ±  0.051 s    [User: 22.099 s, System: 0.630 s]
  Range (min … max):   22.696 s … 22.769 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     22.714 s ±  0.002 s    [User: 22.117 s, System: 0.594 s]
  Range (min … max):   22.712 s … 22.715 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 ± σ):     12.148 s ±  0.003 s    [User: 22.121 s, System: 0.616 s]
  Range (min … max):   12.146 s … 12.150 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     12.247 s ±  0.025 s    [User: 22.214 s, System: 0.620 s]
  Range (min … max):   12.229 s … 12.265 s    2 runs
 
Summary
  hyper_threading_main threads: 2 ran
    1.01 ± 0.00 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 ± σ):      9.674 s ±  0.108 s    [User: 34.647 s, System: 0.764 s]
  Range (min … max):    9.598 s …  9.751 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):      9.605 s ±  0.100 s    [User: 35.134 s, System: 0.737 s]
  Range (min … max):    9.535 s …  9.676 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.01 ± 0.02 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 ± σ):      9.498 s ±  0.012 s    [User: 35.389 s, System: 0.775 s]
  Range (min … max):    9.489 s …  9.506 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):      9.698 s ±  0.288 s    [User: 35.493 s, System: 0.772 s]
  Range (min … max):    9.494 s …  9.901 s    2 runs
 
Summary
  hyper_threading_main threads: 6 ran
    1.02 ± 0.03 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 ± σ):      9.567 s ±  0.062 s    [User: 35.557 s, System: 0.761 s]
  Range (min … max):    9.524 s …  9.611 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):      9.603 s ±  0.036 s    [User: 35.697 s, System: 0.781 s]
  Range (min … max):    9.578 s …  9.628 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 ± σ):      9.592 s ±  0.004 s    [User: 35.706 s, System: 0.829 s]
  Range (min … max):    9.589 s …  9.595 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):      9.829 s ±  0.003 s    [User: 35.808 s, System: 0.851 s]
  Range (min … max):    9.827 s …  9.831 s    2 runs
 
Summary
  hyper_threading_main threads: 16 ran
    1.02 ± 0.00 times faster than hyper_threading_pr threads: 16


@dorimedini-starkware dorimedini-starkware force-pushed the dori-configurable-max-traceback-entries branch 3 times, most recently from 2899d91 to 40141d1 Compare March 17, 2026 19:01
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.111 ± 0.024 2.095 2.174 1.01 ± 0.01
head big_factorial 2.091 ± 0.008 2.084 2.106 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.051 ± 0.011 2.032 2.069 1.01 ± 0.01
head big_fibonacci 2.028 ± 0.004 2.020 2.034 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.386 ± 0.045 7.335 7.504 1.01 ± 0.01
head blake2s_integration_benchmark 7.322 ± 0.068 7.258 7.503 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.167 ± 0.007 2.156 2.177 1.00 ± 0.01
head compare_arrays_200000 2.162 ± 0.010 2.152 2.183 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.414 ± 0.011 1.400 1.432 1.01 ± 0.01
head dict_integration_benchmark 1.405 ± 0.009 1.396 1.427 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.220 ± 0.004 1.215 1.228 1.00 ± 0.01
head field_arithmetic_get_square_benchmark 1.215 ± 0.006 1.210 1.230 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.512 ± 0.135 7.433 7.890 1.02 ± 0.02
head integration_builtins 7.398 ± 0.025 7.366 7.429 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.564 ± 0.013 7.544 7.593 1.01 ± 0.00
head keccak_integration_benchmark 7.487 ± 0.027 7.458 7.550 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.164 ± 0.024 2.142 2.201 1.01 ± 0.01
head linear_search 2.132 ± 0.006 2.122 2.143 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.484 ± 0.005 1.477 1.494 1.01 ± 0.00
head math_cmp_and_pow_integration_benchmark 1.475 ± 0.005 1.468 1.481 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.447 ± 0.009 1.436 1.460 1.00 ± 0.01
head math_integration_benchmark 1.441 ± 0.005 1.432 1.447 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.214 ± 0.008 1.206 1.231 1.01 ± 0.01
head memory_integration_benchmark 1.200 ± 0.003 1.197 1.205 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.536 ± 0.014 1.519 1.561 1.01 ± 0.01
head operations_with_data_structures_benchmarks 1.526 ± 0.005 1.521 1.536 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 530.0 ± 2.1 527.8 533.7 1.01 ± 0.00
head pedersen 527.2 ± 0.9 525.8 528.5 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 606.0 ± 2.9 602.3 611.1 1.00 ± 0.01
head poseidon_integration_benchmark 603.2 ± 1.9 600.8 606.0 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.805 ± 0.004 1.798 1.812 1.00 ± 0.00
head secp_integration_benchmark 1.802 ± 0.005 1.796 1.810 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 632.0 ± 5.9 628.1 648.5 1.00
head set_integration_benchmark 657.7 ± 1.5 655.9 660.8 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.193 ± 0.008 4.184 4.211 1.01 ± 0.00
head uint256_integration_benchmark 4.172 ± 0.012 4.157 4.198 1.00

@dorimedini-starkware dorimedini-starkware force-pushed the dori-configurable-max-traceback-entries branch 2 times, most recently from 6b454d5 to 5032a37 Compare March 18, 2026 07:50
Signed-off-by: Dori Medini <dori@starkware.co>
@dorimedini-starkware dorimedini-starkware force-pushed the dori-configurable-max-traceback-entries branch from 5032a37 to 470362a Compare March 18, 2026 07:55
Copy link
Copy Markdown
Collaborator

@Yael-Starkware Yael-Starkware left a comment

Choose a reason for hiding this comment

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

Adding this variable to the constructor cairo_runner adds a lot of noise, and it is usually being used with the default value.
I think it should be an optional field in cairo_run_config, and in case it is Some, a separate setter will be called after the constrctor.

@Yael-Starkware made 1 comment.
Reviewable status: 0 of 16 files reviewed, all discussions resolved (waiting on YairVaknin-starkware).

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