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
488 stars 133 forks source link

Add zero segment #1668

Closed fmoletta closed 3 months ago

fmoletta commented 4 months ago

Adds zero segment fields & methods to MemorySegmentManager These methods will be used by the new builtin, and are currenlty unused

github-actions[bot] commented 4 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.328 ± 0.016 2.308 2.362 1.01 ± 0.02
head big_factorial 2.299 ± 0.031 2.270 2.369 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.367 ± 0.075 2.319 2.575 1.04 ± 0.03
head big_fibonacci 2.285 ± 0.020 2.253 2.315 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.572 ± 0.118 8.387 8.790 1.01 ± 0.05
head blake2s_integration_benchmark 8.520 ± 0.399 8.259 9.574 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.366 ± 0.017 2.346 2.403 1.00 ± 0.01
head compare_arrays_200000 2.356 ± 0.021 2.318 2.386 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.496 ± 0.027 1.476 1.571 1.01 ± 0.02
head dict_integration_benchmark 1.480 ± 0.009 1.470 1.495 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.315 ± 0.009 1.301 1.325 1.01 ± 0.01
head field_arithmetic_get_square_benchmark 1.308 ± 0.017 1.289 1.346 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.552 ± 0.099 8.378 8.650 1.01 ± 0.02
head integration_builtins 8.495 ± 0.184 8.306 8.713 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.803 ± 0.123 8.634 8.963 1.00 ± 0.04
head keccak_integration_benchmark 8.801 ± 0.332 8.572 9.646 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.404 ± 0.021 2.385 2.458 1.02 ± 0.01
head linear_search 2.356 ± 0.023 2.327 2.407 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.602 ± 0.024 1.572 1.658 1.00 ± 0.02
head math_cmp_and_pow_integration_benchmark 1.594 ± 0.012 1.568 1.616 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.453 ± 0.017 1.436 1.488 1.01 ± 0.01
head math_integration_benchmark 1.441 ± 0.007 1.432 1.452 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.307 ± 0.011 1.286 1.321 1.03 ± 0.01
head memory_integration_benchmark 1.273 ± 0.009 1.260 1.286 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.631 ± 0.006 1.622 1.641 1.00 ± 0.01
head operations_with_data_structures_benchmarks 1.628 ± 0.019 1.607 1.675 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 597.0 ± 4.9 593.2 610.3 1.00 ± 0.02
head pedersen 596.4 ± 9.5 590.1 616.3 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 999.7 ± 4.7 993.4 1006.3 1.01 ± 0.01
head poseidon_integration_benchmark 989.2 ± 6.5 978.1 997.3 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.872 ± 0.020 1.860 1.928 1.00
head secp_integration_benchmark 1.873 ± 0.041 1.846 1.985 1.00 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 702.4 ± 6.5 695.1 715.3 1.01 ± 0.01
head set_integration_benchmark 697.9 ± 3.6 692.2 702.1 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.683 ± 0.046 4.638 4.788 1.01 ± 0.01
head uint256_integration_benchmark 4.639 ± 0.044 4.589 4.700 1.00
codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 96.56%. Comparing base (44de614) to head (f7098eb).

Files Patch % Lines
vm/src/vm/vm_memory/memory_segments.rs 28.00% 18 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1668 +/- ## ========================================== - Coverage 96.61% 96.56% -0.05% ========================================== Files 95 95 Lines 38390 38409 +19 ========================================== + Hits 37089 37090 +1 - Misses 1301 1319 +18 ```

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