Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove unused code & use constants whenever possible for builtin instance definitions #1707

Merged
merged 23 commits into from
Apr 12, 2024

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Apr 11, 2024

Builtin Instance Defs

  • Removes unused/ignored fields
  • Turns constant field values into actual constants
  • Implement Default trait instead of a method named default

Builtin Runners

  • Removes fields cells_per_instance, n_input_cells & cpu_components_per_step, relying on constants instead

Other

  • exec_scope macro now uses full path for ExecScopes and no longer requires it to be imported separately

Copy link

github-actions bot commented Apr 11, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.325 ± 0.059 2.268 2.458 1.01 ± 0.03
head big_factorial 2.306 ± 0.023 2.268 2.347 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.305 ± 0.036 2.266 2.374 1.01 ± 0.02
head big_fibonacci 2.292 ± 0.031 2.255 2.355 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.587 ± 0.187 8.299 8.740 1.01 ± 0.03
head blake2s_integration_benchmark 8.478 ± 0.148 8.308 8.700 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.344 ± 0.024 2.313 2.397 1.00
head compare_arrays_200000 2.349 ± 0.039 2.321 2.452 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.474 ± 0.018 1.454 1.512 1.01 ± 0.02
head dict_integration_benchmark 1.465 ± 0.018 1.446 1.495 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.325 ± 0.023 1.302 1.385 1.01 ± 0.02
head field_arithmetic_get_square_benchmark 1.314 ± 0.012 1.295 1.333 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.532 ± 0.194 8.334 8.787 1.01 ± 0.03
head integration_builtins 8.438 ± 0.155 8.318 8.714 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.949 ± 0.436 8.539 10.047 1.01 ± 0.06
head keccak_integration_benchmark 8.879 ± 0.237 8.658 9.492 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.376 ± 0.053 2.336 2.523 1.01 ± 0.03
head linear_search 2.364 ± 0.048 2.323 2.434 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.585 ± 0.013 1.563 1.599 1.00
head math_cmp_and_pow_integration_benchmark 1.596 ± 0.029 1.566 1.664 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.426 ± 0.015 1.409 1.444 1.00
head math_integration_benchmark 1.446 ± 0.027 1.413 1.485 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.289 ± 0.034 1.254 1.354 1.00 ± 0.03
head memory_integration_benchmark 1.283 ± 0.028 1.249 1.342 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.614 ± 0.016 1.592 1.652 1.00
head operations_with_data_structures_benchmarks 1.618 ± 0.016 1.602 1.651 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 591.6 ± 4.2 587.5 601.6 1.00
head pedersen 594.2 ± 4.1 590.5 603.1 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 972.2 ± 7.9 964.0 989.6 1.01 ± 0.01
head poseidon_integration_benchmark 962.1 ± 4.9 952.2 968.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.870 ± 0.013 1.856 1.899 1.00
head secp_integration_benchmark 1.879 ± 0.015 1.867 1.911 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 721.4 ± 1.0 719.8 722.9 1.00
head set_integration_benchmark 721.4 ± 4.6 716.0 730.8 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.734 ± 0.107 4.620 4.941 1.01 ± 0.03
head uint256_integration_benchmark 4.700 ± 0.054 4.612 4.823 1.00

Copy link

codecov bot commented Apr 12, 2024

Codecov Report

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

Project coverage is 94.94%. Comparing base (6de8f56) to head (0f6870a).

Files Patch % Lines
vm/src/vm/runners/builtin_runner/modulo.rs 0.00% 8 Missing ⚠️
vm/src/vm/runners/builtin_runner/mod.rs 97.43% 2 Missing ⚠️
vm/src/vm/runners/builtin_runner/bitwise.rs 96.00% 1 Missing ⚠️
vm/src/vm/runners/cairo_runner.rs 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1707      +/-   ##
==========================================
- Coverage   94.98%   94.94%   -0.05%     
==========================================
  Files          99       98       -1     
  Lines       38579    38081     -498     
==========================================
- Hits        36646    36155     -491     
+ Misses       1933     1926       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fmoletta fmoletta marked this pull request as ready for review April 12, 2024 21:27
@Oppen Oppen added this pull request to the merge queue Apr 12, 2024
Merged via the queue into main with commit 1d23afb Apr 12, 2024
71 checks passed
@Oppen Oppen deleted the simplify-instance-defs branch April 12, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants