Skip to content

docs(esp32): close out #2886 Stages 4 + 5 — audited / no action - #2902

Merged
zackees merged 1 commit into
masterfrom
feat/2901-close-stage45-audit
Jun 7, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/2901-close-stage45-audit

Conversation

@zackees

@zackees zackees commented Jun 7, 2026 •

Copy link
Copy Markdown
Member

docs(esp32): close out #2886 Stages 4 + 5 — audited / no action

Closes #2901.

Updates the Roadmap section of docs/SLIM_ESP32S3.md to reflect what
re-auditing Stages 4 and 5 against the post-Stage-1 tree actually
found: nothing further to recover.

The #2886 Stage 4 + Stage 5 byte projections (~3-5 KB and ~0.5-1 KB
respectively) were authored before Stage 1 (#2890) flipped
FASTLED_LOG_VERBOSITY to default 0 on release builds. That single
change collapsed the FL_WARN / FL_LOG_RMT string pools that
dominated the pre-Stage-1 byte attribution for each named target. The
residual code bytes in every audit target are essential:

  • Stage 4 — Channel::showPixels — the has_no_runtime_scaling_v<>
    trait the issue named does not exist in the codebase. Actual
    dispatch is a 3-way runtime branch against compact 5-line encoders
    in src/fl/chipsets/encoders/ws2812.h:35-96 — too small to gate.
  • Stage 4 — ChannelEngineRMTImpl::reconfigureForNetwork — 8 of
    10 diagnostics are FL_DBG (already gated by FASTLED_HAS_DBG); the
    remaining 2 FL_WARNs are no-op'd by Stage 1. Residual bytes are
    essential peripheral teardown.
  • Stage 4 — ChannelManager::addDriver — capStr block at
    src/fl/channels/manager.cpp.hpp:117-132 is already wrapped in
    #if FASTLED_HAS_DBG. Verification only; no fix needed.
  • Stage 4 — RmtMemoryManager::handleAllocateTxFailure — already
    a FL_NO_INLINE cold helper at src/platforms/.../rmt_memory_manager.cpp.hpp:417.
    Diagnostics no-op'd by Stage 1; the size_t precomputations are
    DCE'd by the optimizer once the FL_WARN expansions are empty.
  • Stage 5 — fl::basic_string::write — body at
    src/fl/stl/basic_string.cpp.hpp:193-283 is the COW + inline-vs-heap
    storage state machine. No formatted-stream machinery to drop.

The doc now also points readers at #2856 (Batch 3 structural
meta) as the next round of real multi-KB savings, since the
knob/audit work of #2886 is now genuinely complete. The Stage 6
regression-gate baseline at tests/data/esp32s3_bloat_baseline.txt
will only ratchet down further if a #2856 item lands measurable
savings; the projections from Stages 4 + 5 are removed from the
roadmap so users don't wait for phantom savings.

Files

Verification

Refs #2886, #2901.

Summary by CodeRabbit

  • Documentation
    • Updated ESP32-S3 roadmap section with current stage status, reflecting which stages are shipped versus audited.
    • Added reference to structural optimization initiatives in related documentation links.

Closes #2901.

Updates the Roadmap section of `docs/SLIM_ESP32S3.md` to reflect what
re-auditing Stages 4 and 5 against the post-Stage-1 tree actually
found: nothing further to recover.

The #2886 Stage 4 + Stage 5 byte projections (~3-5 KB and ~0.5-1 KB
respectively) were authored before Stage 1 (#2890) flipped
`FASTLED_LOG_VERBOSITY` to default 0 on release builds. That single
change collapsed the FL_WARN / FL_LOG_RMT string pools that
dominated the pre-Stage-1 byte attribution for each named target. The
residual code bytes in every audit target are essential:

- **Stage 4 — `Channel::showPixels`** — the `has_no_runtime_scaling_v<>`
  trait the issue named does not exist in the codebase. Actual
  dispatch is a 3-way runtime branch against compact 5-line encoders
  in `src/fl/chipsets/encoders/ws2812.h:35-96` — too small to gate.
- **Stage 4 — `ChannelEngineRMTImpl::reconfigureForNetwork`** — 8 of
  10 diagnostics are FL_DBG (already gated by `FASTLED_HAS_DBG`); the
  remaining 2 FL_WARNs are no-op'd by Stage 1. Residual bytes are
  essential peripheral teardown.
- **Stage 4 — `ChannelManager::addDriver`** — `capStr` block at
  `src/fl/channels/manager.cpp.hpp:117-132` is already wrapped in
  `#if FASTLED_HAS_DBG`. Verification only; no fix needed.
- **Stage 4 — `RmtMemoryManager::handleAllocateTxFailure`** — already
  a `FL_NO_INLINE` cold helper at `src/platforms/.../rmt_memory_manager.cpp.hpp:417`.
  Diagnostics no-op'd by Stage 1; the size_t precomputations are
  DCE'd by the optimizer once the FL_WARN expansions are empty.
- **Stage 5 — `fl::basic_string::write`** — body at
  `src/fl/stl/basic_string.cpp.hpp:193-283` is the COW + inline-vs-heap
  storage state machine. No formatted-stream machinery to drop.

The doc now also points readers at **#2856** (Batch 3 structural
meta) as the next round of *real* multi-KB savings, since the
knob/audit work of #2886 is now genuinely complete. The Stage 6
regression-gate baseline at `tests/data/esp32s3_bloat_baseline.txt`
will only ratchet down further if a #2856 item lands measurable
savings; the projections from Stages 4 + 5 are removed from the
roadmap so users don't wait for phantom savings.

## Files

- `docs/SLIM_ESP32S3.md` — Roadmap section rewritten: every Stage's
  status reflected, Stages 4 + 5 marked audited / no action with
  file:line citations, pointer added to #2856 for the next round of
  structural savings.

## Verification

- `bash lint --cpp` → C++ linting passes (this PR is docs-only).
- File:line citations verified against post-#2900 master.

Refs #2886, #2901.
@zackees
zackees merged commit 824cb5c into master Jun 7, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e9c418eb-0e43-44a5-a650-3e739ae935ad

📥 Commits

Reviewing files that changed from the base of the PR and between 9d28145 and db1dc74.

📒 Files selected for processing (1)
  • docs/SLIM_ESP32S3.md

📝 Walkthrough

Walkthrough

Documentation update to docs/SLIM_ESP32S3.md reflecting the current ESP32-S3 binary optimization status: Stages 4–5 are now marked as audited/no-action (their projected byte savings were already achieved by Stage 1), Stage 6 remains the CI gate, and a link to FastLED #2856 (next structural savings batch) is added.

Changes

ESP32-S3 Roadmap Documentation

Layer / File(s) Summary
Roadmap status and related links
docs/SLIM_ESP32S3.md
Roadmap section updated to reflect multi-stage status: Stages 4–5 marked as audited/no-action with findings, Stage 6 shipped with CI gate behavior. New "Next round of structural savings" subsection references FastLED #2856 with enumerated items. FastLED #2856 added to Related section.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

  • #2886 — PR updates docs/SLIM_ESP32S3.md to reflect the multi-stage bloat-reduction plan and document that Stages 4–5 are audited/no-action as part of the parent meta-issue closure tracking.
  • #2856 — PR adds a direct reference to this issue in both the "Next round of structural savings" subsection and the Related links, indicating dependency on that batch for future structural savings.
  • #2897 — PR updates the same user-facing roadmap document (SLIM_ESP32S3.md) that was introduced in the Stage-0 doc milestone.
  • #2899 — PR updates the roadmap section of SLIM_ESP32S3.md to reflect status changes related to the Stage-6 CI regression gate work.

Poem

🐰 A roadmap made honest, no longer a jest,
Stages four, five—we've given our best!
Audited, settled, the bytes firmly squared,
Now onward to batch three, with futures prepared. ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2901-close-stage45-audit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 7, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 7, 2026
zackees added a commit that referenced this pull request Jun 7, 2026
… ✅ measured (#2904)

Closes #2903.

Lands the two follow-ups proposed in the 2026-06-06 audit comment on
the parent meta (see
#2886 (comment)).

## What changes

1. **`tests/data/esp32s3_bloat_baseline.txt`** — `388380` → `350568`.

   The previous baseline was the pre-Stage-1 number; with that pin,
   any PR that regressed anywhere between today's measured 350,568 B
   and 388,380 B silently passed the Stage 6 gate. Tightening to the
   measured post-Stage-1 number reclaims that ~38 KB of headroom and
   makes the gate enforce the actual current budget.

2. **`docs/SLIM_ESP32S3.md`** — flip row 1 of the priority table from
   📊 to ✅ with the measured delta inline, add a new "Current
   (Stage 1 only, no opt-in flags)" row to the baseline table, and
   update the per-knob caveat under the table so users know exactly
   which rows are measured vs. still projected.

## What stays 📊

- **Row 2** (`tools/sdkconfig_for_smallest_fastled.defaults`)
- **Row 3** (`-DFASTLED_RMT_STATIC_ALLOCATION=1`)
- **Row 4** (`-DFASTLED_SUPPRESS_ARDUINO_CHIP_DEBUG_REPORT=1`)
- **Row 5** (`CONFIG_BT_ENABLED=n`)

These require their respective build flag / overlay to be exercised in
a measured build before they can flip — that's a separate follow-up.

## Measurement provenance

- ELF: `master @ 824cb5c` (the merge-commit of PR #2902, "Stages 4
  + 5 close-out").
- Build mode: PIO release default (`NDEBUG` defined, so Stage 1's
  `FASTLED_LOG_VERBOSITY=0` default fires per #2890). No Stage 2 or 3
  flag set; no Stage 3 overlay applied.
- Toolchain: `xtensa-esp32s3-elf-nm` from
  `~/.platformio/packages/toolchain-xtensa-esp-elf/bin/`.
- Result: `total_flash = 350,568 B` (4,530 sized flash symbols).
- Artifacts: `.build/symbols/esp32s3/report.json` + `report.md` on the
  measuring host.

## Why this PR is safe

The Stage 6 gate at `.github/workflows/bloat_regression_esp32s3.yml`
will run on this PR with the NEW (`350568`) baseline. The build it
measures is essentially `824cb5c0e3 + this PR's docs/data-only diff`,
which has the same `total_flash` as `824cb5c0e3` because nothing in
this PR touches `src/`. Expected gate result: PASS with
`headroom = 0 B`.

If a future PR regresses past 350,568 B, the gate fails fast and the
PR author either lands a saving in the same change or explicitly
raises the baseline file in the same PR with justification.

Refs #2886, #2903, #2898, #2900, #2902.
@zackees
zackees deleted the feat/2901-close-stage45-audit branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

1 participant