fix(test-benchmark): correct compute benchmarks that ran below worst case#3136
Open
spencer-tb wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devnets/glamsterdam/6-benchmarks #3136 +/- ##
===================================================================
Coverage ? 93.30%
===================================================================
Files ? 624
Lines ? 36986
Branches ? 3383
===================================================================
Hits ? 34508
Misses ? 1695
Partials ? 783
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #3135. Where #3135 fixes benchmarks that measured nothing, this fixes three that measured the "wrong thing" where the gas is exact, but the work is below worst case.
test_arithmetic, drop the MOD/SMOD/ADDMOD/MULMOD cases. Their operand chain collapses tox mod 0after ~150 iterations, so >99.99% of the loop is trivial (the params are even commented "not suitable ... values quickly become zero"). The dedicatedtest_mod/test_mod_arithmeticalready benchmark these at worst case and carry therepricingmarker, so these cases are redundant duplicates.test_msize, dropmem_size=1_000_000. MSIZE is O(1), so its cost never varies with memory size. The large value only makes the one time quadratic memory expansion (~94% of the measured gas) dwarf the MSIZE loop, benchmarking expansion instead of MSIZE. The remaining sizes keep expansion ≤18%.test_bls12_g1_msm/test_bls12_g2_msm, use distinct points and scalars. The input was a single pointP1repeated with scalar = the subgroup orderr, so every term wasr·P1 = Oand an MSM can bucket the identical scalars / factor out the shared point. Distinct points paired with distinct full width scalars belowrforce the full k term computation. The exactly redundant k=128/k=64 cases in thetest_bls12_381sweep (which carry norepricingmarker) are removed.Related Issues or PRs
Follow-up to #3135, related to #3128.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture