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

Make air public inputs deserializable #1648

Closed fmoletta closed 6 months ago

fmoletta commented 6 months ago

Derives Deserialize trait for PublicInput Note: dynamic layout params are currently ignored when deserializing, see #1649

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.318 ± 0.083 2.278 2.551 1.00
head big_factorial 2.347 ± 0.095 2.279 2.611 1.01 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.288 ± 0.027 2.245 2.324 1.01 ± 0.02
head big_fibonacci 2.262 ± 0.030 2.231 2.306 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.590 ± 0.102 8.471 8.809 1.00
head blake2s_integration_benchmark 8.682 ± 0.188 8.461 8.911 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.401 ± 0.027 2.362 2.443 1.00
head compare_arrays_200000 2.410 ± 0.030 2.374 2.478 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.492 ± 0.010 1.476 1.508 1.00 ± 0.01
head dict_integration_benchmark 1.488 ± 0.011 1.473 1.505 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.344 ± 0.014 1.325 1.365 1.00 ± 0.02
head field_arithmetic_get_square_benchmark 1.343 ± 0.017 1.326 1.372 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.770 ± 0.258 8.524 9.437 1.00 ± 0.04
head integration_builtins 8.739 ± 0.172 8.469 8.949 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.917 ± 0.147 8.726 9.102 1.00
head keccak_integration_benchmark 8.969 ± 0.165 8.701 9.148 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.388 ± 0.021 2.367 2.422 1.00
head linear_search 2.419 ± 0.037 2.376 2.500 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.634 ± 0.029 1.605 1.699 1.01 ± 0.02
head math_cmp_and_pow_integration_benchmark 1.614 ± 0.007 1.606 1.626 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.466 ± 0.008 1.454 1.477 1.00 ± 0.01
head math_integration_benchmark 1.465 ± 0.012 1.444 1.486 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.305 ± 0.009 1.294 1.315 1.00
head memory_integration_benchmark 1.309 ± 0.006 1.302 1.322 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.652 ± 0.020 1.636 1.703 1.01 ± 0.01
head operations_with_data_structures_benchmarks 1.643 ± 0.011 1.625 1.662 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 601.3 ± 6.3 597.0 616.4 1.00
head pedersen 605.6 ± 16.3 596.3 647.9 1.01 ± 0.03
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 995.0 ± 5.4 987.7 1003.5 1.01 ± 0.01
head poseidon_integration_benchmark 989.0 ± 5.9 980.8 999.9 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.911 ± 0.017 1.891 1.948 1.00
head secp_integration_benchmark 1.925 ± 0.027 1.898 1.993 1.01 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 723.3 ± 3.8 719.0 731.1 1.01 ± 0.01
head set_integration_benchmark 718.0 ± 4.4 710.9 726.1 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.771 ± 0.060 4.693 4.852 1.00
head uint256_integration_benchmark 4.798 ± 0.068 4.694 4.867 1.01 ± 0.02
codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 97.66%. Comparing base (59a97c7) to head (8f89325).

Files Patch % Lines
vm/src/air_public_input.rs 65.38% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1648 +/- ## ========================================== - Coverage 97.68% 97.66% -0.02% ========================================== Files 91 91 Lines 37689 37712 +23 ========================================== + Hits 36817 36833 +16 - Misses 872 879 +7 ```

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