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
485 stars 132 forks source link

[Cairo 1] Handle `BoundedInt` variant in `serialize_output` #1768

Closed fmoletta closed 1 month ago

fmoletta commented 1 month ago

Handles BoundedInt as integer value when serializing

github-actions[bot] commented 1 month ago
**Hyper Thereading Benchmark results**

hyperfine -r 2 -n "hyper_threading_main threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_main' -n "hyper_threading_pr threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 1
  Time (mean ± σ):     27.774 s ±  0.021 s    [User: 27.032 s, System: 0.741 s]
  Range (min … max):   27.760 s … 27.789 s    2 runs

Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     27.107 s ±  0.073 s    [User: 26.289 s, System: 0.818 s]
  Range (min … max):   27.056 s … 27.159 s    2 runs

Summary
  'hyper_threading_pr threads: 1' ran
    1.02 ± 0.00 times faster than 'hyper_threading_main threads: 1'

hyperfine -r 2 -n "hyper_threading_main threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_main' -n "hyper_threading_pr threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 2
  Time (mean ± σ):     15.063 s ±  0.025 s    [User: 27.458 s, System: 0.749 s]
  Range (min … max):   15.045 s … 15.080 s    2 runs

Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.787 s ±  0.041 s    [User: 26.870 s, System: 0.782 s]
  Range (min … max):   14.758 s … 14.816 s    2 runs

Summary
  'hyper_threading_pr threads: 2' ran
    1.02 ± 0.00 times faster than 'hyper_threading_main threads: 2'

hyperfine -r 2 -n "hyper_threading_main threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_main' -n "hyper_threading_pr threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 4
  Time (mean ± σ):     11.194 s ±  0.016 s    [User: 39.153 s, System: 0.970 s]
  Range (min … max):   11.183 s … 11.206 s    2 runs

Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.702 s ±  0.038 s    [User: 38.505 s, System: 0.926 s]
  Range (min … max):   10.675 s … 10.729 s    2 runs

Summary
  'hyper_threading_pr threads: 4' ran
    1.05 ± 0.00 times faster than 'hyper_threading_main threads: 4'

hyperfine -r 2 -n "hyper_threading_main threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_main' -n "hyper_threading_pr threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 6
  Time (mean ± σ):     10.957 s ±  0.124 s    [User: 39.240 s, System: 0.993 s]
  Range (min … max):   10.869 s … 11.045 s    2 runs

Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.854 s ±  0.591 s    [User: 39.339 s, System: 0.925 s]
  Range (min … max):   10.437 s … 11.272 s    2 runs

Summary
  'hyper_threading_pr threads: 6' ran
    1.01 ± 0.06 times faster than 'hyper_threading_main threads: 6'

hyperfine -r 2 -n "hyper_threading_main threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_main' -n "hyper_threading_pr threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 8
  Time (mean ± σ):     10.572 s ±  0.073 s    [User: 39.296 s, System: 1.013 s]
  Range (min … max):   10.521 s … 10.624 s    2 runs

Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.733 s ±  0.013 s    [User: 39.433 s, System: 0.951 s]
  Range (min … max):   10.724 s … 10.743 s    2 runs

Summary
  'hyper_threading_main threads: 8' ran
    1.02 ± 0.01 times faster than 'hyper_threading_pr threads: 8'

hyperfine -r 2 -n "hyper_threading_main threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_main' -n "hyper_threading_pr threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 16
  Time (mean ± σ):     10.729 s ±  0.039 s    [User: 39.414 s, System: 1.001 s]
  Range (min … max):   10.701 s … 10.757 s    2 runs

Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.535 s ±  0.057 s    [User: 39.795 s, System: 1.006 s]
  Range (min … max):   10.494 s … 10.576 s    2 runs

Summary
  'hyper_threading_pr threads: 16' ran
    1.02 ± 0.01 times faster than 'hyper_threading_main threads: 16'
codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 94.79%. Comparing base (c370e2d) to head (7b4a14b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1768 +/- ## ======================================= Coverage 94.79% 94.79% ======================================= Files 101 101 Lines 38787 38787 ======================================= Hits 36770 36770 Misses 2017 2017 ```

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

github-actions[bot] commented 1 month ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.065 ± 0.030 2.024 2.102 1.01 ± 0.02
head big_factorial 2.046 ± 0.034 1.999 2.104 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 1.988 ± 0.035 1.960 2.053 1.00
head big_fibonacci 2.001 ± 0.030 1.966 2.035 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.702 ± 0.263 7.503 8.396 1.02 ± 0.04
head blake2s_integration_benchmark 7.580 ± 0.155 7.384 7.857 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.117 ± 0.052 2.092 2.258 1.00
head compare_arrays_200000 2.129 ± 0.041 2.094 2.190 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.420 ± 0.010 1.410 1.441 1.00
head dict_integration_benchmark 1.433 ± 0.070 1.403 1.632 1.01 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.285 ± 0.016 1.264 1.303 1.00
head field_arithmetic_get_square_benchmark 1.288 ± 0.016 1.274 1.319 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.640 ± 0.286 7.425 8.409 1.02 ± 0.04
head integration_builtins 7.521 ± 0.091 7.404 7.683 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.874 ± 0.181 7.711 8.342 1.00
head keccak_integration_benchmark 7.959 ± 0.315 7.651 8.735 1.01 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.100 ± 0.042 2.054 2.168 1.00 ± 0.03
head linear_search 2.091 ± 0.033 2.059 2.154 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.701 ± 0.010 1.691 1.722 1.00
head math_cmp_and_pow_integration_benchmark 1.721 ± 0.037 1.691 1.801 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.616 ± 0.012 1.600 1.641 1.01 ± 0.01
head math_integration_benchmark 1.595 ± 0.005 1.587 1.603 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.191 ± 0.012 1.180 1.213 1.00 ± 0.01
head memory_integration_benchmark 1.188 ± 0.012 1.175 1.210 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.824 ± 0.038 1.799 1.922 1.01 ± 0.02
head operations_with_data_structures_benchmarks 1.809 ± 0.006 1.803 1.823 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 516.8 ± 2.5 514.1 520.7 1.01 ± 0.01
head pedersen 513.4 ± 3.2 509.6 518.3 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 955.3 ± 9.2 945.2 976.2 1.00
head poseidon_integration_benchmark 957.4 ± 11.7 944.2 976.9 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.883 ± 0.029 1.848 1.928 1.00 ± 0.02
head secp_integration_benchmark 1.875 ± 0.032 1.852 1.950 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 645.0 ± 3.7 641.4 652.1 1.00 ± 0.01
head set_integration_benchmark 644.1 ± 2.4 640.1 648.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.228 ± 0.069 4.123 4.371 1.01 ± 0.02
head uint256_integration_benchmark 4.181 ± 0.050 4.115 4.269 1.00