Repository navigation
Description
Context
Carve-out from #4056, which deleted the Helix backend and made the fixed-point minimp3 build the production MP3 decoder.
ci/codec_cpu/audit.py still audits minimp3-float, and only that. That is deliberate, not an oversight: codec_cpu_trend.json's host baselines are keyed by the float build's Callgrind symbols and instruction counts, so pointing the driver at the fixed build would invalidate every baseline in the file at the same moment it changed what is being measured. #4055 already demonstrated what a symbol rename alone does to that file. Both the driver (ci/codec_cpu/driver.cpp) and the object it links (ci/codec_memory/minimp3_audit.cpp) now pin MINIMP3_FLOAT_POINT explicitly so the header's new fixed-point default cannot silently swap the measured decoder.
So today the shipping decoder has no CPU trend row.
What is and is not covered right now
- Covered: the fixed build's SIMD kernels are gated on being bit-identical to its own scalar path, and on being no slower than it, by
tests/fl/codec/mp3_fixed_point.hpp(asserting only under__OPTIMIZE__). - Covered: the fixed build's memory and stack footprint, by
codec_memory_ledger.md(minimp3-fixedrows, including the gated compiler-derivedstack-callgraphfigure). - Not covered: per-stage operation counts, cycle/IPC medians, Callgrind function attribution, and cross-target codegen for the fixed build — everything
codec_cpu_trend.jsonrecords.
Proposal
Add minimp3-fixed as a second audited backend rather than replacing minimp3-float, so the float reference build keeps its history and the comparison between the two stays available.
Acceptance criteria
-
ci/codec_cpu/driver.cppcan decode with either variant. The two cannot share a translation unit, so this needs a second namespaced instantiation (MINIMP3_NAMESPACE) or a second driver binary —tests/profile/mp3_memory_audit.cpphas the working pattern for the former. -
BACKENDSbecomes("minimp3-float", "minimp3-fixed");_FUSED_STAGES,_operation_stage, and the codegen kernel needles gain fixed-build entries. - The operation instrumentation counts integer arithmetic. The existing
fmul/faddtaint analysis ininstrument_llvm_irfinds nothing in an integer pipeline, and the deleted HelixMULSHIFT32path is not reusable — the fixed decoder inlines its multiplies rather than routing them through a named helper. - New host baselines for
minimp3-fixedincodec_cpu_trend.json, generated on the CI host, with the SIMD variant pinned (the vector kernels are the point of measuring it). -
ci/tests/test_codec_cpu_audit.pycovers the new backend's instrumentation the way it covers the float one.
Refs #4056, #4055, FastLED/license#14
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(ci): pin the float variant in the codec codegen TU
zackees commentedon Sep 1, 2026
One concrete blocker found while wiring #4056, recorded here because this issue is where it will bite.
fl/stl/stdint.hpublishes globaluint8_t/int8_t,uint16_t/int16_t,uint32_t/int32_t,size_t,uintptr_t,intptr_t,ptrdiff_t— but for the 64-bit pair it emits:u64/i64, notuint64_t/int64_t. That is whyci/codec_cpu/minimp3_codegen.cpphas had to hand-writetypedef fl::u64 uint64_t;since it was created.The fixed-point decoder uses
int64_tthroughout (mp3d_sat64,mp3d_mulshift,mp3d_narrow_q30, the pow43/gain arithmetic), so in a translation unit whose only include path is-I src, the fixed build does not compile:That is real output from
xtensa-esp32-elf-g++on this audit's own TU, from the CI run that caught the missed pin.It is not currently a shipping problem: every real platform build reaches
<stdint.h>transitively through Arduino/IDF/newlib headers, and the fixed decoder compiles and passes everywhere — including natively here in the same-I src-only configuration, where clang does pull it in. It is specifically the Xtensa cross-compile with a bare include path that exposes the gap, which is exactly the configuration this issue's codegen row needs.So whoever picks this up should expect to choose between:
typedef fl::u64 uint64_t; typedef fl::i64 int64_t;tofl/stl/stdint.h— which is the obvious fix but carries the conflicting-typedef risk that file's own header comment documents at length, sincefl::i64's base type has to match the platform's exactly; orminimp3.htofl::i64, which is contained to one file, typedef-identical so codegen does not move, and cannot conflict with a system header.The second is narrower and is probably the right call for this issue's scope.
chore(mp3): make minimp3 the sole backend and delete libhelix (#4056) (…
ci(mp3): measure the CPU audit before gating on it
feat(mp3): seed the fixed-point CPU baselines, allow partial host cov…
fix(mp3): keep codegen gated for uncovered hosts; return a dataclass
docs(mp3): correct what the CPU audit actually measures
fix(mp3): refresh the fixed-point CPU baseline after the IMDCT kernel (…
feat(mp3): audit the fixed-point decoder's CPU alongside the float one (
fix(mp3): count widened Q-format multiplies, and fix the GEP exclusion
fix(mp3): stop clamping dequantised samples to 1.0 (#4127) (#4128)