You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(mp3): add bit-exact SIMD kernels that outperform Helix #4055
Phase 4 / G4 of FastLED/license#14. After scalar fixed-point parity, integer SIMD must make minimp3 strictly faster than Helix while remaining bit-exact and optional.
Proposal
Add SSE2 and NEON fixed-point kernels for the dominant polyphase, DCT32, and IMDCT costs, then an ESP32-S3 PIE path. Preserve a scalar opt-out and evaluate Cortex-M4/M7 DSP scheduling without sacrificing precision.
Acceptance criteria
Capture RED evidence: performance/dispatch tests show no fixed-point SIMD path and fail the G4 speed targets.
Implement SSE2 and NEON int32 paths for polyphase, DCT32, and IMDCT butterflies.
Implement compile-time-guarded ESP32-S3 PIE kernels for polyphase and DCT32.
Preserve MINIMP3_NO_SIMD and prove scalar fallback behavior.
Evaluate Cortex-M4/M7 DSP scheduling, including whether SMLAD can preserve the Q25 precision contract; document and test the result.
Require exact PCM equality between every SIMD path and scalar fixed-point across the full corpus and differential fuzzer.
Demonstrate at least 1.5x speedup over Helix-scalar on x86-64 and Apple/ARM CI runners and at least 1.3x on ESP32-S3 hardware, with no target slower than scalar fixed-point.
Acceptance bar set by repo owner (2026-08-31): unit tests and perf tests passing.
An earlier revision of this comment said the speedup gates were relaxed to informational. That is withdrawn — perf tests gate too.
For this issue that means:
Blocking — implemented for real: the fixed-point SIMD kernels, MINIMP3_NO_SIMD scalar-fallback proof, and exact PCM equality between every SIMD path and scalar fixed-point across the corpus and the differential fuzzer. Bit-exactness is a correctness property and is cheap to verify on host. SIMD stays a hard blocker for chore(mp3): make minimp3 sole backend and remove libhelix #4056.
Blocking — perf:ci/codec_cpu/audit.py must be green with the SIMD path measured, and the SIMD path must not be slower than scalar fixed-point on any audited configuration.
Out of scope as a test: the >=1.3x on ESP32-S3 hardware target — needs attached hardware, not an automated test. The host >=1.5x over Helix-scalar target is measured and recorded; the enforced host gate is "no target slower than scalar fixed-point" plus the existing 5% trend gate.
Delivered in #4107 (merged as d68e1e50de). Disposition against the acceptance criteria, including what did not land.
Done
SSE4.1 and NEON int32 kernels for polyphase and DCT-32. Whole-decode speedup 1.10x on x86, bit-identical to scalar sample for sample.
MINIMP3_NO_SIMD scalar opt-out proven by a dedicated decoder instantiation, which is also the reference the kernels are compared against.
Exact PCM equality across the corpus, plus the differential fuzzer, ASan/UBSan clean.
Enforced perf gate: SIMD must not be slower than scalar, running in the CPU audit in release mode (it asserts only in optimised builds — the same kernel measures 0.93x at -O0 and 1.10x at -O3, so -O0 would gate on the compiler rather than the kernel).
Cortex-M4/M7 DSP evaluation, concluding scalar stays, with the reasoning recorded in PROVENANCE: SMLAD is a dual 16x16 MAC against a pipeline that is 32-bit mantissas throughout, and SMMUL/SMMLA discard the low half of the product, which is where this decoder's rounding lives.
Not done, carved out
ESP32-S3 PIE kernels -> perf(mp3): ESP32-S3 PIE kernels for the fixed-point polyphase and DCT-32 #4108. The kernels are already factored as standalone functions behind MP3D_HAVE_INT_SIMD so a third ISA slots in without touching surrounding code, and the bit-exactness gate is architecture-aware, so a PIE path is tested the moment it reports itself.
IMDCT vectorisation -> perf(mp3): vectorise the fixed-point IMDCT twiddle/window loop #4109. Structural: its inner 9-point DCT-III does not map onto four lanes and cross-band vectorisation needs stride-18 gathers, leaving only the twiddle/window loop addressable at a ~2% ceiling.
Measured results worth keeping
The obvious SSE2 implementation is slower than scalar (0.66x standalone, 0.95x end to end): SSE2 has no signed 32x32 -> 64 multiply and the sign-correction emulation costs more than vectorising saves. SSE2-only hardware stays scalar; SSE4.1 dispatches at run time.
A branchless 32-bit saturating add was tried and reverted: +6,265 bytes of text (+24%) and 48 bytes of decode stack for ~3% of x86 decode time, justified by an MCU argument that was never measured on an MCU.
Closing as delivered with the two carve-outs above tracked separately. The bar set on this issue — unit tests and perf tests passing — is met: both mp3 audits and all 32 checks green on the merge.
Activity
zackees commentedon Aug 31, 2026
Acceptance bar set by repo owner (2026-08-31): unit tests and perf tests passing.
An earlier revision of this comment said the speedup gates were relaxed to informational. That is withdrawn — perf tests gate too.
For this issue that means:
MINIMP3_NO_SIMDscalar-fallback proof, and exact PCM equality between every SIMD path and scalar fixed-point across the corpus and the differential fuzzer. Bit-exactness is a correctness property and is cheap to verify on host. SIMD stays a hard blocker for chore(mp3): make minimp3 sole backend and remove libhelix #4056.ci/codec_cpu/audit.pymust be green with the SIMD path measured, and the SIMD path must not be slower than scalar fixed-point on any audited configuration.>=1.3x on ESP32-S3 hardwaretarget — needs attached hardware, not an automated test. The host>=1.5x over Helix-scalartarget is measured and recorded; the enforced host gate is "no target slower than scalar fixed-point" plus the existing 5% trend gate.Refs FastLED/license#14.
fix(mp3): saturate mp3d_mulshift's narrow to 32 bits
feat(mp3): fixed-point minimp3 DSP path (#4054) (#4105)
fix(mp3): address code review on the integer SIMD
perf(mp3): integer SIMD for the fixed-point decoder (#4055) (#4107)
zackees commentedon Sep 1, 2026
Delivered in #4107 (merged as
d68e1e50de). Disposition against the acceptance criteria, including what did not land.Done
MINIMP3_NO_SIMDscalar opt-out proven by a dedicated decoder instantiation, which is also the reference the kernels are compared against.Not done, carved out
MP3D_HAVE_INT_SIMDso a third ISA slots in without touching surrounding code, and the bit-exactness gate is architecture-aware, so a PIE path is tested the moment it reports itself.Measured results worth keeping
Closing as delivered with the two carve-outs above tracked separately. The bar set on this issue — unit tests and perf tests passing — is met: both mp3 audits and all 32 checks green on the merge.
Refs FastLED/license#14
chore(mp3): make minimp3 the sole backend and delete libhelix (#4056) (…
perf(mp3): vectorise the fixed-point IMDCT twiddle loop (#4109) (#4118)