Skip to content

feat: implement CairoLayout::new from layout name and dynamic params#2362

Merged
dorimedini-starkware merged 1 commit intomainfrom
03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params
Apr 19, 2026
Merged

feat: implement CairoLayout::new from layout name and dynamic params#2362
dorimedini-starkware merged 1 commit intomainfrom
03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

@dorimedini-starkware dorimedini-starkware commented Mar 23, 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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 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.677 s ±  0.002 s    [User: 22.088 s, System: 0.586 s]
  Range (min … max):   22.676 s … 22.679 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     22.516 s ±  0.033 s    [User: 21.930 s, System: 0.582 s]
  Range (min … max):   22.492 s … 22.539 s    2 runs
 
Summary
  hyper_threading_pr threads: 1 ran
    1.01 ± 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.160 s ±  0.042 s    [User: 22.142 s, System: 0.589 s]
  Range (min … max):   12.130 s … 12.190 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     12.090 s ±  0.096 s    [User: 21.994 s, System: 0.587 s]
  Range (min … max):   12.022 s … 12.158 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.01 ± 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 ± σ):      9.798 s ±  0.208 s    [User: 35.366 s, System: 0.717 s]
  Range (min … max):    9.651 s …  9.946 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):      9.250 s ±  0.109 s    [User: 34.820 s, System: 0.716 s]
  Range (min … max):    9.173 s …  9.327 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.06 ± 0.03 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.636 s ±  0.064 s    [User: 35.533 s, System: 0.727 s]
  Range (min … max):    9.591 s …  9.681 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):      9.480 s ±  0.362 s    [User: 34.950 s, System: 0.735 s]
  Range (min … max):    9.225 s …  9.736 s    2 runs
 
Summary
  hyper_threading_pr threads: 6 ran
    1.02 ± 0.04 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 ± σ):      9.535 s ±  0.262 s    [User: 35.783 s, System: 0.746 s]
  Range (min … max):    9.350 s …  9.721 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):      9.334 s ±  0.018 s    [User: 34.758 s, System: 0.760 s]
  Range (min … max):    9.321 s …  9.346 s    2 runs
 
Summary
  hyper_threading_pr threads: 8 ran
    1.02 ± 0.03 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 ± σ):      9.514 s ±  0.052 s    [User: 35.770 s, System: 0.798 s]
  Range (min … max):    9.477 s …  9.550 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):      9.273 s ±  0.035 s    [User: 35.336 s, System: 0.803 s]
  Range (min … max):    9.248 s …  9.298 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.03 ± 0.01 times faster than hyper_threading_main threads: 16


@dorimedini-starkware dorimedini-starkware force-pushed the 03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params branch from 7fb1266 to 14d555d Compare March 23, 2026 09:18
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.341 ± 0.016 2.314 2.361 1.02 ± 0.01
head big_factorial 2.287 ± 0.018 2.268 2.317 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.204 ± 0.016 2.189 2.237 1.00 ± 0.01
head big_fibonacci 2.198 ± 0.023 2.160 2.226 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.272 ± 0.140 7.190 7.665 1.02 ± 0.02
head blake2s_integration_benchmark 7.125 ± 0.053 7.070 7.255 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.350 ± 0.015 2.331 2.374 1.01 ± 0.01
head compare_arrays_200000 2.328 ± 0.022 2.294 2.364 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.538 ± 0.013 1.521 1.566 1.00
head dict_integration_benchmark 1.547 ± 0.008 1.534 1.562 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.191 ± 0.005 1.184 1.198 1.00
head field_arithmetic_get_square_benchmark 1.192 ± 0.011 1.180 1.220 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.281 ± 0.041 7.232 7.375 1.02 ± 0.01
head integration_builtins 7.115 ± 0.021 7.071 7.146 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.477 ± 0.048 7.417 7.546 1.02 ± 0.02
head keccak_integration_benchmark 7.312 ± 0.171 7.191 7.757 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.331 ± 0.016 2.315 2.364 1.01 ± 0.01
head linear_search 2.310 ± 0.023 2.287 2.367 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.698 ± 0.015 1.674 1.724 1.01 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.685 ± 0.010 1.671 1.705 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.574 ± 0.010 1.557 1.591 1.01 ± 0.01
head math_integration_benchmark 1.563 ± 0.003 1.559 1.569 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.359 ± 0.014 1.346 1.397 1.02 ± 0.01
head memory_integration_benchmark 1.336 ± 0.007 1.323 1.348 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.626 ± 0.016 1.610 1.661 1.00
head operations_with_data_structures_benchmarks 1.636 ± 0.016 1.618 1.670 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 524.7 ± 3.0 520.0 529.3 1.01 ± 0.01
head pedersen 518.2 ± 2.1 515.5 520.7 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 649.2 ± 6.9 643.3 665.4 1.01 ± 0.01
head poseidon_integration_benchmark 645.3 ± 1.8 643.0 648.8 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.760 ± 0.013 1.748 1.790 1.00 ± 0.01
head secp_integration_benchmark 1.758 ± 0.011 1.745 1.785 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 694.0 ± 4.1 689.3 704.2 1.04 ± 0.01
head set_integration_benchmark 670.1 ± 3.0 666.5 675.9 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.329 ± 0.026 4.282 4.372 1.02 ± 0.01
head uint256_integration_benchmark 4.251 ± 0.055 4.206 4.399 1.00

@dorimedini-starkware dorimedini-starkware force-pushed the 03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params branch from 14d555d to a690cb4 Compare March 25, 2026 13:23
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.08%. Comparing base (b709e7e) to head (4103853).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2362      +/-   ##
==========================================
+ Coverage   96.07%   96.08%   +0.01%     
==========================================
  Files         105      105              
  Lines       37737    37756      +19     
==========================================
+ Hits        36254    36277      +23     
+ Misses       1483     1479       -4     

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

@dorimedini-starkware dorimedini-starkware force-pushed the 03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params branch from a690cb4 to a44f7b5 Compare March 25, 2026 13:37
Copy link
Copy Markdown
Collaborator

@YairVaknin-starkware YairVaknin-starkware left a comment

Choose a reason for hiding this comment

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

@YairVaknin-starkware reviewed 5 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware and Yael-Starkware).


vm/src/types/instance_definitions/diluted_pool_instance_def.rs line 7 at r2 (raw file):

pub enum DilutedPoolInstanceDefError {
    #[error(
        "Dynamic layout log_diluted_units_per_step is out of range, absolute value must be < 32"

add the value to the error msg (same as it was before in RunnerError variant).

Code quote:

"Dynamic layout log_diluted_units_per_step is out of range, absolute value must be < 32"

vm/src/vm/errors/runner_errors.rs line 125 at r2 (raw file):

    BadDynamicLayoutBuiltinRatio(BuiltinName),
    #[error("dynamic layout log_diluted_units_per_step {0} is out of range, absolute value must be < 32")]
    DynamicLayoutLogDilutedUnitsPerStepOverflow(i32),

not needed anymore, right?

Code quote:

    #[error("dynamic layout log_diluted_units_per_step {0} is out of range, absolute value must be < 32")]
    DynamicLayoutLogDilutedUnitsPerStepOverflow(i32),

@dorimedini-starkware dorimedini-starkware force-pushed the 03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params branch from a44f7b5 to 4d059c1 Compare April 9, 2026 19:15
Copy link
Copy Markdown
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

@dorimedini-starkware made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on Yael-Starkware and YairVaknin-starkware).


vm/src/types/instance_definitions/diluted_pool_instance_def.rs line 7 at r2 (raw file):

Previously, YairVaknin-starkware wrote…

add the value to the error msg (same as it was before in RunnerError variant).

Done.


vm/src/vm/errors/runner_errors.rs line 125 at r2 (raw file):

Previously, YairVaknin-starkware wrote…

not needed anymore, right?

Done.

@dorimedini-starkware dorimedini-starkware force-pushed the 03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params branch from 4d059c1 to 4103853 Compare April 13, 2026 06:14
Copy link
Copy Markdown
Collaborator

@YairVaknin-starkware YairVaknin-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@YairVaknin-starkware reviewed 4 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Yael-Starkware).

Copy link
Copy Markdown
Collaborator Author

dorimedini-starkware commented Apr 16, 2026

Merge activity

  • Apr 16, 8:04 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 16, 8:05 AM UTC: Graphite couldn't merge this PR because it failed for an unknown reason (Merge commits are not allowed on this repository. Please update the merge method in your Graphite merge queue settings, or enable merge commits in your GitHub repository settings.).
  • Apr 16, 8:15 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 16, 8:15 AM UTC: Graphite couldn't merge this PR because it failed for an unknown reason (This repository has GitHub's merge queue enabled. Please configure the GitHub merge queue integration in Graphite settings.).

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue Apr 19, 2026
Merged via the queue into main with commit 6053f60 Apr 19, 2026
67 checks passed
@dorimedini-starkware dorimedini-starkware deleted the 03-18-feat_implement_cairolayout_new_from_layout_name_and_dynamic_params branch April 19, 2026 07:55
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