Skip to content

fix(mp3): refresh the fixed-point CPU baseline after the IMDCT kernel - #4126

Merged
zackees merged 1 commit into
masterfrom
fix/4110-refresh-fixed-baseline
Sep 1, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/4110-refresh-fixed-baseline

Conversation

@zackees

@zackees zackees commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Master is red on the MP3 CPU audit.

RuntimeError: callgrind attribution disappeared for
  minimp3-fixed/...mp3d_dequant(int, int, int, int)

My sequencing error. #4110's baselines were harvested from a branch based on master before #4109, then #4109 merged first and #4110 second — so the committed profile describes a decoder that no longer exists. The gate was right to fire; the baseline was stale.

What changed, on the same CI host

mp3d_imdct36_twiddle enters the callgrind set — #4109 introduced it
mp3d_dequant leaves it, having fallen below the attribution threshold
instructions 657,659,874 → 659,084,514 (+0.22%)

The rise is an artifact of the audit build, not a regression in what ships. _common_compile_flags passes -fno-inline, so #4109's dispatching wrapper costs a real call per band here. At -Os it is a static function with a single call site and inlines away — the shipping measurement for that change was −2.34% instructions on an optimised build, via Callgrind.

The invariant held

The operation ledger is byte-identical for both backends, asserted before writing rather than assumed. That is the figure that matters: the exact, host-independent count of the arithmetic the algorithm performs. It is unchanged because the audit compiles -DMINIMP3_NO_SIMD and #4109 only adds a vector path — which is exactly the property I checked for before merging #4118, and it held.

Only the host and codegen halves are refreshed.

Refs #4110, #4109

Summary by CodeRabbit

  • Performance
    • Refreshed benchmark data for the minimp3-fixed audio decoding backend.
    • Updated CPU instruction counts, branch-miss metrics, and decoding-stage timing measurements.
    • Revised the tracked function set used in performance reporting.

Master is red on the MP3 CPU audit:

    RuntimeError: callgrind attribution disappeared for
      minimp3-fixed/...mp3d_dequant(int, int, int, int)

My sequencing error. #4110's baselines were harvested from a branch based on
master *before* #4109, then #4109 merged first and #4110 second -- so the
committed profile describes a decoder that no longer exists. The gate was
right to fire; the baseline was stale.

What actually changed, measured on the same CI host (AMD EPYC 9V74):

  - `mp3d_imdct36_twiddle` enters the callgrind set -- #4109 introduced it.
  - `mp3d_dequant` leaves it, having fallen below the attribution threshold.
  - Instructions 657,659,874 -> 659,084,514, up 0.22%.

The rise is an artifact of the audit build, not a regression in what ships.
`_common_compile_flags` passes `-fno-inline`, so #4109's dispatching wrapper
costs a real call per band here; at -Os it is a static function with a single
call site and inlines away. The shipping measurement for that change was
-2.34% instructions, taken on an optimised build.

**The operation ledger is byte-identical for both backends**, asserted before
writing rather than assumed. That is the invariant that matters: it is the
exact, host-independent count of the arithmetic the algorithm performs, and it
is unchanged because the audit compiles `-DMINIMP3_NO_SIMD` and #4109 only adds
a vector path. Only the host and codegen halves are refreshed.

Refs #4110, #4109

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ByD5ZKrnFJuchjRmPiQdd5
@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 5e90db4f-1e29-481c-92b4-e4c7ce2b2a9a

📥 Commits

Reviewing files that changed from the base of the PR and between b979b15 and 53621cd.

📒 Files selected for processing (1)
  • codec_cpu_trend.json

Included review availability: Your plan provides up to 8 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The change refreshes minimp3-fixed benchmark data in codec_cpu_trend.json. It updates callgrind metrics, counter medians, stage timings, and the recorded callgrind function map.

Changes

Codec benchmark refresh

Layer / File(s) Summary
Refresh minimp3-fixed measurements
codec_cpu_trend.json
The benchmark data now contains updated callgrind instruction and branch-miss counts, counter medians, stage timings, and function entries.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 53621

This PR refreshes the committed MP3 CPU audit measurements without changing shipped decoder behavior; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: refreshing the fixed-point MP3 CPU baseline after the IMDCT kernel change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/4110-refresh-fixed-baseline

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit afd2192 into master Sep 1, 2026
3 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 1, 2026
@zackees
zackees deleted the fix/4110-refresh-fixed-baseline branch September 1, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant