Skip to content

test: accept TM1812 encoder flash cost - #3945

Merged
zackees merged 1 commit into
masterfrom
fix/3944-esp32s3-bloat-baseline
Aug 20, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/3944-esp32s3-bloat-baseline

Conversation

@zackees

@zackees zackees commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • record the intentional 283 B ESP32-S3 Blink flash cost introduced by TM1812 RGBCCT runtime encoder support in feat(tm1812): add RGBCCT frame encoder #3911
  • restore the dedicated bloat-regression gate without disabling or weakening it
  • keep the ceiling pinned to the first measured feature revision: 341,051 B

Evidence

Validation

A controlled invocation of the existing gate logic verified:

  • read_baseline() == 341051
  • 341,048 B passes with 3 B headroom
  • 341,052 B fails by 1 B
  • git diff --check passes

The local PlatformIO bloat rebuild was attempted but timed out before compiler startup; no local build result is claimed. Consecutive GitHub Actions runs above provide the authoritative same-workflow evidence.

Closes #3944

Summary by CodeRabbit

  • Tests
    • Updated the ESP32-S3 size baseline to reflect the latest measured output.

@zackees
zackees merged commit 31167ea into master Aug 20, 2026
5 checks passed
@zackees
zackees deleted the fix/3944-esp32s3-bloat-baseline branch August 20, 2026 20:53
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Aug 20, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Aug 20, 2026
@coderabbitai

coderabbitai Bot commented Aug 20, 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 Plus

Run ID: 54954084-051f-4cb7-b278-9a189d3fdd34

📥 Commits

Reviewing files that changed from the base of the PR and between ad40fd2 and ac87681.

📒 Files selected for processing (1)
  • tests/data/esp32s3_bloat_baseline.txt

📝 Walkthrough

Walkthrough

The PR updates the recorded ESP32-S3 bloat baseline from 340774 to 341051.

Changes

ESP32-S3 bloat baseline

Layer / File(s) Summary
Update ESP32-S3 baseline
tests/data/esp32s3_bloat_baseline.txt
The pinned baseline changes from 340774 to 341051.

Estimated code review effort: 1 (Trivial) | ~2 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/3944-esp32s3-bloat-baseline

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.

pull Bot pushed a commit to manmuqingshan/FastLED that referenced this pull request Sep 3, 2026
The ESP32-S3 bloat gate has been red on master since FastLED#4141 unblocked it.
The regression is not from FastLED#4140 (minimp3 fixed-point), as FastLED#4142 assumed:
there is no minimp3 symbol in the Blink ELF at all. It is the TM1908
encoder from 3a61ded (Closes FastLED#1441).

Measured on this machine, Blink/esp32s3, symbol-diffing report.json across
the two commits:

    f9909d5 (pre-TM1908)   341,055 B
    8d2a841 (master)       341,259 B
    delta                        +204 B

    +161  fl::PixelIterator::writeTM1908<vector_psram<u8>>   [fl.channels+.cpp.o]
     +28  fl::Channel::showPixels(PixelController<GRB,1,~0ul>&) [fl.channels+.cpp.o]
      +8  fl::ChannelManager::waitForReady(unsigned long)      [fl.channels+.cpp.o]
      +4  fl::ChannelManager::addDriver(int, shared_ptr<IChannelDriver>)
      +2  fl::encodeLPD6803<...>
      +1  fl::RxDevice::lastBeginError() const

Every byte lands in fl.channels+.cpp.o. Adding a `case` to the
`Channel::showPixels` switch force-links the encoder into every clockless
build whether or not the sketch names the chipset -- the same mechanism
that cost 277 B for TM1812 in FastLED#3945, which this change mirrors.

The baseline is pinned to CI's number, not this machine's. CI measures
341,250 B; this host measures 341,259 B, and CI reported 341,250 on two
independent runs (the master push of 8d2a841 and PR FastLED#4141), so the exact
pin is safe and carries no slack, as the previous three bumps did not.

Why it slipped: TM1908's own bloat run on 3a61ded was concurrency-
cancelled after 19 s, and the next master run (f8d9ae6) died in `uv sync`
building running-process 4.10.10 -- the breakage FastLED#4141 fixed. The gate
never measured the regression until the dependency cap landed.

Not done here: a FASTLED_DISABLE_TM1908 opt-out alongside the existing
FASTLED_DISABLE_UCS7604 gate in the same switch. Per-chipset flags do not
scale, and FastLED#3947 already tracks tree-shaking unused Channels encoders as
the general fix.

master remains red on `audit` (fixed-point SIMD at 0.935x scalar on
x86-64). That is FastLED#4138 -- separate cause, separate PR.

Closes FastLED#4142
Refs FastLED#1441, FastLED#3945, FastLED#3947, FastLED#4140
zackees added a commit that referenced this pull request Sep 10, 2026
…4200) (#4274)

* fix(ci): settle the bloat ratchet, and make it notice its own slack (#4200)

#4200 has been parked on this since it was opened:

    The ratchet question is unchanged and still yours: the gate's docstring
    says the baseline only ratchets down, while its own failure message says
    to update it when a regression is intentional.

Both cannot be the rule. The docstring is the stale half: #3944/#3945 took
TM1812's measured +283 B into the baseline, and no policy that forbids every
flash-costing feature is one anyone runs. So the rule is stated once, in the
script and in the workflow that runs it, and it moves in both directions --
the file ends every PR equal to what that PR builds. An upward move carries
its reason in the file, as a `#` comment, because it is a decision and should
read like one in `git log`.

The other half is the mechanism, and #4200 measured why it was needed:

    master has *fallen* to 342,177 while the baseline stayed pinned at
    342,409, so the gate is measuring against a number 232 B stale ...
    | current master | +429 B  <- the real cost
    | stale baseline | +197 B  <- what the gate prints

A saving nobody pinned had no verdict at all -- the gate congratulated the
build on its headroom -- so the slack accumulated until a real 429 B
regression printed as 197 B and had to be explained in prose. A ratchet with
slack is not a ratchet, so unclaimed headroom now fails, with the exact number
to write.

`kHeadroomTolerance` is 64 B and is for build noise rather than savings. That
number is a judgement and is labelled as one: master measured the same total
on three consecutive runs, so the observed noise is zero, and 64 is far under
the 232 B drift that made #4200 unreadable.

No `bash bloat` run is involved in any of this -- the parser and the three
verdicts are host-testable, and that is what the new cases cover. Mutation-
tested: tolerating any headroom, dropping the comment skip, and raising on a
malformed file instead of reporting it each fail.

Refs #2886.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

* review(ci): enforce the reason on a baseline raise, not just document it

Right, and it is the same gap in a new place: the point of that PR was that
the gate said two things and neither was enforced, and I answered it by
writing a third thing down without enforcing it either. A PR could raise the
number, match it, and pass.

`raise_lacks_reason()` compares the file against its merge-base version. The
workflow recovers that version with `git show <base>:...` and passes it in;
`fetch-depth: 0` because a shallow clone has no merge base to read. With no
base available -- a first commit, or a force push that dropped it -- the
reason check is skipped rather than guessed at, and the size gate still runs.

Two details that are decisions rather than defaults:

- the comparison is against the *previous comments*, not against "has any
  comment", so a reason left over from an earlier raise cannot stand in for
  this one. Full lines rather than a count, so editing the old reason into a
  new one counts;
- a lowering needs no reason. A saving explains itself, and demanding prose
  for one would make the ratchet's easy direction the annoying one.

A malformed baseline stays an infrastructure failure and is reported as one.
Calling it a missing reason would point the reader at the wrong fault.

Mutation-tested: accepting any comment, demanding a reason for a lowering, and
reporting a malformed file as a missing reason each fail.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

* review(ci): compare against the merge base, not the target-branch tip

Correct. `github.event.pull_request.base.sha` is master's tip at the moment
the workflow runs, not the commit this branch diverged from, so it moves
whenever master advances. The gate would then be comparing this PR's baseline
against a version that already contains someone else's change to it -- and
would read their raise, or their lowering, as this PR's.

`git merge-base head base` is the commit that actually answers "what did this
PR start from". A push event has no merge to take, so `github.event.before`
stays the comparison point there.

`fetch-depth: 0` was already needed for `git show` and is what makes
`merge-base` resolvable too. When it cannot be computed -- a force push that
dropped the ancestor -- the reason check is skipped rather than guessed at,
and the size gate still runs.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

ESP32-S3 bloat gate: accept measured 283 B TM1812 encoder cost

1 participant