Skip to content

[BREAKING] Compute_missing_builtin_cells_only_in_proof_mode #2088

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

Conversation

YairVaknin-starkware
Copy link
Collaborator

@YairVaknin-starkware YairVaknin-starkware commented May 6, 2025

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

@FrancoGiachetta
Copy link
Contributor

FrancoGiachetta commented May 6, 2025

This PR changes the firm of CairoRunner::end_run and VirtualMachine::end_run, making it a breaking change. Would be nice to have this stated as reminder for the changelog update.

Copy link

github-actions bot commented May 6, 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.214 s ±  0.098 s    [User: 25.444 s, System: 0.766 s]
  Range (min … max):   26.145 s … 26.284 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     25.615 s ±  0.033 s    [User: 24.786 s, System: 0.824 s]
  Range (min … max):   25.591 s … 25.638 s    2 runs
 
Summary
  hyper_threading_pr threads: 1 ran
    1.02 ± 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.567 s ±  0.017 s    [User: 25.556 s, System: 0.808 s]
  Range (min … max):   14.555 s … 14.580 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.009 s ±  0.037 s    [User: 24.954 s, System: 0.878 s]
  Range (min … max):   13.983 s … 14.036 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.04 ± 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.610 s ±  0.191 s    [User: 37.751 s, System: 1.036 s]
  Range (min … max):   10.475 s … 10.745 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.560 s ±  0.014 s    [User: 36.910 s, System: 1.099 s]
  Range (min … max):   10.551 s … 10.570 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.00 ± 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 ± σ):     10.370 s ±  0.305 s    [User: 38.192 s, System: 1.043 s]
  Range (min … max):   10.154 s … 10.586 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.227 s ±  0.199 s    [User: 36.966 s, System: 1.051 s]
  Range (min … max):   10.087 s … 10.368 s    2 runs
 
Summary
  hyper_threading_pr threads: 6 ran
    1.01 ± 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 ± σ):     10.614 s ±  0.356 s    [User: 37.986 s, System: 1.095 s]
  Range (min … max):   10.362 s … 10.865 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.329 s ±  0.014 s    [User: 37.517 s, System: 1.121 s]
  Range (min … max):   10.319 s … 10.338 s    2 runs
 
Summary
  hyper_threading_pr threads: 8 ran
    1.03 ± 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 ± σ):     10.172 s ±  0.067 s    [User: 38.670 s, System: 1.144 s]
  Range (min … max):   10.125 s … 10.219 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.095 s ±  0.162 s    [User: 37.773 s, System: 1.209 s]
  Range (min … max):    9.981 s … 10.210 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.01 ± 0.02 times faster than hyper_threading_main threads: 16


Copy link

github-actions bot commented May 6, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.205 ± 0.032 2.175 2.291 1.01 ± 0.02
head big_factorial 2.194 ± 0.015 2.173 2.221 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.118 ± 0.019 2.094 2.157 1.00
head big_fibonacci 2.134 ± 0.030 2.101 2.188 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.034 ± 0.043 7.940 8.081 1.04 ± 0.01
head blake2s_integration_benchmark 7.701 ± 0.042 7.649 7.772 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.298 ± 0.026 2.268 2.350 1.01 ± 0.01
head compare_arrays_200000 2.276 ± 0.021 2.238 2.323 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.474 ± 0.013 1.458 1.499 1.00
head dict_integration_benchmark 1.477 ± 0.007 1.469 1.492 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.263 ± 0.013 1.249 1.292 1.00
head field_arithmetic_get_square_benchmark 1.265 ± 0.013 1.246 1.293 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.098 ± 0.076 8.002 8.232 1.04 ± 0.01
head integration_builtins 7.772 ± 0.074 7.662 7.872 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.402 ± 0.044 8.328 8.488 1.06 ± 0.01
head keccak_integration_benchmark 7.918 ± 0.069 7.848 8.038 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.274 ± 0.025 2.254 2.330 1.01 ± 0.01
head linear_search 2.244 ± 0.020 2.203 2.270 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.573 ± 0.017 1.544 1.593 1.00
head math_cmp_and_pow_integration_benchmark 1.578 ± 0.011 1.565 1.599 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.498 ± 0.016 1.475 1.526 1.00
head math_integration_benchmark 1.516 ± 0.019 1.491 1.563 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.253 ± 0.007 1.240 1.262 1.00
head memory_integration_benchmark 1.266 ± 0.007 1.255 1.276 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.619 ± 0.014 1.598 1.648 1.02 ± 0.01
head operations_with_data_structures_benchmarks 1.586 ± 0.006 1.579 1.600 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 543.9 ± 2.2 539.8 546.7 1.00
head pedersen 546.0 ± 4.7 540.9 554.7 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 665.4 ± 2.7 662.2 669.8 1.03 ± 0.01
head poseidon_integration_benchmark 646.3 ± 5.5 641.3 659.8 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.868 ± 0.008 1.861 1.887 1.00
head secp_integration_benchmark 1.873 ± 0.008 1.859 1.882 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 644.4 ± 3.9 640.2 653.7 1.00
head set_integration_benchmark 696.6 ± 3.7 688.8 702.0 1.08 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.406 ± 0.040 4.360 4.496 1.01 ± 0.01
head uint256_integration_benchmark 4.354 ± 0.027 4.314 4.387 1.00

@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/compute_missing_builtin_cells_only_in_proof_mode branch 2 times, most recently from 8cd9b22 to a56fb44 Compare May 6, 2025 16:23
@YairVaknin-starkware YairVaknin-starkware changed the title Compute_missing_builtin_cells_only_in_proof_mode [BREAKING] Compute_missing_builtin_cells_only_in_proof_mode May 6, 2025
@YairVaknin-starkware
Copy link
Collaborator Author

This PR changes the firm of CairoRunner::end_run and VirtualMachine::end_run, making it a breaking change. Would be nice to have this stated as reminder for the changelog update.

added to commit msg and PR name

@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/compute_missing_builtin_cells_only_in_proof_mode branch from a56fb44 to bddd477 Compare May 6, 2025 16:43
Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 97.95918% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.54%. Comparing base (dc1c49b) to head (642ea1e).
Report is 1 commits behind head on starkware-development.

Files with missing lines Patch % Lines
vm/src/cairo_run.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           starkware-development    #2088      +/-   ##
=========================================================
- Coverage                  96.62%   96.54%   -0.08%     
=========================================================
  Files                        102      102              
  Lines                      44396    43224    -1172     
=========================================================
- Hits                       42897    41731    -1166     
+ Misses                      1499     1493       -6     

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

@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/compute_missing_builtin_cells_only_in_proof_mode branch from bddd477 to ec16c63 Compare May 6, 2025 18:40
Copy link
Collaborator

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 7 files at r1.
Reviewable status: 5 of 7 files reviewed, 2 unresolved discussions


vm/src/cairo_run.rs line 108 at r1 (raw file):

    )?;

    cairo_runner.vm.verify_auto_deductions()?;

I also saw this extra verification, but I don't know if it's here for some reason, so I'm not sure about deleting it.


vm/src/vm/runners/cairo_runner.rs line 3925 at r1 (raw file):

            .expect("Call to `CairoRunner::run_until_pc()` failed.");
        assert_matches!(
            cairo_runner.end_run(false, false, &mut hint_processor, true),

can you do the same as in the next test and declaring proof_mode=true and use it in Cairo runner and end run ?

@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/compute_missing_builtin_cells_only_in_proof_mode branch from ec16c63 to 642ea1e Compare May 7, 2025 07:50
Copy link
Collaborator Author

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

Reviewable status: 4 of 7 files reviewed, 2 unresolved discussions (waiting on @Stavbe)


vm/src/cairo_run.rs line 108 at r1 (raw file):

Previously, Stavbe wrote…

I also saw this extra verification, but I don't know if it's here for some reason, so I'm not sure about deleting it.

No reason to have it twice. It was also in other funcs that initiate a run, so removed there as well (PTAL).


vm/src/vm/runners/cairo_runner.rs line 3925 at r1 (raw file):

Previously, Stavbe wrote…

can you do the same as in the next test and declaring proof_mode=true and use it in Cairo runner and end run ?

thanks, missed it.

Copy link
Collaborator

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r2.
Reviewable status: 5 of 7 files reviewed, all discussions resolved

Copy link
Collaborator Author

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

Reviewed 5 of 7 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @YairVaknin-starkware)

@YairVaknin-starkware YairVaknin-starkware merged commit b1a91f9 into starkware-development May 7, 2025
92 of 93 checks passed
@YairVaknin-starkware YairVaknin-starkware deleted the yairv/compute_missing_builtin_cells_only_in_proof_mode branch May 7, 2025 08:19
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