Skip to content

test(mp3): add memory audit and regression ledger #4052

Closed

Description

@zackees

Context

Phase 1 / G1 of FastLED/license#14. It starts after the Phase 0 dual-backend scaffold is merged and establishes apples-to-apples memory evidence for Helix and minimp3-float before optimization.

Proposal

Add host-native heap, stack, and static/flash instrumentation for both MP3 backends. Check in a machine-readable memory ledger and make regressions fail closed.

Acceptance criteria

  • Capture RED evidence: the focused memory-gate test fails because no codec ledger/instrumentation exists.
  • Route codec allocations through accounting hooks reporting current bytes, peak bytes, allocation count, and decoder-state/scratch/stream-buffer tags.
  • Cross-check Linux heap results with heaptrack or Valgrind Massif.
  • Enforce -fstack-usage and -Wframe-larger-than= on codec translation units; add decode-call watermarking and a static .su + call-graph depth estimate.
  • Enforce no more than 2 KiB stack per decode call.
  • Measure codec object/static-table footprint with nm --size-sort / size, itemized per table and stage.
  • Check in a machine-parsed codec_memory_ledger.md covering Helix and minimp3-float and fail CI for regressions over 2% unless the ledger is deliberately updated.
  • Demonstrate working RAM at or below 24 KiB and flash tables at or below Helix +20%, or keep the gate red.
  • 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

  • Both backends use the identical rig so parity claims are comparable.
  • The 24 KiB working-RAM and 2 KiB stack limits are blocking budgets; the 20 KiB RAM goal is a stretch target.
  • This issue owns G1 only and depends on the Phase 0 child issue.

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