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

Fix modulo builtin constraints #1841

Draft
wants to merge 80 commits into
base: main
Choose a base branch
from
Draft

Fix modulo builtin constraints #1841

wants to merge 80 commits into from

Conversation

JulianGCalderon
Copy link
Contributor

@JulianGCalderon JulianGCalderon commented Sep 19, 2024

Fix modulo builtin bugs

Closes #1835

Description

This PR changes the modulo builtin to comply with the prover constraints.

It also uploads mod_builtin feature test coverage to codecov.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

@JulianGCalderon JulianGCalderon force-pushed the mod-builtin-fix branch 2 times, most recently from 2fa00c3 to ed8d99a Compare September 19, 2024 17:33
Copy link

github-actions bot commented Sep 19, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.395 ± 0.009 2.381 2.411 1.00
head big_factorial 2.439 ± 0.092 2.373 2.608 1.02 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.338 ± 0.041 2.312 2.451 1.00
head big_fibonacci 2.369 ± 0.067 2.310 2.501 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.891 ± 0.435 8.453 9.843 1.03 ± 0.06
head blake2s_integration_benchmark 8.666 ± 0.323 8.410 9.456 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.538 ± 0.045 2.501 2.651 1.01 ± 0.04
head compare_arrays_200000 2.521 ± 0.096 2.470 2.786 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.654 ± 0.032 1.633 1.736 1.00 ± 0.03
head dict_integration_benchmark 1.649 ± 0.047 1.621 1.744 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.398 ± 0.036 1.360 1.482 1.03 ± 0.03
head field_arithmetic_get_square_benchmark 1.361 ± 0.023 1.343 1.420 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.792 ± 0.168 8.575 9.014 1.02 ± 0.02
head integration_builtins 8.616 ± 0.124 8.490 8.892 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 9.051 ± 0.293 8.768 9.726 1.02 ± 0.04
head keccak_integration_benchmark 8.849 ± 0.116 8.709 9.130 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.510 ± 0.040 2.469 2.584 1.01 ± 0.02
head linear_search 2.478 ± 0.037 2.438 2.536 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.715 ± 0.014 1.702 1.749 1.01 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.697 ± 0.016 1.683 1.735 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.677 ± 0.055 1.653 1.832 1.02 ± 0.03
head math_integration_benchmark 1.650 ± 0.006 1.642 1.662 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.391 ± 0.005 1.385 1.400 1.00
head memory_integration_benchmark 1.399 ± 0.040 1.374 1.508 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.766 ± 0.012 1.754 1.797 1.00 ± 0.01
head operations_with_data_structures_benchmarks 1.762 ± 0.016 1.749 1.803 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 581.6 ± 10.4 575.4 607.4 1.00 ± 0.02
head pedersen 581.4 ± 5.3 577.0 592.5 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 692.6 ± 9.0 684.8 715.6 1.01 ± 0.02
head poseidon_integration_benchmark 685.8 ± 9.7 675.5 710.1 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.996 ± 0.013 1.982 2.021 1.00
head secp_integration_benchmark 2.011 ± 0.029 1.982 2.081 1.01 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 702.7 ± 2.4 699.3 706.8 1.00
head set_integration_benchmark 705.1 ± 10.0 697.3 725.7 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.822 ± 0.079 4.727 4.929 1.01 ± 0.02
head uint256_integration_benchmark 4.785 ± 0.069 4.676 4.901 1.00

@JulianGCalderon JulianGCalderon changed the title Fix modulo builtin bugs Fix modulo builtin constraints Sep 19, 2024
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

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

Please upload report for BASE (dynamic-layout@9bbfc36). Learn more about missing BASE report.

Files with missing lines Patch % Lines
vm/src/vm/runners/builtin_runner/modulo.rs 94.00% 9 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             dynamic-layout    #1841   +/-   ##
=================================================
  Coverage                  ?   96.35%           
=================================================
  Files                     ?      101           
  Lines                     ?    40201           
  Branches                  ?        0           
=================================================
  Hits                      ?    38735           
  Misses                    ?     1466           
  Partials                  ?        0           
Flag Coverage Δ
96.35% <95.90%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@JulianGCalderon JulianGCalderon force-pushed the mod-builtin-fix branch 2 times, most recently from 2d22ac5 to 8f1a09f Compare September 23, 2024 15:58
Base automatically changed from dynamic-layout to main September 27, 2024 22:39
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.

4 participants