Skip to content

fix(bench): pair scale-curve tests by matching parametrize suffix#92

Merged
Oaklight merged 1 commit into
masterfrom
fix/bench-scale-curve-pairing
May 18, 2026
Merged

fix(bench): pair scale-curve tests by matching parametrize suffix#92
Oaklight merged 1 commit into
masterfrom
fix/bench-scale-curve-pairing

Conversation

@Oaklight
Copy link
Copy Markdown
Owner

Summary

  • Scale-curve parametrized tests like zerodep[50nodes] were matched against all reference sizes (Cartesian product), inflating comparison counts and producing incorrect faster/slower stats on the dashboard
  • Fix: extract _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
  • Tests without a parametrize suffix ("") continue to match freely — no regression for non-parametrized benchmarks
  • Extracted _make_pair() and _pair_op_entries() helpers to keep _build_comparisons() under the C901 complexity limit

Test plan

  • CI passes (ruff, ty, complexipy, test suite)
  • After merge: rerun Benchmark workflow and verify dashboard summary counts are reasonable (not ~1000+ comparisons from Cartesian product)

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.
@Oaklight Oaklight merged commit cdaa3e0 into master May 18, 2026
6 checks passed
@Oaklight Oaklight deleted the fix/bench-scale-curve-pairing branch May 18, 2026 12:50
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.

1 participant