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
515 stars 148 forks source link

Add `allow_missing_builtins` flag #1600

Closed fmoletta closed 8 months ago

fmoletta commented 9 months ago

This new flag will skip the check that all builtins used by the program need to be present in the selected layout if enabled. It will also be enabled by default when running in proof_mode. This flag has been added to : CLI, CairoRunConfig, CairoRunner::initialize & CairoRunner::initialize_builtins Documentation has been added/updated Other changes: Removed outdated comment from many cairo_runner tests

github-actions[bot] commented 9 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.281 ± 0.046 2.247 2.387 1.01 ± 0.02
head big_factorial 2.253 ± 0.014 2.237 2.278 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.239 ± 0.020 2.202 2.282 1.00 ± 0.01
head big_fibonacci 2.232 ± 0.012 2.214 2.255 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.207 ± 0.044 8.152 8.277 1.00
head blake2s_integration_benchmark 8.229 ± 0.081 8.155 8.383 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.314 ± 0.059 2.273 2.478 1.00 ± 0.03
head compare_arrays_200000 2.306 ± 0.018 2.280 2.324 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.439 ± 0.004 1.434 1.448 1.00
head dict_integration_benchmark 1.456 ± 0.010 1.444 1.469 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.294 ± 0.007 1.281 1.304 1.00
head field_arithmetic_get_square_benchmark 1.303 ± 0.041 1.277 1.413 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.284 ± 0.068 8.212 8.405 1.00
head integration_builtins 8.285 ± 0.088 8.193 8.405 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.483 ± 0.022 8.458 8.529 1.00
head keccak_integration_benchmark 8.522 ± 0.092 8.445 8.654 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.349 ± 0.016 2.329 2.390 1.00
head linear_search 2.350 ± 0.049 2.320 2.479 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.566 ± 0.007 1.558 1.579 1.00
head math_cmp_and_pow_integration_benchmark 1.572 ± 0.015 1.556 1.607 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.438 ± 0.012 1.429 1.470 1.00
head math_integration_benchmark 1.449 ± 0.023 1.431 1.510 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.255 ± 0.003 1.251 1.259 1.00
head memory_integration_benchmark 1.260 ± 0.025 1.245 1.327 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.609 ± 0.008 1.599 1.623 1.01 ± 0.01
head operations_with_data_structures_benchmarks 1.598 ± 0.004 1.594 1.607 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 605.7 ± 2.6 600.8 610.5 1.00
head pedersen 611.2 ± 13.3 604.2 648.7 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.073 ± 0.002 1.072 1.078 1.00
head poseidon_integration_benchmark 1.075 ± 0.003 1.072 1.081 1.00 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.928 ± 0.008 1.917 1.946 1.00 ± 0.01
head secp_integration_benchmark 1.928 ± 0.009 1.914 1.941 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 758.7 ± 2.9 754.2 762.6 1.00
head set_integration_benchmark 774.3 ± 3.9 770.9 783.1 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.560 ± 0.023 4.527 4.588 1.00
head uint256_integration_benchmark 4.573 ± 0.040 4.521 4.616 1.00 ± 0.01
codecov[bot] commented 9 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (aeb6d19) 97.16% compared to head (ddf6be1) 97.16%.

Files Patch % Lines
vm/src/vm/runners/cairo_runner.rs 98.38% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1600 +/- ## ======================================= Coverage 97.16% 97.16% ======================================= Files 91 91 Lines 37324 37326 +2 ======================================= + Hits 36264 36266 +2 Misses 1060 1060 ```

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