lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
514 stars 145 forks source link

Add range_check96 builtin #1698

Closed fmoletta closed 5 months ago

fmoletta commented 6 months ago

Refactors RangeCheckBuiltinRunner to accomodate both standard and 96 variants Adds range_check96 to all_cairo layout Integration test added in #1699 as it depends on #1673

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 93.68421% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 94.96%. Comparing base (15f9dc0) to head (6500201).

Files Patch % Lines
vm/src/vm/runners/builtin_runner/range_check.rs 88.00% 6 Missing :warning:
vm/src/vm/runners/cairo_runner.rs 86.95% 3 Missing :warning:
vm/src/vm/runners/builtin_runner/mod.rs 97.10% 2 Missing :warning:
vm/src/serde/deserialize_program.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1698 +/- ## ========================================== - Coverage 94.96% 94.96% -0.01% ========================================== Files 99 99 Lines 38474 38532 +58 ========================================== + Hits 36538 36592 +54 - Misses 1936 1940 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 6 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.298 ± 0.028 2.270 2.349 1.12 ± 0.02
head big_factorial 2.053 ± 0.018 2.027 2.081 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.260 ± 0.024 2.242 2.313 1.13 ± 0.02
head big_fibonacci 1.998 ± 0.025 1.968 2.058 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.646 ± 0.301 8.485 9.323 1.21 ± 0.05
head blake2s_integration_benchmark 7.125 ± 0.155 7.010 7.534 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.360 ± 0.030 2.330 2.412 1.12 ± 0.02
head compare_arrays_200000 2.116 ± 0.029 2.091 2.183 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.459 ± 0.008 1.451 1.477 1.05 ± 0.01
head dict_integration_benchmark 1.386 ± 0.005 1.373 1.391 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.329 ± 0.038 1.305 1.433 1.15 ± 0.03
head field_arithmetic_get_square_benchmark 1.160 ± 0.006 1.149 1.169 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.553 ± 0.092 8.497 8.729 1.19 ± 0.02
head integration_builtins 7.192 ± 0.069 7.088 7.308 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.895 ± 0.281 8.749 9.575 1.20 ± 0.06
head keccak_integration_benchmark 7.423 ± 0.248 7.262 8.115 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.363 ± 0.015 2.350 2.399 1.10 ± 0.02
head linear_search 2.143 ± 0.028 2.110 2.204 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.587 ± 0.008 1.578 1.597 1.05 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.515 ± 0.005 1.503 1.521 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.443 ± 0.022 1.422 1.481 1.04 ± 0.02
head math_integration_benchmark 1.384 ± 0.015 1.371 1.424 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.288 ± 0.013 1.269 1.311 1.08 ± 0.01
head memory_integration_benchmark 1.190 ± 0.007 1.174 1.197 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.634 ± 0.011 1.615 1.648 1.05 ± 0.02
head operations_with_data_structures_benchmarks 1.554 ± 0.027 1.534 1.617 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 596.1 ± 3.2 591.9 601.6 1.04 ± 0.01
head pedersen 572.0 ± 3.2 569.1 580.3 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 976.3 ± 3.3 971.1 984.3 1.01 ± 0.01
head poseidon_integration_benchmark 967.5 ± 7.5 956.6 977.8 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.889 ± 0.051 1.862 2.031 1.07 ± 0.03
head secp_integration_benchmark 1.772 ± 0.013 1.754 1.798 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 728.1 ± 5.8 720.4 739.1 1.00
head set_integration_benchmark 728.1 ± 4.7 722.9 737.2 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.729 ± 0.074 4.654 4.879 1.16 ± 0.02
head uint256_integration_benchmark 4.063 ± 0.031 4.032 4.124 1.00