fix(bench): pair scale-curve tests by matching parametrize suffix#92
Merged
Conversation
Scale-curve tests use pytest parametrize with a size suffix like [50nodes]. The previous pairing logic did a full cross-product within each canonical key group, so zerodep[50nodes] was incorrectly matched against every reference size (bs4[5nodes], bs4[25nodes], …), inflating comparison counts and producing misleading faster/slower statistics on the dashboard. Fix: extract _param_suffix() to pull the [...] bracket from a test name, and add a suffix-equality guard in both the canonical-key matching branch and the fallback cross-product branch. Tests without a parametrize suffix (suffix == "") continue to match freely. Also extract _make_pair() and _pair_op_entries() helpers to reduce _build_comparisons() McCabe complexity below the C901 limit.
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.
Summary
zerodep[50nodes]were matched against all reference sizes (Cartesian product), inflating comparison counts and producing incorrect faster/slower stats on the dashboard_param_suffix()to capture the[...]bracket from test names; add a suffix-equality guard in both the canonical-key pairing branch and the fallback cross-product branch"") continue to match freely — no regression for non-parametrized benchmarks_make_pair()and_pair_op_entries()helpers to keep_build_comparisons()under the C901 complexity limitTest plan