Repository navigation
Description
Goal
Ship the CI regression gate that locks in the savings from Stages 1+2+3 (and any future stage) by asserting bash bloat esp32s3 flash total stays at or below a recorded baseline.
No code change to FastLED runtime. New deliverables are tooling + CI wiring only. The acceptance criterion in #2886 reads:
Add
tests/test_esp32s3_bloat_regression.shthat assertsbash bloat esp32s3flash total is ≤ 280,000 B. Wire into CI so future PRs flag regressions.
Parent: #2886 — Stage 6 of the multi-stage bloat-reduction plan.
Why this is the next stage to ship
Stages 1+2+3 introduced ~70 KB of projected savings. Stage 0 (#2898) documented every knob in docs/SLIM_ESP32S3.md but marked all numbers 📊 because no measured baseline lives in the tree yet. Stage 6 is the bridge that flips 📊 → ✅ AND prevents the savings from silently regressing as the codebase evolves.
Stages 4 (cold-helper audit) and 5 (basic_string::write simplification) are smaller and harder to PR cleanly without a regression gate already in place — a careless refactor on either path could unwittingly undo Stage 1's collapse. Shipping Stage 6 first means Stage 4/5 PRs are validated against an objective gate.
Threshold strategy — initial gate vs. end goal
The #2886 end goal is ≤ 280,000 B. That assumes ALL six stages are landed; with only 1+2+3 shipped, current flash is projected at ~318-325 KB. Setting the gate at 280,000 B immediately would fail every PR.
Initial gate: ≤ 388,380 B (the pre-Stage-1 baseline). Catches any regression beyond where we started.
Headroom policy: the gate ratchets down as later stages land. Each stage PR that lands measurable savings includes a follow-up commit that lowers the threshold in the regression-gate's pinned-baseline file. The file lives at tests/data/esp32s3_bloat_baseline.txt (single-line integer) so the ratchet is a one-line diff per stage.
End-goal gate: ≤ 280,000 B after Stages 4+5+6 all land (and the regression-gate has flipped its baseline file ≥ 3 times in lockstep).
Deliverable
1. Regression test script
Path: tests/test_esp32s3_bloat_regression.py
Python (not shell — bash bloat is a thin wrapper around ci/bloat.py, so the test should be CLI-launchable on any of CI's Linux/macOS/Windows runners without bash quirks). The script:
def main() -> int:
"""Run `bash bloat esp32s3 --build`; assert flash total <= baseline.
Reads:
- tests/data/esp32s3_bloat_baseline.txt — single integer, in bytes.
Updated in the same PR as each Stage's savings to ratchet down.
Writes:
- .build/symbols/esp32s3/report.json (via the bloat wrapper).
Exits 0 on pass, non-zero on regression (with a per-symbol delta
table printed to stderr to help the PR author diagnose).
"""2. Recorded baseline
Path: tests/data/esp32s3_bloat_baseline.txt
Single-line plain-text integer (388380) representing the pre-Stage-1 NEOPIXEL Blink flash baseline from the #2886 top-25 audit. Each subsequent Stage that lands measurable savings includes a one-line diff lowering this number.
3. CI workflow
Path: .github/workflows/bloat_regression_esp32s3.yml
Mirrors the path filters of .github/workflows/build_esp32s3.yml (any change to src/**, examples/**, ci/**, build descriptors, or pyproject.toml). Invokes:
- run: uv run python tests/test_esp32s3_bloat_regression.pyAfter the existing esp32s3 build step succeeds (so the ELF is already on disk and --build can be skipped in the test invocation when reusing the cached artifact).
4. Doc update — flip 📊 → ✅ where applicable
Once the gate is live and the recorded baseline reflects measured numbers, the table in docs/SLIM_ESP32S3.md flips the relevant rows from 📊 → ✅. This is a follow-up commit that lands after the first successful CI run that records the measurement.
Acceptance
tests/test_esp32s3_bloat_regression.pyexists and runs end-to-end viauv run python tests/test_esp32s3_bloat_regression.py.tests/data/esp32s3_bloat_baseline.txtcontains the integer388380..github/workflows/bloat_regression_esp32s3.ymlexists and is wired to PR + push events on the same path filters asbuild_esp32s3.yml.- On a deliberately-regressed PR (e.g. a sketch that adds
-DFASTLED_LOG_VERBOSITY=1to force a regression), the workflow fails with a clear "flash total X exceeds baseline Y" message. - The roadmap entry in
docs/SLIM_ESP32S3.mdlists Stage 6 as "in progress" → "shipped" once this lands.
Out of scope
- Flipping 📊 → ✅ in
docs/SLIM_ESP32S3.mdfor Stages 1+2+3 — that's a follow-up PR after the first successful CI run records the measurement. - Stage 4 (cold-helper audit) and Stage 5 (
basic_string::writesimplification) — each lands as its own PR with its own baseline ratchet. - Per-symbol delta enforcement (e.g. "no single symbol may grow by > 256 B") — that's a separate, finer-grained gate tracked in a future issue.
Related
- Meta: ESP32-S3 Blink bloat reduction (file:line concrete plan) — supersedes #2885 #2886 — parent meta tracking the multi-stage bloat reduction (Stage 6 of 6 ships the gate).
- perf(log): default FASTLED_LOG_VERBOSITY=0 in release builds (#2886 Stage 1) #2890 / perf(esp32): suppress Arduino-ESP32 boot banner via build-flag shim (#2886 Stage 2) #2894 / docs(esp32): ship tools/sdkconfig_for_smallest_fastled.defaults overlay (#2886 Stage 3) #2896 — Stages 1, 2, 3 (the savings this gate locks in).
- docs(esp32): ship docs/SLIM_ESP32S3.md user-facing reference (#2886 Stage 0) #2898 — Stage 0 (the user-facing doc this gate's first-pass-measurement unblocks).
agents/docs/binary-size-analysis.md— the tool reference the new script invokes viaci/bloat.py.- fbuild FastLED Error #434 — push-button
fbuild bloatmigration; once it lands, the test script can callfbuild bloatdirectly instead of going throughbash bloat.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
ci(esp32): bloat regression gate with ratcheting baseline (FastLED#2886…