Skip to content

feat: -threshold filters diff findings by bytes saved#38

Merged
peczenyj merged 4 commits into
develfrom
feature/threshold
May 26, 2026
Merged

feat: -threshold filters diff findings by bytes saved#38
peczenyj merged 4 commits into
develfrom
feature/threshold

Conversation

@peczenyj
Copy link
Copy Markdown
Owner

Adds -threshold N (int, default 0, diff-only): only show structs that save at least N bytes (inclusive). Negative values are treated as 0 (no filtering).

The filter runs before sort/summary/exit, so:

  • -summary counts only the structs that pass (verified by a test);
  • the exit code is 0 when everything is filtered out (CI-friendly "nothing saves ≥ N bytes");
  • it composes with -sort (filter, then sort).

Reuses the savings() helper. Tests cover the inclusive boundary (-threshold=16 keeps the 16-byte saver, drops the 8-byte one), =0 shows all, negatives behave like 0, all-filtered exits 0, and summary reflects the filtered set. task ci green (96 tests).

⚠️ Stacked (base feature/sort-inspect) during the GitHub Actions incident; base retargets to devel as the stack merges.

Closes #31

🤖 Generated with Claude Code

peczenyj and others added 3 commits May 26, 2026 14:21
-sort (default off) collects findings across all scanned packages and
presents them largest-first by absolute bytes saved (OldSize-NewSize),
using a stable sort so equal-savings structs keep source order and
unknown-size findings sink to the bottom. Diff mode only for now; inspect
support follows.

Part of #30

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
In -inspect mode, -sort now collects all layouts across packages and
orders them largest-first by Layout.Total (stable sort). Updates the flag
help to cover both modes. Diff behavior unchanged.

Closes #30

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
-threshold N (int, default 0, diff-only) drops findings that save fewer
than N bytes. Negative values are treated as 0 (no filtering). The filter
runs before sort and summary, so -summary counts only the kept structs and
the exit code is 0 when everything is filtered out.

Closes #31

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@peczenyj peczenyj self-assigned this May 26, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (devel@cb93846). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             devel      #38   +/-   ##
========================================
  Coverage         ?   85.71%           
========================================
  Files            ?       10           
  Lines            ?      721           
  Branches         ?        0           
========================================
  Hits             ?      618           
  Misses           ?       65           
  Partials         ?       38           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peczenyj peczenyj force-pushed the feature/sort-inspect branch from e7748d8 to 3f2d2fd Compare May 26, 2026 14:36
@peczenyj peczenyj changed the base branch from feature/sort-inspect to devel May 26, 2026 14:55
@peczenyj peczenyj merged commit 76d1a58 into devel May 26, 2026
6 checks 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.

feat: -threshold flag (diff mode)

2 participants