Skip to content

fix: correct inverted sign on benchmark delta display#9

Merged
weklund merged 1 commit intomainfrom
fix/bench-delta-sign
Apr 2, 2026
Merged

fix: correct inverted sign on benchmark delta display#9
weklund merged 1 commit intomainfrom
fix/bench-delta-sign

Conversation

@weklund
Copy link
Copy Markdown
Owner

@weklund weklund commented Apr 2, 2026

Summary

  • Benchmark comparison table displayed inverted signs: below-catalog results showed - and above-catalog showed +
  • Root cause: manual sign formatting on lines 146-149 overrode the correct {:+.1f} format spec on line 145
  • Fix: remove the manual override, keep Python's built-in sign formatting
  • Adds 3 regression tests asserting correct sign for below-catalog (+29.4%), above-catalog (-5.9%), and exact-match (+0.0%) scenarios

Test plan

  • New tests fail against buggy code, pass against fix
  • All 26 bench CLI tests pass
  • CI passes

🤖 Generated with Claude Code

delta_pct is calculated as (catalog - measured) / catalog, so positive
values mean measured is below catalog. The manual sign formatting
inverted this, showing "-" for below-catalog and "+" for above-catalog.
Removed the manual override in favor of Python's built-in {:+.1f}
format spec which handles signs correctly.

Adds tests asserting correct sign behavior for below-catalog, above-
catalog, and exact-match scenarios.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@weklund weklund merged commit ae7d209 into main Apr 2, 2026
1 check passed
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