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

Add cairo1-run pretty printing #1630

Closed juanbono closed 6 months ago

juanbono commented 6 months ago

Add cairo1-run pretty printing

Description

This PR adds pretty printing of the cairo1-run output for the following types:

Checklist

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.310 ± 0.020 2.289 2.356 1.00 ± 0.01
head big_factorial 2.308 ± 0.014 2.295 2.334 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.306 ± 0.009 2.294 2.316 1.00
head big_fibonacci 2.315 ± 0.022 2.300 2.369 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.591 ± 0.099 8.498 8.760 1.00
head blake2s_integration_benchmark 8.688 ± 0.287 8.446 9.290 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.379 ± 0.023 2.355 2.435 1.00
head compare_arrays_200000 2.387 ± 0.036 2.360 2.487 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.483 ± 0.023 1.458 1.537 1.01 ± 0.02
head dict_integration_benchmark 1.472 ± 0.013 1.461 1.491 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.330 ± 0.020 1.312 1.382 1.00
head field_arithmetic_get_square_benchmark 1.332 ± 0.034 1.303 1.423 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.644 ± 0.103 8.457 8.805 1.00 ± 0.04
head integration_builtins 8.631 ± 0.297 8.443 9.417 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.869 ± 0.125 8.687 9.068 1.00 ± 0.02
head keccak_integration_benchmark 8.842 ± 0.111 8.695 8.985 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.412 ± 0.051 2.372 2.544 1.01 ± 0.02
head linear_search 2.399 ± 0.013 2.378 2.418 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.604 ± 0.017 1.580 1.632 1.00
head math_cmp_and_pow_integration_benchmark 1.613 ± 0.021 1.579 1.654 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.458 ± 0.019 1.433 1.492 1.00 ± 0.02
head math_integration_benchmark 1.452 ± 0.017 1.432 1.470 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.293 ± 0.018 1.275 1.310 1.00
head memory_integration_benchmark 1.316 ± 0.037 1.276 1.399 1.02 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.633 ± 0.010 1.620 1.647 1.00 ± 0.01
head operations_with_data_structures_benchmarks 1.632 ± 0.016 1.615 1.664 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 596.4 ± 2.4 592.3 599.4 1.00
head pedersen 597.0 ± 5.4 592.6 609.7 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 993.9 ± 12.5 982.5 1027.7 1.01 ± 0.01
head poseidon_integration_benchmark 985.5 ± 5.2 977.3 992.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.897 ± 0.027 1.871 1.964 1.00 ± 0.02
head secp_integration_benchmark 1.897 ± 0.018 1.883 1.935 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 737.5 ± 6.5 728.9 752.0 1.00
head set_integration_benchmark 738.5 ± 7.5 731.6 756.6 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.718 ± 0.051 4.679 4.855 1.00 ± 0.01
head uint256_integration_benchmark 4.703 ± 0.030 4.663 4.742 1.00
codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 97.63%. Comparing base (bdcfb1f) to head (967bd18).

Files Patch % Lines
cairo1-run/src/serialize_output.rs 86.36% 15 Missing :warning:
cairo1-run/src/main.rs 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1630 +/- ## ========================================== - Coverage 97.67% 97.63% -0.04% ========================================== Files 91 92 +1 Lines 37393 37464 +71 ========================================== + Hits 36523 36579 +56 - Misses 870 885 +15 ```

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