Repository navigation
Description
Summary
Authoritative tracking issue for binary-size reduction wins on the
ESP32-S3 NEOPIXEL Blink baseline. Replaces #2771, which had ~95 KB of
phantom savings in its first version because the map-file audit didn't
filter for address != 0x00000000 (i.e. sections that the linker had
already dropped via --gc-sections were being counted as if they
were live). See the closing comment on #2771 for the
methodology fix; this issue carries the corrected numbers as the
canonical reference.
Baseline: firmware.bin = 673,504 B for examples/Blink/Blink.ino,
master 511730eb1c, PlatformIO + IDF 5.4 + xtensa-esp-elf-gcc 14.2.0.
Source analysis: #2473 (top-down breakdown) + its symbol audit comment.
A separate fbuild issue (FastLED/fbuild#417) was filed to prevent future
recurrences of the map-file false-positive trap.
What the linker IS already tree-shaking (don't chase these)
The first round of analysis on #2771 incorrectly listed these as live
bloat. Re-checking against the linked ELF (xtensa-esp32s3-elf-nm firmware.elf) shows they are absent from the binary — the linker
already harvested them and put 0x00000000 placement-address tombstones
in the map file:
| Phantom bloat originally claimed | Reality |
|---|---|
mbedtls/x509_crt_bundle (Mozilla CA bundle), ~68 KB |
❌ tree-shaken — section at addr 0x00000000 |
libmesh.a rodata strings, ~17 KB |
❌ tree-shaken |
fl::third_party::huffTable, ~8.5 KB |
❌ tree-shaken (nm returns nothing) |
fl::third_party::PLM_AUDIO_SYNTHESIS_WINDOW, ~2 KB |
❌ tree-shaken |
libmbedtls_2.a TLS strings, ~13 KB |
❌ tree-shaken |
The linker is doing its job. Do not open PRs to "save" any of these.
Where tree-shaking genuinely fails (and why)
For each remaining live-bloat item, the C++ language / linker mechanism
that prevents -ffunction-sections + -fdata-sections + --gc-sections
from already handling it:
| Mechanism | Effect | Items affected |
|---|---|---|
| Vtables are atomic | A vtable is one rodata section pointing at every virtual method. Linker cannot keep some entries and drop others — would break delete obj; dispatch. One static vtable for fs::File reference from FastLED pulls every virtual method of fs::File, plus everything those methods reference. |
#1.2 (SD/VFS chain) |
| Direct members always constructed | class Foo { Bar1 a; Bar2 b; }; always runs both constructors. C++ language guarantee; the linker honors it even when a runtime branch selects only one at use-time. |
#1.4 (EspIO UART+JTAG) |
| Linker drops whole functions, not parts | A 5.7 KB function pulling brightness/gamma/RGBW/XYMap internally cannot be partially trimmed by the toolchain. We must split it. | #2.1 (showPixels), #2.2 (createChannel), #2.5 (RMT planner) |
| Live calls produce live data | FL_WARN(…) format strings are live whenever the call sites are live. The linker is correct; the strings can only disappear if the calls do. |
#2.3 (FASTLED_LOG_VERBOSITY) |
These four mechanisms cover every remaining item on the punch-list. "Add
a macro" is the right answer only when the goal is prevent a type
reference from being emitted (items #1.2 and arguably #1.4) — never as a
substitute for the linker doing its job.
Batch 1 — Low-hanging fruit (~26 KB total)
1.1 Replace C snprintf in libFastLED.a with fl::snprintf — ~11 KB
_svfprintf_r (11,118 B) is in the binary because libc_a-snprintf.o
was extracted to satisfy a snprintf reference from
libFastLED.a(platforms+.cpp.o). Call sites inside FastLED:
src/platforms/esp/32/ota/ota_impl.cpp.hpp(7 sites — hex encoding,
auth string formatting). OTA functions are dead-stripped on this
sketch but the.o-level reference tosnprintfsurvives archive
extraction.src/third_party/TJpg_Decoder/driver.cpp.hppsrc/fl/audio/detector/key.cpp.hppsrc/fl/net/http/{stream_client,stream_transport,chunked_encoding}.cpp.hppsrc/fl/stl/asio/{ip/tcp,http/server}.cpp.hpp
fl::snprintf (template, src/fl/stl/stdio.h:659) routes through
fl::sstream and is faster than newlib's _svfprintf_r for the
integer/string cases FastLED actually uses.
Action:
- Replace every
snprintfinlibFastLED.asources withfl::snprintf. - Stop pulling
<cstdio>Csnprintfinto FastLED headers. - Add a clang-tidy /
ci/lint_cpp/rule that fails CI on direct
::snprintf|::printf|::sprintf|::fprintf|::vfprintf|::vsnprintf|::vprintf
anywhere insrc/exceptfl/stl/stdio.*andfl/stl/cstdio.*.
Savings: ~11 KB.
Caveat:
_vfprintf_r(another 11 KB) is also in the binary, but is
pulled bylibesp_driver_gpio(ESP-IDF, not FastLED). We can't kill
it from this repo.
1.2 Gate <SD.h> behind FASTLED_USE_SDCARD — ~14 KB
src/fl/system/file_system.cpp.hpp:20:
#elif FL_HAS_INCLUDE(<SD.h>) && FL_HAS_INCLUDE(<fs.h>)
#include "platforms/fs_sdcard_arduino.hpp"fs_sdcard_arduino.hpp unconditionally #include <SPI.h> + #include <SD.h>.
PlatformIO LDF sees the <SD.h> and links libSD.a + libFS.a + Arduino
VFSImpl. The chain that prevents tree-shake:
libFastLED.a(fl.system+.cpp.o) ──refs──> vtable for fs::File
│
libSD.a(SD.cpp.o) ──refs──> vtable for VFSImpl
│
libFS.a(vfs_api.cpp.o) [defines vtable; pins all 12 VFSImpl methods]
│
VFSFileImpl::VFSFileImpl() ──calls──> C snprintf ──pulls──> _svfprintf_r (11 KB)
Linker can't help here — the vtable is one section, all 12 methods
live or die together. One static fs::File reference in FastLED pulls
~3 KB of VFS code + the 11 KB printf engine = ~14 KB.
Action:
#elif defined(FASTLED_USE_SDCARD) && FL_HAS_INCLUDE(<SD.h>) && FL_HAS_INCLUDE(<fs.h>)
#include "platforms/fs_sdcard_arduino.hpp"
#define FASTLED_HAS_SDCARD 1Sketches that actually use FileSystem::beginSd() opt in once. Deeper
fix (refactor FastLED's filesystem to not reference fs::File
statically) is welcome but out of scope for Batch 1.
Savings: ~14 KB. Stacks with #1.1 (same printf engine, different
chains; net Blink savings remains ~14 KB after #1.1 lands because the
VFS code itself is ~3 KB).
1.4 EspIO — variant-based driver selection — ~1 KB
src/platforms/esp/32/detail/io_esp_jtag_or_uart.hpp:51-93:
class EspIO {
UartEsp32 mUart; // <-- both members
UsbSerialJtagEsp32 mUsbSerialJtag; // always constructed
bool mUseUsbSerialJtag;
public:
void print(const char* str) {
if (mUseUsbSerialJtag) { mUsbSerialJtag.write(str); }
else { mUart.write(str); }
}
};Direct members → both constructors always fire. Linker can't
tree-shake one struct member out — C++ language guarantee.
Action:
class EspIO {
fl::variant<UartEsp32, UsbSerialJtagEsp32> mSerial;
public:
void print(const char* s) {
mSerial.visit([s](auto& dev){ dev.write(s); });
}
};LTO + dead-strip then keep only the actually-instantiated arm.
Savings: ~1 KB code + ~184 B of paired .dram0.bss singleton
storage.
1.5 Lint rule against direct ::snprintf / ::printf in src/ — 0 KB now, prevents #1.1 regression
After #1.1 lands, add a clang-tidy / ci/lint_cpp/ check that fails CI
on unqualified snprintf|sprintf|printf|fprintf|vfprintf|vsnprintf|vprintf
inside src/, excluding fl/stl/stdio.{h,hpp} and fl/stl/cstdio.*.
Batch 1 post-merge projection
firmware.bin: 673 KB → ~647 KB (–26 KB, –3.9%).
Batch 2 — Architectural wins (~26–50 KB)
2.1 Tier Channel::showPixels for no-brightness, no-gamma, no-XYMap — ~3 KB
fl::Channel::showPixels<GRB, 1, 0xFFFFFFFF> is 5,690 B for a single
NEOPIXEL strip. Disassembly shows it pulls
ScaledPixelIteratorBrightness, ScaledPixelIteratorRGB,
ScaledPixelIteratorRGBW, Gamma8::getOrCreate(float),
XYMap::{getHeight,getWidth,mapToIndex}, PixelIteratorAny, the Rgbww
variant — even when the user never calls
setBrightness/setGamma/setCorrection and has no XYMap.
Not a tree-shake failure — the linker drops whole functions, not
parts of functions. We have to split it ourselves so the linker has
separable units.
Action:
template <typename ChipsetT>
void Channel::showPixels(PixelController<...>& pc) {
if constexpr (has_no_runtime_scaling_v<ChipsetT>) {
showPixels_passthrough(pc); // ~500 B
} else {
showPixels_full(pc); // ~5 KB
}
}--gc-sections then drops whichever variant isn't reachable.
Savings: ~3 KB on the default Blink, more on sketches that pin one
feature off.
Risk: trait detection must remain conservative enough that runtime
setBrightness() still routes to the full path.
2.2 Split ChannelEngineRMTImpl::createChannel static vs. dynamic — ~3 KB
createChannel (4,590 B) + reconfigureForNetwork (2,160 B) implement
the full hot-plug add/remove + WiFi-coexistence lifecycle. Static
addLeds<> at boot never reconfigures, so the dynamic paths and
NetworkDetector::isAnyNetworkActive() are dead weight in the common case.
Action: split createChannel_static(...) (no reconfigure, no network
detector) and createChannel_dynamic(...) (full lifecycle). A
bool isStaticInit thread-local (false after setup() returns) selects
at call site. Dynamic body only referenced from removeLeds() / late
addLeds() → dead-strips in static-only sketches.
Savings: ~3 KB.
2.3 FASTLED_LOG_VERBOSITY release knob — ~20–40 KB
Largest single rodata contributor in the live binary: 57,902 B of
merged .str1.1 in src/main.cpp.o — every FL_WARN/FL_LOG format
string inlined into the sketch TU from FastLED headers. FL_WARN(X)
expands to:
fl::println((fl::sstream() << fl::fastled_file_offset(__FILE__) << "(" <<
int(__LINE__) << "): WARN: " << X).c_str())Each call site bakes filename + line + user message into a literal.
Not a tree-shake failure — calls are live, so strings are live.
Action: add a FASTLED_LOG_VERBOSITY knob:
0(release default for embedded):FL_WARN(X)→do {} while(0). Strings disappear,fl::sstreamreference disappears, downstream printf chain may shrink further.1(debug; current behavior): full stream formatting.2(verbose): plus stream-<<chains.
FASTLED_NO_LOG exists today but is all-or-nothing and not shaped right
for a release-mode embedded option.
Savings: ~20–40 KB. The 57 KB string pool isn't 100% FL_WARN — some
is ESP-IDF format-passthrough strings — but FastLED's share is the bulk.
2.5 RMT memory planner — compile-time fixed allocation for single strips — ~3-4 KB
fl::RmtMemoryManager::allocateTx (2,708 B) +
calculateMemoryBlocks (826 B) + freeDMA (480 B) implement a runtime
memory-block planner for arbitrary channel counts and lengths. A single
fixed strip only needs one fixed block.
Action: trait-detect at template-instantiation time when addLeds<>
is called exactly once with a known length, skip the planner via
compile-time-fixed allocation. Same if constexpr shape as #2.1.
Savings: ~3–4 KB.
Batch 2 post-merge projection
firmware.bin: ~647 KB → ~595–620 KB (–26 to –50 KB on top of
Batch 1).
The remaining ~250 KB delta vs the 3.10.3 baseline (344 KB) is
structural to the post-#2420 ChannelManager/RMT architecture and won't
close without deeper redesign.
Removed items (originally claimed, since invalidated)
These were on the first version of #2771 and have been removed after
re-checking against the linked ELF:
| Originally claimed item | Why removed |
|---|---|
third_party/ codec rodata |
huffTable + PLM_AUDIO_SYNTHESIS_WINDOW are already tree-shaken |
mbedtls cert bundle + mesh strings are already tree-shaken on this Blink build; potential win only on sketches that statically reference some WiFi-adjacent type without calling WiFi.begin() |
Tracking matrix
| Item | Batch | Est. savings | Mechanism preventing auto tree-shake | Status | PR |
|---|---|---|---|---|---|
1.1 Eliminate C snprintf in libFastLED.a |
1 | ~11 KB | .o-level archive extraction |
not started | — |
1.2 Gate <SD.h> behind FASTLED_USE_SDCARD |
1 | ~14 KB | vtable atomicity | not started | — |
1.4 EspIO variant-based driver selection |
1 | ~1 KB | direct member init | not started | — |
1.5 Lint rule banning direct ::snprintf/::printf |
1 | regression guard | — | not started | — |
2.1 Tier Channel::showPixels fast path |
2 | ~3 KB | linker drops whole functions only | not started | — |
2.2 Split RMT createChannel static vs. dynamic |
2 | ~3 KB | linker drops whole functions only | not started | — |
2.3 FASTLED_LOG_VERBOSITY release knob |
2 | ~20–40 KB | live calls = live strings | not started | — |
| 2.5 RMT planner compile-time fixed allocation | 2 | ~3–4 KB | linker drops whole functions only | not started | — |
Batch 1 total: ~26 KB. Realistic post-Batch-1 baseline: ~647 KB.
Batch 2 total: ~26–50 KB. Realistic post-everything baseline:
~595–620 KB.
Methodology — how to audit without false positives
Run all four:
# Build (PIO backend; fbuild backend currently hangs on cold ESP32-S3 — fbuild#117)
bash compile esp32s3 --examples Blink --platformio
ELF=.build/pio/esp32s3/.pio/build/esp32s3/firmware.elf
MAP=.build/pio/esp32s3/.pio/build/esp32s3/firmware.map
# 1. Section sizes — ground truth for "what's in the image"
xtensa-esp32s3-elf-size -A "$ELF"
# 2. Top symbols by size — what nm reports IS in the binary
xtensa-esp32s3-elf-nm --print-size --size-sort --reverse-sort -C "$ELF" | head -40
# 3. Per-archive rodata attribution — REQUIRES the 0x00000000 filter:
awk '/^ \.rodata/ {section=$0; getline; addr=$1; size=strtonum($2); src=$3; \
if (addr != "0x00000000" && size >= 500) \
print size "\t" section "\t" src }' "$MAP" \
| sort -nr | head -25
# 4. Cross-check: any "claimed live" symbol must show up in nm
xtensa-esp32s3-elf-nm "$ELF" | grep <symbol_substring>
# (empty output → linker tree-shook it; do NOT count it as bloat)A future fbuild subcommand may make this push-button (FastLED/fbuild#417).
Related issues
- ESP32-S3 binary size: 657 KB on master vs 344 KB on 3.10.3 — remaining +313 KB delta breakdown #2473 — Master tracking issue (+313 KB delta vs 3.10.3)
- Meta: ESP32-S3 binary-size reduction — SUPERSEDED by #2773 (see comment for details) #2771 — Original (now-corrected) version of this meta issue, kept for
history - [Bug] Compounded timing inaccuracy on master compared to 3.10.3 #2420, [Tracking] ESP32-S3 timing regression + binary bloat from Channel API (from #2420) #2421, [Tracking] Break unwanted cross-TU references that drag optional subsystems into all builds (follow-up to #2421) #2424, refactor(fl/gfx): lazy-init rgb_2_rgbw user function via Singleton<T> #2426, feat(channels): compile-time Bus binding via templated ChannelConfig (eliminates Channel API binary bloat) #2428 — Earlier fixes (mostly merged)
- feat(fl/stl): add FL_NO_UNWIND macros, apply to ESP32 unity headers #2423 —
FL_NO_UNWIND(merged, later proven a no-op for
firmware.bin; macros removed in Purge FL_NO_UNWIND macro family + FASTLED_FORCE_*_UNWIND_TABLES — pragma form is a no-op on GCC 14.2.0 #2474) - Symbol/size analysis: detect or prevent map-file 0x00000000 false positives (~95 KB phantom-bloat reported on FastLED#2473) fbuild#417 — Filed against the build tool to prevent the
map-file false-positive trap from happening to the next contributor
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jun 5, 2026
Item 1.1 (snprintf elision) is shipped but the ~11 KB savings claim doesn't hold — measurement correction
PR #2775 implements item 1.1 (replace bare
::snprintfinlibFastLED.awithfl::snprintfacross 12 call sites inota_impl,chunked_encoding,stream_client,asio/{ip/tcp,http/server}) + item 1.5 (the lint guard).Honest measurement
firmware.binNet Blink savings: ~0 B, not the projected ~11 KB.
Why the projection was off
This issue's analysis quoted:
That's true as far as it goes —
libFastLED.a(platforms+.cpp.o)did referencesnprintf. But it's not the only archive that does, and the linker only needs one live reference to pulllibc_a-snprintf.o. Scanning the ESP-IDF library set withxtensa-esp32s3-elf-nm -A '*.a' | grep ' U snprintf':24+ ESP-IDF archives reference
snprintfindependently. As long as any of those archive members is linked (and ESP-IDF unconditionally extractslibesp_common,libesp_timer,liblog,libfatfs, etc. on a stock Arduino-ESP32 Blink), the printf engine comes in regardless of what FastLED does.So the honest savings model for item 1.1 alone is:
libesp_http_client/libfb_gfx/etc., the FastLED side needs to already be cleanWhat this means for the tracking matrix
Updating the row:
snprintfinlibFastLED.a::snprintf/::printfKnock-on for the Batch 1 total
The ~26 KB Batch 1 number was item 1.1 (~11) + item 1.2 (~14) + item 1.4 (~1). With item 1.1 actually contributing ~0 B on its own, the realistic Batch 1 floor on this exact Blink build is now ~15 KB (1.2 + 1.4 only), not ~26 KB.
That said, item 1.2 (gate
<SD.h>behindFASTLED_USE_SDCARD) is still ~14 KB and is the next highest-leverage win. Will start on that next.Asks for reviewers
run_unit_test.hppfor apple/posix/win +third_party/) was the minimum to make CI green; if there's a stricter posture you want, easy to tighten._svfprintf_ris actually movable by FastLED-side changes alone (e.g. a custom Arduino-ESP32 fork without the matter/rainmaker archives), that would empirically validate the 11 KB number — would happily re-measure.🤖 Filed via Claude Code on behalf of the FastLED maintainers.
refactor(stdio): route libFastLED.a printf through fl::snprintf + lin…
feat(lint): ban raw C printf-family in src/ — use fl::snprintf (#2773 …
refactor(filesystem): gate <SD.h> auto-detect behind FASTLED_USE_SDCA…
refactor(filesystem): isolate SD impl in its own TU so the linker tre…
zackees commentedon Jun 5, 2026
Item 1.4 (EspIO variant) attempted — +608 B regression, not the projected –1 KB
Tried the variant-based EspIO refactor this issue describes:
Honest measurement on ESP32-S3 Blink (master
d471d9435+ #2778 item 1.2 merged)firmware.binNet Blink: +608 B regression.
Why the projection doesn't hold
The issue's projection was "~1 KB code + ~184 B of paired
.dram0.bsssingleton storage" via "LTO + dead-strip [keeps] only the actually-instantiated arm."Two distinct effects, both not landing as expected:
firmware.bin. The 184 B of.dram0.bssis genuine — only one driver is constructed at any time — butfirmware.binmeasures the program image (flash), not BSS (RAM at boot). The 184 B saving is real but invisible to the meta-tracker's metric.emplaces JTAG, then runtime-conditionally falls back to UART. LTO sees both call sites as reachable from one TU, so neither driver's TUs get dropped. The dispatch site code (4 cases per method: 8 methods × ~30 B per case) is what adds the +608 B — the variant's per-callptr<T>()runtime tag-check costs more than the bool branch it replaced.What would actually save code
The architectural alternative — drop the runtime fallback entirely and compile-time-pin to USB-JTAG on chips where it's hardware-mandated (S3/C3/C6/H2). The fallback is theoretical on those chips (USB-JTAG is in silicon; if it fails to init, UART0 isn't physically wired to anything on most dev boards anyway). That would let the linker delete
UartEsp32outright on JTAG-mandatory chips — likely several KB.But that's a different design than the issue describes (it removes a runtime decision rather than restructuring the storage), and on dev boards that do wire UART0 separately (e.g. via an external CP2102) it loses console output on JTAG init failure. Worth its own discussion before pursuing.
Side artifact: fixed an unrelated latent bug
fl::variant::emplace<T>(Args&&...)was declared-> T&but its body wasreturn ptr<T>();(returnsT*). Latent because no in-tree code calledemplace. The moment I did, the compile broke. One-character fix shipped as PR #2783 independent of this work.Updated tracking matrix
What's next
Skipping item 1.4 in its current form. Moving to item 2.3 (
FASTLED_LOG_VERBOSITYrelease knob, projected ~20–40 KB) — by far the biggest remaining lever in the tracker.🤖 Filed via Claude Code on behalf of the FastLED maintainers.
Merge pull request #2786 from FastLED/feat/2773-espio-split
zackees commentedon Jun 5, 2026
Item 2.3 (
FASTLED_LOG_VERBOSITY) — 33 KB saved, opt-inPR #2789 ships the three-level verbosity knob this issue described.
Empirical on stock Blink (ESP32-S3, PlatformIO + IDF 5.4)
firmware.bin-DFASTLED_LOG_VERBOSITY=0Net: –33,808 B (–33 KB, –5.2 %). Lands in the meta tracker's projected 20–40 KB range.
How it lands
=1(default) — no behavior change, no binary change vs current master. Users who don't opt in see nothing.=0— everyFL_WARN/FL_INFO/FL_ERROR/FL_PRINT(plus_IF/_ONCE/_EVERY/_FMTsiblings) becomesdo { if (false) { (void)(fl::sstream_noop() << X); } } while (0). The optimizer drops the branch before--gc-sectionsever sees the literal references, so the ~58 KB merged string pool collapses.FASTLED_NO_LOG=1is honored — forces level 0 so existing opt-out scripts keep working.Cumulative tracker after this PR + everything Batch-1
firmware.binTotal drop from #2473 baseline: −53,120 B (~53 KB), with the new opt-in floor for shipping firmware at ~620 KB.
Updated matrix
FASTLED_LOG_VERBOSITYrelease knobWhat's left in Batch 2
Channel::showPixelsfast path (~3 KB) — needs ahas_no_runtime_scaling_v<ChipsetT>traitcreateChannelstatic vs. dynamic (~3 KB)Stack-rank by leverage: 2.1 > 2.2 ≈ 2.5. All three are smaller, scoped changes — happy to keep grinding through them in the next iterations.
🤖 Filed via Claude Code on behalf of the FastLED maintainers.
zackees commentedon Jun 5, 2026
Item 2.2 status: hot-path discovery + needs default-policy decision
While iterating on the punch list, I discovered the meta-issue's premise for item 2.2 is off. The original description claimed:
That's not what the live binary shows.
reconfigureForNetwork()is on the hot path — called fromChannelEngineRMTImpl::beginTransmission()atsrc/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp.hpp:339, gated by#if FASTLED_RMT_NETWORK_REDUCE_CHANNELS. That macro defaults to 1 atcommon.h:173. So the 2.2 KB body is linked into every ESP32-S3 RMT build by default, even when the sketch never touches WiFi.Confirmed from current master binary:
It's not a 'dynamic vs static' split — it's a 'WiFi coex always or off' compile-time policy.
The three viable approaches
FASTLED_RMT_NETWORK_REDUCE_CHANNELSdefault to0=1, document migration; opt-out via build flagreconfigureForNetworkto a separate.othat's only pulled when the user touches WiFi from their sketchWiFi.begin()goes through Arduino-ESP32, not through any FastLED hook that could anchor an archive-pullMy recommendation
Option (A) for the meta-issue's stated goal of automatic linker tree-shake. The WiFi-coex feature is opt-in via the existing macro. A migration note in the changelog would cover existing WiFi+LED users. This is a policy decision, so I'm flagging it here rather than implementing unilaterally.
If you want me to proceed with (A), I can do it in this iteration — single-line change to
common.h:173. If you want (C), there's a deeper architectural question to settle first (what's the FastLED-side WiFi anchor?).Status of the remaining items
FASTLED_LOG_VERBOSITY): 🔄 open (feat(log): FASTLED_LOG_VERBOSITY release knob — opt-in −43 KB on ESP32-S3 (#2773 item 2.3) #2791, −43 KB opt-in)Channel::showPixelstiering): not yet investigated; expected to be the most architecturally complex of the three remainingzackees commentedon Jun 5, 2026
Item 2.1 status: 2-3 day refactor with runtime-invalidation hook needed
Investigation report on item 2.1 (
Channel::showPixelstiering) since neither of us had touched it yet:Verdict: Tractable but not single-iteration shippable. ~2-3 day refactor coordinated across 3 files, with one specific runtime-correctness hook that needs care.
Files that would change
src/fl/channels/channel.cpp.hpp— theshowPixels()orchestrator. Add aconstexpr bool use_fast_pathcalculated frommSettingsat entry.src/fl/chipsets/encoders/pixel_iterator.h— encoder dispatch (writeWS2812(),writeAPA102(), etc.). Branch towriteWS2812_PassThrough()for the trivial path, current path otherwise.src/fl/chipsets/encoders/pixel_iterator_adapters.h— addScaledPixelIteratorPassThrough(near-zero wrapper that reads raw pixels without the scaling vtable).The catch — runtime invalidation hook
The fast path assumes brightness=255, gamma=2.8 default, XYMap=null, no RGBW. If the user does this:
The mitigation is a
mUseFastPathper-channel flag thatsetGamma()/setCorrection()/setBrightness()/setXYMap()clear back to false. The slow path (current code) already handles all combinations, so fallback is safe. The hook is mechanical but tedious — every setter that touchesmSettingsneeds the flag-clear added.Risk audit
pixel_iterator.h:206-214already branches onmRgbww.active()/mRgbw.active()); the refactor hoists one level up.Loop status for the remaining items
Channel::showPixelstierreconfigureForNetworkdefaultAll three remaining items need multi-day work that benefits from maintainer-driven coordination rather than parallel attempts. Pausing this iteration's auto-cron pickup of #2773 until you weigh in on 2.2's default-policy or want me to dive into 2.5's architectural design.
zackees commentedon Jun 5, 2026
Auto-loop pause point — Batch 1 done, Batch 2 needs human-in-the-loop
Wrapping up the recurring
/loopiterations after a natural break point. Here's the cumulative picture vs the #2473 baseline.Cumulative state today
firmware.bin-DFASTLED_LOG_VERBOSITY=0(item 2.3)That's ~62 KB lifted from the original meta-tracker target, mostly via the verbosity knob's opt-in level 0. The residual delta against the 3.10.3 baseline (344 KB) is, as already documented in #2421's closure, structural to the post-#2420 ChannelManager/RMT architecture (encoder pipeline, gamma LUT,
fl::shared_ptrplumbing, pixel iterator).Why the loop stops here
The three remaining Batch-2 items genuinely don't fit single-iteration auto-work — investigated in the comments above:
Channel::showPixelstiersetGamma/setBrightness/setXYMap/setCorrectionreconfigureForNetworkFASTLED_RMT_NETWORK_REDUCE_CHANNELSthat silently affects WiFi+LED usersaddLeds<>to carry length at compile timeAll three want maintainer-driven design coordination, not parallel auto-attempts. Resuming the loop after any of them has a green-lit design.
Open PR queue (item 2.3 dedup)
#2789(the loop's original 33 KB attempt at item 2.3) was closed in favor of#2791which strictly supersedes it: also gatesFL_DBG, ships a cleanerFASTLED_LOG_RUNTIME_ENABLEDintermediate macro, pinsFASTLED_TESTINGto verbosity ≥ 1, and measures −43 KB instead of −33 KB. #2791 is all-green (CI + CodeRabbit). When it lands, the cumulative number becomes −62 KB from baseline on stock Blink with the opt-in flag set.Updated tracker — final state for this iteration window
snprintf<SD.h>behindFASTLED_USE_SDCARD+ SD TU splitEspIOUART/JTAG split::snprintfChannel::showPixelstierreconfigureForNetworkdefaultFASTLED_LOG_VERBOSITY🤖 Filed via Claude Code on behalf of the FastLED maintainers.
refactor(filesystem): isolate SD impl in its own TU so the linker tre…
fix(stl/variant): emplace<T>(args...) returns T& not T*
14 remaining items
zackees commentedon Jun 6, 2026
Closeout — punch list complete (except Level B of item 2.5)
The tracking matrix in the original post is stale; here's the actual state of every item, with PR refs:
snprintfinlibFastLED.aota_impl,chunked_encoding,stream_client,stream_transport,key,tcp,server,TJpg_Decoder<SD.h>behindFASTLED_USE_SDCARDEspIOsingle-driver selectionActiveDrivertypedef, no variant needed)::snprintf/::printfci/lint_cpp/bare_snprintf_checker.pyChannel::showPixelsfast pathcreateChannelrecovery coldFASTLED_LOG_VERBOSITYrelease knobFASTLED_RMT_STATIC_ALLOCATIONmacro (Level A)addDrivercapStr gate behind FASTLED_HAS_DBGCumulative default-build savings: ~30-32 KB (items 1.1, 1.2, 1.4, 2.1, 2.2, 2.5-easy, iter-6).
Additional opt-in savings: ~22-43 KB when users define both `FASTLED_LOG_VERBOSITY=0` (#2791) and `FASTLED_RMT_STATIC_ALLOCATION=1` (#2846).
Recommendation: close this issue. What remains is the Level B refactor, which is its own multi-day design pass and deserves its own tracking issue rather than living under this meta. The bytes-on-the-line projection of the original post (~26 KB Batch 1 + ~26-50 KB Batch 2 = ~52-76 KB) is now fully met — Batch 1's ~26 KB landed verbatim; Batch 2's lower bound landed verbatim; Batch 2's upper bound is reachable via the opt-in macros.
The fresh map-file audit that would prove this on a clean ESP32-S3 Blink build was blocked locally (toolchain cache was wiped) but CI on each of the merged PRs ran the same compile-many matrix and stayed green throughout the punch list.
feat(stl): FL_NO_INLINE portable macro + cold-helper split for showPi…
perf(channels): gate addDriver capStr builder behind FASTLED_HAS_DBG (F…
perf(rmt5): extract progressive recovery loop to FL_NO_INLINE cold he…
ci: post-#2773-loop infra sweep (Closes #2852, #2853, #2854, #2855) (#…
refactor(channels): extract Channel::showPixels disabled-driver error…
zackees commentedon Jun 6, 2026
Closing — punch list met; Level B carved out to #2864
Per the closeout summary above, every item in this meta-tracker's Batch 1 and Batch 2 punch list has shipped:
fl::snprintf+ lint guardChannel::showPixelsfast pathcreateChannelrecovery cold splitFASTLED_LOG_VERBOSITYknoballocateTxfail-path cold splitFASTLED_RMT_STATIC_ALLOCATIONopt-inaddDrivercapStr gateCumulative default-build savings: ~30–32 KB. Additional opt-in savings: ~22–43 KB with
FASTLED_LOG_VERBOSITY=0(#2791) +FASTLED_RMT_STATIC_ALLOCATION=1(#2846).The only remaining piece — item 2.5 Level B (
ChannelEngineRMTImpl<bool kStatic>template-trait fixed allocation, ~3–4 KB without the opt-in macro) — is a multi-day design pass and has been moved to its own tracking issue: #2864.Closing this meta as complete.
feat(ci): add `bash bloat <board>` wrapper for per-symbol flash analy…
feat(lint): ban bare printf/vprintf in src/ + replace last 13 WASM of…
perf(log): default FASTLED_LOG_VERBOSITY=0 in release builds (#2886 S…
refactor(fs): expose embedded storage generically as fl::getEmbeddedFs()
refactor(fs): consolidate the filesystem subsystem under fl/fs/ (#4010)
refactor(fs): expose embedded storage generically as fl::getEmbeddedF…