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

Add_option_to_simulate_builtins #1956

Open
wants to merge 1 commit into
base: yaiv/add_all_cairo_stwo_layout
Choose a base branch
from

Conversation

YairVaknin-starkware
Copy link
Collaborator

@YairVaknin-starkware YairVaknin-starkware commented Feb 16, 2025

TITLE

Adding option to simulate builtins

Description

This adds the option to use simulated runners that will later be verified by the cairo code that uses them (instead of proven later).

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.

Copy link

github-actions bot commented Feb 16, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.215 ± 0.022 2.195 2.270 1.01 ± 0.01
head big_factorial 2.189 ± 0.008 2.177 2.203 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.150 ± 0.014 2.130 2.173 1.00 ± 0.01
head big_fibonacci 2.143 ± 0.007 2.131 2.152 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.035 ± 0.085 7.849 8.175 1.00
head blake2s_integration_benchmark 8.140 ± 0.086 8.040 8.293 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.279 ± 0.020 2.252 2.310 1.00 ± 0.01
head compare_arrays_200000 2.269 ± 0.015 2.247 2.289 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.486 ± 0.027 1.467 1.545 1.01 ± 0.02
head dict_integration_benchmark 1.472 ± 0.007 1.462 1.486 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.258 ± 0.007 1.245 1.266 1.00
head field_arithmetic_get_square_benchmark 1.281 ± 0.008 1.271 1.293 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.122 ± 0.070 8.064 8.270 1.00
head integration_builtins 8.221 ± 0.045 8.153 8.295 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.276 ± 0.096 8.154 8.396 1.00
head keccak_integration_benchmark 8.518 ± 0.117 8.390 8.743 1.03 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.278 ± 0.013 2.257 2.297 1.00
head linear_search 2.288 ± 0.048 2.254 2.369 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.566 ± 0.004 1.561 1.575 1.00 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.565 ± 0.011 1.556 1.594 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.522 ± 0.006 1.512 1.532 1.01 ± 0.01
head math_integration_benchmark 1.512 ± 0.007 1.504 1.522 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.255 ± 0.004 1.252 1.264 1.00
head memory_integration_benchmark 1.258 ± 0.007 1.251 1.274 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.635 ± 0.018 1.620 1.680 1.00
head operations_with_data_structures_benchmarks 1.635 ± 0.009 1.627 1.654 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 543.2 ± 1.7 541.1 546.1 1.00
head pedersen 544.7 ± 2.1 542.5 549.4 1.00 ± 0.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 646.6 ± 5.3 637.2 652.2 1.00 ± 0.01
head poseidon_integration_benchmark 645.1 ± 4.2 637.7 649.9 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.908 ± 0.014 1.890 1.940 1.00
head secp_integration_benchmark 1.908 ± 0.012 1.892 1.933 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 643.0 ± 3.9 640.0 652.8 1.00 ± 0.01
head set_integration_benchmark 640.7 ± 2.8 637.3 647.7 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.432 ± 0.035 4.363 4.469 1.00
head uint256_integration_benchmark 4.468 ± 0.025 4.432 4.504 1.01 ± 0.01

Copy link

codecov bot commented Feb 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.46%. Comparing base (d2ab417) to head (2507fcb).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           yaiv/add_all_cairo_stwo_layout    #1956   +/-   ##
===============================================================
  Coverage                           96.46%   96.46%           
===============================================================
  Files                                 102      102           
  Lines                               41558    41564    +6     
===============================================================
+ Hits                                40087    40094    +7     
+ Misses                               1471     1470    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@YairVaknin-starkware YairVaknin-starkware force-pushed the yaiv/add_all_cairo_stwo_layout branch from bc25090 to 6182e1f Compare February 17, 2025 07:04
@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/add_option_to_simulate_builtins branch from 1747d6a to 7fd34a9 Compare February 17, 2025 07:05
@YairVaknin-starkware YairVaknin-starkware force-pushed the yaiv/add_all_cairo_stwo_layout branch from 6182e1f to 1b8e606 Compare February 17, 2025 16:48
@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/add_option_to_simulate_builtins branch from 7fd34a9 to 22c9360 Compare February 17, 2025 16:49
@YairVaknin-starkware YairVaknin-starkware force-pushed the yaiv/add_all_cairo_stwo_layout branch from 1b8e606 to d2ab417 Compare February 17, 2025 17:23
@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/add_option_to_simulate_builtins branch from 22c9360 to 2507fcb Compare February 17, 2025 17:23
Copy link
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.

Reviewed 4 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @fmoletta, @gabrielbosio, @igaray, @juanbono, @Oppen, @pefontana, and @yuvalsw)


vm/src/vm/runners/builtin_runner/ec_op.rs line 26 at r2 (raw file):

impl EcOpBuiltinRunner {
    pub(crate) fn new(ratio: Option<u32>, included: bool) -> Self {

why is this change needed (x3)?


vm/src/vm/vm_core.rs line 755 at r2 (raw file):

    ///Makes sure that all assigned memory cells are consistent with their auto deduction rules.
    pub fn verify_auto_deductions(&self) -> Result<(), VirtualMachineError> {

don't you need to take care of simulated_builtin_runners here?
other places?

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