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
504 stars 138 forks source link

Show only layout builtins in air private input #1651

Closed fmoletta closed 6 months ago

fmoletta commented 6 months ago

When converting to serializable format, the air private input contained all the builtins instead of only the ones present in the layout, this worked fine when running with starknet_with_keccak layout but produces a different output from cairo_lang when using a different layout that doesn't use all the builtins

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.68%. Comparing base (7566aa5) to head (287f313).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1651 +/- ## ======================================= Coverage 97.68% 97.68% ======================================= Files 91 91 Lines 37668 37681 +13 ======================================= + Hits 36796 36809 +13 Misses 872 872 ```

: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.268 ± 0.051 2.232 2.402 1.00
head big_factorial 2.287 ± 0.026 2.251 2.330 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.272 ± 0.026 2.251 2.340 1.01 ± 0.01
head big_fibonacci 2.240 ± 0.018 2.208 2.264 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.433 ± 0.354 8.244 9.348 1.00
head blake2s_integration_benchmark 8.666 ± 0.359 8.428 9.500 1.03 ± 0.06
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.330 ± 0.028 2.305 2.391 1.00
head compare_arrays_200000 2.382 ± 0.056 2.339 2.525 1.02 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.446 ± 0.017 1.429 1.484 1.00
head dict_integration_benchmark 1.460 ± 0.014 1.445 1.497 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.308 ± 0.018 1.292 1.354 1.00
head field_arithmetic_get_square_benchmark 1.310 ± 0.003 1.306 1.314 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.481 ± 0.121 8.303 8.644 1.00
head integration_builtins 8.543 ± 0.037 8.481 8.605 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.705 ± 0.116 8.556 8.838 1.00
head keccak_integration_benchmark 8.948 ± 0.364 8.683 9.851 1.03 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.335 ± 0.017 2.317 2.371 1.00
head linear_search 2.382 ± 0.020 2.367 2.427 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.601 ± 0.021 1.577 1.641 1.00
head math_cmp_and_pow_integration_benchmark 1.604 ± 0.010 1.593 1.627 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.442 ± 0.009 1.425 1.456 1.00
head math_integration_benchmark 1.444 ± 0.005 1.434 1.450 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.252 ± 0.011 1.243 1.270 1.00
head memory_integration_benchmark 1.273 ± 0.006 1.264 1.279 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.617 ± 0.005 1.608 1.626 1.00
head operations_with_data_structures_benchmarks 1.640 ± 0.025 1.621 1.691 1.01 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 595.2 ± 2.4 593.4 601.6 1.00
head pedersen 595.5 ± 2.3 590.2 598.4 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.002 ± 0.003 0.999 1.009 1.00
head poseidon_integration_benchmark 1.010 ± 0.020 0.999 1.066 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.890 ± 0.032 1.872 1.978 1.00
head secp_integration_benchmark 1.930 ± 0.060 1.876 2.080 1.02 ± 0.04
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 728.2 ± 6.4 721.0 740.4 1.00
head set_integration_benchmark 731.6 ± 12.1 723.2 764.8 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.611 ± 0.018 4.583 4.640 1.00
head uint256_integration_benchmark 4.691 ± 0.027 4.651 4.724 1.02 ± 0.01