Skip to content

feat(esp32-s3): ISR-driven chunked DMA for LCD_CAM SPI and clockless drivers - #2260

Merged
zackees merged 5 commits into
masterfrom
feat/lcd-isr-buffer-refill
Apr 17, 2026
Merged

zackees merged 5 commits into
masterfrom
feat/lcd-isr-buffer-refill

Conversation

@zackees

@zackees zackees commented Apr 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Refactor LCD_CAM SPI driver for ISR-driven chunked DMA streaming (3-buffer ring)
  • Add new LCD_CAM clockless driver with wave3/wave8 auto-selection
  • Both share the same peripheral interface and mock infrastructure
  • LCD clockless replaces the misnamed "I2S" driver on ESP32-S3

Changes

SPI driver (ChannelDriverLcdSpi):

  • ISR callback (isrChunkDone) transposes next chunk on DMA completion
  • Chunk size capped at ~100 APA102 LEDs (~6.5KB per ring slot, 19KB total)
  • Ring buffer reused across frames

Clockless driver (ChannelDriverLcdClockless):

  • Auto-selects wave3 (3 ticks/bit) or wave8 (8 ticks/bit) via canUseWave3()
  • Uses wave3Transpose_16 / wave8Transpose_16 for ISR-safe encoding
  • Chunk size capped at ~30 LEDs (~4.3KB wave3 / ~11.5KB wave8 per slot)
  • Registered in channel manager at priority 1 (same as legacy I2S)

Mock (LcdSpiPeripheralMock):

  • simulateTransmitComplete() now drains entire ISR callback chain in one call

Channel manager:

  • addLcdClocklessIfPossible() registered for ESP32-S3
  • FASTLED_ESP32_FORCE_LCD_CLOCKLESS force macro available

Test plan

  • 10 SPI chunked streaming tests (single/multi-chunk, ring wrap, transpose fidelity, error mid-stream, asymmetric lanes)
  • 12 clockless tests (wave3 auto-select, single/multi-chunk, multi-lane, ring wrap, multi-cycle, error handling, DMA output size)
  • All 299 tests pass
  • ASAN/LSAN/UBSAN clean
  • Lint clean
  • Hardware validation via autoresearch (Phase 3, follow-up)

Closes #2258

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for clockless LED chipsets via the ESP32 LCD_CAM path.
    • ISR-driven, chunked DMA streaming for LCD/SPI outputs.
    • Serial adapter device-reset capability (pyserial DTR/RTS and adapter fallback) used by CI.
  • Bug Fixes

    • Improved GPIO pretest recovery with automatic device-reset retry and clearer, multi-cause diagnostics.
  • Tests

    • Added comprehensive unit tests for clockless driver, chunked streaming, multi‑lane behavior, wraparound, reuse, failure cases, and serial-reset support.

@coderabbitai

coderabbitai Bot commented Apr 15, 2026 •

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an ISR-driven, chunked DMA streaming implementation for ESP32 LCD_SPI (SPI and new clockless paths), introduces a new LCD_CAM clockless channel driver and factory, registers the clockless engine before the legacy I2S path, and expands mocks and unit tests for multi-chunk flows.

Changes

Cohort / File(s) Summary
Channel manager & registration
src/platforms/esp/32/drivers/channel_manager_esp32.cpp.hpp
Adds PRIORITY_LCD_CLOCKLESS, addLcdClocklessIfPossible() and calls it before addI2sIfPossible() to optionally register the LCD clockless engine at the new priority.
New clockless driver
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h, src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp
Adds ChannelDriverLcdClockless and createLcdClocklessEngine() implementing ISR-driven, chunked DMA for clockless protocols with 3-slot ring buffers, ISR context, encoding (wave3/wave8 selection), enqueue/show/poll lifecycle, and ring allocation helpers.
SPI driver chunking refactor
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.h, src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp
Refactors ChannelDriverLcdSpi to ISR-driven chunked DMA (3-slot ring), updates transposition API to support subrange (startByte, byteCount), adds ISR completion callback and IsrContext, ring lifecycle, and test hooks for chunk sizing.
Build unity & peripheral mock
src/platforms/esp/32/drivers/lcd_spi/_build.cpp.hpp, src/platforms/esp/32/drivers/lcd_spi/lcd_spi_peripheral_mock.cpp.hpp
Unity build now includes clockless TU; mock simulateTransmitComplete() changed to drain pending transmits and repeatedly invoke callbacks to support multi-chunk sequences.
Tests
tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp, tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp
Adds unit tests for clockless driver behavior and ISR-driven chunking: chunk wrap, reuse across cycles, multi-lane cases, and transmit-failure scenarios.
CI autoresearch & serial utils
ci/autoresearch/gpio.py, ci/autoresearch/phases.py, ci/util/serial_interface.py, ci/tests/test_serial_interface_reset.py
Adds SerialInterface.reset_device() support with pyserial DTR fallback, RPC ping retry via device reset, improved GPIO pretest diagnostics, and unit tests asserting reset API presence.

Sequence Diagram(s)

sequenceDiagram
    participant App as Application
    participant CM as ChannelManager
    participant Driver as LCD_CLOCKLESS Driver
    participant Periph as LCD Peripheral
    participant DMA as DMA Engine
    participant ISR as ISR Callback

    App->>CM: register/create engine
    CM->>Driver: createLcdClocklessEngine()
    App->>Driver: enqueue(channelData)
    App->>Driver: show()
    Driver->>Periph: registerIsrCallback(isrChunkDone)
    Driver->>Periph: startTransmit(ring[0])
    Periph->>DMA: submit(ring[0])
    DMA->>ISR: onTransmitComplete()
    ISR->>Driver: transpose next chunk -> ring[next]
    ISR->>Periph: scheduleTransmit(ring[next])
    alt more chunks
        loop
            DMA->>ISR: onTransmitComplete()
            ISR->>Driver: prepare/schedule next chunk
        end
    else all done
        ISR->>Driver: set mStreamComplete = true
    end
    App->>Driver: poll()
    Driver-->>App: READY (when stream complete or peripheral idle)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

Possibly related issues

Possibly related PRs

Poem

🐰
I hopped through buffers, three by three,
ISR drums tapping a chunked DMA melody,
Clockless sparks and SPI lights gleam,
Rings spin fast to power the dream,
A tiny rabbit cheers the LED stream.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope changes to CI/autoresearch infrastructure (gpio.py, phases.py, serial_interface.py) that are not related to the LCD_CAM driver ISR refactoring objectives. Remove or defer the CI/autoresearch changes (gpio.py, phases.py, serial_interface.py, test_serial_interface_reset.py) to a separate PR focused on improving device communication and diagnostics.
Docstring Coverage ⚠️ Warning Docstring coverage is 42.03% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature: ISR-driven chunked DMA streaming for both LCD_CAM SPI and a new clockless driver on ESP32-S3.
Linked Issues check ✅ Passed The PR comprehensively implements all coding objectives from issue #2258: ISR-driven chunked DMA for SPI (#2258), new ChannelDriverLcdClockless with wave3/wave8 support (#2258), unified peripheral interfaces (#2258), channel manager updates (#2258), and comprehensive unit tests (#2258).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/lcd-isr-buffer-refill

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp (2)

299-340: ⚠️ Potential issue | 🟠 Major

Reinitialize on pin/clock changes, not only on lane-count changes.

config.data_gpios[], config.clock_gpio, and config.clock_hz are rebuilt from the current channels, but needPeripheralInit only checks numLanes. Reusing this driver for a different SPI pinout or bitrate with the same lane count will keep the old LCD_CAM wiring/clock and transmit with stale hardware settings.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp` around
lines 299 - 340, The code only reinitializes the peripheral when numLanes
changes (needPeripheralInit) but must also detect changes to the actual
pin/clock configuration: compare the newly-built config.data_gpios[],
config.clock_gpio and config.clock_hz against the driver's currently-active
values (e.g., stored fields like mNumLanes, mDataGpios, mClockGpio, mClockHz)
and set needPeripheralInit = true if any entry differs; then continue to call
freeRingBuffers(), mPeripheral->deinitialize(), mPeripheral->initialize(config)
and update the stored mDataGpios/mClockGpio/mClockHz/mNumLanes/mInitialized
after successful init so future comparisons are correct.

182-210: ⚠️ Potential issue | 🟠 Major

The ISR path is still using the slow transpose.

isrChunkDone() calls transposeToWords() for every chunk, and this implementation is still a byte × bit × lane loop in the callback path. At the default 408-byte chunk size that is a large amount of per-bit work in ISR context, which defeats the stated ISR budget and the LUT-based transpose objective of this refactor.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp` around
lines 182 - 210, The ISR path still does per-byte×per-bit×per-lane work in
transposeToWords(), which is too slow for isrChunkDone(); replace the bit-loop
with a LUT-based transpose: precompute a static u16 lookup table lookup[256][8]
where lookup[b][k] contains the 8 u16 words for byte value b with bits placed
for lane 0 (MSB->words[0]..words[7]); then in
ChannelDriverLcdSpi::transposeToWords() iterate bytes and lanes, and for each
lane OR (lookup[lane_byte][7 - bit_index] << lane) into the corresponding 8
output words (or better: for k=0..7 do output[k] |= lookup[byte][k] << lane);
this removes the per-bit branch and inner bit loop in transposeToWords() called
from isrChunkDone() and keeps the heavy work table-driven and ISR-safe (store
LUT in flash/const) or move preparation outside the ISR if needed.
🧹 Nitpick comments (2)
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h (2)

98-100: Wrap ring-buffer ownership in an RAII type.

allocateRingBuffers()/freeRingBuffers() plus u16 *mRingBuffers[kRingBufferCount] makes DMA slot lifetime manual and easy to miss on partial-allocation or future early-return paths. A small buffer wrapper or fl::unique_ptr with the right deleter would make ownership explicit and self-cleaning. As per coding guidelines, "Use proper RAII patterns with smart pointers (fl::shared_ptr, fl::unique_ptr) or moveable wrapper objects instead of raw pointers".

Also applies to: 140-141

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h` around
lines 98 - 100, The mRingBuffers array and manual
allocateRingBuffers()/freeRingBuffers() must be converted to an RAII-managed
type to ensure deterministic cleanup on partial failures; replace raw u16*
mRingBuffers[kRingBufferCount] with a moveable RAII wrapper (e.g.,
fl::unique_ptr<u16[]> with a custom deleter or a small RingBuffer class owning
the buffer and capacity) and update allocateRingBuffers and freeRingBuffers to
construct/assign or reset those RAII objects instead of doing manual new/free;
ensure allocateRingBuffers returns false on any allocation failure without
leaking by relying on the RAII wrapper and update any code paths that accessed
mRingBuffers directly to use the wrapper's data()/get() accessor or member
functions.

25-29: Replace raw #pragma once with the project’s approved header-guard/compiler-control pattern.

This header already includes fl/stl/compiler_control.h, so the raw pragma is the remaining guideline violation here. As per coding guidelines, "Use FastLED compiler control macros from fl/stl/compiler_control.h instead of raw #pragma directives".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h` around
lines 25 - 29, Replace the raw "#pragma once" in channel_driver_lcd_clockless.h
with the project's approved FastLED compiler-control header macros (the macros
provided by fl/stl/compiler_control.h), i.e., remove the pragma and wrap the
header contents with the begin/end compiler-control macros (use the FL_*
header-guard macros such as the FL_BEGIN_HEADER/FL_END_HEADER pattern provided
in compiler_control.h) so the file follows the project's header-guard
convention.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/platforms/esp/32/drivers/channel_manager_esp32.cpp.hpp`:
- Around line 128-132: Channel selection is nondeterministic because
PRIORITY_LCD_CLOCKLESS and the legacy I2S priority are equal; update the
constants so LCD_CLOCKLESS has a strictly higher value than the I2S legacy
driver (e.g., increment PRIORITY_LCD_CLOCKLESS above PRIORITY_I2S) or
alternatively guard the legacy I2S registration so ChannelManager::addDriver()
never registers the I2S driver when the LCD clockless path
(FASTLED_ESP32_FORCE_LCD_CLOCKLESS or the LCD_CLOCKLESS availability check) is
enabled; apply the same fix for the other occurrence of these priority
definitions so LCD_CLOCKLESS always outranks I2S deterministically.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`:
- Around line 376-378: The call to
mPeripheral->registerTransmitCallback(reinterpret_cast<void *>(&isrChunkDone),
this) can fail and currently is ignored, causing only the first DMA chunk to be
sent; update the start/stream initialization path (where
registerTransmitCallback is invoked in the channel_driver_lcd_clockless code) to
check the return/result of registerTransmitCallback, and if it fails abort the
streaming startup: undo any started DMA/tx state, log an error with context
(including that registerTransmitCallback failed), set the channel/state to
not-streaming/ERROR or READY as appropriate, and return/propagate an error so
the caller does not assume streaming will proceed; ensure cleanup of resources
allocated before the call so no partial state remains.
- Around line 66-72: The destructor
ChannelDriverLcdClockless::~ChannelDriverLcdClockless currently clears mBusy and
calls freeRingBuffers even if mPeripheral->waitTransmitDone(2000) times out;
change the logic so you only clear mBusy and call freeRingBuffers when
waitTransmitDone indicates success, and do not free the DMA/ring buffers on
timeout (leave mBusy set and retain buffers) to avoid the LCD_CAM continuing to
read freed memory; update the flow around mPeripheral->waitTransmitDone, mBusy,
and freeRingBuffers accordingly (and optionally log or take a safe abort path if
waitTransmitDone fails).
- Around line 278-301: The peripheral reinit logic must consider timing and pin
changes, not just numLanes: update the code that loops channels (the block
computing maxSize, chipsetTiming, firstPin from channels using getSize,
getTiming, getPin) so it computes a deterministic signature/hash (or compares
per-lane timing and pin values) and set needPeripheralInit when that signature
differs from the previous configuration in addition to numLanes; stop using only
the first channel's timing (ChipsetTiming and timingFound) — either enforce all
channels share identical getTiming() and fail/normalize if not, or
aggregate/compare each channel.getTiming() and channel.getPin() so mixed-timing
lanes are detected and trigger full reconfigure prior to recomputing mClockHz,
wave mode and GPIO assignments used by show(). Ensure the signature is stored
and compared across calls to show() and used to decide peripheral
reinitialization.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h`:
- Around line 112-116: The ISR/task handoff currently relies on volatile fields
in struct IsrContext (mStreamComplete, mNextByteOffset, mRingWriteIdx) and the
volatile mBusy, which is unsafe because volatile doesn't provide atomicity or
ordering; change these to properly synchronized accesses by either (a) replacing
the volatile fields with atomic types (e.g., std::atomic<bool> for
mStreamComplete/mBusy and std::atomic<size_t> for mNextByteOffset/mRingWriteIdx)
and use atomic read/modify operations in isrChunkDone(), show(), and poll(), or
(b) wrap all accesses and compound updates to those fields in a critical section
using the ESP32 port macros (e.g., portENTER_CRITICAL/portEXIT_CRITICAL or an
appropriate spinlock) so read-modify-write sequences in isrChunkDone(), show(),
and poll() are atomic and ordered.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp`:
- Around line 61-69: Destructor ChannelDriverLcdSpi::~ChannelDriverLcdSpi()
clears mBusy and calls freeRingBuffers() even if
mPeripheral->waitTransmitDone(2000) timed out; change it to check the result of
waitTransmitDone and only clear mBusy and call freeRingBuffers() when
waitTransmitDone indicates success/completion, otherwise leave mBusy true and do
not free the DMA ring buffers (optionally log or attempt a safe abort/retry
path), referencing mBusy, mPeripheral->waitTransmitDone, and freeRingBuffers()
to locate the code to change.
- Around line 347-349: The transmit callback registration can fail and currently
isn't checked; update the initialization where
mPeripheral->registerTransmitCallback(reinterpret_cast<void *>(&isrChunkDone),
this) is called to verify its boolean return and fail early on false (e.g.,
log/error and abort init or set an error state and return false) so the driver
never starts the first DMA chunk without a working callback; ensure any cleanup
is performed and that poll() will not attempt to send chunks when registration
failed.

---

Outside diff comments:
In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp`:
- Around line 299-340: The code only reinitializes the peripheral when numLanes
changes (needPeripheralInit) but must also detect changes to the actual
pin/clock configuration: compare the newly-built config.data_gpios[],
config.clock_gpio and config.clock_hz against the driver's currently-active
values (e.g., stored fields like mNumLanes, mDataGpios, mClockGpio, mClockHz)
and set needPeripheralInit = true if any entry differs; then continue to call
freeRingBuffers(), mPeripheral->deinitialize(), mPeripheral->initialize(config)
and update the stored mDataGpios/mClockGpio/mClockHz/mNumLanes/mInitialized
after successful init so future comparisons are correct.
- Around line 182-210: The ISR path still does per-byte×per-bit×per-lane work in
transposeToWords(), which is too slow for isrChunkDone(); replace the bit-loop
with a LUT-based transpose: precompute a static u16 lookup table lookup[256][8]
where lookup[b][k] contains the 8 u16 words for byte value b with bits placed
for lane 0 (MSB->words[0]..words[7]); then in
ChannelDriverLcdSpi::transposeToWords() iterate bytes and lanes, and for each
lane OR (lookup[lane_byte][7 - bit_index] << lane) into the corresponding 8
output words (or better: for k=0..7 do output[k] |= lookup[byte][k] << lane);
this removes the per-bit branch and inner bit loop in transposeToWords() called
from isrChunkDone() and keeps the heavy work table-driven and ISR-safe (store
LUT in flash/const) or move preparation outside the ISR if needed.

---

Nitpick comments:
In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h`:
- Around line 98-100: The mRingBuffers array and manual
allocateRingBuffers()/freeRingBuffers() must be converted to an RAII-managed
type to ensure deterministic cleanup on partial failures; replace raw u16*
mRingBuffers[kRingBufferCount] with a moveable RAII wrapper (e.g.,
fl::unique_ptr<u16[]> with a custom deleter or a small RingBuffer class owning
the buffer and capacity) and update allocateRingBuffers and freeRingBuffers to
construct/assign or reset those RAII objects instead of doing manual new/free;
ensure allocateRingBuffers returns false on any allocation failure without
leaking by relying on the RAII wrapper and update any code paths that accessed
mRingBuffers directly to use the wrapper's data()/get() accessor or member
functions.
- Around line 25-29: Replace the raw "#pragma once" in
channel_driver_lcd_clockless.h with the project's approved FastLED
compiler-control header macros (the macros provided by
fl/stl/compiler_control.h), i.e., remove the pragma and wrap the header contents
with the begin/end compiler-control macros (use the FL_* header-guard macros
such as the FL_BEGIN_HEADER/FL_END_HEADER pattern provided in
compiler_control.h) so the file follows the project's header-guard convention.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e3d7449c-2ac9-4be8-9ceb-712b912f3ec6

📥 Commits

Reviewing files that changed from the base of the PR and between 72a1936 and 4a0fa7e.

📒 Files selected for processing (9)
  • src/platforms/esp/32/drivers/channel_manager_esp32.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/_build.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.h
  • src/platforms/esp/32/drivers/lcd_spi/lcd_spi_peripheral_mock.cpp.hpp
  • tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp
  • tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp

…drivers

Refactor the LCD_CAM SPI driver (ChannelDriverLcdSpi) and add a new
clockless driver (ChannelDriverLcdClockless) for ESP32-S3. Both use
ISR-driven 3-buffer ring architecture for chunked DMA streaming,
modeled after the PARLIO driver.

Key changes:
- SPI driver: ISR callback transposes next chunk on DMA completion
- Clockless driver: wave3/wave8 auto-select via canUseWave3(), uses
  wave3Transpose_16/wave8Transpose_16 for encoding in ISR context
- Mock simulateTransmitComplete() drains full ISR callback chain
- Chunk size capped at ~100 LEDs (SPI) / ~30 LEDs (clockless)
- LCD clockless registered in channel manager, replacing misnamed
  "I2S" driver on ESP32-S3

22 new test cases across both drivers. All 299 tests pass,
ASAN/LSAN/UBSAN clean, lint clean.

Closes #2258

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@zackees
zackees force-pushed the feat/lcd-isr-buffer-refill branch from 4a0fa7e to 2320b2f Compare April 16, 2026 20:15

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (4)
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp (3)

376-378: ⚠️ Potential issue | 🟠 Major

Callback registration failure still silently ignored.

The return value of registerTransmitCallback is discarded. If registration fails, the initial transmit() below will still send the first chunk, mBusy will be set, and then no ISR will ever advance the stream — subsequent chunks never ship and poll() will eventually report READY off the peripheralIdle path (see related comment on poll). Check the result, abort the stream (clear setInUse, don't set mBusy), and return false.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`
around lines 376 - 378, Check the boolean/return result of
mPeripheral->registerTransmitCallback(reinterpret_cast<void *>(&isrChunkDone),
this) and if it fails abort the stream: call the same cleanup used when a stream
cannot start (clear setInUse on this stream), do not set mBusy, and make
transmit() immediately return false so the caller knows start failed; this
prevents starting the first chunk without an ISR and avoids leaving the stream
stuck for poll()/peripheralIdle. Ensure you reference registerTransmitCallback,
isrChunkDone, transmit(), mBusy, setInUse, and poll in the fix.

66-72: ⚠️ Potential issue | 🟠 Major

Destructor still frees DMA ring buffers after a failed wait.

If waitTransmitDone(2000) times out, mBusy is still cleared and freeRingBuffers() proceeds unconditionally, so a stuck LCD_CAM transfer would continue DMA-reading freed memory. On timeout, leave mBusy set and skip freeing ring buffers (or take a hard-reset path on the peripheral first).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`
around lines 66 - 72, The destructor
ChannelDriverLcdClockless::~ChannelDriverLcdClockless currently clears mBusy and
always calls freeRingBuffers() even if mPeripheral->waitTransmitDone(2000) times
out; change the flow so that you check the return/timeout result of
waitTransmitDone and only clear mBusy and call freeRingBuffers() when
waitTransmitDone succeeded, otherwise leave mBusy true and skip
freeRingBuffers() (or attempt a safe peripheral hard-reset via mPeripheral
before freeing); use the wait result to decide whether to freeRingBuffers() to
avoid the DMA reading freed memory.

278-370: ⚠️ Potential issue | 🟠 Major

Reinit trigger still ignores timing and pin changes.

needPeripheralInit at line 334 is still keyed only off mNumLanes. A subsequent show() with the same lane count but different per-channel timing (getTiming()) or different data GPIOs (getPin()) will skip deinitialize()/initialize() and keep the previous config.clock_hz and config.data_gpios[]. Additionally, only lane 0's timing feeds canUseWave3, mWave3Lut, and mClockHz (lines 289–297), so mixed-timing lanes are silently encoded with lane 0's waveform. Build a signature over (numLanes, all pins, all timings) and compare — or enforce uniform timing across channels and fail otherwise.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`
around lines 278 - 370, The peripheral reinit logic only checks mNumLanes so
changes in per-channel timing or pins are ignored, causing stale
mClockHz/mWave*Lut and config.data_gpios; update the reinit condition in the
init path (where needPeripheralInit is computed) to also consider a signature of
all channels' getPin() and getTiming() (or alternatively validate that all
channels share identical timing and fail early), and when the signature differs
force deinitialize()/initialize() and recompute canUseWave3(chipsetTiming),
mClockHz, mWave3Lut/mWave8Lut, and populate config.data_gpios[] from each
channels[i]->getPin(); ensure mNumLanes/mInitialized are updated as before after
successful init.
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h (1)

112-145: ⚠️ Potential issue | 🟠 Major

volatile is not sufficient for ISR↔task handoff on ESP32.

mStreamComplete, mNextByteOffset, mRingWriteIdx, and mBusy are volatile but accessed from both ISR (isrChunkDone) and task contexts (show, poll, dtor). volatile guarantees neither atomicity nor ordering; compound updates like ctx.mNextByteOffset += chunkBytes in the ISR combined with unsynchronized task reads create real race windows on Xtensa/RISC-V with caches and OoO stores. Use fl::atomic<...> with explicit memory orders, or wrap the handoff in portENTER_CRITICAL_ISR / portENTER_CRITICAL spinlocks.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h` around
lines 112 - 145, The ISR/task shared flags and counters
(IsrContext::mStreamComplete, mNextByteOffset, mRingWriteIdx and the member
mBusy) are declared volatile but need atomicity and ordering for safe handoff
between isrChunkDone and task methods (show, poll, destructor); replace these
volatile fields with fl::atomic<T> (e.g. fl::atomic<bool> for
mStreamComplete/mBusy and fl::atomic<size_t> for offsets) and use appropriate
memory_order (release in ISR updates, acquire in task reads) or alternatively
protect all accesses in isrChunkDone and task paths with
portENTER_CRITICAL_ISR/portEXIT_CRITICAL_ISR and
portENTER_CRITICAL/portEXIT_CRITICAL critical sections to eliminate races.
Ensure all compound updates (like ctx.mNextByteOffset += chunkBytes) are done
using atomic fetch_add or inside the same critical section so isr and task views
are consistent.
🧹 Nitpick comments (1)
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp (1)

419-466: EspWrapper is a shared singleton bridge; consider hoisting out of the factory.

Defining EspWrapper as a local class inside createLcdClocklessEngine() and allocating a fresh one per call is fine functionally, but it duplicates the identical wrapper pattern used for ChannelDriverLcdSpi against the same LcdSpiPeripheralEsp::instance(). Consider extracting a single reusable LcdSpiPeripheralEspBridge (or similar) so both clockless and SPI factories share one bridge type and allocation. Non-blocking.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`
around lines 419 - 466, The local class EspWrapper inside
createLcdClocklessEngine should be hoisted into a shared bridge type (e.g.
LcdSpiPeripheralEspBridge) implemented once (wrapping
detail::LcdSpiPeripheralEsp::instance()) and placed at namespace scope so both
createLcdClocklessEngine and the ChannelDriverLcdSpi factory can reuse it;
replace the local EspWrapper with fl::make_shared<LcdSpiPeripheralEspBridge>()
when constructing ChannelDriverLcdClockless (and update the other factory to use
the same bridge), keeping the same overridden methods (initialize, deinitialize,
allocateBuffer, transmit, registerTransmitCallback, getConfig, getMicroseconds,
delay, etc.) and preserving FL_NOEXCEPT and return types.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`:
- Around line 307-352: The code sets numLanes =
static_cast<int>(channels.size()) and writes it to config.num_lanes while only
populating config.data_gpios[0..15], which can leave lanes >16 uninitialized;
clamp or reject extras. Update the initialization path (before using config) to
enforce a hard limit: compute an effectiveNumLanes =
std::min(static_cast<int>(channels.size()), 16) and use effectiveNumLanes for
config.num_lanes and any size calculations (e.g., slotCapacityBytes,
config.num_lanes), and either log/warn and ignore any channels beyond 16 or
return/fail early; ensure the for loop that fills config.data_gpios still
iterates up to effectiveNumLanes (or 16) so no data_gpios entries remain unset.
- Around line 157-176: The poll() method currently treats peripheralIdle
(mPeripheral->isBusy()) as a completion signal which can race with ISR chunking;
change the termination condition to rely only on the ISR-driven signals: use
mIsrCtx.mStreamComplete or mBusy (i.e., check streamDone || !mBusy) instead of
peripheralIdle, then only clear mBusy, reset mIsrCtx.mStreamComplete, mark
channels free via channel->setInUse(false) and clear mTransmittingChannels when
that ISR-driven condition is met (leave the rest of poll() behavior unchanged).

---

Duplicate comments:
In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`:
- Around line 376-378: Check the boolean/return result of
mPeripheral->registerTransmitCallback(reinterpret_cast<void *>(&isrChunkDone),
this) and if it fails abort the stream: call the same cleanup used when a stream
cannot start (clear setInUse on this stream), do not set mBusy, and make
transmit() immediately return false so the caller knows start failed; this
prevents starting the first chunk without an ISR and avoids leaving the stream
stuck for poll()/peripheralIdle. Ensure you reference registerTransmitCallback,
isrChunkDone, transmit(), mBusy, setInUse, and poll in the fix.
- Around line 66-72: The destructor
ChannelDriverLcdClockless::~ChannelDriverLcdClockless currently clears mBusy and
always calls freeRingBuffers() even if mPeripheral->waitTransmitDone(2000) times
out; change the flow so that you check the return/timeout result of
waitTransmitDone and only clear mBusy and call freeRingBuffers() when
waitTransmitDone succeeded, otherwise leave mBusy true and skip
freeRingBuffers() (or attempt a safe peripheral hard-reset via mPeripheral
before freeing); use the wait result to decide whether to freeRingBuffers() to
avoid the DMA reading freed memory.
- Around line 278-370: The peripheral reinit logic only checks mNumLanes so
changes in per-channel timing or pins are ignored, causing stale
mClockHz/mWave*Lut and config.data_gpios; update the reinit condition in the
init path (where needPeripheralInit is computed) to also consider a signature of
all channels' getPin() and getTiming() (or alternatively validate that all
channels share identical timing and fail early), and when the signature differs
force deinitialize()/initialize() and recompute canUseWave3(chipsetTiming),
mClockHz, mWave3Lut/mWave8Lut, and populate config.data_gpios[] from each
channels[i]->getPin(); ensure mNumLanes/mInitialized are updated as before after
successful init.

In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h`:
- Around line 112-145: The ISR/task shared flags and counters
(IsrContext::mStreamComplete, mNextByteOffset, mRingWriteIdx and the member
mBusy) are declared volatile but need atomicity and ordering for safe handoff
between isrChunkDone and task methods (show, poll, destructor); replace these
volatile fields with fl::atomic<T> (e.g. fl::atomic<bool> for
mStreamComplete/mBusy and fl::atomic<size_t> for offsets) and use appropriate
memory_order (release in ISR updates, acquire in task reads) or alternatively
protect all accesses in isrChunkDone and task paths with
portENTER_CRITICAL_ISR/portEXIT_CRITICAL_ISR and
portENTER_CRITICAL/portEXIT_CRITICAL critical sections to eliminate races.
Ensure all compound updates (like ctx.mNextByteOffset += chunkBytes) are done
using atomic fetch_add or inside the same critical section so isr and task views
are consistent.

---

Nitpick comments:
In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`:
- Around line 419-466: The local class EspWrapper inside
createLcdClocklessEngine should be hoisted into a shared bridge type (e.g.
LcdSpiPeripheralEspBridge) implemented once (wrapping
detail::LcdSpiPeripheralEsp::instance()) and placed at namespace scope so both
createLcdClocklessEngine and the ChannelDriverLcdSpi factory can reuse it;
replace the local EspWrapper with fl::make_shared<LcdSpiPeripheralEspBridge>()
when constructing ChannelDriverLcdClockless (and update the other factory to use
the same bridge), keeping the same overridden methods (initialize, deinitialize,
allocateBuffer, transmit, registerTransmitCallback, getConfig, getMicroseconds,
delay, etc.) and preserving FL_NOEXCEPT and return types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92ef3bd4-6d50-4988-952b-f759089b0e51

📥 Commits

Reviewing files that changed from the base of the PR and between 4a0fa7e and 2320b2f.

📒 Files selected for processing (9)
  • src/platforms/esp/32/drivers/channel_manager_esp32.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/_build.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.h
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.h
  • src/platforms/esp/32/drivers/lcd_spi/lcd_spi_peripheral_mock.cpp.hpp
  • tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp
  • tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp
✅ Files skipped from review due to trivial changes (2)
  • src/platforms/esp/32/drivers/lcd_spi/_build.cpp.hpp
  • tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/platforms/esp/32/drivers/lcd_spi/lcd_spi_peripheral_mock.cpp.hpp
  • tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp
  • src/platforms/esp/32/drivers/channel_manager_esp32.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.h
  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_spi.cpp.hpp

@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1005.40ms

Top 5 Slowest Headers

  1. FastLED.h - 755.00ms
  2. fl/fastled.h - 317.82ms
  3. fl/task/executor.h - 242.94ms
  4. crgb.h - 173.60ms
  5. fl/gfx/crgb.h - 172.34ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (755.0ms)
⚠️ Header fl/fastled.h exceeds 150ms (317.8ms)
⚠️ Header fl/task/executor.h exceeds 150ms (242.9ms)
⚠️ Header crgb.h exceeds 150ms (173.6ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (172.3ms)
⚠️ Header fl/math/ease.h exceeds 150ms (168.0ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (166.2ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (127.5ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (118.8ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (118.1ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (117.0ms)
⚠️ Header platforms/thread.h exceeds 50ms (116.9ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (116.9ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (116.8ms)
⚠️ Header fl/ui.h exceeds 50ms (108.5ms)
⚠️ Header fl/task/promise.h exceeds 50ms (103.3ms)
⚠️ Header fl/stl/json.h exceeds 50ms (68.4ms)
⚠️ Header fl/stl/function.h exceeds 50ms (61.2ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (53.5ms)
⚠️ Header platforms.h exceeds 50ms (50.2ms)
⚠️ Header platforms/stub/fastled_stub.h exceeds 50ms (50.1ms)
⚠️ Template instantiation time is high (53.2%)

Full Report
================================================================================
FASTLED COMPILATION PERFORMANCE REPORT
================================================================================
Generated: 2026-04-16 20:32:22
Compiler: clang++-17
File: ci/perf/test_compile.cpp

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    1,645.02 ms
Frontend Time:             14.81 ms (0.9%)
Backend Time:              128.07 ms (7.8%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    10508.68 ms (638.8%)
Templates                   531.58 ms ( 32.3%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1240.7 ms - FastLED.h (SLOW)
   635.6 ms - fl/task/executor.h (SLOW)
   384.5 ms - fl/fastled.h (SLOW)
   331.8 ms - fl/task/scheduler.h (SLOW)
   322.9 ms - fl/stl/singleton.h (SLOW)
   322.2 ms - fl/stl/thread_local.h (SLOW)
   321.0 ms - fl/stl/thread.h (SLOW)
   320.9 ms - platforms/thread.h (SLOW)
   320.9 ms - platforms/stub/thread_stub.h (SLOW)
   320.8 ms - platforms/stub/thread_stub_stl.h (SLOW)
   291.0 ms - fl/task/promise.h (SLOW)
   249.3 ms - fl/stl/function.h (SLOW)
   215.3 ms - crgb.h (SLOW)
   214.0 ms - fl/gfx/crgb.h (SLOW)
   209.5 ms - fl/math/ease.h (SLOW)
   207.6 ms - fl/math/fixed_point.h (SLOW)
   140.1 ms - fl/stl/vector.h (SLOW)
   111.8 ms - fl/math/math.h (SLOW)
   107.5 ms - fl/ui.h (SLOW)
   107.3 ms - fl/stl/undef.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1240.7ms)
  ├─  635.6 ms - fl/task/executor.h
  │ ├─  331.8 ms - fl/task/scheduler.h
  │ │ ├─  322.9 ms - fl/stl/singleton.h
  │ │ │ └─  322.2 ms - fl/stl/thread_local.h
  │ │ │   └─  321.0 ms - fl/stl/thread.h
  │ │ │     └─  320.9 ms - platforms/thread.h
  │ │ │       └─  320.9 ms - platforms/stub/thread_stub.h
  │ │ │         └─  320.8 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  316.4 ms - thread
  │ │ │             ├─  180.5 ms - std_thread.h
  │ │ │             └─  123.7 ms - this_thread_sleep.h
  │ │ └─    8.1 ms - fl/task/task.h
  │ │   └─    3.2 ms - fl/trace.h
  │ │     ├─    2.0 ms - fl/stl/chrono.h
  │ │     └─    0.9 ms - fl/stl/tuple.h
  │ ├─  291.0 ms - fl/task/promise.h
  │ │ ├─  249.3 ms - fl/stl/function.h
  │ │ │ ├─  140.1 ms - fl/stl/vector.h
  │ │ │ │ ├─  111.8 ms - fl/math/math.h
  │ │ │ │ │ └─  107.3 ms - fl/stl/undef.h
  │ │ │ │ │   └─  196.1 ms - stdlib.h
  │ │ │ │ │     ├─  100.3 ms - cstdlib
  │ │ │ │ │     │ └─  196.1 ms - stdlib.h
  │ │ │ │ │     │   ├─  100.3 ms - cstdlib
  │ │ │ │ │     │   ├─   55.4 ms - types.h
  │ │ │ │ │     │   ├─    3.5 ms - floatn.h
  │ │ │ │ │     │   └─    3.2 ms - locale_t.h
  │ │ │ │ │     ├─   55.4 ms - types.h
  │ │ │ │ │     │ ├─   55.4 ms - types.h
  │ │ │ │ │     │ │ ├─   55.4 ms - types.h
  │ │ │ │ │     │ │ ├─   10.4 ms - select.h
  │ │ │ │ │     │ │ ├─    7.4 ms - endian.h
  │ │ │ │ │     │ │ └─    7.3 ms - pthreadtypes.h
  │ │ │ │ │     │ ├─   10.4 ms - select.h
  │ │ │ │ │     │ ├─    7.4 ms - endian.h
  │ │ │ │ │     │ └─    7.3 ms - pthreadtypes.h
  │ │ │ │ │     │   └─    6.9 ms - thread-shared-types.h
  │ │ │ │ │     ├─    3.5 ms - floatn.h
  │ │ │ │ │     └─    3.2 ms - locale_t.h
  │ │ │ │ ├─   15.3 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   10.4 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    6.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    1.9 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─    3.9 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.3 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─   64.0 ms - fl/stl/variant.h
  │ │ │ │ └─   62.4 ms - fl/stl/new.h
  │ │ │ │   └─   62.3 ms - platforms/new.h
  │ │ │ │     └─   62.3 ms - platforms/shared/new.h
  │ │ │ │       └─   58.3 ms - new
  │ │ │ │         ├─   44.6 ms - c++config.h
  │ │ │ │         │ └─   39.8 ms - os_defines.h
  │ │ │ │         └─    0.5 ms - version.h
  │ │ │ ├─   32.2 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   21.8 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   16.8 ms - fl/stl/move.h
  │ │ │ │ ├─    6.0 ms - fl/stl/atomic.h
  │ │ │ │ │ └─    5.2 ms - platforms/atomic.h
  │ │ │ │ │   └─    5.1 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ │ ├─    4.6 ms - fl/stl/compiler_control.h
  │ │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │ │   └─    1.6 ms - fl/math/random.h
  │ │ │     └─    0.8 ms - fl/math/random8.h
  │ │ └─   37.0 ms - fl/stl/string.h
  │ │   ├─   11.1 ms - fl/stl/basic_string.h
  │ │   │ ├─    0.9 ms - fl/stl/not_null.h
  │ │   │ └─    0.8 ms - fl/stl/iterator.h
  │ │   ├─    7.1 ms - fl/stl/span.h
  │ │   │ └─    2.9 ms - fl/math/geometry.h
  │ │   ├─    4.4 ms - fl/stl/string_view.h
  │ │   └─    1.3 ms - fl/stl/optional.h
  │ ├─   10.6 ms - platforms/await.h
  │ │ └─   10.2 ms - platforms/coroutine_runtime.h
  │ │   └─    8.7 ms - fl/system/engine_events.h
  │ │     ├─    4.3 ms - fl/math/screenmap.h
  │ │     │ └─    3.1 ms - fl/stl/flat_map.h
  │ │     └─    2.9 ms - fl/math/xymap.h
  │ │       └─    0.7 ms - fl/math/lut.h
  │ └─    0.7 ms - fl/task/promise_result.h
  ├─  384.5 ms - fl/fastled.h
  │ ├─  215.3 ms - crgb.h
  │ │ ├─  214.0 ms - fl/gfx/crgb.h
  │ │ │ └─  209.5 ms - fl/math/ease.h
  │ │ │   └─  207.6 ms - fl/math/fixed_point.h
  │ │ │     ├─   86.1 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─   69.0 ms - fl/math/sin32.h
  │ │ │     │ │ └─   66.3 ms - fl/math/simd.h
  │ │ │     │ │   └─   65.7 ms - fl/math/simd/types.h
  │ │ │     │ │     └─   65.4 ms - platforms/simd.h
  │ │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   15.1 ms - fl/math/fixed_point/s24x8.h
  │ │ │     ├─   15.0 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   15.0 ms - fl/math/fixed_point/s8x24.h
  │ │ │     └─   14.9 ms - fl/math/fixed_point/s16x16.h
  │ │ └─    0.9 ms - chsv.h
  │ │   └─    0.8 ms - fl/gfx/hsv.h
  │ ├─   73.9 ms - platforms.h
  │ │ └─   73.8 ms - platforms/stub/fastled_stub.h
  │ │   ├─   40.6 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   40.5 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   34.6 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   32.5 ms - fl/id_tracker.h
  │ │   │   │   └─   31.6 ms - fl/stl/mutex.h
  │ │   │   │     └─   31.5 ms - platforms/mutex.h
  │ │   │   │       └─   31.3 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.5 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   33.2 ms - platforms/stub/clockless_stub.h
  │ │     └─   33.1 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.8 ms - fl/channels/data.h
  │ │       │ └─    8.7 ms - fl/channels/config.h
  │ │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.4 ms - fl/chipsets/spi.h
  │ │       ├─   11.3 ms - fl/system/log.h
  │ │       │ └─   10.9 ms - fl/stl/strstream.h
  │ │       ├─    2.3 ms - fl/channels/manager.h
  │ │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │ │       └─    1.0 ms - fl/channels/driver.h
  │ ├─   36.0 ms - colorutils.h
  │ │ └─   35.1 ms - fl/gfx/colorutils.h
  │ │   ├─    7.9 ms - fl/gfx/blur.h
  │ │   │ └─    4.3 ms - fl/gfx/canvas.h
  │ │   │   └─    2.6 ms - fl/math/alpha.h
  │ │   └─    2.8 ms - fl/gfx/fill.h
  │ ├─   20.8 ms - pixel_controller.h
  │ │ ├─   14.8 ms - pixel_iterator.h
  │ │ │ └─   14.7 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    4.2 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.3 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    2.6 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    4.1 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.6 ms - rgbw.h
  │ │   └─    2.4 ms - fl/gfx/rgbw.h
  │ └─   18.6 ms - pixeltypes.h
  │   ├─   15.5 ms - lib8tion.h
  │   │ ├─    7.8 ms - fl/math/math8.h
  │   │ │ ├─    4.0 ms - fl/math/intmap.h
  │   │ │ │ └─    3.1 ms - platforms/intmap.h
  │   │ │ ├─    2.0 ms - fl/math/scale8.h
  │   │ │ │ └─    2.0 ms - platforms/scale8.h
  │   │ │ │   └─    0.8 ms - platforms/shared/scale8.h
  │   │ │ └─    1.6 ms - platforms/math8.h
  │   │ │   └─    1.2 ms - platforms/shared/math8.h
  │   │ └─    1.6 ms - fl/math/beat.h
  │   │   └─    0.9 ms - fl/math/trig8.h
  │   │     └─    0.9 ms - platforms/trig8.h
  │   │       └─    0.8 ms - platforms/shared/trig8.h
  │   └─    2.8 ms - crgb.hpp
  ├─  107.5 ms - fl/ui.h
  │ ├─   67.7 ms - fl/stl/json.h
  │ │ └─   53.0 ms - fl/stl/json/types.h
  │ │   └─    6.3 ms - fl/stl/limits.h
  │ ├─   10.6 ms - fl/ui_impl.h
  │ │ └─    9.9 ms - platforms/ui_defs.h
  │ │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.6 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    1.0 ms - platforms/shared/ui/json/checkbox.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/help.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ └─    5.2 ms - fl/stl/url.h
  ├─   24.9 ms - chipsets.h
  │ ├─   10.2 ms - fl/chipsets/ucs7604.h
  │ │ └─    7.6 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    5.8 ms - fl/chipsets/apa102.h
  │ ├─    1.5 ms - fl/chipsets/lpd880x.h
  │ ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  │ └─    0.7 ms - fl/chipsets/ws2801.h
  └─   22.9 ms - fl/stl/stdint.h
    └─   22.7 ms - platforms/int.h
      └─   22.3 ms - platforms/shared/int.h
        └─   22.2 ms - platforms/shared/int_linux.h
fl/task/executor.h (635.6ms)
  ├─  331.8 ms - fl/task/scheduler.h
  │ ├─  322.9 ms - fl/stl/singleton.h
  │ │ └─  322.2 ms - fl/stl/thread_local.h
  │ │   └─  321.0 ms - fl/stl/thread.h
  │ │     └─  320.9 ms - platforms/thread.h
  │ │       └─  320.9 ms - platforms/stub/thread_stub.h
  │ │         └─  320.8 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  316.4 ms - thread
  │ │             ├─  180.5 ms - std_thread.h
  │ │             │ ├─   48.7 ms - tuple
  │ │             │ ├─   46.7 ms - iosfwd
  │ │             │ ├─   25.1 ms - gthr.h
  │ │             │ ├─   17.3 ms - refwrap.h
  │ │             │ └─    8.3 ms - unique_ptr.h
  │ │             └─  123.7 ms - this_thread_sleep.h
  │ │               ├─  100.3 ms - chrono.h
  │ │               └─   15.7 ms - cerrno
  │ └─    8.1 ms - fl/task/task.h
  │   └─    3.2 ms - fl/trace.h
  │     ├─    2.0 ms - fl/stl/chrono.h
  │     └─    0.9 ms - fl/stl/tuple.h
  ├─  291.0 ms - fl/task/promise.h
  │ ├─  249.3 ms - fl/stl/function.h
  │ │ ├─  140.1 ms - fl/stl/vector.h
  │ │ │ ├─  111.8 ms - fl/math/math.h
  │ │ │ │ └─  107.3 ms - fl/stl/undef.h
  │ │ │ │   └─  196.1 ms - stdlib.h
  │ │ │ │     ├─  100.3 ms - cstdlib
  │ │ │ │     │ └─  196.1 ms - stdlib.h
  │ │ │ │     │   ├─  100.3 ms - cstdlib
  │ │ │ │     │   │ └─  196.1 ms - stdlib.h
  │ │ │ │     │   ├─   55.4 ms - types.h
  │ │ │ │     │   │ ├─   55.4 ms - types.h
  │ │ │ │     │   │ ├─   10.4 ms - select.h
  │ │ │ │     │   │ ├─    7.4 ms - endian.h
  │ │ │ │     │   │ └─    7.3 ms - pthreadtypes.h
  │ │ │ │     │   ├─    3.5 ms - floatn.h
  │ │ │ │     │   └─    3.2 ms - locale_t.h
  │ │ │ │     ├─   55.4 ms - types.h
  │ │ │ │     │ ├─   55.4 ms - types.h
  │ │ │ │     │ │ ├─   55.4 ms - types.h
  │ │ │ │     │ │ │ ├─   55.4 ms - types.h
  │ │ │ │     │ │ │ ├─   10.4 ms - select.h
  │ │ │ │     │ │ │ ├─    7.4 ms - endian.h
  │ │ │ │     │ │ │ └─    7.3 ms - pthreadtypes.h
  │ │ │ │     │ │ ├─   10.4 ms - select.h
  │ │ │ │     │ │ ├─    7.4 ms - endian.h
  │ │ │ │     │ │ └─    7.3 ms - pthreadtypes.h
  │ │ │ │     │ │   └─    6.9 ms - thread-shared-types.h
  │ │ │ │     │ ├─   10.4 ms - select.h
  │ │ │ │     │ ├─    7.4 ms - endian.h
  │ │ │ │     │ └─    7.3 ms - pthreadtypes.h
  │ │ │ │     │   └─    6.9 ms - thread-shared-types.h
  │ │ │ │     ├─    3.5 ms - floatn.h
  │ │ │ │     └─    3.2 ms - locale_t.h
  │ │ │ ├─   15.3 ms - fl/stl/allocator.h
  │ │ │ │ └─   10.4 ms - fl/stl/bitset.h
  │ │ │ │   └─    6.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    1.9 ms - fl/stl/unique_ptr.h
  │ │ │ ├─    3.9 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.3 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─   64.0 ms - fl/stl/variant.h
  │ │ │ └─   62.4 ms - fl/stl/new.h
  │ │ │   └─   62.3 ms - platforms/new.h
  │ │ │     └─   62.3 ms - platforms/shared/new.h
  │ │ │       └─   58.3 ms - new
  │ │ │         ├─   44.6 ms - c++config.h
  │ │ │         │ └─   39.8 ms - os_defines.h
  │ │ │         │   └─   36.0 ms - features.h
  │ │ │         └─    0.5 ms - version.h
  │ │ ├─   32.2 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   21.8 ms - fl/stl/type_traits.h
  │ │ │ │ └─   16.8 ms - fl/stl/move.h
  │ │ │ ├─    6.0 ms - fl/stl/atomic.h
  │ │ │ │ └─    5.2 ms - platforms/atomic.h
  │ │ │ │   └─    5.1 ms - platforms/shared/atomic.h
  │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ ├─    4.6 ms - fl/stl/compiler_control.h
  │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │   └─    1.6 ms - fl/math/random.h
  │ │     └─    0.8 ms - fl/math/random8.h
  │ └─   37.0 ms - fl/stl/string.h
  │   ├─   11.1 ms - fl/stl/basic_string.h
  │   │ ├─    0.9 ms - fl/stl/not_null.h
  │   │ └─    0.8 ms - fl/stl/iterator.h
  │   ├─    7.1 ms - fl/stl/span.h
  │   │ └─    2.9 ms - fl/math/geometry.h
  │   ├─    4.4 ms - fl/stl/string_view.h
  │   └─    1.3 ms - fl/stl/optional.h
  ├─   10.6 ms - platforms/await.h
  │ └─   10.2 ms - platforms/coroutine_runtime.h
  │   └─    8.7 ms - fl/system/engine_events.h
  │     ├─    4.3 ms - fl/math/screenmap.h
  │     │ └─    3.1 ms - fl/stl/flat_map.h
  │     └─    2.9 ms - fl/math/xymap.h
  │       └─    0.7 ms - fl/math/lut.h
  └─    0.7 ms - fl/task/promise_result.h
fl/fastled.h (384.5ms)
  ├─  215.3 ms - crgb.h
  │ ├─  214.0 ms - fl/gfx/crgb.h
  │ │ └─  209.5 ms - fl/math/ease.h
  │ │   └─  207.6 ms - fl/math/fixed_point.h
  │ │     ├─   86.1 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─   69.0 ms - fl/math/sin32.h
  │ │     │ │ └─   66.3 ms - fl/math/simd.h
  │ │     │ │   └─   65.7 ms - fl/math/simd/types.h
  │ │     │ │     └─   65.4 ms - platforms/simd.h
  │ │     │ │       └─   65.4 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   15.1 ms - fl/math/fixed_point/s24x8.h
  │ │     ├─   15.0 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   15.0 ms - fl/math/fixed_point/s8x24.h
  │ │     └─   14.9 ms - fl/math/fixed_point/s16x16.h
  │ └─    0.9 ms - chsv.h
  │   └─    0.8 ms - fl/gfx/hsv.h
  ├─   73.9 ms - platforms.h
  │ └─   73.8 ms - platforms/stub/fastled_stub.h
  │   ├─   40.6 ms - platforms/stub/fastspi_stub.h
  │   │ └─   40.5 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   34.6 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   32.5 ms - fl/id_tracker.h
  │   │   │   └─   31.6 ms - fl/stl/mutex.h
  │   │   │     └─   31.5 ms - platforms/mutex.h
  │   │   │       └─   31.3 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   31.3 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.5 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   33.2 ms - platforms/stub/clockless_stub.h
  │     └─   33.1 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.8 ms - fl/channels/data.h
  │       │ └─    8.7 ms - fl/channels/config.h
  │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │       │   └─    1.4 ms - fl/chipsets/spi.h
  │       ├─   11.3 ms - fl/system/log.h
  │       │ └─   10.9 ms - fl/stl/strstream.h
  │       ├─    2.3 ms - fl/channels/manager.h
  │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │       └─    1.0 ms - fl/channels/driver.h
  ├─   36.0 ms - colorutils.h
  │ └─   35.1 ms - fl/gfx/colorutils.h
  │   ├─    7.9 ms - fl/gfx/blur.h
  │   │ └─    4.3 ms - fl/gfx/canvas.h
  │   │   └─    2.6 ms - fl/math/alpha.h
  │   └─    2.8 ms - fl/gfx/fill.h
  ├─   20.8 ms - pixel_controller.h
  │ ├─   14.8 ms - pixel_iterator.h
  │ │ └─   14.7 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    4.2 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.3 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    2.6 ms - fl/gfx/gamma_lut.h
  │ │   ├─    4.1 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.6 ms - rgbw.h
  │   └─    2.4 ms - fl/gfx/rgbw.h
  └─   18.6 ms - pixeltypes.h
    ├─   15.5 ms - lib8tion.h
    │ ├─    7.8 ms - fl/math/math8.h
    │ │ ├─    4.0 ms - fl/math/intmap.h
    │ │ │ └─    3.1 ms - platforms/intmap.h
    │ │ ├─    2.0 ms - fl/math/scale8.h
    │ │ │ └─    2.0 ms - platforms/scale8.h
    │ │ │   └─    0.8 ms - platforms/shared/scale8.h
    │ │ └─    1.6 ms - platforms/math8.h
    │ │   └─    1.2 ms - platforms/shared/math8.h
    │ └─    1.6 ms - fl/math/beat.h
    │   └─    0.9 ms - fl/math/trig8.h
    │     └─    0.9 ms - platforms/trig8.h
    │       └─    0.8 ms - platforms/shared/trig8.h
    └─    2.8 ms - crgb.hpp
fl/ui.h (107.5ms)
  ├─   67.7 ms - fl/stl/json.h
  │ └─   53.0 ms - fl/stl/json/types.h
  │   └─    6.3 ms - fl/stl/limits.h
  ├─   10.6 ms - fl/ui_impl.h
  │ └─    9.9 ms - platforms/ui_defs.h
  │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.6 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    1.0 ms - platforms/shared/ui/json/checkbox.h
  │   ├─    0.9 ms - platforms/shared/ui/json/help.h
  │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  └─    5.2 ms - fl/stl/url.h
chipsets.h (24.9ms)
  ├─   10.2 ms - fl/chipsets/ucs7604.h
  │ └─    7.6 ms - fl/chipsets/encoders/ucs7604.h
  ├─    5.8 ms - fl/chipsets/apa102.h
  ├─    1.5 ms - fl/chipsets/lpd880x.h
  ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  └─    0.7 ms - fl/chipsets/ws2801.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1240.7 ms - Source: FastLED.h
  2.  1240.7 ms - Total Source: 
  3.   635.6 ms - Source: fl/task/executor.h
  4.   557.5 ms - Total ParseClass: 
  5.   384.5 ms - Source: fl/fastled.h
  6.   331.8 ms - Source: fl/task/scheduler.h
  7.   322.9 ms - Source: fl/stl/singleton.h
  8.   322.2 ms - Source: fl/stl/thread_local.h
  9.   321.0 ms - Source: fl/stl/thread.h
 10.   320.9 ms - Source: platforms/thread.h
 11.   320.9 ms - Source: platforms/stub/thread_stub.h
 12.   320.8 ms - Source: platforms/stub/thread_stub_stl.h
 13.   316.4 ms - Source: thread
 14.   291.0 ms - Source: fl/task/promise.h
 15.   249.3 ms - Source: fl/stl/function.h
 16.   215.3 ms - Source: crgb.h
 17.   214.0 ms - Source: fl/gfx/crgb.h
 18.   209.5 ms - Source: fl/math/ease.h
 19.   207.6 ms - Source: fl/math/fixed_point.h
 20.   195.6 ms - Total InstantiateFunction: 

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1240.7ms)
    - fl/task/executor.h (635.6ms)
    - fl/fastled.h (384.5ms)
    - fl/task/scheduler.h (331.8ms)
    - fl/stl/singleton.h (322.9ms)
    - fl/stl/thread_local.h (322.2ms)
    - fl/stl/thread.h (321.0ms)
    - platforms/thread.h (320.9ms)
    - platforms/stub/thread_stub.h (320.9ms)
    - platforms/stub/thread_stub_stl.h (320.8ms)

⚠️  Template instantiation time is high (32.3% of total)
✓  Lexing time is acceptable (<10% of total)

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1240.7ms)
2. Consider optimizing fl/task/executor.h (635.6ms)
3. Consider optimizing fl/fastled.h (384.5ms)

================================================================================

…t retry

When RPC ping fails (device already booted, no serial output), the tool
now attempts a DTR reset to reboot the device and retries. This fixes
the common case where the device is idle and not producing output.

Error messages now distinguish between:
- RPC communication failure (not a jumper wire issue)
- Wrong pin pair (suggest --auto-discover-pins)
- No jumper wire connected
- Driver/DMA failure (0 edges captured despite electrical connection)

This helps AI agents correctly diagnose issues instead of always
defaulting to "connect a jumper wire".

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 947.91ms

Top 5 Slowest Headers

  1. FastLED.h - 710.06ms
  2. fl/fastled.h - 300.01ms
  3. fl/task/executor.h - 234.49ms
  4. crgb.h - 168.46ms
  5. fl/gfx/crgb.h - 167.32ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (710.1ms)
⚠️ Header fl/fastled.h exceeds 150ms (300.0ms)
⚠️ Header fl/task/executor.h exceeds 150ms (234.5ms)
⚠️ Header crgb.h exceeds 150ms (168.5ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (167.3ms)
⚠️ Header fl/math/ease.h exceeds 150ms (163.1ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (161.2ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (126.8ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (118.9ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (118.3ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (117.3ms)
⚠️ Header platforms/thread.h exceeds 50ms (117.3ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (117.2ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (117.2ms)
⚠️ Header fl/ui.h exceeds 50ms (98.0ms)
⚠️ Header fl/task/promise.h exceeds 50ms (96.3ms)
⚠️ Header fl/stl/json.h exceeds 50ms (62.8ms)
⚠️ Header fl/stl/function.h exceeds 50ms (56.8ms)
⚠️ Template instantiation time is high (53.8%)

Full Report
================================================================================
FASTLED COMPILATION PERFORMANCE REPORT
================================================================================
Generated: 2026-04-16 20:50:07
Compiler: clang++-17
File: ci/perf/test_compile.cpp

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,251.92 ms
Frontend Time:             14.36 ms (0.6%)
Backend Time:              169.06 ms (7.5%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    15231.89 ms (676.4%)
Templates                   464.51 ms ( 20.6%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1701.8 ms - FastLED.h (SLOW)
   947.8 ms - fl/task/executor.h (SLOW)
   559.7 ms - fl/fastled.h (SLOW)
   537.6 ms - fl/task/promise.h (SLOW)
   497.6 ms - fl/stl/function.h (SLOW)
   398.6 ms - fl/task/scheduler.h (SLOW)
   390.6 ms - fl/stl/singleton.h (SLOW)
   390.0 ms - fl/stl/thread_local.h (SLOW)
   389.0 ms - fl/stl/thread.h (SLOW)
   388.9 ms - platforms/thread.h (SLOW)
   388.9 ms - platforms/stub/thread_stub.h (SLOW)
   388.9 ms - platforms/stub/thread_stub_stl.h (SLOW)
   367.5 ms - crgb.h (SLOW)
   366.4 ms - fl/gfx/crgb.h (SLOW)
   362.2 ms - fl/math/ease.h (SLOW)
   360.3 ms - fl/math/fixed_point.h (SLOW)
   244.4 ms - fl/math/fixed_point/s4x12.h (SLOW)
   242.8 ms - fl/stl/vector.h (SLOW)
   227.9 ms - fl/math/sin32.h (SLOW)
   225.4 ms - fl/math/simd.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1701.8ms)
  ├─  947.8 ms - fl/task/executor.h
  │ ├─  537.6 ms - fl/task/promise.h
  │ │ ├─  497.6 ms - fl/stl/function.h
  │ │ │ ├─  242.8 ms - fl/stl/vector.h
  │ │ │ │ ├─  188.2 ms - fl/math/math.h
  │ │ │ │ │ └─  182.6 ms - fl/stl/undef.h
  │ │ │ │ │   └─  303.9 ms - stdlib.h
  │ │ │ │ │     ├─  169.0 ms - cstdlib
  │ │ │ │ │     │ ├─  303.9 ms - stdlib.h
  │ │ │ │ │     │ │ ├─  169.0 ms - cstdlib
  │ │ │ │ │     │ │ └─   11.5 ms - types.h
  │ │ │ │ │     │ └─    0.6 ms - std_abs.h
  │ │ │ │ │     └─   11.5 ms - types.h
  │ │ │ │ │       ├─   11.5 ms - types.h
  │ │ │ │ │       │ ├─   11.5 ms - types.h
  │ │ │ │ │       │ ├─    3.0 ms - pthreadtypes.h
  │ │ │ │ │       │ ├─    1.7 ms - select.h
  │ │ │ │ │       │ └─    1.4 ms - endian.h
  │ │ │ │ │       ├─    3.0 ms - pthreadtypes.h
  │ │ │ │ │       │ └─    2.5 ms - thread-shared-types.h
  │ │ │ │ │       ├─    1.7 ms - select.h
  │ │ │ │ │       └─    1.4 ms - endian.h
  │ │ │ │ ├─   29.6 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─   16.1 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   11.3 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    7.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    2.4 ms - fl/stl/unique_ptr.h
  │ │ │ │ │       └─    0.5 ms - fl/stl/utility.h
  │ │ │ │ ├─    2.2 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─  138.8 ms - fl/stl/variant.h
  │ │ │ │ └─  137.3 ms - fl/stl/new.h
  │ │ │ │   └─  137.2 ms - platforms/new.h
  │ │ │ │     └─  137.2 ms - platforms/shared/new.h
  │ │ │ │       └─  125.4 ms - new
  │ │ │ │         ├─   51.1 ms - c++config.h
  │ │ │ │         │ └─    3.8 ms - os_defines.h
  │ │ │ │         └─    1.4 ms - version.h
  │ │ │ ├─  101.3 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   68.2 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   62.8 ms - fl/stl/move.h
  │ │ │ │ ├─   28.8 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   27.9 ms - platforms/atomic.h
  │ │ │ │ │   └─   27.9 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ │ ├─    6.4 ms - fl/stl/compiler_control.h
  │ │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │ │   └─    1.6 ms - fl/math/random.h
  │ │ │     └─    0.7 ms - fl/math/random8.h
  │ │ └─   35.6 ms - fl/stl/string.h
  │ │   ├─   10.7 ms - fl/stl/basic_string.h
  │ │   │ ├─    0.9 ms - fl/stl/not_null.h
  │ │   │ └─    0.8 ms - fl/stl/iterator.h
  │ │   ├─    7.1 ms - fl/stl/span.h
  │ │   │ └─    2.9 ms - fl/math/geometry.h
  │ │   ├─    4.3 ms - fl/stl/string_view.h
  │ │   └─    1.2 ms - fl/stl/optional.h
  │ ├─  398.6 ms - fl/task/scheduler.h
  │ │ ├─  390.6 ms - fl/stl/singleton.h
  │ │ │ └─  390.0 ms - fl/stl/thread_local.h
  │ │ │   └─  389.0 ms - fl/stl/thread.h
  │ │ │     └─  388.9 ms - platforms/thread.h
  │ │ │       └─  388.9 ms - platforms/stub/thread_stub.h
  │ │ │         └─  388.9 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  381.4 ms - thread
  │ │ │             ├─  201.9 ms - std_thread.h
  │ │ │             └─  126.5 ms - this_thread_sleep.h
  │ │ └─    7.4 ms - fl/task/task.h
  │ │   └─    2.9 ms - fl/trace.h
  │ │     ├─    1.8 ms - fl/stl/chrono.h
  │ │     └─    0.8 ms - fl/stl/tuple.h
  │ ├─    9.6 ms - platforms/await.h
  │ │ └─    9.3 ms - platforms/coroutine_runtime.h
  │ │   └─    8.0 ms - fl/system/engine_events.h
  │ │     ├─    4.0 ms - fl/math/screenmap.h
  │ │     │ └─    2.9 ms - fl/stl/flat_map.h
  │ │     └─    2.6 ms - fl/math/xymap.h
  │ │       └─    0.6 ms - fl/math/lut.h
  │ └─    0.7 ms - fl/task/promise_result.h
  ├─  559.7 ms - fl/fastled.h
  │ ├─  367.5 ms - crgb.h
  │ │ ├─  366.4 ms - fl/gfx/crgb.h
  │ │ │ └─  362.2 ms - fl/math/ease.h
  │ │ │   └─  360.3 ms - fl/math/fixed_point.h
  │ │ │     ├─  244.4 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  227.9 ms - fl/math/sin32.h
  │ │ │     │ │ └─  225.4 ms - fl/math/simd.h
  │ │ │     │ │   └─  224.9 ms - fl/math/simd/types.h
  │ │ │     │ │     └─  224.6 ms - platforms/simd.h
  │ │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   14.5 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   14.4 ms - fl/math/fixed_point/s16x16.h
  │ │ │     ├─   14.4 ms - fl/math/fixed_point/s8x24.h
  │ │ │     └─   14.1 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.7 ms - chsv.h
  │ │   └─    0.7 ms - fl/gfx/hsv.h
  │ ├─  104.7 ms - platforms.h
  │ │ └─  104.7 ms - platforms/stub/fastled_stub.h
  │ │   ├─   74.0 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   73.9 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   68.5 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   66.7 ms - fl/id_tracker.h
  │ │   │   │   └─   65.8 ms - fl/stl/mutex.h
  │ │   │   │     └─   65.8 ms - platforms/mutex.h
  │ │   │   │       └─   65.7 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.0 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   30.6 ms - platforms/stub/clockless_stub.h
  │ │     └─   30.6 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.2 ms - fl/channels/data.h
  │ │       │ └─    8.3 ms - fl/channels/config.h
  │ │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.4 ms - fl/chipsets/spi.h
  │ │       ├─   10.4 ms - fl/system/log.h
  │ │       │ └─    9.9 ms - fl/stl/strstream.h
  │ │       ├─    2.1 ms - fl/channels/manager.h
  │ │       ├─    1.3 ms - fl/stl/weak_ptr.h
  │ │       └─    1.0 ms - fl/channels/driver.h
  │ ├─   33.4 ms - colorutils.h
  │ │ └─   32.6 ms - fl/gfx/colorutils.h
  │ │   ├─    7.1 ms - fl/gfx/blur.h
  │ │   │ └─    3.9 ms - fl/gfx/canvas.h
  │ │   │   └─    2.4 ms - fl/math/alpha.h
  │ │   └─    2.6 ms - fl/gfx/fill.h
  │ ├─   18.8 ms - pixel_controller.h
  │ │ ├─   13.3 ms - pixel_iterator.h
  │ │ │ └─   13.2 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    3.8 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    2.9 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    2.4 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    3.6 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.2 ms - rgbw.h
  │ │   └─    2.0 ms - fl/gfx/rgbw.h
  │ └─   17.1 ms - pixeltypes.h
  │   ├─   14.3 ms - lib8tion.h
  │   │ ├─    7.2 ms - fl/math/math8.h
  │   │ │ ├─    3.6 ms - fl/math/intmap.h
  │   │ │ │ └─    2.9 ms - platforms/intmap.h
  │   │ │ ├─    1.9 ms - fl/math/scale8.h
  │   │ │ │ └─    1.8 ms - platforms/scale8.h
  │   │ │ │   └─    0.8 ms - platforms/shared/scale8.h
  │   │ │ └─    1.5 ms - platforms/math8.h
  │   │ │   └─    1.2 ms - platforms/shared/math8.h
  │   │ └─    1.5 ms - fl/math/beat.h
  │   │   └─    0.8 ms - fl/math/trig8.h
  │   │     └─    0.8 ms - platforms/trig8.h
  │   │       └─    0.7 ms - platforms/shared/trig8.h
  │   └─    2.5 ms - crgb.hpp
  ├─  100.0 ms - fl/ui.h
  │ ├─   64.0 ms - fl/stl/json.h
  │ │ └─   50.2 ms - fl/stl/json/types.h
  │ │   └─    5.7 ms - fl/stl/limits.h
  │ ├─    9.0 ms - fl/ui_impl.h
  │ │ └─    8.5 ms - platforms/ui_defs.h
  │ │   ├─    1.8 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    0.9 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.4 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.5 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/checkbox.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ └─    4.8 ms - fl/stl/url.h
  ├─   23.3 ms - chipsets.h
  │ ├─    9.5 ms - fl/chipsets/ucs7604.h
  │ │ └─    7.1 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    5.5 ms - fl/chipsets/apa102.h
  │ ├─    1.4 ms - fl/chipsets/lpd880x.h
  │ ├─    0.7 ms - fl/chipsets/encoders/ws2816.h
  │ └─    0.7 ms - fl/chipsets/p9813.h
  └─   19.1 ms - fl/audio/audio_processor.h
    ├─    4.9 ms - fl/audio/audio_context.h
    │ └─    1.4 ms - fl/audio/fft/fft.h
    ├─    1.5 ms - fl/audio/detector/vibe.h
    └─    0.8 ms - fl/audio/signal_conditioner.h
fl/task/executor.h (947.8ms)
  ├─  537.6 ms - fl/task/promise.h
  │ ├─  497.6 ms - fl/stl/function.h
  │ │ ├─  242.8 ms - fl/stl/vector.h
  │ │ │ ├─  188.2 ms - fl/math/math.h
  │ │ │ │ └─  182.6 ms - fl/stl/undef.h
  │ │ │ │   └─  303.9 ms - stdlib.h
  │ │ │ │     ├─  169.0 ms - cstdlib
  │ │ │ │     │ ├─  303.9 ms - stdlib.h
  │ │ │ │     │ │ ├─  169.0 ms - cstdlib
  │ │ │ │     │ │ │ ├─  303.9 ms - stdlib.h
  │ │ │ │     │ │ │ └─    0.6 ms - std_abs.h
  │ │ │ │     │ │ └─   11.5 ms - types.h
  │ │ │ │     │ │   ├─   11.5 ms - types.h
  │ │ │ │     │ │   ├─    3.0 ms - pthreadtypes.h
  │ │ │ │     │ │   ├─    1.7 ms - select.h
  │ │ │ │     │ │   └─    1.4 ms - endian.h
  │ │ │ │     │ └─    0.6 ms - std_abs.h
  │ │ │ │     └─   11.5 ms - types.h
  │ │ │ │       ├─   11.5 ms - types.h
  │ │ │ │       │ ├─   11.5 ms - types.h
  │ │ │ │       │ │ ├─   11.5 ms - types.h
  │ │ │ │       │ │ ├─    3.0 ms - pthreadtypes.h
  │ │ │ │       │ │ ├─    1.7 ms - select.h
  │ │ │ │       │ │ └─    1.4 ms - endian.h
  │ │ │ │       │ ├─    3.0 ms - pthreadtypes.h
  │ │ │ │       │ │ └─    2.5 ms - thread-shared-types.h
  │ │ │ │       │ ├─    1.7 ms - select.h
  │ │ │ │       │ └─    1.4 ms - endian.h
  │ │ │ │       ├─    3.0 ms - pthreadtypes.h
  │ │ │ │       │ └─    2.5 ms - thread-shared-types.h
  │ │ │ │       ├─    1.7 ms - select.h
  │ │ │ │       └─    1.4 ms - endian.h
  │ │ │ ├─   29.6 ms - fl/stl/initializer_list.h
  │ │ │ ├─   16.1 ms - fl/stl/allocator.h
  │ │ │ │ └─   11.3 ms - fl/stl/bitset.h
  │ │ │ │   └─    7.7 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    2.4 ms - fl/stl/unique_ptr.h
  │ │ │ │       └─    0.5 ms - fl/stl/utility.h
  │ │ │ ├─    2.2 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─  138.8 ms - fl/stl/variant.h
  │ │ │ └─  137.3 ms - fl/stl/new.h
  │ │ │   └─  137.2 ms - platforms/new.h
  │ │ │     └─  137.2 ms - platforms/shared/new.h
  │ │ │       └─  125.4 ms - new
  │ │ │         ├─   51.1 ms - c++config.h
  │ │ │         │ └─    3.8 ms - os_defines.h
  │ │ │         │   └─    3.4 ms - features.h
  │ │ │         └─    1.4 ms - version.h
  │ │ ├─  101.3 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   68.2 ms - fl/stl/type_traits.h
  │ │ │ │ └─   62.8 ms - fl/stl/move.h
  │ │ │ ├─   28.8 ms - fl/stl/atomic.h
  │ │ │ │ └─   27.9 ms - platforms/atomic.h
  │ │ │ │   └─   27.9 ms - platforms/shared/atomic.h
  │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ ├─    6.4 ms - fl/stl/compiler_control.h
  │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │   └─    1.6 ms - fl/math/random.h
  │ │     └─    0.7 ms - fl/math/random8.h
  │ └─   35.6 ms - fl/stl/string.h
  │   ├─   10.7 ms - fl/stl/basic_string.h
  │   │ ├─    0.9 ms - fl/stl/not_null.h
  │   │ └─    0.8 ms - fl/stl/iterator.h
  │   ├─    7.1 ms - fl/stl/span.h
  │   │ └─    2.9 ms - fl/math/geometry.h
  │   ├─    4.3 ms - fl/stl/string_view.h
  │   └─    1.2 ms - fl/stl/optional.h
  ├─  398.6 ms - fl/task/scheduler.h
  │ ├─  390.6 ms - fl/stl/singleton.h
  │ │ └─  390.0 ms - fl/stl/thread_local.h
  │ │   └─  389.0 ms - fl/stl/thread.h
  │ │     └─  388.9 ms - platforms/thread.h
  │ │       └─  388.9 ms - platforms/stub/thread_stub.h
  │ │         └─  388.9 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  381.4 ms - thread
  │ │             ├─  201.9 ms - std_thread.h
  │ │             │ ├─   61.3 ms - tuple
  │ │             │ ├─   41.1 ms - refwrap.h
  │ │             │ ├─   35.9 ms - iosfwd
  │ │             │ ├─   10.1 ms - gthr.h
  │ │             │ └─    5.1 ms - unique_ptr.h
  │ │             └─  126.5 ms - this_thread_sleep.h
  │ │               ├─  108.7 ms - chrono.h
  │ │               └─    4.1 ms - cerrno
  │ └─    7.4 ms - fl/task/task.h
  │   └─    2.9 ms - fl/trace.h
  │     ├─    1.8 ms - fl/stl/chrono.h
  │     └─    0.8 ms - fl/stl/tuple.h
  ├─    9.6 ms - platforms/await.h
  │ └─    9.3 ms - platforms/coroutine_runtime.h
  │   └─    8.0 ms - fl/system/engine_events.h
  │     ├─    4.0 ms - fl/math/screenmap.h
  │     │ └─    2.9 ms - fl/stl/flat_map.h
  │     └─    2.6 ms - fl/math/xymap.h
  │       └─    0.6 ms - fl/math/lut.h
  └─    0.7 ms - fl/task/promise_result.h
fl/fastled.h (559.7ms)
  ├─  367.5 ms - crgb.h
  │ ├─  366.4 ms - fl/gfx/crgb.h
  │ │ └─  362.2 ms - fl/math/ease.h
  │ │   └─  360.3 ms - fl/math/fixed_point.h
  │ │     ├─  244.4 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  227.9 ms - fl/math/sin32.h
  │ │     │ │ └─  225.4 ms - fl/math/simd.h
  │ │     │ │   └─  224.9 ms - fl/math/simd/types.h
  │ │     │ │     └─  224.6 ms - platforms/simd.h
  │ │     │ │       └─  224.6 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.7 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   14.5 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   14.4 ms - fl/math/fixed_point/s16x16.h
  │ │     ├─   14.4 ms - fl/math/fixed_point/s8x24.h
  │ │     └─   14.1 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.7 ms - chsv.h
  │   └─    0.7 ms - fl/gfx/hsv.h
  ├─  104.7 ms - platforms.h
  │ └─  104.7 ms - platforms/stub/fastled_stub.h
  │   ├─   74.0 ms - platforms/stub/fastspi_stub.h
  │   │ └─   73.9 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   68.5 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   66.7 ms - fl/id_tracker.h
  │   │   │   └─   65.8 ms - fl/stl/mutex.h
  │   │   │     └─   65.8 ms - platforms/mutex.h
  │   │   │       └─   65.7 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   65.7 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.0 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   30.6 ms - platforms/stub/clockless_stub.h
  │     └─   30.6 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.2 ms - fl/channels/data.h
  │       │ └─    8.3 ms - fl/channels/config.h
  │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │       │   └─    1.4 ms - fl/chipsets/spi.h
  │       ├─   10.4 ms - fl/system/log.h
  │       │ └─    9.9 ms - fl/stl/strstream.h
  │       ├─    2.1 ms - fl/channels/manager.h
  │       ├─    1.3 ms - fl/stl/weak_ptr.h
  │       └─    1.0 ms - fl/channels/driver.h
  ├─   33.4 ms - colorutils.h
  │ └─   32.6 ms - fl/gfx/colorutils.h
  │   ├─    7.1 ms - fl/gfx/blur.h
  │   │ └─    3.9 ms - fl/gfx/canvas.h
  │   │   └─    2.4 ms - fl/math/alpha.h
  │   └─    2.6 ms - fl/gfx/fill.h
  ├─   18.8 ms - pixel_controller.h
  │ ├─   13.3 ms - pixel_iterator.h
  │ │ └─   13.2 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    3.8 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    2.9 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    2.4 ms - fl/gfx/gamma_lut.h
  │ │   ├─    3.6 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.2 ms - rgbw.h
  │   └─    2.0 ms - fl/gfx/rgbw.h
  └─   17.1 ms - pixeltypes.h
    ├─   14.3 ms - lib8tion.h
    │ ├─    7.2 ms - fl/math/math8.h
    │ │ ├─    3.6 ms - fl/math/intmap.h
    │ │ │ └─    2.9 ms - platforms/intmap.h
    │ │ ├─    1.9 ms - fl/math/scale8.h
    │ │ │ └─    1.8 ms - platforms/scale8.h
    │ │ │   └─    0.8 ms - platforms/shared/scale8.h
    │ │ └─    1.5 ms - platforms/math8.h
    │ │   └─    1.2 ms - platforms/shared/math8.h
    │ └─    1.5 ms - fl/math/beat.h
    │   └─    0.8 ms - fl/math/trig8.h
    │     └─    0.8 ms - platforms/trig8.h
    │       └─    0.7 ms - platforms/shared/trig8.h
    └─    2.5 ms - crgb.hpp
fl/ui.h (100.0ms)
  ├─   64.0 ms - fl/stl/json.h
  │ └─   50.2 ms - fl/stl/json/types.h
  │   └─    5.7 ms - fl/stl/limits.h
  ├─    9.0 ms - fl/ui_impl.h
  │ └─    8.5 ms - platforms/ui_defs.h
  │   ├─    1.8 ms - platforms/shared/ui/json/audio.h
  │   │ └─    0.9 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.4 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.5 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.8 ms - platforms/shared/ui/json/checkbox.h
  │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  └─    4.8 ms - fl/stl/url.h
chipsets.h (23.3ms)
  ├─    9.5 ms - fl/chipsets/ucs7604.h
  │ └─    7.1 ms - fl/chipsets/encoders/ucs7604.h
  ├─    5.5 ms - fl/chipsets/apa102.h
  ├─    1.4 ms - fl/chipsets/lpd880x.h
  ├─    0.7 ms - fl/chipsets/encoders/ws2816.h
  └─    0.7 ms - fl/chipsets/p9813.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1701.8 ms - Source: FastLED.h
  2.  1701.8 ms - Total Source: 
  3.   947.8 ms - Source: fl/task/executor.h
  4.   559.7 ms - Source: fl/fastled.h
  5.   551.8 ms - Total ParseClass: 
  6.   537.6 ms - Source: fl/task/promise.h
  7.   497.6 ms - Source: fl/stl/function.h
  8.   398.6 ms - Source: fl/task/scheduler.h
  9.   390.6 ms - Source: fl/stl/singleton.h
 10.   390.0 ms - Source: fl/stl/thread_local.h
 11.   389.0 ms - Source: fl/stl/thread.h
 12.   388.9 ms - Source: platforms/thread.h
 13.   388.9 ms - Source: platforms/stub/thread_stub.h
 14.   388.9 ms - Source: platforms/stub/thread_stub_stl.h
 15.   381.4 ms - Source: thread
 16.   367.5 ms - Source: crgb.h
 17.   366.4 ms - Source: fl/gfx/crgb.h
 18.   362.2 ms - Source: fl/math/ease.h
 19.   360.3 ms - Source: fl/math/fixed_point.h
 20.   244.4 ms - Source: fl/math/fixed_point/s4x12.h

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1701.8ms)
    - fl/task/executor.h (947.8ms)
    - fl/fastled.h (559.7ms)
    - fl/task/promise.h (537.6ms)
    - fl/stl/function.h (497.6ms)
    - fl/task/scheduler.h (398.6ms)
    - fl/stl/singleton.h (390.6ms)
    - fl/stl/thread_local.h (390.0ms)
    - fl/stl/thread.h (389.0ms)
    - platforms/thread.h (388.9ms)

⚠️  Template instantiation time is high (20.6% of total)
✓  Lexing time is acceptable (<10% of total)

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1701.8ms)
2. Consider optimizing fl/task/executor.h (947.8ms)
3. Consider optimizing fl/fastled.h (559.7ms)

================================================================================

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
ci/autoresearch/gpio.py (1)

62-105: Consider extracting the DTR-reset helper — it is duplicated verbatim.

The DTR-reset + reconnect sequence at lines 62–90 is ~30 lines and is duplicated in run_pin_discovery at lines 252–281 with only a timeout=30.0 difference on the retry ping. Extracting something like async def _dtr_reset_and_reconnect(port, serial_interface, timeout, ping_timeout=None) -> RpcClient would deduplicate and make the (currently inconsistent) client = None handling uniform across both call sites.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ci/autoresearch/gpio.py` around lines 62 - 105, Extract the duplicated
DTR-reset + reconnect block into an async helper named
_dtr_reset_and_reconnect(port, serial_interface, timeout, ping_retries=3,
ping_wait=3.0) that performs the serial DTR toggle, reopens RpcClient, calls
connect(boot_wait=ping_wait, drain_boot=True), sends a "ping" with the given
retries, and returns the connected RpcClient (or raises the caught exception);
update both call sites (the current code using client, and run_pin_discovery) to
call this helper, pass ping_retries/ ping_wait to preserve the different retry
behavior (e.g., ping_timeout/timeout difference), ensure KeyboardInterrupt is
still handled by delegating to handle_keyboard_interrupt before re-raising, and
make sure client variable handling is consistent (assign returned RpcClient to
client or return False on handled failures as existing logic expects).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ci/autoresearch/gpio.py`:
- Around line 64-105: The DTR-reset block calls await client.close() then later
reassigns client to a new RpcClient, but doesn't set client = None after closing
— so if an exception occurs before the reassignment the outer finally will
double-close the already-closed RpcClient; to fix, after calling await
client.close() in the DTR-reset branch (the block that creates pyserial and
constructs RpcClient), set client = None immediately, then only reassign client
when you successfully create the new RpcClient and connect (the RpcClient(...) +
await client.connect(...) sequence); follow the same pattern used in
run_pin_discovery (set client = None after close) so the outer finally can
safely skip closing when client is None.
- Around line 62-105: Hoist the missing imports (import serial as pyserial and
import asyncio) to the top of the module with the other third-party imports,
then wrap the pyserial.Serial(...) usage in the DTR-reset block in a try/finally
that ensures the serial handle (s) is closed even if await asyncio.sleep or
other awaits raise; update the except block where RpcClient is recreated and
handle_keyboard_interrupt is used to reference the same s variable scope and
ensure s.close() runs in the finally before any return or re-raise.
- Around line 68-75: The current DTR-only pulse using s = pyserial.Serial(...),
s.dtr and awaits does not reliably reset ESP32-S3; update the sequence to mirror
esptool: start with s.rts=False, s.dtr=False (idle), then s.dtr=True (GPIO0 low)
while s.rts stays False, then pulse s.rts=True (EN low) briefly, then
s.rts=False (release EN so GPIO0 state is sampled), and finally s.dtr=False; use
the existing asyncio.sleep timing around each transition and s.close() as
before; if the goal was only USB-CDC re-enumeration rather than hardware reset,
instead leave DTR-only logic but change the "DTR reset" log messages to clarify
re-enumeration intent.

In `@ci/autoresearch/phases.py`:
- Around line 1011-1016: The diagnostic prints can show "TX=None, RX=None"
because ctx.effective_tx_pin and ctx.effective_rx_pin are int | None; change the
prints to use the same fallback as run_gpio_pretest by computing tested_tx =
ctx.effective_tx_pin or PIN_TX and tested_rx = ctx.effective_rx_pin or PIN_RX
(or similar) once before the diagnostic block, then use tested_tx/tested_rx in
the f-strings for the lines referencing tested pins; update both the "tested
TX=…" message and the "between GPIO … and GPIO …" line to use those variables
instead of ctx.effective_tx_pin/ctx.effective_rx_pin.

---

Nitpick comments:
In `@ci/autoresearch/gpio.py`:
- Around line 62-105: Extract the duplicated DTR-reset + reconnect block into an
async helper named _dtr_reset_and_reconnect(port, serial_interface, timeout,
ping_retries=3, ping_wait=3.0) that performs the serial DTR toggle, reopens
RpcClient, calls connect(boot_wait=ping_wait, drain_boot=True), sends a "ping"
with the given retries, and returns the connected RpcClient (or raises the
caught exception); update both call sites (the current code using client, and
run_pin_discovery) to call this helper, pass ping_retries/ ping_wait to preserve
the different retry behavior (e.g., ping_timeout/timeout difference), ensure
KeyboardInterrupt is still handled by delegating to handle_keyboard_interrupt
before re-raising, and make sure client variable handling is consistent (assign
returned RpcClient to client or return False on handled failures as existing
logic expects).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 87be055c-7390-457c-bb21-b68bed2c19ea

📥 Commits

Reviewing files that changed from the base of the PR and between 2320b2f and 2168882.

📒 Files selected for processing (2)
  • ci/autoresearch/gpio.py
  • ci/autoresearch/phases.py

Comment thread ci/autoresearch/gpio.py Resolved
Comment thread ci/autoresearch/gpio.py Resolved
Comment thread ci/autoresearch/gpio.py Resolved
Comment thread ci/autoresearch/phases.py Resolved
…w pyserial workaround

- Add reset_device(board) to SerialInterface protocol
- FbuildSerialAdapter delegates to fbuild 2.1.15's SerialMonitor.reset_device()
- PySerialAdapter uses direct DTR toggle as fallback
- gpio.py now uses serial_interface.reset_device() instead of raw pyserial
- FbuildSerialAdapter falls back to pyserial for older fbuild versions

Closes #2264

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1012.59ms

Top 5 Slowest Headers

  1. FastLED.h - 764.32ms
  2. fl/fastled.h - 322.04ms
  3. fl/task/executor.h - 247.83ms
  4. crgb.h - 176.31ms
  5. fl/gfx/crgb.h - 174.98ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (764.3ms)
⚠️ Header fl/fastled.h exceeds 150ms (322.0ms)
⚠️ Header fl/task/executor.h exceeds 150ms (247.8ms)
⚠️ Header crgb.h exceeds 150ms (176.3ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (175.0ms)
⚠️ Header fl/math/ease.h exceeds 150ms (170.6ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (168.7ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (130.0ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (121.0ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (120.4ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (119.2ms)
⚠️ Header platforms/thread.h exceeds 50ms (119.1ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (119.1ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (119.0ms)
⚠️ Header fl/ui.h exceeds 50ms (107.6ms)
⚠️ Header fl/task/promise.h exceeds 50ms (105.4ms)
⚠️ Header fl/stl/json.h exceeds 50ms (68.2ms)
⚠️ Header fl/stl/function.h exceeds 50ms (61.9ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (53.6ms)
⚠️ Header platforms.h exceeds 50ms (51.0ms)
⚠️ Header platforms/stub/fastled_stub.h exceeds 50ms (50.9ms)
⚠️ Template instantiation time is high (52.6%)

Full Report
================================================================================
FASTLED COMPILATION PERFORMANCE REPORT
================================================================================
Generated: 2026-04-17 06:13:07
Compiler: clang++-17
File: ci/perf/test_compile.cpp

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,472.28 ms
Frontend Time:             16.17 ms (0.7%)
Backend Time:              563.75 ms (22.8%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    12850.95 ms (519.8%)
Templates                   576.03 ms ( 23.3%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1519.4 ms - FastLED.h (SLOW)
   877.3 ms - fl/task/executor.h (SLOW)
   469.0 ms - fl/task/promise.h (SLOW)
   426.8 ms - fl/stl/function.h (SLOW)
   395.9 ms - fl/task/scheduler.h (SLOW)
   387.0 ms - fl/stl/singleton.h (SLOW)
   386.3 ms - fl/stl/thread_local.h (SLOW)
   385.4 ms - fl/fastled.h (SLOW)
   385.2 ms - fl/stl/thread.h (SLOW)
   385.1 ms - platforms/thread.h (SLOW)
   385.1 ms - platforms/stub/thread_stub.h (SLOW)
   385.0 ms - platforms/stub/thread_stub_stl.h (SLOW)
   209.8 ms - crgb.h (SLOW)
   208.5 ms - fl/gfx/crgb.h (SLOW)
   204.1 ms - fl/math/ease.h (SLOW)
   202.3 ms - fl/math/fixed_point.h (SLOW)
   188.9 ms - fl/stl/vector.h (SLOW)
   158.9 ms - fl/math/math.h (SLOW)
   154.3 ms - fl/stl/undef.h (SLOW)
   110.4 ms - fl/ui.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1519.4ms)
  ├─  877.3 ms - fl/task/executor.h
  │ ├─  469.0 ms - fl/task/promise.h
  │ │ ├─  426.8 ms - fl/stl/function.h
  │ │ │ ├─  188.9 ms - fl/stl/vector.h
  │ │ │ │ ├─  158.9 ms - fl/math/math.h
  │ │ │ │ │ └─  154.3 ms - fl/stl/undef.h
  │ │ │ │ │   └─  285.2 ms - stdlib.h
  │ │ │ │ │     ├─  145.1 ms - cstdlib
  │ │ │ │ │     │ └─  285.2 ms - stdlib.h
  │ │ │ │ │     │   ├─  145.1 ms - cstdlib
  │ │ │ │ │     │   ├─   72.0 ms - types.h
  │ │ │ │ │     │   ├─    4.6 ms - locale_t.h
  │ │ │ │ │     │   └─    4.1 ms - floatn.h
  │ │ │ │ │     ├─   72.0 ms - types.h
  │ │ │ │ │     │ ├─   72.0 ms - types.h
  │ │ │ │ │     │ │ ├─   72.0 ms - types.h
  │ │ │ │ │     │ │ ├─   13.7 ms - select.h
  │ │ │ │ │     │ │ ├─    9.9 ms - endian.h
  │ │ │ │ │     │ │ └─    9.2 ms - pthreadtypes.h
  │ │ │ │ │     │ ├─   13.7 ms - select.h
  │ │ │ │ │     │ ├─    9.9 ms - endian.h
  │ │ │ │ │     │ └─    9.2 ms - pthreadtypes.h
  │ │ │ │ │     │   └─    8.8 ms - thread-shared-types.h
  │ │ │ │ │     ├─    4.6 ms - locale_t.h
  │ │ │ │ │     └─    4.1 ms - floatn.h
  │ │ │ │ ├─   15.4 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   10.5 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    6.8 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    1.9 ms - fl/stl/unique_ptr.h
  │ │ │ │ ├─    5.3 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.4 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─   92.9 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   70.1 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   64.8 ms - fl/stl/move.h
  │ │ │ │ ├─   18.3 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   17.4 ms - platforms/atomic.h
  │ │ │ │ │   └─   17.4 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ │ ├─   84.4 ms - fl/stl/variant.h
  │ │ │ │ └─   82.7 ms - fl/stl/new.h
  │ │ │ │   └─   82.7 ms - platforms/new.h
  │ │ │ │     └─   82.7 ms - platforms/shared/new.h
  │ │ │ │       └─   78.1 ms - new
  │ │ │ │         ├─   63.5 ms - c++config.h
  │ │ │ │         │ └─   55.6 ms - os_defines.h
  │ │ │ │         └─    0.5 ms - version.h
  │ │ │ ├─   51.8 ms - fl/stl/compiler_control.h
  │ │ │ └─    3.8 ms - fl/stl/algorithm.h
  │ │ │   └─    1.6 ms - fl/math/random.h
  │ │ │     └─    0.8 ms - fl/math/random8.h
  │ │ └─   37.3 ms - fl/stl/string.h
  │ │   ├─   11.2 ms - fl/stl/basic_string.h
  │ │   │ ├─    0.9 ms - fl/stl/not_null.h
  │ │   │ └─    0.8 ms - fl/stl/iterator.h
  │ │   ├─    7.1 ms - fl/stl/span.h
  │ │   │ └─    3.0 ms - fl/math/geometry.h
  │ │   ├─    4.4 ms - fl/stl/string_view.h
  │ │   └─    1.3 ms - fl/stl/optional.h
  │ ├─  395.9 ms - fl/task/scheduler.h
  │ │ ├─  387.0 ms - fl/stl/singleton.h
  │ │ │ └─  386.3 ms - fl/stl/thread_local.h
  │ │ │   └─  385.2 ms - fl/stl/thread.h
  │ │ │     └─  385.1 ms - platforms/thread.h
  │ │ │       └─  385.1 ms - platforms/stub/thread_stub.h
  │ │ │         └─  385.0 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  379.3 ms - thread
  │ │ │             ├─  231.5 ms - std_thread.h
  │ │ │             └─  130.5 ms - this_thread_sleep.h
  │ │ └─    8.1 ms - fl/task/task.h
  │ │   └─    3.2 ms - fl/trace.h
  │ │     ├─    2.0 ms - fl/stl/chrono.h
  │ │     └─    0.8 ms - fl/stl/tuple.h
  │ ├─   10.3 ms - platforms/await.h
  │ │ └─    9.9 ms - platforms/coroutine_runtime.h
  │ │   └─    8.4 ms - fl/system/engine_events.h
  │ │     ├─    4.2 ms - fl/math/screenmap.h
  │ │     │ └─    3.0 ms - fl/stl/flat_map.h
  │ │     └─    2.8 ms - fl/math/xymap.h
  │ │       └─    0.7 ms - fl/math/lut.h
  │ └─    0.7 ms - fl/task/promise_result.h
  ├─  385.4 ms - fl/fastled.h
  │ ├─  209.8 ms - crgb.h
  │ │ ├─  208.5 ms - fl/gfx/crgb.h
  │ │ │ └─  204.1 ms - fl/math/ease.h
  │ │ │   └─  202.3 ms - fl/math/fixed_point.h
  │ │ │     ├─   80.6 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─   63.6 ms - fl/math/sin32.h
  │ │ │     │ │ └─   61.0 ms - fl/math/simd.h
  │ │ │     │ │   └─   60.5 ms - fl/math/simd/types.h
  │ │ │     │ │     └─   60.2 ms - platforms/simd.h
  │ │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   15.2 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   15.1 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   14.8 ms - fl/math/fixed_point/s16x16.h
  │ │ │     └─   14.6 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.8 ms - chsv.h
  │ │   └─    0.7 ms - fl/gfx/hsv.h
  │ ├─   80.6 ms - platforms.h
  │ │ └─   80.5 ms - platforms/stub/fastled_stub.h
  │ │   ├─   47.4 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   47.4 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   41.3 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   39.3 ms - fl/id_tracker.h
  │ │   │   │   └─   38.3 ms - fl/stl/mutex.h
  │ │   │   │     └─   38.2 ms - platforms/mutex.h
  │ │   │   │       └─   38.1 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.6 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   33.1 ms - platforms/stub/clockless_stub.h
  │ │     └─   33.0 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.8 ms - fl/channels/data.h
  │ │       │ └─    8.7 ms - fl/channels/config.h
  │ │       │   ├─    1.9 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.4 ms - fl/chipsets/spi.h
  │ │       ├─   11.4 ms - fl/system/log.h
  │ │       │ └─   10.9 ms - fl/stl/strstream.h
  │ │       ├─    2.3 ms - fl/channels/manager.h
  │ │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │ │       └─    1.0 ms - fl/channels/driver.h
  │ ├─   35.8 ms - colorutils.h
  │ │ └─   35.0 ms - fl/gfx/colorutils.h
  │ │   ├─    7.9 ms - fl/gfx/blur.h
  │ │   │ └─    4.3 ms - fl/gfx/canvas.h
  │ │   │   └─    2.6 ms - fl/math/alpha.h
  │ │   └─    2.8 ms - fl/gfx/fill.h
  │ ├─   20.6 ms - pixel_controller.h
  │ │ ├─   14.8 ms - pixel_iterator.h
  │ │ │ └─   14.7 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    4.1 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    4.0 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.1 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    2.6 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.4 ms - rgbw.h
  │ │   └─    2.2 ms - fl/gfx/rgbw.h
  │ └─   18.7 ms - pixeltypes.h
  │   ├─   15.4 ms - lib8tion.h
  │   │ ├─    7.8 ms - fl/math/math8.h
  │   │ │ ├─    4.0 ms - fl/math/intmap.h
  │   │ │ │ └─    3.1 ms - platforms/intmap.h
  │   │ │ ├─    2.0 ms - fl/math/scale8.h
  │   │ │ │ └─    2.0 ms - platforms/scale8.h
  │   │ │ │   └─    0.8 ms - platforms/shared/scale8.h
  │   │ │ └─    1.6 ms - platforms/math8.h
  │   │ │   └─    1.2 ms - platforms/shared/math8.h
  │   │ └─    1.6 ms - fl/math/beat.h
  │   │   └─    0.9 ms - fl/math/trig8.h
  │   │     └─    0.8 ms - platforms/trig8.h
  │   │       └─    0.7 ms - platforms/shared/trig8.h
  │   └─    2.9 ms - crgb.hpp
  ├─  110.4 ms - fl/ui.h
  │ ├─   70.1 ms - fl/stl/json.h
  │ │ └─   55.4 ms - fl/stl/json/types.h
  │ │   └─    7.3 ms - fl/stl/limits.h
  │ ├─   10.6 ms - fl/ui_impl.h
  │ │ └─    9.9 ms - platforms/ui_defs.h
  │ │   ├─    2.3 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.1 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.5 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/checkbox.h
  │ │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  │ └─    5.0 ms - fl/stl/url.h
  ├─   33.7 ms - fl/stl/stdint.h
  │ └─   33.5 ms - platforms/int.h
  │   └─   33.1 ms - platforms/shared/int.h
  │     └─   32.9 ms - platforms/shared/int_linux.h
  └─   28.8 ms - fl/audio/audio_processor.h
    ├─    7.8 ms - fl/audio/audio_context.h
    │ └─    2.4 ms - fl/audio/fft/fft.h
    ├─    2.3 ms - fl/audio/detector/vibe.h
    ├─    1.2 ms - fl/audio/signal_conditioner.h
    └─    0.5 ms - fl/audio/noise_floor_tracker.h
fl/task/executor.h (877.3ms)
  ├─  469.0 ms - fl/task/promise.h
  │ ├─  426.8 ms - fl/stl/function.h
  │ │ ├─  188.9 ms - fl/stl/vector.h
  │ │ │ ├─  158.9 ms - fl/math/math.h
  │ │ │ │ └─  154.3 ms - fl/stl/undef.h
  │ │ │ │   └─  285.2 ms - stdlib.h
  │ │ │ │     ├─  145.1 ms - cstdlib
  │ │ │ │     │ └─  285.2 ms - stdlib.h
  │ │ │ │     │   ├─  145.1 ms - cstdlib
  │ │ │ │     │   │ └─  285.2 ms - stdlib.h
  │ │ │ │     │   ├─   72.0 ms - types.h
  │ │ │ │     │   │ ├─   72.0 ms - types.h
  │ │ │ │     │   │ ├─   13.7 ms - select.h
  │ │ │ │     │   │ ├─    9.9 ms - endian.h
  │ │ │ │     │   │ └─    9.2 ms - pthreadtypes.h
  │ │ │ │     │   ├─    4.6 ms - locale_t.h
  │ │ │ │     │   └─    4.1 ms - floatn.h
  │ │ │ │     ├─   72.0 ms - types.h
  │ │ │ │     │ ├─   72.0 ms - types.h
  │ │ │ │     │ │ ├─   72.0 ms - types.h
  │ │ │ │     │ │ │ ├─   72.0 ms - types.h
  │ │ │ │     │ │ │ ├─   13.7 ms - select.h
  │ │ │ │     │ │ │ ├─    9.9 ms - endian.h
  │ │ │ │     │ │ │ └─    9.2 ms - pthreadtypes.h
  │ │ │ │     │ │ ├─   13.7 ms - select.h
  │ │ │ │     │ │ ├─    9.9 ms - endian.h
  │ │ │ │     │ │ └─    9.2 ms - pthreadtypes.h
  │ │ │ │     │ │   └─    8.8 ms - thread-shared-types.h
  │ │ │ │     │ ├─   13.7 ms - select.h
  │ │ │ │     │ ├─    9.9 ms - endian.h
  │ │ │ │     │ └─    9.2 ms - pthreadtypes.h
  │ │ │ │     │   └─    8.8 ms - thread-shared-types.h
  │ │ │ │     ├─    4.6 ms - locale_t.h
  │ │ │ │     └─    4.1 ms - floatn.h
  │ │ │ ├─   15.4 ms - fl/stl/allocator.h
  │ │ │ │ └─   10.5 ms - fl/stl/bitset.h
  │ │ │ │   └─    6.8 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    1.9 ms - fl/stl/unique_ptr.h
  │ │ │ ├─    5.3 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.4 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─   92.9 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   70.1 ms - fl/stl/type_traits.h
  │ │ │ │ └─   64.8 ms - fl/stl/move.h
  │ │ │ ├─   18.3 ms - fl/stl/atomic.h
  │ │ │ │ └─   17.4 ms - platforms/atomic.h
  │ │ │ │   └─   17.4 ms - platforms/shared/atomic.h
  │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ ├─   84.4 ms - fl/stl/variant.h
  │ │ │ └─   82.7 ms - fl/stl/new.h
  │ │ │   └─   82.7 ms - platforms/new.h
  │ │ │     └─   82.7 ms - platforms/shared/new.h
  │ │ │       └─   78.1 ms - new
  │ │ │         ├─   63.5 ms - c++config.h
  │ │ │         │ └─   55.6 ms - os_defines.h
  │ │ │         │   └─   50.9 ms - features.h
  │ │ │         └─    0.5 ms - version.h
  │ │ ├─   51.8 ms - fl/stl/compiler_control.h
  │ │ └─    3.8 ms - fl/stl/algorithm.h
  │ │   └─    1.6 ms - fl/math/random.h
  │ │     └─    0.8 ms - fl/math/random8.h
  │ └─   37.3 ms - fl/stl/string.h
  │   ├─   11.2 ms - fl/stl/basic_string.h
  │   │ ├─    0.9 ms - fl/stl/not_null.h
  │   │ └─    0.8 ms - fl/stl/iterator.h
  │   ├─    7.1 ms - fl/stl/span.h
  │   │ └─    3.0 ms - fl/math/geometry.h
  │   ├─    4.4 ms - fl/stl/string_view.h
  │   └─    1.3 ms - fl/stl/optional.h
  ├─  395.9 ms - fl/task/scheduler.h
  │ ├─  387.0 ms - fl/stl/singleton.h
  │ │ └─  386.3 ms - fl/stl/thread_local.h
  │ │   └─  385.2 ms - fl/stl/thread.h
  │ │     └─  385.1 ms - platforms/thread.h
  │ │       └─  385.1 ms - platforms/stub/thread_stub.h
  │ │         └─  385.0 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  379.3 ms - thread
  │ │             ├─  231.5 ms - std_thread.h
  │ │             │ ├─   56.7 ms - tuple
  │ │             │ ├─   56.0 ms - iosfwd
  │ │             │ ├─   36.3 ms - gthr.h
  │ │             │ ├─   21.5 ms - refwrap.h
  │ │             │ └─   12.5 ms - unique_ptr.h
  │ │             └─  130.5 ms - this_thread_sleep.h
  │ │               ├─   93.7 ms - chrono.h
  │ │               └─   27.5 ms - cerrno
  │ └─    8.1 ms - fl/task/task.h
  │   └─    3.2 ms - fl/trace.h
  │     ├─    2.0 ms - fl/stl/chrono.h
  │     └─    0.8 ms - fl/stl/tuple.h
  ├─   10.3 ms - platforms/await.h
  │ └─    9.9 ms - platforms/coroutine_runtime.h
  │   └─    8.4 ms - fl/system/engine_events.h
  │     ├─    4.2 ms - fl/math/screenmap.h
  │     │ └─    3.0 ms - fl/stl/flat_map.h
  │     └─    2.8 ms - fl/math/xymap.h
  │       └─    0.7 ms - fl/math/lut.h
  └─    0.7 ms - fl/task/promise_result.h
fl/fastled.h (385.4ms)
  ├─  209.8 ms - crgb.h
  │ ├─  208.5 ms - fl/gfx/crgb.h
  │ │ └─  204.1 ms - fl/math/ease.h
  │ │   └─  202.3 ms - fl/math/fixed_point.h
  │ │     ├─   80.6 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─   63.6 ms - fl/math/sin32.h
  │ │     │ │ └─   61.0 ms - fl/math/simd.h
  │ │     │ │   └─   60.5 ms - fl/math/simd/types.h
  │ │     │ │     └─   60.2 ms - platforms/simd.h
  │ │     │ │       └─   60.1 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   15.2 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   15.1 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   14.8 ms - fl/math/fixed_point/s16x16.h
  │ │     └─   14.6 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.8 ms - chsv.h
  │   └─    0.7 ms - fl/gfx/hsv.h
  ├─   80.6 ms - platforms.h
  │ └─   80.5 ms - platforms/stub/fastled_stub.h
  │   ├─   47.4 ms - platforms/stub/fastspi_stub.h
  │   │ └─   47.4 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   41.3 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   39.3 ms - fl/id_tracker.h
  │   │   │   └─   38.3 ms - fl/stl/mutex.h
  │   │   │     └─   38.2 ms - platforms/mutex.h
  │   │   │       └─   38.1 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   38.0 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.6 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   33.1 ms - platforms/stub/clockless_stub.h
  │     └─   33.0 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.8 ms - fl/channels/data.h
  │       │ └─    8.7 ms - fl/channels/config.h
  │       │   ├─    1.9 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │       │   └─    1.4 ms - fl/chipsets/spi.h
  │       ├─   11.4 ms - fl/system/log.h
  │       │ └─   10.9 ms - fl/stl/strstream.h
  │       ├─    2.3 ms - fl/channels/manager.h
  │       ├─    1.4 ms - fl/stl/weak_ptr.h
  │       └─    1.0 ms - fl/channels/driver.h
  ├─   35.8 ms - colorutils.h
  │ └─   35.0 ms - fl/gfx/colorutils.h
  │   ├─    7.9 ms - fl/gfx/blur.h
  │   │ └─    4.3 ms - fl/gfx/canvas.h
  │   │   └─    2.6 ms - fl/math/alpha.h
  │   └─    2.8 ms - fl/gfx/fill.h
  ├─   20.6 ms - pixel_controller.h
  │ ├─   14.8 ms - pixel_iterator.h
  │ │ └─   14.7 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    4.1 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    4.0 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.1 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    2.6 ms - fl/gfx/gamma_lut.h
  │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.4 ms - rgbw.h
  │   └─    2.2 ms - fl/gfx/rgbw.h
  └─   18.7 ms - pixeltypes.h
    ├─   15.4 ms - lib8tion.h
    │ ├─    7.8 ms - fl/math/math8.h
    │ │ ├─    4.0 ms - fl/math/intmap.h
    │ │ │ └─    3.1 ms - platforms/intmap.h
    │ │ ├─    2.0 ms - fl/math/scale8.h
    │ │ │ └─    2.0 ms - platforms/scale8.h
    │ │ │   └─    0.8 ms - platforms/shared/scale8.h
    │ │ └─    1.6 ms - platforms/math8.h
    │ │   └─    1.2 ms - platforms/shared/math8.h
    │ └─    1.6 ms - fl/math/beat.h
    │   └─    0.9 ms - fl/math/trig8.h
    │     └─    0.8 ms - platforms/trig8.h
    │       └─    0.7 ms - platforms/shared/trig8.h
    └─    2.9 ms - crgb.hpp
fl/ui.h (110.4ms)
  ├─   70.1 ms - fl/stl/json.h
  │ └─   55.4 ms - fl/stl/json/types.h
  │   └─    7.3 ms - fl/stl/limits.h
  ├─   10.6 ms - fl/ui_impl.h
  │ └─    9.9 ms - platforms/ui_defs.h
  │   ├─    2.3 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.1 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.5 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    0.9 ms - platforms/shared/ui/json/checkbox.h
  │   ├─    0.8 ms - platforms/shared/ui/json/help.h
  │   └─    0.8 ms - platforms/shared/ui/json/number_field.h
  └─    5.0 ms - fl/stl/url.h
fl/stl/stdint.h (33.7ms)
  └─   33.5 ms - platforms/int.h
    └─   33.1 ms - platforms/shared/int.h
      └─   32.9 ms - platforms/shared/int_linux.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1519.4 ms - Source: FastLED.h
  2.  1519.4 ms - Total Source: 
  3.   877.3 ms - Source: fl/task/executor.h
  4.   585.3 ms - Total ParseClass: 
  5.   469.0 ms - Source: fl/task/promise.h
  6.   426.8 ms - Source: fl/stl/function.h
  7.   395.9 ms - Source: fl/task/scheduler.h
  8.   387.0 ms - Source: fl/stl/singleton.h
  9.   386.3 ms - Source: fl/stl/thread_local.h
 10.   385.4 ms - Source: fl/fastled.h
 11.   385.2 ms - Source: fl/stl/thread.h
 12.   385.1 ms - Source: platforms/thread.h
 13.   385.1 ms - Source: platforms/stub/thread_stub.h
 14.   385.0 ms - Source: platforms/stub/thread_stub_stl.h
 15.   379.3 ms - Source: thread
 16.   231.5 ms - Source: std_thread.h
 17.   209.8 ms - Source: crgb.h
 18.   208.5 ms - Source: fl/gfx/crgb.h
 19.   207.5 ms - Total InstantiateFunction: 
 20.   204.1 ms - Source: fl/math/ease.h

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1519.4ms)
    - fl/task/executor.h (877.3ms)
    - fl/task/promise.h (469.0ms)
    - fl/stl/function.h (426.8ms)
    - fl/task/scheduler.h (395.9ms)
    - fl/stl/singleton.h (387.0ms)
    - fl/stl/thread_local.h (386.3ms)
    - fl/fastled.h (385.4ms)
    - fl/stl/thread.h (385.2ms)
    - platforms/thread.h (385.1ms)

⚠️  Template instantiation time is high (23.3% of total)
✓  Lexing time is acceptable (<10% of total)

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1519.4ms)
2. Consider optimizing fl/task/executor.h (877.3ms)
3. Consider optimizing fl/task/promise.h (469.0ms)

================================================================================

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

♻️ Duplicate comments (1)
ci/autoresearch/gpio.py (1)

62-115: ⚠️ Potential issue | 🟡 Minor

Known issues from prior review still present in the fallback branch.

The previously-flagged concerns on this block still apply to the fallback path (serial_interface is None):

  • import serial as pyserial (Line 73) and import asyncio (Lines 77 and 83) are inside the handler. As per coding guidelines, "All system imports must be at the top of the file in proper order: standard library, third-party, local."
  • The pyserial handle s (Lines 75–81) is not wrapped in try/finally; a cancellation or error during await asyncio.sleep(0.1) leaks the port.
  • client is not set to None after await client.close() on Line 65. Unlike run_pin_discovery (Line 267), this function does not clear client after closing it. If any statement at Lines 68–86 raises before the new RpcClient is fully constructed on Line 87, the outer finally at Line 173 calls await client.close() on the already-closed client. This is inconsistent with run_pin_discovery and a latent foot-gun if RpcClient.close() ever becomes non-idempotent.
♻️ Proposed fix (client = None in run_gpio_pretest only)
             except Exception as e:
                 # Try DTR reset and retry — device may be booted but idle
                 print(f"\u26a0\ufe0f  Ping failed ({e}), attempting DTR reset...")
                 try:
                     await client.close()
+                    client = None  # type: ignore[assignment]

                     # Use SerialInterface.reset_device() if available
                     if serial_interface is not None:

And in the outer finally at Line 172–173:

         finally:
-            await client.close()
+            if client is not None:
+                await client.close()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ci/autoresearch/gpio.py` around lines 62 - 115, In the fallback branch of the
DTR-reset handler inside run_gpio_pretest (the block that executes when
serial_interface is None) fix three issues: move the local imports (import
serial as pyserial and import asyncio) to the top-level imports; wrap the
pyserial.Serial(...) usage (variable s) in a try/finally so s.close() always
runs even if await asyncio.sleep(0.1) is cancelled or raises; and after await
client.close() set client = None (like run_pin_discovery does) so the outer
finally won't attempt to close the already-closed RpcClient instance; keep
existing calls to SerialInterface.reset_device() and RpcClient(...) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ci/autoresearch/gpio.py`:
- Around line 137-169: The diagnosis branch uses integer comparisons against
rx_low and rx_high (rx_low == 1 / rx_high == 0) but the firmware returns the
strings "LOW"/"HIGH"; update the conditions to compare those string values
(e.g., if rx_low == "HIGH" and rx_high == "HIGH": for stuck HIGH, and if rx_low
== "LOW" and rx_high == "LOW": for stuck LOW) and keep the existing diagnostic
messages that reference rx_pin and tx_pin (rx_low, rx_high, rx_pin, tx_pin).

In `@ci/tests/test_serial_interface_reset.py`:
- Around line 1-30: Move these three small checks into the existing
serial_interface test module and replace weak presence checks with stronger
signature/behavior assertions: import inspect and assert that SerialInterface,
FbuildSerialAdapter, and PySerialAdapter each expose a callable reset_device
(use callable(...) or inspect.iscoroutinefunction(...) if it should be async),
then use inspect.signature(reset_device) to assert it accepts a parameter named
"board" and (if your APIs annotate return types) that the return annotation is
bool; alternatively add a small behavioral test that calls reset_device on a
test adapter with a mocked board and asserts a boolean result. Ensure you update
the existing serial_interface test file rather than creating this new test file
and reference the classes SerialInterface, FbuildSerialAdapter, PySerialAdapter
and the method reset_device when editing.

In `@ci/util/serial_interface.py`:
- Around line 203-223: The reset_device method currently catches AttributeError
broadly and uses a leaky pyserial fallback; change it to first check for the
presence of reset_device via reset_fn = getattr(self._monitor, "reset_device",
None) and only call _run_in_thread(reset_fn, board) if reset_fn is not None,
wrapping that call to re-raise KeyboardInterrupt and return False on other
exceptions; if reset_fn is None, perform the pyserial fallback but move the
import out (or at least avoid importing inside the try), ensure the Serial
handle (pyserial.Serial(...)) is closed in a finally block, catch and re-raise
KeyboardInterrupt separately, and only catch other exceptions to return False so
unrelated AttributeError from within reset_device is not mistaken for a missing
method.
- Line 53: The method signature for reset_device and the two adapter
implementations currently use a default parameter value (board: str | None =
None); remove the default so the parameter is non-defaulted (e.g., board: str |
None) and keep the explicit type annotation, then update all callers to pass the
board argument explicitly (pass None when unknown). Locate and change the
reset_device definition and the two adapter method definitions that mirror it
(the adapter implementations referenced in the review) to the non-defaulted
signature and run tests to ensure callers were updated to supply the argument.
- Around line 98-111: The reset_device fallback in reset_device (and
FbuildSerialAdapter.reset_device) must hoist the third-party import (serial as
pyserial) to the module top, handle KeyboardInterrupt/asyncio.CancelledError
before a broad Exception, ensure the Serial instance is always closed by
wrapping usage of s in try/finally, and avoid silently swallowing errors: on
unexpected exceptions log the full exception (exc_info) and re-raise or let
non-recoverable errors propagate while only returning False for defined
reset-failure conditions; update the async awaits to properly propagate
CancelledError so the finally block still closes s.
- Around line 54-63: The Protocol.reset docstring and the two adapter
implementations are inconsistent and lack the proper RTS/DTR sequence required
for ESP32-S3; update Protocol.reset to accurately describe both behaviors
(generic DTR-only fallback and a platform-specific RTS/DTR sequence) and modify
PySerialAdapter.reset and FbuildSerialAdapter.reset to implement the correct
hardware reset sequence for ESP32-S3: assert RTS=True (hold EN low for reset),
toggle DTR as needed to drive GPIO0 (boot mode), then deassert RTS=False to
release EN so the chip actually resets and boots; use the existing board
parameter to choose the esp32s3 sequence vs. generic DTR toggle, and ensure you
use the adapters’ serial control methods (e.g., setRTS/setDTR or the equivalent
wrapper calls) and preserve existing timing/delays around the toggles.

---

Duplicate comments:
In `@ci/autoresearch/gpio.py`:
- Around line 62-115: In the fallback branch of the DTR-reset handler inside
run_gpio_pretest (the block that executes when serial_interface is None) fix
three issues: move the local imports (import serial as pyserial and import
asyncio) to the top-level imports; wrap the pyserial.Serial(...) usage (variable
s) in a try/finally so s.close() always runs even if await asyncio.sleep(0.1) is
cancelled or raises; and after await client.close() set client = None (like
run_pin_discovery does) so the outer finally won't attempt to close the
already-closed RpcClient instance; keep existing calls to
SerialInterface.reset_device() and RpcClient(...) unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6011fa0d-7cf0-47e1-9239-69f13e4aa2d7

📥 Commits

Reviewing files that changed from the base of the PR and between 2168882 and 2bd00c3.

📒 Files selected for processing (3)
  • ci/autoresearch/gpio.py
  • ci/tests/test_serial_interface_reset.py
  • ci/util/serial_interface.py

Comment thread ci/autoresearch/gpio.py Resolved
Comment thread ci/tests/test_serial_interface_reset.py Resolved
Comment thread ci/util/serial_interface.py Resolved
Comment thread ci/util/serial_interface.py Resolved
Comment thread ci/util/serial_interface.py Resolved
Comment thread ci/util/serial_interface.py Resolved
- Move pyserial import to top of serial_interface.py
- Extract _pyserial_dtr_reset() helper using proper ClassicReset sequence
  (DTR/RTS toggling matching esptool's default-reset)
- Remove default parameter values from reset_device (board: str | None)
- Use hasattr() check instead of broad except AttributeError
- Set client = None after close to prevent double-close in finally
- Fix None pin display in abort message (fall back to PIN_TX/PIN_RX)
- Remove inline imports from gpio.py DTR reset blocks

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 1201.29ms

Top 5 Slowest Headers

  1. FastLED.h - 915.63ms
  2. fl/fastled.h - 388.79ms
  3. fl/task/executor.h - 308.33ms
  4. crgb.h - 221.10ms
  5. fl/gfx/crgb.h - 219.82ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (915.6ms)
⚠️ Header fl/fastled.h exceeds 150ms (388.8ms)
⚠️ Header fl/task/executor.h exceeds 150ms (308.3ms)
⚠️ Header crgb.h exceeds 150ms (221.1ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (219.8ms)
⚠️ Header fl/math/ease.h exceeds 150ms (214.9ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (212.5ms)
⚠️ Header fl/task/scheduler.h exceeds 150ms (163.0ms)
⚠️ Header fl/stl/singleton.h exceeds 150ms (152.6ms)
⚠️ Header fl/stl/thread_local.h exceeds 150ms (151.9ms)
⚠️ Header fl/stl/thread.h exceeds 150ms (150.7ms)
⚠️ Header platforms/thread.h exceeds 150ms (150.6ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 150ms (150.5ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 150ms (150.5ms)
⚠️ Header fl/task/promise.h exceeds 50ms (131.2ms)
⚠️ Header fl/ui.h exceeds 50ms (122.3ms)
⚠️ Header fl/stl/function.h exceeds 50ms (81.0ms)
⚠️ Header fl/stl/json.h exceeds 50ms (79.0ms)
⚠️ Header fl/math/fixed_point/s4x12.h exceeds 50ms (63.8ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (61.4ms)
⚠️ Header platforms.h exceeds 50ms (57.0ms)
⚠️ Header platforms/stub/fastled_stub.h exceeds 50ms (57.0ms)
⚠️ Header fl/stl/vector.h exceeds 50ms (52.2ms)
⚠️ Template instantiation time is high (54.8%)

Full Report
================================================================================
FASTLED COMPILATION PERFORMANCE REPORT
================================================================================
Generated: 2026-04-17 15:09:02
Compiler: clang++-17
File: ci/perf/test_compile.cpp

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,248.69 ms
Frontend Time:             18.14 ms (0.8%)
Backend Time:              246.58 ms (11.0%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                    11708.12 ms (520.7%)
Templates                   640.69 ms ( 28.5%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1456.9 ms - FastLED.h (SLOW)
   714.7 ms - fl/task/executor.h (SLOW)
   491.0 ms - fl/fastled.h (SLOW)
   359.9 ms - fl/task/promise.h (SLOW)
   340.7 ms - fl/task/scheduler.h (SLOW)
   330.9 ms - fl/stl/singleton.h (SLOW)
   330.1 ms - fl/stl/thread_local.h (SLOW)
   328.9 ms - fl/stl/thread.h (SLOW)
   328.9 ms - platforms/thread.h (SLOW)
   328.8 ms - platforms/stub/thread_stub.h (SLOW)
   328.7 ms - platforms/stub/thread_stub_stl.h (SLOW)
   308.7 ms - fl/stl/function.h (SLOW)
   297.7 ms - crgb.h (SLOW)
   296.3 ms - fl/gfx/crgb.h (SLOW)
   291.2 ms - fl/math/ease.h (SLOW)
   288.8 ms - fl/math/fixed_point.h (SLOW)
   138.0 ms - fl/math/fixed_point/s4x12.h (SLOW)
   123.4 ms - fl/ui.h (SLOW)
   116.5 ms - fl/math/sin32.h (SLOW)
   113.2 ms - fl/math/simd.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1456.9ms)
  ├─  714.7 ms - fl/task/executor.h
  │ ├─  359.9 ms - fl/task/promise.h
  │ │ ├─  308.7 ms - fl/stl/function.h
  │ │ │ ├─  111.7 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   78.8 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   72.2 ms - fl/stl/move.h
  │ │ │ │ ├─   27.5 ms - fl/stl/atomic.h
  │ │ │ │ │ └─   26.5 ms - platforms/atomic.h
  │ │ │ │ │   └─   26.4 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ │ ├─   91.5 ms - fl/stl/vector.h
  │ │ │ │ ├─   56.4 ms - fl/math/math.h
  │ │ │ │ │ └─   50.6 ms - fl/stl/undef.h
  │ │ │ │ │   └─   81.6 ms - stdlib.h
  │ │ │ │ │     ├─   41.1 ms - cstdlib
  │ │ │ │ │     │ └─   81.6 ms - stdlib.h
  │ │ │ │ │     │   ├─   41.1 ms - cstdlib
  │ │ │ │ │     │   └─    6.6 ms - types.h
  │ │ │ │ │     └─    6.6 ms - types.h
  │ │ │ │ │       ├─    6.6 ms - types.h
  │ │ │ │ │       │ ├─    6.6 ms - types.h
  │ │ │ │ │       │ ├─    1.6 ms - pthreadtypes.h
  │ │ │ │ │       │ ├─    1.1 ms - endian.h
  │ │ │ │ │       │ └─    1.0 ms - select.h
  │ │ │ │ │       ├─    1.6 ms - pthreadtypes.h
  │ │ │ │ │       │ └─    1.2 ms - thread-shared-types.h
  │ │ │ │ │       ├─    1.1 ms - endian.h
  │ │ │ │ │       └─    1.0 ms - select.h
  │ │ │ │ ├─   19.1 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   13.0 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    8.4 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    2.3 ms - fl/stl/unique_ptr.h
  │ │ │ │ │       └─    0.5 ms - fl/stl/utility.h
  │ │ │ │ ├─    4.6 ms - fl/stl/initializer_list.h
  │ │ │ │ ├─    2.9 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.8 ms - fl/stl/functional.h
  │ │ │ ├─   64.2 ms - fl/stl/variant.h
  │ │ │ │ └─   62.2 ms - fl/stl/new.h
  │ │ │ │   └─   62.2 ms - platforms/new.h
  │ │ │ │     └─   62.1 ms - platforms/shared/new.h
  │ │ │ │       └─   53.4 ms - new
  │ │ │ │         ├─   29.2 ms - c++config.h
  │ │ │ │         │ └─   19.8 ms - os_defines.h
  │ │ │ │         └─    0.6 ms - version.h
  │ │ │ ├─   30.7 ms - fl/stl/compiler_control.h
  │ │ │ └─    4.9 ms - fl/stl/algorithm.h
  │ │ │   └─    2.1 ms - fl/math/random.h
  │ │ │     └─    1.0 ms - fl/math/random8.h
  │ │ └─   45.7 ms - fl/stl/string.h
  │ │   ├─   13.4 ms - fl/stl/basic_string.h
  │ │   │ ├─    1.1 ms - fl/stl/not_null.h
  │ │   │ ├─    1.0 ms - fl/stl/iterator.h
  │ │   │ └─    0.6 ms - fl/stl/charconv.h
  │ │   ├─    9.0 ms - fl/stl/span.h
  │ │   │ └─    3.6 ms - fl/math/geometry.h
  │ │   ├─    5.8 ms - fl/stl/string_view.h
  │ │   └─    1.5 ms - fl/stl/optional.h
  │ ├─  340.7 ms - fl/task/scheduler.h
  │ │ ├─  330.9 ms - fl/stl/singleton.h
  │ │ │ └─  330.1 ms - fl/stl/thread_local.h
  │ │ │   └─  328.9 ms - fl/stl/thread.h
  │ │ │     └─  328.9 ms - platforms/thread.h
  │ │ │       └─  328.8 ms - platforms/stub/thread_stub.h
  │ │ │         └─  328.7 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  323.7 ms - thread
  │ │ │             ├─  214.8 ms - std_thread.h
  │ │ │             └─   94.6 ms - this_thread_sleep.h
  │ │ └─    9.0 ms - fl/task/task.h
  │ │   └─    3.7 ms - fl/trace.h
  │ │     ├─    2.3 ms - fl/stl/chrono.h
  │ │     └─    1.0 ms - fl/stl/tuple.h
  │ ├─   11.8 ms - platforms/await.h
  │ │ └─   11.4 ms - platforms/coroutine_runtime.h
  │ │   └─    9.7 ms - fl/system/engine_events.h
  │ │     ├─    5.0 ms - fl/math/screenmap.h
  │ │     │ └─    3.7 ms - fl/stl/flat_map.h
  │ │     └─    3.1 ms - fl/math/xymap.h
  │ │       └─    0.8 ms - fl/math/lut.h
  │ └─    0.8 ms - fl/task/promise_result.h
  ├─  491.0 ms - fl/fastled.h
  │ ├─  297.7 ms - crgb.h
  │ │ ├─  296.3 ms - fl/gfx/crgb.h
  │ │ │ └─  291.2 ms - fl/math/ease.h
  │ │ │   └─  288.8 ms - fl/math/fixed_point.h
  │ │ │     ├─  138.0 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─  116.5 ms - fl/math/sin32.h
  │ │ │     │ │ └─  113.2 ms - fl/math/simd.h
  │ │ │     │ │   └─  112.6 ms - fl/math/simd/types.h
  │ │ │     │ │     └─  112.3 ms - platforms/simd.h
  │ │ │     │ ├─    1.1 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.8 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   19.0 ms - fl/math/fixed_point/s8x8.h
  │ │ │     ├─   18.9 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   18.8 ms - fl/math/fixed_point/s24x8.h
  │ │ │     └─   18.6 ms - fl/math/fixed_point/s16x16.h
  │ │ └─    0.9 ms - chsv.h
  │ │   └─    0.8 ms - fl/gfx/hsv.h
  │ ├─   80.2 ms - platforms.h
  │ │ └─   80.2 ms - platforms/stub/fastled_stub.h
  │ │   ├─   40.5 ms - platforms/stub/clockless_stub.h
  │ │   │ └─   40.4 ms - platforms/stub/clockless_channel_stub.h
  │ │   │   ├─   15.2 ms - fl/channels/data.h
  │ │   │   │ └─   11.7 ms - fl/channels/config.h
  │ │   │   │   ├─    3.6 ms - fl/chipsets/chipset_timing_config.h
  │ │   │   │   │ └─    2.4 ms - fl/chipsets/led_timing.h
  │ │   │   │   └─    2.0 ms - fl/chipsets/spi.h
  │ │   │   ├─   13.9 ms - fl/system/log.h
  │ │   │   │ └─   13.4 ms - fl/stl/strstream.h
  │ │   │   ├─    2.4 ms - fl/channels/manager.h
  │ │   │   ├─    1.6 ms - fl/stl/weak_ptr.h
  │ │   │   └─    1.1 ms - fl/channels/driver.h
  │ │   └─   39.6 ms - platforms/stub/fastspi_stub.h
  │ │     └─   39.6 ms - platforms/stub/fastspi_stub_generic.h
  │ │       ├─   30.4 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │       │ └─   28.2 ms - fl/id_tracker.h
  │ │       │   └─   27.2 ms - fl/stl/mutex.h
  │ │       │     └─   27.1 ms - platforms/mutex.h
  │ │       │       └─   27.0 ms - platforms/stub/mutex_stub.h
  │ │       └─    8.7 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ ├─   42.9 ms - colorutils.h
  │ │ └─   42.0 ms - fl/gfx/colorutils.h
  │ │   ├─    9.1 ms - fl/gfx/blur.h
  │ │   │ └─    4.9 ms - fl/gfx/canvas.h
  │ │   │   └─    2.9 ms - fl/math/alpha.h
  │ │   └─    3.3 ms - fl/gfx/fill.h
  │ ├─   24.5 ms - pixel_controller.h
  │ │ ├─   17.7 ms - pixel_iterator.h
  │ │ │ └─   17.6 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    5.2 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    4.0 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    3.3 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    4.6 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    1.0 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.7 ms - rgbw.h
  │ │   └─    2.5 ms - fl/gfx/rgbw.h
  │ └─   23.0 ms - pixeltypes.h
  │   ├─   19.3 ms - lib8tion.h
  │   │ ├─   10.1 ms - fl/math/math8.h
  │   │ │ ├─    5.3 ms - fl/math/intmap.h
  │   │ │ │ └─    4.2 ms - platforms/intmap.h
  │   │ │ ├─    2.5 ms - fl/math/scale8.h
  │   │ │ │ └─    2.5 ms - platforms/scale8.h
  │   │ │ │   └─    1.0 ms - platforms/shared/scale8.h
  │   │ │ └─    2.1 ms - platforms/math8.h
  │   │ │   └─    1.7 ms - platforms/shared/math8.h
  │   │ ├─    2.0 ms - fl/math/beat.h
  │   │ │ └─    1.0 ms - fl/math/trig8.h
  │   │ │   └─    1.0 ms - platforms/trig8.h
  │   │ │     └─    0.9 ms - platforms/shared/trig8.h
  │   │ └─    0.6 ms - fl/math/qfx.h
  │   └─    3.3 ms - crgb.hpp
  ├─  123.4 ms - fl/ui.h
  │ ├─   79.9 ms - fl/stl/json.h
  │ │ └─   62.1 ms - fl/stl/json/types.h
  │ │   └─    7.6 ms - fl/stl/limits.h
  │ ├─   10.7 ms - fl/ui_impl.h
  │ │ └─   10.1 ms - platforms/ui_defs.h
  │ │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.1 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.6 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    1.0 ms - platforms/shared/ui/json/checkbox.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/number_field.h
  │ │   └─    0.9 ms - platforms/shared/ui/json/help.h
  │ └─    6.2 ms - fl/stl/url.h
  ├─   28.8 ms - chipsets.h
  │ ├─   11.7 ms - fl/chipsets/ucs7604.h
  │ │ └─    8.8 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    6.8 ms - fl/chipsets/apa102.h
  │ ├─    1.8 ms - fl/chipsets/lpd880x.h
  │ ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  │ └─    0.9 ms - fl/chipsets/ws2801.h
  └─   25.4 ms - fl/stl/stdint.h
    └─   25.1 ms - platforms/int.h
      └─   24.7 ms - platforms/shared/int.h
        └─   24.6 ms - platforms/shared/int_linux.h
fl/task/executor.h (714.7ms)
  ├─  359.9 ms - fl/task/promise.h
  │ ├─  308.7 ms - fl/stl/function.h
  │ │ ├─  111.7 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   78.8 ms - fl/stl/type_traits.h
  │ │ │ │ └─   72.2 ms - fl/stl/move.h
  │ │ │ ├─   27.5 ms - fl/stl/atomic.h
  │ │ │ │ └─   26.5 ms - platforms/atomic.h
  │ │ │ │   └─   26.4 ms - platforms/shared/atomic.h
  │ │ │ └─    0.7 ms - fl/stl/bit_cast.h
  │ │ ├─   91.5 ms - fl/stl/vector.h
  │ │ │ ├─   56.4 ms - fl/math/math.h
  │ │ │ │ └─   50.6 ms - fl/stl/undef.h
  │ │ │ │   └─   81.6 ms - stdlib.h
  │ │ │ │     ├─   41.1 ms - cstdlib
  │ │ │ │     │ └─   81.6 ms - stdlib.h
  │ │ │ │     │   ├─   41.1 ms - cstdlib
  │ │ │ │     │   │ └─   81.6 ms - stdlib.h
  │ │ │ │     │   └─    6.6 ms - types.h
  │ │ │ │     │     ├─    6.6 ms - types.h
  │ │ │ │     │     ├─    1.6 ms - pthreadtypes.h
  │ │ │ │     │     ├─    1.1 ms - endian.h
  │ │ │ │     │     └─    1.0 ms - select.h
  │ │ │ │     └─    6.6 ms - types.h
  │ │ │ │       ├─    6.6 ms - types.h
  │ │ │ │       │ ├─    6.6 ms - types.h
  │ │ │ │       │ │ ├─    6.6 ms - types.h
  │ │ │ │       │ │ ├─    1.6 ms - pthreadtypes.h
  │ │ │ │       │ │ ├─    1.1 ms - endian.h
  │ │ │ │       │ │ └─    1.0 ms - select.h
  │ │ │ │       │ ├─    1.6 ms - pthreadtypes.h
  │ │ │ │       │ │ └─    1.2 ms - thread-shared-types.h
  │ │ │ │       │ ├─    1.1 ms - endian.h
  │ │ │ │       │ └─    1.0 ms - select.h
  │ │ │ │       ├─    1.6 ms - pthreadtypes.h
  │ │ │ │       │ └─    1.2 ms - thread-shared-types.h
  │ │ │ │       ├─    1.1 ms - endian.h
  │ │ │ │       └─    1.0 ms - select.h
  │ │ │ ├─   19.1 ms - fl/stl/allocator.h
  │ │ │ │ └─   13.0 ms - fl/stl/bitset.h
  │ │ │ │   └─    8.4 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    2.3 ms - fl/stl/unique_ptr.h
  │ │ │ │       └─    0.5 ms - fl/stl/utility.h
  │ │ │ ├─    4.6 ms - fl/stl/initializer_list.h
  │ │ │ ├─    2.9 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.8 ms - fl/stl/functional.h
  │ │ ├─   64.2 ms - fl/stl/variant.h
  │ │ │ └─   62.2 ms - fl/stl/new.h
  │ │ │   └─   62.2 ms - platforms/new.h
  │ │ │     └─   62.1 ms - platforms/shared/new.h
  │ │ │       └─   53.4 ms - new
  │ │ │         ├─   29.2 ms - c++config.h
  │ │ │         │ └─   19.8 ms - os_defines.h
  │ │ │         │   └─   19.5 ms - features.h
  │ │ │         └─    0.6 ms - version.h
  │ │ ├─   30.7 ms - fl/stl/compiler_control.h
  │ │ └─    4.9 ms - fl/stl/algorithm.h
  │ │   └─    2.1 ms - fl/math/random.h
  │ │     └─    1.0 ms - fl/math/random8.h
  │ └─   45.7 ms - fl/stl/string.h
  │   ├─   13.4 ms - fl/stl/basic_string.h
  │   │ ├─    1.1 ms - fl/stl/not_null.h
  │   │ ├─    1.0 ms - fl/stl/iterator.h
  │   │ └─    0.6 ms - fl/stl/charconv.h
  │   ├─    9.0 ms - fl/stl/span.h
  │   │ └─    3.6 ms - fl/math/geometry.h
  │   ├─    5.8 ms - fl/stl/string_view.h
  │   └─    1.5 ms - fl/stl/optional.h
  ├─  340.7 ms - fl/task/scheduler.h
  │ ├─  330.9 ms - fl/stl/singleton.h
  │ │ └─  330.1 ms - fl/stl/thread_local.h
  │ │   └─  328.9 ms - fl/stl/thread.h
  │ │     └─  328.9 ms - platforms/thread.h
  │ │       └─  328.8 ms - platforms/stub/thread_stub.h
  │ │         └─  328.7 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  323.7 ms - thread
  │ │             ├─  214.8 ms - std_thread.h
  │ │             │ ├─   58.6 ms - tuple
  │ │             │ ├─   48.2 ms - refwrap.h
  │ │             │ ├─   40.8 ms - iosfwd
  │ │             │ ├─    9.9 ms - gthr.h
  │ │             │ └─    6.1 ms - unique_ptr.h
  │ │             └─   94.6 ms - this_thread_sleep.h
  │ │               ├─   84.0 ms - chrono.h
  │ │               └─    2.2 ms - cerrno
  │ └─    9.0 ms - fl/task/task.h
  │   └─    3.7 ms - fl/trace.h
  │     ├─    2.3 ms - fl/stl/chrono.h
  │     └─    1.0 ms - fl/stl/tuple.h
  ├─   11.8 ms - platforms/await.h
  │ └─   11.4 ms - platforms/coroutine_runtime.h
  │   └─    9.7 ms - fl/system/engine_events.h
  │     ├─    5.0 ms - fl/math/screenmap.h
  │     │ └─    3.7 ms - fl/stl/flat_map.h
  │     └─    3.1 ms - fl/math/xymap.h
  │       └─    0.8 ms - fl/math/lut.h
  └─    0.8 ms - fl/task/promise_result.h
fl/fastled.h (491.0ms)
  ├─  297.7 ms - crgb.h
  │ ├─  296.3 ms - fl/gfx/crgb.h
  │ │ └─  291.2 ms - fl/math/ease.h
  │ │   └─  288.8 ms - fl/math/fixed_point.h
  │ │     ├─  138.0 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─  116.5 ms - fl/math/sin32.h
  │ │     │ │ └─  113.2 ms - fl/math/simd.h
  │ │     │ │   └─  112.6 ms - fl/math/simd/types.h
  │ │     │ │     └─  112.3 ms - platforms/simd.h
  │ │     │ │       └─  112.2 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    1.1 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.8 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   19.0 ms - fl/math/fixed_point/s8x8.h
  │ │     ├─   18.9 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   18.8 ms - fl/math/fixed_point/s24x8.h
  │ │     └─   18.6 ms - fl/math/fixed_point/s16x16.h
  │ └─    0.9 ms - chsv.h
  │   └─    0.8 ms - fl/gfx/hsv.h
  ├─   80.2 ms - platforms.h
  │ └─   80.2 ms - platforms/stub/fastled_stub.h
  │   ├─   40.5 ms - platforms/stub/clockless_stub.h
  │   │ └─   40.4 ms - platforms/stub/clockless_channel_stub.h
  │   │   ├─   15.2 ms - fl/channels/data.h
  │   │   │ └─   11.7 ms - fl/channels/config.h
  │   │   │   ├─    3.6 ms - fl/chipsets/chipset_timing_config.h
  │   │   │   │ └─    2.4 ms - fl/chipsets/led_timing.h
  │   │   │   └─    2.0 ms - fl/chipsets/spi.h
  │   │   ├─   13.9 ms - fl/system/log.h
  │   │   │ └─   13.4 ms - fl/stl/strstream.h
  │   │   ├─    2.4 ms - fl/channels/manager.h
  │   │   ├─    1.6 ms - fl/stl/weak_ptr.h
  │   │   └─    1.1 ms - fl/channels/driver.h
  │   └─   39.6 ms - platforms/stub/fastspi_stub.h
  │     └─   39.6 ms - platforms/stub/fastspi_stub_generic.h
  │       ├─   30.4 ms - platforms/shared/active_strip_data/active_strip_data.h
  │       │ └─   28.2 ms - fl/id_tracker.h
  │       │   └─   27.2 ms - fl/stl/mutex.h
  │       │     └─   27.1 ms - platforms/mutex.h
  │       │       └─   27.0 ms - platforms/stub/mutex_stub.h
  │       │         └─   27.0 ms - platforms/stub/mutex_stub_stl.h
  │       └─    8.7 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  ├─   42.9 ms - colorutils.h
  │ └─   42.0 ms - fl/gfx/colorutils.h
  │   ├─    9.1 ms - fl/gfx/blur.h
  │   │ └─    4.9 ms - fl/gfx/canvas.h
  │   │   └─    2.9 ms - fl/math/alpha.h
  │   └─    3.3 ms - fl/gfx/fill.h
  ├─   24.5 ms - pixel_controller.h
  │ ├─   17.7 ms - pixel_iterator.h
  │ │ └─   17.6 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    5.2 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    4.0 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    3.3 ms - fl/gfx/gamma_lut.h
  │ │   ├─    4.6 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    1.0 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.9 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.7 ms - rgbw.h
  │   └─    2.5 ms - fl/gfx/rgbw.h
  └─   23.0 ms - pixeltypes.h
    ├─   19.3 ms - lib8tion.h
    │ ├─   10.1 ms - fl/math/math8.h
    │ │ ├─    5.3 ms - fl/math/intmap.h
    │ │ │ └─    4.2 ms - platforms/intmap.h
    │ │ ├─    2.5 ms - fl/math/scale8.h
    │ │ │ └─    2.5 ms - platforms/scale8.h
    │ │ │   └─    1.0 ms - platforms/shared/scale8.h
    │ │ └─    2.1 ms - platforms/math8.h
    │ │   └─    1.7 ms - platforms/shared/math8.h
    │ ├─    2.0 ms - fl/math/beat.h
    │ │ └─    1.0 ms - fl/math/trig8.h
    │ │   └─    1.0 ms - platforms/trig8.h
    │ │     └─    0.9 ms - platforms/shared/trig8.h
    │ └─    0.6 ms - fl/math/qfx.h
    └─    3.3 ms - crgb.hpp
fl/ui.h (123.4ms)
  ├─   79.9 ms - fl/stl/json.h
  │ └─   62.1 ms - fl/stl/json/types.h
  │   └─    7.6 ms - fl/stl/limits.h
  ├─   10.7 ms - fl/ui_impl.h
  │ └─   10.1 ms - platforms/ui_defs.h
  │   ├─    2.2 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.1 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.6 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.6 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    1.0 ms - platforms/shared/ui/json/checkbox.h
  │   ├─    0.9 ms - platforms/shared/ui/json/number_field.h
  │   └─    0.9 ms - platforms/shared/ui/json/help.h
  └─    6.2 ms - fl/stl/url.h
chipsets.h (28.8ms)
  ├─   11.7 ms - fl/chipsets/ucs7604.h
  │ └─    8.8 ms - fl/chipsets/encoders/ucs7604.h
  ├─    6.8 ms - fl/chipsets/apa102.h
  ├─    1.8 ms - fl/chipsets/lpd880x.h
  ├─    0.9 ms - fl/chipsets/encoders/ws2816.h
  └─    0.9 ms - fl/chipsets/ws2801.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1456.9 ms - Source: FastLED.h
  2.  1456.9 ms - Total Source: 
  3.   714.7 ms - Source: fl/task/executor.h
  4.   690.3 ms - Total ParseClass: 
  5.   491.0 ms - Source: fl/fastled.h
  6.   359.9 ms - Source: fl/task/promise.h
  7.   340.7 ms - Source: fl/task/scheduler.h
  8.   330.9 ms - Source: fl/stl/singleton.h
  9.   330.1 ms - Source: fl/stl/thread_local.h
 10.   328.9 ms - Source: fl/stl/thread.h
 11.   328.9 ms - Source: platforms/thread.h
 12.   328.8 ms - Source: platforms/stub/thread_stub.h
 13.   328.7 ms - Source: platforms/stub/thread_stub_stl.h
 14.   323.7 ms - Source: thread
 15.   308.7 ms - Source: fl/stl/function.h
 16.   297.7 ms - Source: crgb.h
 17.   296.3 ms - Source: fl/gfx/crgb.h
 18.   291.2 ms - Source: fl/math/ease.h
 19.   288.8 ms - Source: fl/math/fixed_point.h
 20.   227.8 ms - Total InstantiateFunction: 

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1456.9ms)
    - fl/task/executor.h (714.7ms)
    - fl/fastled.h (491.0ms)
    - fl/task/promise.h (359.9ms)
    - fl/task/scheduler.h (340.7ms)
    - fl/stl/singleton.h (330.9ms)
    - fl/stl/thread_local.h (330.1ms)
    - fl/stl/thread.h (328.9ms)
    - platforms/thread.h (328.9ms)
    - platforms/stub/thread_stub.h (328.8ms)

⚠️  Template instantiation time is high (28.5% of total)
✓  Lexing time is acceptable (<10% of total)

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1456.9ms)
2. Consider optimizing fl/task/executor.h (714.7ms)
3. Consider optimizing fl/fastled.h (491.0ms)

================================================================================

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (2)
ci/autoresearch/gpio.py (1)

77-77: ⚠️ Potential issue | 🔴 Critical

Critical: asyncio is not imported — both reset-retry paths will crash with NameError.

Lines 77 and 271 call await asyncio.sleep(3.0), but asyncio is not imported anywhere in this module (Ruff F821 confirms). The moment a ping fails and the DTR-reset recovery path is taken, Python will raise NameError: name 'asyncio' is not defined, which is then caught by the outer except Exception as e2: and reported as "Ping failed after DTR reset" — masking the real bug and making the reset-retry logic completely non-functional.

As per coding guidelines: "All system imports must be at the top of the file in proper order: standard library, third-party, local."

🐛 Proposed fix
 from __future__ import annotations
 
+import asyncio
 from dataclasses import dataclass
 from typing import TYPE_CHECKING
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ci/autoresearch/gpio.py` at line 77, The module calls await
asyncio.sleep(...) (seen in gpio.py around the retry logic for DTR reset) but
never imports asyncio, causing a NameError during retry paths; fix by adding
"import asyncio" to the top-level imports in gpio.py (under standard-library
imports before third-party/local), so the functions that reference asyncio.sleep
(the DTR-reset retry blocks where await asyncio.sleep(3.0) is used) will run
correctly.
ci/util/serial_interface.py (1)

221-225: ⚠️ Potential issue | 🟠 Major

Handle KeyboardInterrupt first and avoid silent swallow.

The except Exception: on Line 224 catches KeyboardInterrupt-adjacent cancellation patterns and silently returns False, hiding the root cause of fbuild reset failures.

As per coding guidelines: "All Python try-catch blocks must handle KeyboardInterrupt before other exceptions" and "Never use silent fallbacks for missing critical resources - always fail fast with descriptive errors".

♻️ Proposed fix
         try:
             result = await self._run_in_thread(self._monitor.reset_device, board)
             return bool(result)
+        except KeyboardInterrupt:
+            raise
         except Exception as exc:
+            warnings.warn(
+                f"FbuildSerialAdapter.reset_device failed: {exc}", stacklevel=2
+            )
             return False
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ci/util/serial_interface.py` around lines 221 - 225, The try/except currently
swallows all exceptions (including KeyboardInterrupt) and returns False; change
it to handle KeyboardInterrupt first by catching KeyboardInterrupt and
re-raising it, and then catch other Exceptions as e to either log a descriptive
error and raise a new RuntimeError (or propagate e) instead of silently
returning False; apply this around the call to
self._run_in_thread(self._monitor.reset_device, board) so that KeyboardInterrupt
isn't suppressed and other failures fail fast with a clear message.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ci/autoresearch/gpio.py`:
- Around line 285-297: The except blocks that currently read "except Exception
as e2:" and print a generic diagnosis swallow useful error context; update both
the DTR-reset handler (the block that prints "Ping failed after DTR reset") and
the pretest branch exception handler to include the caught exception details and
traceback in the output (e.g., include the exception object e2 in the printed
message and log or print the full exception info/traceback via exc_info or
traceback.print_exc()), and avoid silently concealing unexpected errors—ensure
any client.close() remains awaited and then return the PinDiscoveryResult as
before after logging the detailed error information so root causes are visible
for debugging.

---

Duplicate comments:
In `@ci/autoresearch/gpio.py`:
- Line 77: The module calls await asyncio.sleep(...) (seen in gpio.py around the
retry logic for DTR reset) but never imports asyncio, causing a NameError during
retry paths; fix by adding "import asyncio" to the top-level imports in gpio.py
(under standard-library imports before third-party/local), so the functions that
reference asyncio.sleep (the DTR-reset retry blocks where await
asyncio.sleep(3.0) is used) will run correctly.

In `@ci/util/serial_interface.py`:
- Around line 221-225: The try/except currently swallows all exceptions
(including KeyboardInterrupt) and returns False; change it to handle
KeyboardInterrupt first by catching KeyboardInterrupt and re-raising it, and
then catch other Exceptions as e to either log a descriptive error and raise a
new RuntimeError (or propagate e) instead of silently returning False; apply
this around the call to self._run_in_thread(self._monitor.reset_device, board)
so that KeyboardInterrupt isn't suppressed and other failures fail fast with a
clear message.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9e479daa-935d-4460-b9e8-ba2f70a7733c

📥 Commits

Reviewing files that changed from the base of the PR and between 2bd00c3 and 722c402.

📒 Files selected for processing (3)
  • ci/autoresearch/gpio.py
  • ci/autoresearch/phases.py
  • ci/util/serial_interface.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • ci/autoresearch/phases.py

Comment thread ci/autoresearch/gpio.py Resolved
…priority

- LCD_CLOCKLESS priority 1→2 to deterministically outrank legacy I2S
- Don't free DMA ring buffers after timed-out shutdown wait (both
  clockless and SPI drivers) — prevents use-after-free while DMA active
- Check registerTransmitCallback() return value, fail early if false
- Fix poll() completion: require streamDone AND peripheralIdle (not OR)
  to prevent premature completion between DMA send and callback register
- Add channels.size() > 16 bounds check with early return
- Remove dead mDmaBytesPerChunk field from IsrContext
- Add config change detection for peripheral reconfigure on timing/pin changes

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Header Compilation Performance

Total Time: 943.47ms

Top 5 Slowest Headers

  1. FastLED.h - 716.42ms
  2. fl/fastled.h - 304.65ms
  3. fl/task/executor.h - 232.81ms
  4. crgb.h - 170.03ms
  5. fl/gfx/crgb.h - 168.88ms

Warnings

⚠️ Header FastLED.h exceeds 150ms (716.4ms)
⚠️ Header fl/fastled.h exceeds 150ms (304.6ms)
⚠️ Header fl/task/executor.h exceeds 150ms (232.8ms)
⚠️ Header crgb.h exceeds 150ms (170.0ms)
⚠️ Header fl/gfx/crgb.h exceeds 150ms (168.9ms)
⚠️ Header fl/math/ease.h exceeds 150ms (164.6ms)
⚠️ Header fl/math/fixed_point.h exceeds 150ms (162.7ms)
⚠️ Header fl/task/scheduler.h exceeds 50ms (122.9ms)
⚠️ Header fl/stl/singleton.h exceeds 50ms (114.8ms)
⚠️ Header fl/stl/thread_local.h exceeds 50ms (114.2ms)
⚠️ Header fl/stl/thread.h exceeds 50ms (113.2ms)
⚠️ Header platforms/thread.h exceeds 50ms (113.1ms)
⚠️ Header platforms/stub/thread_stub.h exceeds 50ms (113.1ms)
⚠️ Header platforms/stub/thread_stub_stl.h exceeds 50ms (113.1ms)
⚠️ Header fl/ui.h exceeds 50ms (100.2ms)
⚠️ Header fl/task/promise.h exceeds 50ms (98.2ms)
⚠️ Header fl/stl/json.h exceeds 50ms (64.0ms)
⚠️ Header fl/stl/function.h exceeds 50ms (57.8ms)
⚠️ Header fl/stl/json/types.h exceeds 50ms (50.4ms)
⚠️ Template instantiation time is high (50.7%)

Full Report
================================================================================
FASTLED COMPILATION PERFORMANCE REPORT
================================================================================
Generated: 2026-04-17 15:15:05
Compiler: clang++-17
File: ci/perf/test_compile.cpp

SUMMARY
--------------------------------------------------------------------------------
Total Compilation Time:    2,163.42 ms
Frontend Time:             14.25 ms (0.7%)
Backend Time:              594.46 ms (27.5%)

COMPILATION PHASES
--------------------------------------------------------------------------------
Source                     9923.42 ms (458.7%)
Templates                   481.77 ms ( 22.3%)

FASTLED HEADERS (Level 1 - Direct Includes)
--------------------------------------------------------------------------------
  1226.0 ms - FastLED.h (SLOW)
   618.5 ms - fl/task/executor.h (SLOW)
   390.2 ms - fl/fastled.h (SLOW)
   315.5 ms - fl/task/scheduler.h (SLOW)
   307.0 ms - fl/stl/singleton.h (SLOW)
   306.4 ms - fl/stl/thread_local.h (SLOW)
   305.4 ms - fl/stl/thread.h (SLOW)
   305.3 ms - platforms/thread.h (SLOW)
   305.2 ms - platforms/stub/thread_stub.h (SLOW)
   305.2 ms - platforms/stub/thread_stub_stl.h (SLOW)
   290.9 ms - fl/task/promise.h (SLOW)
   250.1 ms - fl/stl/function.h (SLOW)
   229.9 ms - crgb.h (SLOW)
   228.7 ms - fl/gfx/crgb.h (SLOW)
   224.3 ms - fl/math/ease.h (SLOW)
   222.5 ms - fl/math/fixed_point.h (SLOW)
   124.4 ms - fl/ui.h (SLOW)
   114.7 ms - fl/stl/vector.h (SLOW)
   105.1 ms - fl/math/fixed_point/s4x12.h (SLOW)
    88.6 ms - fl/math/sin32.h (SLOW)

FASTLED HEADERS (Nested Includes - Up to 10 Levels)
--------------------------------------------------------------------------------
FastLED.h (1226.0ms)
  ├─  618.5 ms - fl/task/executor.h
  │ ├─  315.5 ms - fl/task/scheduler.h
  │ │ ├─  307.0 ms - fl/stl/singleton.h
  │ │ │ └─  306.4 ms - fl/stl/thread_local.h
  │ │ │   └─  305.4 ms - fl/stl/thread.h
  │ │ │     └─  305.3 ms - platforms/thread.h
  │ │ │       └─  305.2 ms - platforms/stub/thread_stub.h
  │ │ │         └─  305.2 ms - platforms/stub/thread_stub_stl.h
  │ │ │           └─  300.6 ms - thread
  │ │ │             ├─  170.8 ms - std_thread.h
  │ │ │             └─   97.1 ms - this_thread_sleep.h
  │ │ └─    7.7 ms - fl/task/task.h
  │ │   └─    3.0 ms - fl/trace.h
  │ │     ├─    1.9 ms - fl/stl/chrono.h
  │ │     └─    0.8 ms - fl/stl/tuple.h
  │ ├─  290.9 ms - fl/task/promise.h
  │ │ ├─  250.1 ms - fl/stl/function.h
  │ │ │ ├─  114.7 ms - fl/stl/vector.h
  │ │ │ │ ├─   70.6 ms - fl/math/math.h
  │ │ │ │ │ └─   64.8 ms - fl/stl/undef.h
  │ │ │ │ │   └─  100.9 ms - stdlib.h
  │ │ │ │ │     ├─   50.6 ms - cstdlib
  │ │ │ │ │     │ ├─  100.9 ms - stdlib.h
  │ │ │ │ │     │ │ ├─   50.6 ms - cstdlib
  │ │ │ │ │     │ │ └─   14.2 ms - types.h
  │ │ │ │ │     │ └─    0.6 ms - std_abs.h
  │ │ │ │ │     └─   14.2 ms - types.h
  │ │ │ │ │       ├─   14.2 ms - types.h
  │ │ │ │ │       │ ├─   14.2 ms - types.h
  │ │ │ │ │       │ ├─    6.4 ms - select.h
  │ │ │ │ │       │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │ │       │ └─    1.5 ms - endian.h
  │ │ │ │ │       ├─    6.4 ms - select.h
  │ │ │ │ │       ├─    2.1 ms - pthreadtypes.h
  │ │ │ │ │       │ └─    1.6 ms - thread-shared-types.h
  │ │ │ │ │       └─    1.5 ms - endian.h
  │ │ │ │ ├─   17.8 ms - fl/stl/initializer_list.h
  │ │ │ │ │ └─    0.5 ms - initializer_list
  │ │ │ │ ├─   17.3 ms - fl/stl/allocator.h
  │ │ │ │ │ └─   12.6 ms - fl/stl/bitset.h
  │ │ │ │ │   └─    8.6 ms - fl/stl/bitset_dynamic.h
  │ │ │ │ │     └─    2.4 ms - fl/stl/unique_ptr.h
  │ │ │ │ │       └─    0.5 ms - fl/stl/utility.h
  │ │ │ │ ├─    2.2 ms - fl/stl/basic_vector.h
  │ │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ │ ├─   82.6 ms - fl/stl/variant.h
  │ │ │ │ └─   80.0 ms - fl/stl/new.h
  │ │ │ │   └─   80.0 ms - platforms/new.h
  │ │ │ │     └─   80.0 ms - platforms/shared/new.h
  │ │ │ │       └─   50.6 ms - new
  │ │ │ │         ├─   13.6 ms - c++config.h
  │ │ │ │         │ └─    4.5 ms - os_defines.h
  │ │ │ │         └─    0.7 ms - version.h
  │ │ │ ├─   37.7 ms - fl/stl/shared_ptr.h
  │ │ │ │ ├─   22.3 ms - fl/stl/type_traits.h
  │ │ │ │ │ └─   15.7 ms - fl/stl/move.h
  │ │ │ │ ├─   10.2 ms - fl/stl/atomic.h
  │ │ │ │ │ └─    9.4 ms - platforms/atomic.h
  │ │ │ │ │   └─    9.4 ms - platforms/shared/atomic.h
  │ │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ │ ├─    4.2 ms - fl/stl/compiler_control.h
  │ │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │ │   └─    1.6 ms - fl/math/random.h
  │ │ │     └─    0.8 ms - fl/math/random8.h
  │ │ └─   36.2 ms - fl/stl/string.h
  │ │   ├─   10.8 ms - fl/stl/basic_string.h
  │ │   │ ├─    0.9 ms - fl/stl/not_null.h
  │ │   │ └─    0.8 ms - fl/stl/iterator.h
  │ │   ├─    7.1 ms - fl/stl/span.h
  │ │   │ └─    2.9 ms - fl/math/geometry.h
  │ │   ├─    4.3 ms - fl/stl/string_view.h
  │ │   └─    1.3 ms - fl/stl/optional.h
  │ ├─   10.1 ms - platforms/await.h
  │ │ └─    9.7 ms - platforms/coroutine_runtime.h
  │ │   └─    8.3 ms - fl/system/engine_events.h
  │ │     ├─    4.2 ms - fl/math/screenmap.h
  │ │     │ └─    3.1 ms - fl/stl/flat_map.h
  │ │     └─    2.7 ms - fl/math/xymap.h
  │ │       └─    0.7 ms - fl/math/lut.h
  │ └─    0.7 ms - fl/task/promise_result.h
  ├─  390.2 ms - fl/fastled.h
  │ ├─  229.9 ms - crgb.h
  │ │ ├─  228.7 ms - fl/gfx/crgb.h
  │ │ │ └─  224.3 ms - fl/math/ease.h
  │ │ │   └─  222.5 ms - fl/math/fixed_point.h
  │ │ │     ├─  105.1 ms - fl/math/fixed_point/s4x12.h
  │ │ │     │ ├─   88.6 ms - fl/math/sin32.h
  │ │ │     │ │ └─   86.0 ms - fl/math/simd.h
  │ │ │     │ │   └─   85.5 ms - fl/math/simd/types.h
  │ │ │     │ │     └─   85.2 ms - platforms/simd.h
  │ │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │ │     ├─   14.8 ms - fl/math/fixed_point/s8x24.h
  │ │ │     ├─   14.6 ms - fl/math/fixed_point/s16x16.h
  │ │ │     ├─   14.6 ms - fl/math/fixed_point/s8x8.h
  │ │ │     └─   14.4 ms - fl/math/fixed_point/s24x8.h
  │ │ └─    0.8 ms - chsv.h
  │ │   └─    0.7 ms - fl/gfx/hsv.h
  │ ├─   71.1 ms - platforms.h
  │ │ └─   71.1 ms - platforms/stub/fastled_stub.h
  │ │   ├─   39.6 ms - platforms/stub/fastspi_stub.h
  │ │   │ └─   39.6 ms - platforms/stub/fastspi_stub_generic.h
  │ │   │   ├─   34.1 ms - platforms/shared/active_strip_data/active_strip_data.h
  │ │   │   │ └─   32.2 ms - fl/id_tracker.h
  │ │   │   │   └─   31.3 ms - fl/stl/mutex.h
  │ │   │   │     └─   31.2 ms - platforms/mutex.h
  │ │   │   │       └─   31.1 ms - platforms/stub/mutex_stub.h
  │ │   │   └─    5.1 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │ │   └─   31.4 ms - platforms/stub/clockless_stub.h
  │ │     └─   31.4 ms - platforms/stub/clockless_channel_stub.h
  │ │       ├─   11.3 ms - fl/channels/data.h
  │ │       │ └─    8.3 ms - fl/channels/config.h
  │ │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │ │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │ │       │   └─    1.4 ms - fl/chipsets/spi.h
  │ │       ├─   10.7 ms - fl/system/log.h
  │ │       │ └─   10.3 ms - fl/stl/strstream.h
  │ │       ├─    2.1 ms - fl/channels/manager.h
  │ │       ├─    1.3 ms - fl/stl/weak_ptr.h
  │ │       └─    1.0 ms - fl/channels/driver.h
  │ ├─   34.0 ms - colorutils.h
  │ │ └─   33.1 ms - fl/gfx/colorutils.h
  │ │   ├─    7.2 ms - fl/gfx/blur.h
  │ │   │ └─    3.9 ms - fl/gfx/canvas.h
  │ │   │   └─    2.4 ms - fl/math/alpha.h
  │ │   └─    2.6 ms - fl/gfx/fill.h
  │ ├─   19.2 ms - pixel_controller.h
  │ │ ├─   13.6 ms - pixel_iterator.h
  │ │ │ └─   13.5 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │ │   ├─    3.8 ms - fl/chipsets/encoders/apa102.h
  │ │ │   │ └─    3.0 ms - fl/chipsets/encoders/encoder_utils.h
  │ │ │   │   └─    2.4 ms - fl/gfx/gamma_lut.h
  │ │ │   ├─    3.7 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ │ └─    2.3 ms - rgbw.h
  │ │   └─    2.2 ms - fl/gfx/rgbw.h
  │ └─   17.4 ms - pixeltypes.h
  │   ├─   14.5 ms - lib8tion.h
  │   │ ├─    7.4 ms - fl/math/math8.h
  │   │ │ ├─    3.7 ms - fl/math/intmap.h
  │   │ │ │ └─    2.9 ms - platforms/intmap.h
  │   │ │ ├─    1.9 ms - fl/math/scale8.h
  │   │ │ │ └─    1.9 ms - platforms/scale8.h
  │   │ │ │   └─    0.7 ms - platforms/shared/scale8.h
  │   │ │ └─    1.7 ms - platforms/math8.h
  │   │ │   └─    1.3 ms - platforms/shared/math8.h
  │   │ └─    1.5 ms - fl/math/beat.h
  │   │   └─    0.8 ms - fl/math/trig8.h
  │   │     └─    0.8 ms - platforms/trig8.h
  │   │       └─    0.7 ms - platforms/shared/trig8.h
  │   └─    2.5 ms - crgb.hpp
  ├─  124.4 ms - fl/ui.h
  │ ├─   66.5 ms - fl/stl/json.h
  │ │ └─   51.1 ms - fl/stl/json/types.h
  │ │   └─    5.8 ms - fl/stl/limits.h
  │ ├─   10.5 ms - fl/ui_impl.h
  │ │ └─    9.9 ms - platforms/ui_defs.h
  │ │   ├─    2.0 ms - platforms/shared/ui/json/audio.h
  │ │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │ │   ├─    1.8 ms - platforms/shared/ui/json/button.h
  │ │   │ └─    0.8 ms - platforms/shared/ui/json/ui_internal.h
  │ │   ├─    1.1 ms - platforms/shared/ui/json/checkbox.h
  │ │   ├─    0.9 ms - platforms/shared/ui/json/number_field.h
  │ │   └─    0.8 ms - platforms/shared/ui/json/help.h
  │ └─    6.2 ms - fl/stl/url.h
  ├─   24.4 ms - chipsets.h
  │ ├─   10.4 ms - fl/chipsets/ucs7604.h
  │ │ └─    8.0 ms - fl/chipsets/encoders/ucs7604.h
  │ ├─    5.6 ms - fl/chipsets/apa102.h
  │ ├─    1.5 ms - fl/chipsets/lpd880x.h
  │ ├─    0.8 ms - fl/chipsets/encoders/ws2816.h
  │ └─    0.7 ms - fl/chipsets/p9813.h
  └─   19.7 ms - fl/audio/audio_processor.h
    ├─    5.0 ms - fl/audio/audio_context.h
    │ └─    1.4 ms - fl/audio/fft/fft.h
    ├─    1.5 ms - fl/audio/detector/vibe.h
    └─    0.8 ms - fl/audio/signal_conditioner.h
fl/task/executor.h (618.5ms)
  ├─  315.5 ms - fl/task/scheduler.h
  │ ├─  307.0 ms - fl/stl/singleton.h
  │ │ └─  306.4 ms - fl/stl/thread_local.h
  │ │   └─  305.4 ms - fl/stl/thread.h
  │ │     └─  305.3 ms - platforms/thread.h
  │ │       └─  305.2 ms - platforms/stub/thread_stub.h
  │ │         └─  305.2 ms - platforms/stub/thread_stub_stl.h
  │ │           └─  300.6 ms - thread
  │ │             ├─  170.8 ms - std_thread.h
  │ │             │ ├─   52.5 ms - tuple
  │ │             │ ├─   30.4 ms - refwrap.h
  │ │             │ ├─   28.0 ms - iosfwd
  │ │             │ ├─    9.5 ms - gthr.h
  │ │             │ └─    5.2 ms - unique_ptr.h
  │ │             └─   97.1 ms - this_thread_sleep.h
  │ │               ├─   85.6 ms - chrono.h
  │ │               └─    3.1 ms - cerrno
  │ └─    7.7 ms - fl/task/task.h
  │   └─    3.0 ms - fl/trace.h
  │     ├─    1.9 ms - fl/stl/chrono.h
  │     └─    0.8 ms - fl/stl/tuple.h
  ├─  290.9 ms - fl/task/promise.h
  │ ├─  250.1 ms - fl/stl/function.h
  │ │ ├─  114.7 ms - fl/stl/vector.h
  │ │ │ ├─   70.6 ms - fl/math/math.h
  │ │ │ │ └─   64.8 ms - fl/stl/undef.h
  │ │ │ │   └─  100.9 ms - stdlib.h
  │ │ │ │     ├─   50.6 ms - cstdlib
  │ │ │ │     │ ├─  100.9 ms - stdlib.h
  │ │ │ │     │ │ ├─   50.6 ms - cstdlib
  │ │ │ │     │ │ │ ├─  100.9 ms - stdlib.h
  │ │ │ │     │ │ │ └─    0.6 ms - std_abs.h
  │ │ │ │     │ │ └─   14.2 ms - types.h
  │ │ │ │     │ │   ├─   14.2 ms - types.h
  │ │ │ │     │ │   ├─    6.4 ms - select.h
  │ │ │ │     │ │   ├─    2.1 ms - pthreadtypes.h
  │ │ │ │     │ │   └─    1.5 ms - endian.h
  │ │ │ │     │ └─    0.6 ms - std_abs.h
  │ │ │ │     └─   14.2 ms - types.h
  │ │ │ │       ├─   14.2 ms - types.h
  │ │ │ │       │ ├─   14.2 ms - types.h
  │ │ │ │       │ │ ├─   14.2 ms - types.h
  │ │ │ │       │ │ ├─    6.4 ms - select.h
  │ │ │ │       │ │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │       │ │ └─    1.5 ms - endian.h
  │ │ │ │       │ ├─    6.4 ms - select.h
  │ │ │ │       │ ├─    2.1 ms - pthreadtypes.h
  │ │ │ │       │ │ └─    1.6 ms - thread-shared-types.h
  │ │ │ │       │ └─    1.5 ms - endian.h
  │ │ │ │       ├─    6.4 ms - select.h
  │ │ │ │       ├─    2.1 ms - pthreadtypes.h
  │ │ │ │       │ └─    1.6 ms - thread-shared-types.h
  │ │ │ │       └─    1.5 ms - endian.h
  │ │ │ ├─   17.8 ms - fl/stl/initializer_list.h
  │ │ │ │ └─    0.5 ms - initializer_list
  │ │ │ ├─   17.3 ms - fl/stl/allocator.h
  │ │ │ │ └─   12.6 ms - fl/stl/bitset.h
  │ │ │ │   └─    8.6 ms - fl/stl/bitset_dynamic.h
  │ │ │ │     └─    2.4 ms - fl/stl/unique_ptr.h
  │ │ │ │       └─    0.5 ms - fl/stl/utility.h
  │ │ │ ├─    2.2 ms - fl/stl/basic_vector.h
  │ │ │ └─    0.6 ms - fl/stl/functional.h
  │ │ ├─   82.6 ms - fl/stl/variant.h
  │ │ │ └─   80.0 ms - fl/stl/new.h
  │ │ │   └─   80.0 ms - platforms/new.h
  │ │ │     └─   80.0 ms - platforms/shared/new.h
  │ │ │       └─   50.6 ms - new
  │ │ │         ├─   13.6 ms - c++config.h
  │ │ │         │ └─    4.5 ms - os_defines.h
  │ │ │         │   └─    3.9 ms - features.h
  │ │ │         └─    0.7 ms - version.h
  │ │ ├─   37.7 ms - fl/stl/shared_ptr.h
  │ │ │ ├─   22.3 ms - fl/stl/type_traits.h
  │ │ │ │ └─   15.7 ms - fl/stl/move.h
  │ │ │ ├─   10.2 ms - fl/stl/atomic.h
  │ │ │ │ └─    9.4 ms - platforms/atomic.h
  │ │ │ │   └─    9.4 ms - platforms/shared/atomic.h
  │ │ │ └─    0.6 ms - fl/stl/bit_cast.h
  │ │ ├─    4.2 ms - fl/stl/compiler_control.h
  │ │ └─    3.7 ms - fl/stl/algorithm.h
  │ │   └─    1.6 ms - fl/math/random.h
  │ │     └─    0.8 ms - fl/math/random8.h
  │ └─   36.2 ms - fl/stl/string.h
  │   ├─   10.8 ms - fl/stl/basic_string.h
  │   │ ├─    0.9 ms - fl/stl/not_null.h
  │   │ └─    0.8 ms - fl/stl/iterator.h
  │   ├─    7.1 ms - fl/stl/span.h
  │   │ └─    2.9 ms - fl/math/geometry.h
  │   ├─    4.3 ms - fl/stl/string_view.h
  │   └─    1.3 ms - fl/stl/optional.h
  ├─   10.1 ms - platforms/await.h
  │ └─    9.7 ms - platforms/coroutine_runtime.h
  │   └─    8.3 ms - fl/system/engine_events.h
  │     ├─    4.2 ms - fl/math/screenmap.h
  │     │ └─    3.1 ms - fl/stl/flat_map.h
  │     └─    2.7 ms - fl/math/xymap.h
  │       └─    0.7 ms - fl/math/lut.h
  └─    0.7 ms - fl/task/promise_result.h
fl/fastled.h (390.2ms)
  ├─  229.9 ms - crgb.h
  │ ├─  228.7 ms - fl/gfx/crgb.h
  │ │ └─  224.3 ms - fl/math/ease.h
  │ │   └─  222.5 ms - fl/math/fixed_point.h
  │ │     ├─  105.1 ms - fl/math/fixed_point/s4x12.h
  │ │     │ ├─   88.6 ms - fl/math/sin32.h
  │ │     │ │ └─   86.0 ms - fl/math/simd.h
  │ │     │ │   └─   85.5 ms - fl/math/simd/types.h
  │ │     │ │     └─   85.2 ms - platforms/simd.h
  │ │     │ │       └─   85.2 ms - platforms/shared/simd_x86.hpp
  │ │     │ ├─    0.9 ms - fl/math/fixed_point/traits.h
  │ │     │ └─    0.6 ms - fl/math/fixed_point/isqrt.h
  │ │     ├─   14.8 ms - fl/math/fixed_point/s8x24.h
  │ │     ├─   14.6 ms - fl/math/fixed_point/s16x16.h
  │ │     ├─   14.6 ms - fl/math/fixed_point/s8x8.h
  │ │     └─   14.4 ms - fl/math/fixed_point/s24x8.h
  │ └─    0.8 ms - chsv.h
  │   └─    0.7 ms - fl/gfx/hsv.h
  ├─   71.1 ms - platforms.h
  │ └─   71.1 ms - platforms/stub/fastled_stub.h
  │   ├─   39.6 ms - platforms/stub/fastspi_stub.h
  │   │ └─   39.6 ms - platforms/stub/fastspi_stub_generic.h
  │   │   ├─   34.1 ms - platforms/shared/active_strip_data/active_strip_data.h
  │   │   │ └─   32.2 ms - fl/id_tracker.h
  │   │   │   └─   31.3 ms - fl/stl/mutex.h
  │   │   │     └─   31.2 ms - platforms/mutex.h
  │   │   │       └─   31.1 ms - platforms/stub/mutex_stub.h
  │   │   │         └─   31.1 ms - platforms/stub/mutex_stub_stl.h
  │   │   └─    5.1 ms - platforms/shared/active_strip_tracker/active_strip_tracker.h
  │   └─   31.4 ms - platforms/stub/clockless_stub.h
  │     └─   31.4 ms - platforms/stub/clockless_channel_stub.h
  │       ├─   11.3 ms - fl/channels/data.h
  │       │ └─    8.3 ms - fl/channels/config.h
  │       │   ├─    1.8 ms - fl/chipsets/chipset_timing_config.h
  │       │   │ └─    1.2 ms - fl/chipsets/led_timing.h
  │       │   └─    1.4 ms - fl/chipsets/spi.h
  │       ├─   10.7 ms - fl/system/log.h
  │       │ └─   10.3 ms - fl/stl/strstream.h
  │       ├─    2.1 ms - fl/channels/manager.h
  │       ├─    1.3 ms - fl/stl/weak_ptr.h
  │       └─    1.0 ms - fl/channels/driver.h
  ├─   34.0 ms - colorutils.h
  │ └─   33.1 ms - fl/gfx/colorutils.h
  │   ├─    7.2 ms - fl/gfx/blur.h
  │   │ └─    3.9 ms - fl/gfx/canvas.h
  │   │   └─    2.4 ms - fl/math/alpha.h
  │   └─    2.6 ms - fl/gfx/fill.h
  ├─   19.2 ms - pixel_controller.h
  │ ├─   13.6 ms - pixel_iterator.h
  │ │ └─   13.5 ms - fl/chipsets/encoders/pixel_iterator.h
  │ │   ├─    3.8 ms - fl/chipsets/encoders/apa102.h
  │ │   │ └─    3.0 ms - fl/chipsets/encoders/encoder_utils.h
  │ │   │   └─    2.4 ms - fl/gfx/gamma_lut.h
  │ │   ├─    3.7 ms - fl/chipsets/encoders/pixel_iterator_adapters.h
  │ │   ├─    0.8 ms - fl/chipsets/encoders/sk9822.h
  │ │   └─    0.7 ms - fl/chipsets/encoders/hd108.h
  │ └─    2.3 ms - rgbw.h
  │   └─    2.2 ms - fl/gfx/rgbw.h
  └─   17.4 ms - pixeltypes.h
    ├─   14.5 ms - lib8tion.h
    │ ├─    7.4 ms - fl/math/math8.h
    │ │ ├─    3.7 ms - fl/math/intmap.h
    │ │ │ └─    2.9 ms - platforms/intmap.h
    │ │ ├─    1.9 ms - fl/math/scale8.h
    │ │ │ └─    1.9 ms - platforms/scale8.h
    │ │ │   └─    0.7 ms - platforms/shared/scale8.h
    │ │ └─    1.7 ms - platforms/math8.h
    │ │   └─    1.3 ms - platforms/shared/math8.h
    │ └─    1.5 ms - fl/math/beat.h
    │   └─    0.8 ms - fl/math/trig8.h
    │     └─    0.8 ms - platforms/trig8.h
    │       └─    0.7 ms - platforms/shared/trig8.h
    └─    2.5 ms - crgb.hpp
fl/ui.h (124.4ms)
  ├─   66.5 ms - fl/stl/json.h
  │ └─   51.1 ms - fl/stl/json/types.h
  │   └─    5.8 ms - fl/stl/limits.h
  ├─   10.5 ms - fl/ui_impl.h
  │ └─    9.9 ms - platforms/ui_defs.h
  │   ├─    2.0 ms - platforms/shared/ui/json/audio.h
  │   │ └─    1.0 ms - platforms/shared/ui/json/audio_internal.h
  │   ├─    1.8 ms - platforms/shared/ui/json/button.h
  │   │ └─    0.8 ms - platforms/shared/ui/json/ui_internal.h
  │   ├─    1.1 ms - platforms/shared/ui/json/checkbox.h
  │   ├─    0.9 ms - platforms/shared/ui/json/number_field.h
  │   └─    0.8 ms - platforms/shared/ui/json/help.h
  └─    6.2 ms - fl/stl/url.h
chipsets.h (24.4ms)
  ├─   10.4 ms - fl/chipsets/ucs7604.h
  │ └─    8.0 ms - fl/chipsets/encoders/ucs7604.h
  ├─    5.6 ms - fl/chipsets/apa102.h
  ├─    1.5 ms - fl/chipsets/lpd880x.h
  ├─    0.8 ms - fl/chipsets/encoders/ws2816.h
  └─    0.7 ms - fl/chipsets/p9813.h

TOP 20 SLOWEST OPERATIONS
--------------------------------------------------------------------------------
  1.  1226.0 ms - Source: FastLED.h
  2.  1226.0 ms - Total Source: 
  3.   618.5 ms - Source: fl/task/executor.h
  4.   549.4 ms - Total ParseClass: 
  5.   390.2 ms - Source: fl/fastled.h
  6.   315.5 ms - Source: fl/task/scheduler.h
  7.   307.0 ms - Source: fl/stl/singleton.h
  8.   306.4 ms - Source: fl/stl/thread_local.h
  9.   305.4 ms - Source: fl/stl/thread.h
 10.   305.3 ms - Source: platforms/thread.h
 11.   305.2 ms - Source: platforms/stub/thread_stub.h
 12.   305.2 ms - Source: platforms/stub/thread_stub_stl.h
 13.   300.6 ms - Source: thread
 14.   290.9 ms - Source: fl/task/promise.h
 15.   250.1 ms - Source: fl/stl/function.h
 16.   229.9 ms - Source: crgb.h
 17.   228.7 ms - Source: fl/gfx/crgb.h
 18.   224.3 ms - Source: fl/math/ease.h
 19.   222.5 ms - Source: fl/math/fixed_point.h
 20.   178.6 ms - Total InstantiateFunction: 

PERFORMANCE FLAGS
--------------------------------------------------------------------------------
⚠️  SLOW HEADERS (>50.0ms):
    - FastLED.h (1226.0ms)
    - fl/task/executor.h (618.5ms)
    - fl/fastled.h (390.2ms)
    - fl/task/scheduler.h (315.5ms)
    - fl/stl/singleton.h (307.0ms)
    - fl/stl/thread_local.h (306.4ms)
    - fl/stl/thread.h (305.4ms)
    - platforms/thread.h (305.3ms)
    - platforms/stub/thread_stub.h (305.2ms)
    - platforms/stub/thread_stub_stl.h (305.2ms)

⚠️  Template instantiation time is high (22.3% of total)
✓  Lexing time is acceptable (<10% of total)

RECOMMENDATIONS
--------------------------------------------------------------------------------
1. Consider optimizing FastLED.h (1226.0ms)
2. Consider optimizing fl/task/executor.h (618.5ms)
3. Consider optimizing fl/fastled.h (390.2ms)

================================================================================

@zackees
zackees merged commit c57bcec into master Apr 17, 2026
65 of 85 checks passed
@zackees
zackees deleted the feat/lcd-isr-buffer-refill branch April 17, 2026 15:20
zackees added a commit that referenced this pull request Apr 17, 2026
…-spi

Hardware bring-up for PR #2260 (LCD_CAM ISR-driven chunked DMA).

Crash fix
  ChannelDriverLcdClockless defaulted dc_gpio=22 and clock_gpio=21.
  GPIO 22 does not exist on common ESP32-S3 packages, so
  esp_lcd_new_i80_bus -> lcd_i80_bus_configure_gpio -> gpio_func_sel
  hit an error-log path that detected heap poisoning and triggered a
  Guru Meditation panic. Changed both defaults to GPIO 0 (same
  convention as the legacy I2S LCD_CAM driver this replaces).

autoresearch CLI
  --lcd now maps to LCD_CLOCKLESS (was the legacy I2S name).
  Added --lcd-spi mapping to LCD_SPI (APA102/SK9822 via LCD_CAM I80).
  Both auto-select the esp32s3 environment and are included in --all.

autoresearch RX decoder
  AutoResearchTest.cpp recognises LCD_CLOCKLESS and reconstructs the
  RX timing for wave3 or wave8 encoding using the same
  fl::canUseWave3() eligibility check the firmware uses at runtime.

GPIO pre-test timing
  Bumped RpcClient boot_wait from 3s to 8s and enabled drain_boot in
  gpio.py. The ESP32-S3 AutoResearch setup() takes ~5-7s before the
  RPC dispatcher is ready, so the old 3s wait raced the first ping
  against setup and produced intermittent GPIO PRE-TEST timeouts.

Hardware verification (ESP32-S3 @ COM13, jumper GPIO 1 -> GPIO 2)
  LCD_SPI:       4/4 patterns pass (passed:true)
  LCD_CLOCKLESS: 4/4 patterns pass (passed:true, after GPIO fix)

Host unit tests: 299/299 pass. Lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Apr 17, 2026
…-spi

Hardware bring-up for PR #2260 (LCD_CAM ISR-driven chunked DMA).

Crash fix
  ChannelDriverLcdClockless defaulted dc_gpio=22 and clock_gpio=21.
  GPIO 22 does not exist on common ESP32-S3 packages, so
  esp_lcd_new_i80_bus -> lcd_i80_bus_configure_gpio -> gpio_func_sel
  hit an error-log path that detected heap poisoning and triggered a
  Guru Meditation panic. Changed both defaults to GPIO 0 (same
  convention as the legacy I2S LCD_CAM driver this replaces).

autoresearch CLI
  --lcd now maps to LCD_CLOCKLESS (was the legacy I2S name).
  Added --lcd-spi mapping to LCD_SPI (APA102/SK9822 via LCD_CAM I80).
  Both auto-select the esp32s3 environment and are included in --all.

autoresearch RX decoder
  AutoResearchTest.cpp recognises LCD_CLOCKLESS and reconstructs the
  RX timing for wave3 or wave8 encoding using the same
  fl::canUseWave3() eligibility check the firmware uses at runtime.

GPIO pre-test timing
  Bumped RpcClient boot_wait from 3s to 8s and enabled drain_boot in
  gpio.py. The ESP32-S3 AutoResearch setup() takes ~5-7s before the
  RPC dispatcher is ready, so the old 3s wait raced the first ping
  against setup and produced intermittent GPIO PRE-TEST timeouts.

Hardware verification (ESP32-S3 @ COM13, jumper GPIO 1 -> GPIO 2)
  LCD_SPI:       4/4 patterns pass (passed:true)
  LCD_CLOCKLESS: 4/4 patterns pass (passed:true, after GPIO fix)

Host unit tests: 299/299 pass. Lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Apr 17, 2026
…d-spi (#2273)

* fix(esp32-s3): LCD_CLOCKLESS GPIO defaults + autoresearch --lcd/--lcd-spi

Hardware bring-up for PR #2260 (LCD_CAM ISR-driven chunked DMA).

Crash fix
  ChannelDriverLcdClockless defaulted dc_gpio=22 and clock_gpio=21.
  GPIO 22 does not exist on common ESP32-S3 packages, so
  esp_lcd_new_i80_bus -> lcd_i80_bus_configure_gpio -> gpio_func_sel
  hit an error-log path that detected heap poisoning and triggered a
  Guru Meditation panic. Changed both defaults to GPIO 0 (same
  convention as the legacy I2S LCD_CAM driver this replaces).

autoresearch CLI
  --lcd now maps to LCD_CLOCKLESS (was the legacy I2S name).
  Added --lcd-spi mapping to LCD_SPI (APA102/SK9822 via LCD_CAM I80).
  Both auto-select the esp32s3 environment and are included in --all.

autoresearch RX decoder
  AutoResearchTest.cpp recognises LCD_CLOCKLESS and reconstructs the
  RX timing for wave3 or wave8 encoding using the same
  fl::canUseWave3() eligibility check the firmware uses at runtime.

GPIO pre-test timing
  Bumped RpcClient boot_wait from 3s to 8s and enabled drain_boot in
  gpio.py. The ESP32-S3 AutoResearch setup() takes ~5-7s before the
  RPC dispatcher is ready, so the old 3s wait raced the first ping
  against setup and produced intermittent GPIO PRE-TEST timeouts.

Hardware verification (ESP32-S3 @ COM13, jumper GPIO 1 -> GPIO 2)
  LCD_SPI:       4/4 patterns pass (passed:true)
  LCD_CLOCKLESS: 4/4 patterns pass (passed:true, after GPIO fix)

Host unit tests: 299/299 pass. Lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* chore: ignore autoresearch + claude transient files

.autoresearch_last.log is rewritten by every autoresearch run and
.claude/scheduled_tasks.lock is a lockfile managed by Claude Code's
background-task system. Neither should be tracked.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* fix(esp32-s3): always free ring buffers in LCD driver dtors (LSan fix)

Both ChannelDriverLcdClockless and ChannelDriverLcdSpi destructors had
an "intentional leak" branch that skipped freeRingBuffers() whenever
waitTransmitDone() returned false, on the theory that DMA might still
be reading the buffers.

In the unit-test mocks (LcdSpiPeripheralMock), waitTransmitDone()
returns false immediately whenever mPendingTransmits > 0 — so any test
that does not explicitly drain via simulateTransmitComplete() hits the
leak path, and LeakSanitizer (active in CI --debug runs) rejects the
test.

A 2 s stall on real hardware already indicates the DMA is lost; the
leak-to-be-safe strategy never actually helps production code and it
strictly breaks tests. Free unconditionally and log a warning instead.

Both failing CI jobs pass locally:
  bash test channel_driver_lcd_clockless --debug --clean   PASS
  bash test channel_driver_lcd_spi --debug                 PASS

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@zackees zackees mentioned this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(esp32-s3): LCD_CAM ISR-driven buffer refill for chunked DMA streaming

1 participant