Skip to content

Stages 4 + 5: close-out audit (no action — already addressed by Stage 1) (#2886) #2901

Closed

Description

@zackees

Goal

Close out Stage 4 (cold-helper audit) and Stage 5 (fl::basic_string::write simplification) from #2886 by updating the user-facing roadmap to document the audit findings against the current (post-Stage-1) tree. No source change. The audit was the deliverable; the only artifact is a roadmap update with file:line citations.

Parent: #2886 — Stages 4 + 5 of the multi-stage bloat-reduction plan.

Why these are "no-action — already addressed"

Stage 4 and Stage 5 were authored before Stage 1 (#2890) flipped the FASTLED_LOG_VERBOSITY default to 0 on release builds. The pre-Stage-1 byte attribution for each target was dominated by FL_WARN / FL_LOG_RMT string pools, which Stage 1 already collapses. Re-auditing each target against the post-Stage-1 tree shows the residual code bytes are essential (storage state machines, peripheral teardown, IDF API plumbing) — nothing further to squeeze without changing semantics.

Stage 4, target #1 — Channel::showPixels trait detection

Verdict: no action. The has_no_runtime_scaling_v<> template trait the #2886 description mentioned does not exist in the codebase. The actual dispatch in pixel_iterator.h:206-215 is a three-way runtime branch on mRgbww.active() / mRgbw.active() against compact 5-line encoders (encodeWS2812_RGB/_RGBW/_RGBWW in ws2812.h:35-96). The encoder bodies are too small for a build-flag-gated removal to be worth the user-facing complexity.

Stage 4, target #2 — ChannelEngineRMTImpl::reconfigureForNetwork

Verdict: no action. Body at channel_driver_rmt.cpp.hpp:1128-1236 is the channel destroy / recreate sequence around an Network state transition. Of 10 diagnostic emissions, 8 are FL_DBG (already gated by FASTLED_HAS_DBG) and 2 are FL_WARN (no-op'd by Stage 1 in release builds). The remaining bytes are the destroy / encoder-delete / channel-recreate / DMA-free loop — essential peripheral teardown that cannot be eliminated.

Stage 4, target #3 — ChannelManager::addDriver capStr builder

Verdict: already correct in master. The entire capStr builder block at manager.cpp.hpp:117-132 (Capabilities query + fl::string capStr allocation + branches + FL_DBG emission) is wrapped in #if FASTLED_HAS_DBG. No fix needed; the audit was a verification.

Stage 4, target #4 — RmtMemoryManager::handleAllocateTxFailure

Verdict: no action. At rmt_memory_manager.cpp.hpp:417-478, the function is already a FL_NO_INLINE cold helper (#2840). Post-Stage-1: the 5 FL_LOG_RMT and 10 FL_WARN sites are no-op'd by FASTLED_LOG_VERBOSITY=0, and the size_t computations at lines 451-454 that fed those FL_WARNs are DCE'd by the optimizer because they're only used inside the now-empty FL_WARN expansion. Residual: the tryAllocateWords fallback path + the mLedger.allocations.push_back call — essential fallback logic.

Stage 5 — fl::basic_string::write simplification

Verdict: no action. Body at basic_string.cpp.hpp:193-283 is the COW + inline-vs-heap storage state machine: four branches (non-owning, unique-heap, COW-heap, inline + inline→heap transition). Each branch contains memcpy + make_shared + '\0' terminator. There is no formatted-stream machinery in the body. The projected ~0.5-1 KB from #2886 likely overestimates — the body does what it has to do for FastLED's COW string semantics.

Deliverable

One file edit: docs/SLIM_ESP32S3.md — update the Roadmap section to mark Stage 4 and Stage 5 as audited / no action with the specific file:line citations above. No other change.

Why this matters even without a code change

The current roadmap section in docs/SLIM_ESP32S3.md lists Stages 4 + 5 as "in progress with projected savings ~3-5 KB / ~0.5-1 KB". A user reading the doc would expect those savings to land. The honest update is that the savings won't materialize — post-Stage-1, the relevant byte budgets are already squeezed. The roadmap should reflect that so users don't wait for phantom savings before deciding their current FastLED build is already at its smallest reasonable size.

Acceptance

  1. docs/SLIM_ESP32S3.md Roadmap section updates Stages 4 + 5 to "audited / no action" with the file:line citations from this issue.
  2. Stage 6 (the CI gate) remains the only Stage that can still ratchet the baseline — and even then, only if a future structural refactor (Batch 4 / Meta: ESP32-S3 binary-size reduction — Batch 3 (successor to #2773) #2856 successor) lands real savings.
  3. The doc still cites Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 as the parent meta with the original projections preserved for context (a footnote / sidebar).

Out of scope

Related

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Jun 7, 2026
    824cb5c
  2. moved this from Triage to Done in FastLED Trackeron Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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