Skip to content

fix(ci): stop faking the sdkconfig overlay in the ESP32-S3 audit (#4570); fix RMT5 poll() READY race - #4573

Merged
zackees merged 2 commits into
masterfrom
fix/4570-sdkconfig-overlay
Sep 24, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/4570-sdkconfig-overlay

Conversation

@zackees

@zackees zackees commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Closes #4570.

1. Measurement script (#4570)

tests/measure_esp32s3_opt_ins.py applied the Stage 3 overlay by patching the repo-root platformio.ini. The fbuild compile path never reads that file, and fbuild has no sdkconfig-override support at all (filed as FastLED/fbuild#1460). As a result, stage3, stack and max_savings silently measured the baseline.

  • --config all now skips those configs and prints a notice.
  • Naming one explicitly exits 2 with an error that links the fbuild issue.
  • The dead code that patched, backed up and restored the ini, including its signal handlers, is removed.
  • Tests in ci/tests/test_measure_esp32s3_opt_ins.py.

2. RMT5 driver: poll() reported READY mid-transmit

The bug:

  • poll() releases a finished channel, then processPendingChannels() can restart a pending strip on that same ChannelState.
  • That state was already counted and then subtracted from activeCount, so poll() returned READY and cleared the in-use flags while the strip was still transmitting.
  • With more strips than RMT channels, a caller could therefore overwrite pixel data mid-send.

Also fixed: Strategy 2 handed out a channel that configureChannel() had just destroyed, for example on an invalid pin.

Found because channel_driver_rmt hit the 20 s test watchdog in local full runs (it took 20–50 s). The #4571 tests waited on isInUse(), which the bogus READY had already cleared, so each test left the driver BUSY and its destructor spun until timeout. The tests now assert READY at the end; the new check failed before the fix and passes after. The suite now runs in about 0.02 s.

Validation

  • bash test --cpp: 410/410 passed.
  • channel_driver_rmt passes in the --debug sanitizer build.
  • bash lint is clean.
  • pytest: 7/7 passed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved RMT channel status reporting when pending strips start, and prevented failed channel reconfigurations from being treated as usable.
    • Updated RMT tests to verify channels return to a ready state after transmissions complete.
  • Documentation
    • Clarified that ESP32-S3 measurement configurations requiring unsupported SDK configuration overlays are skipped when measuring all configurations and refused when requested by name.
  • Tools
    • The ESP32-S3 measurement script now reports unsupported overlay configurations rather than measuring them.

zackees and others added 2 commits September 24, 2026 12:19
The script patched the repo-root platformio.ini, which the fbuild compile
path never reads, so stage3/stack/max_savings silently measured the
baseline. fbuild cannot apply sdkconfig overrides yet (FastLED/fbuild#1460).
`--config all` now skips overlay configs with a notice, and naming one
explicitly exits 2. The dead ini patch/backup/signal handling is removed.

Closes #4570

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When poll() released a channel and processPendingChannels() restarted a
pending strip on that same, already-counted ChannelState, activeCount hit
zero and poll() returned READY, clearing in-use flags mid-transmit. With
more strips than RMT channels this let callers overwrite pixel data while
it was still being sent. Also stop Strategy 2 from handing out a channel
that configureChannel() just destroyed.

The channel_driver_rmt tests from #4571 hid this: their completion loops
waited on isInUse(), which the bogus READY had already cleared, so each
test left the driver BUSY and its destructor spun out its full timeout
(20-50 s per run, tripping the 20 s test watchdog). Tests now assert
READY at the end; the suite runs in ~0.02 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees
zackees merged commit 123f6b1 into master Sep 24, 2026
61 checks passed
@zackees
zackees deleted the fix/4570-sdkconfig-overlay branch September 24, 2026 19:19
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 24, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 43df1da5-e574-4375-8c3a-7ebd8138afa7

📥 Commits

Reviewing files that changed from the base of the PR and between 479994d and 4938513.

📒 Files selected for processing (5)
  • agents/docs/binary-size-analysis.md
  • ci/tests/test_measure_esp32s3_opt_ins.py
  • src/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp.hpp
  • tests/measure_esp32s3_opt_ins.py
  • tests/platforms/esp/32/drivers/rmt/rmt_5/channel_driver_rmt.cpp
 ______________________________________________
< Making your bugs an offer they can't refuse. >
 ----------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@zackees

zackees commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

Bloat before vs after (ESP32-S3 Blink, bash bloat esp32s3 --example Blink --build --top 40, host, measured at 123f6b1140^ vs 123f6b1140):

before after delta
Firmware flash 459,108 B 459,180 B +72 B
Attributed flash 374,154 B 374,228 B +74 B
RAM 80,912 B 80,912 B 0
Attributed RAM 41,339 B 41,339 B 0

The #4570 part (audit script) is CI tooling and cannot reach firmware. The +74 B is the RMT5 poll() READY-race fix (#4573). The overlay's real savings stay unmeasurable until FastLED/fbuild#1460 lands.

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.

measure_esp32s3_opt_ins: Stage 3 sdkconfig overlay is never applied

1 participant