Skip to content

test(mp3): add CPU profiling and codegen ledgers #4053

Closed

Description

@zackees

Context

Phase 2 / G2 of FastLED/license#14. Host timing alone cannot predict embedded decoder performance, so parity requires portable operation counts, host attribution, and target-ISA codegen evidence for both backends.

Proposal

Build a three-tier CPU audit rig: exact arithmetic counts per decoder stage, deterministic host profiling/trends, and cross-compiled inner-loop instruction ledgers for the target MCU families.

Acceptance criteria

  • Capture RED evidence: the focused CPU-gate test fails because no operation/trend/codegen ledgers exist.
  • Instrument Helix and minimp3 multiply/MAC primitives and report exact multiplies/frame and MACs/frame per stage.
  • Add deterministic N=30 host profiling with medians for cycles, instructions, IPC, branch misses, per-function attribution, and per-stage timing.
  • Check in and enforce codec_cpu_trend.json with a ±5% regression gate.
  • Cross-compile the codec translation unit at -Os for Xtensa ESP32, RISC-V ESP32, Cortex-M0+, and Cortex-M4; itemize polyphase/DCT32 inner-loop instruction counts.
  • Record all three tiers for both Helix and minimp3-float.
  • Turn the focused RED signal GREEN, pass broader checks, and merge a PR that closes this issue and links Execution plan: vendor minimp3, optimize to Helix parity, SIMD past Helix, delete libhelix_mp3 (phased, gated) license#14.

Decisions

  • Exact operation counts are the architecture-independent parity metric; host timing is supporting trend evidence.
  • G2 records the expected float-backend deficit rather than weakening the gate.
  • This issue owns G2 and depends on G0; its ledger is a prerequisite for the fixed-point parity claim.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions