Repository navigation
Fix AutoResearch lane limits and LCD chunk sizing - #2691
Conversation
📝 WalkthroughWalkthroughThis PR addresses two follow-up issues from a prior review: it expands AutoResearch lane validation from 1–8 to 1–16 lanes across the CLI, firmware, tests, and documentation, and it simplifies LCD_CLOCKLESS DMA chunk sizing to round up instead of shrinking chunks, reducing interrupt overhead. ChangesLane Limit Expansion to 1–16
DMA Chunk Sizing Optimization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Infer (1.2.0)tests/fl/channels/validation.cpptests/fl/channels/validation.cpp:5:10: fatal error: 'test.h' file not found ... [truncated 1058 characters] ... ll/lib/clang/18/include" examples/AutoResearch/AutoResearchRemote.cppIn file included from examples/AutoResearch/AutoResearchRemote.cpp:14: ... [truncated 2200 characters] ... in file "src/istd/IExn.ml" (inlined), line 13, characters 2-50 tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpptests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp:384:1: error: extraneous closing brace ('}') ... [truncated 1144 characters] ... stem" "/usr/local/include" "-internal-isystem" 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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp (1)
352-383:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftChunk sizing invariant is still broken: last ISR chunk can be smaller, triggering
esp_lcd_panel_io_delfrom ISR viaLcdSpiPeripheralEsp::transmit().
ChannelDriverLcdClockless::isrChunkDone()clampschunkBytesto the remaining bytes (lines 268-272), sodmaBytespassed tomPeripheral->transmit()can differ between chunks whenmaxSizeisn’t an exact multiple ofmChunkInputBytes(e.g.maxSize=1025,requestedChunkInputBytes=1024⇒chunkInputBytes=513, chunks:513then512).LcdSpiPeripheralEsp::transmit()recreatesmPanelIowheneversize_bytes != mLastTransmitSize, callingesp_lcd_panel_io_del()(lines 342-352), which undermines the deadlock-avoidance rationale in the chunk sizing comment (lines 360-363).Options:
- Make ISR transmits always use a fixed size by not clamping
chunkBytesto the remainder (encodeChunk already zero-fills beyonddata.size()), sosize_bytesstays constant across ISR re-arms.- If smaller final chunks are acceptable, update the chunk sizing comment to remove the claim that
chunkInputBytesevenly dividesmaxSize/ all ISR-driven chunks carry the same DMA byte count.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp` around lines 352 - 383, The chunk-sizing logic still allows a smaller final ISR chunk so dmaBytes passed to mPeripheral->transmit() can differ between ISR transmits and cause LcdSpiPeripheralEsp::transmit() to recreate mPanelIo (triggering esp_lcd_panel_io_del from ISR); to fix, change ChannelDriverLcdClockless::isrChunkDone() to stop clamping chunkBytes to the remaining bytes and always emit the full chunkInputBytes (encodeChunk already zero-fills past data.size()), ensuring every ISR call passes the same size_bytes to mPeripheral->transmit() and avoids mLastTransmitSize changes; alternatively, if variable final chunks are intended, update the chunk-sizing comment around chunkInputBytes/numChunks to remove the claim that chunks all carry the same DMA byte count and ensure LcdSpiPeripheralEsp::transmit() does not call esp_lcd_panel_io_del from ISR contexts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp`:
- Around line 352-383: The chunk-sizing logic still allows a smaller final ISR
chunk so dmaBytes passed to mPeripheral->transmit() can differ between ISR
transmits and cause LcdSpiPeripheralEsp::transmit() to recreate mPanelIo
(triggering esp_lcd_panel_io_del from ISR); to fix, change
ChannelDriverLcdClockless::isrChunkDone() to stop clamping chunkBytes to the
remaining bytes and always emit the full chunkInputBytes (encodeChunk already
zero-fills past data.size()), ensuring every ISR call passes the same size_bytes
to mPeripheral->transmit() and avoids mLastTransmitSize changes; alternatively,
if variable final chunks are intended, update the chunk-sizing comment around
chunkInputBytes/numChunks to remove the claim that chunks all carry the same DMA
byte count and ensure LcdSpiPeripheralEsp::transmit() does not call
esp_lcd_panel_io_del from ISR contexts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5158c863-8ec3-43e8-bce3-028103caa6b4
📒 Files selected for processing (11)
autoresearchci/autoresearch/args.pyci/autoresearch/phases.pyci/tests/test_autoresearch_phases.pyexamples/AutoResearch/AutoResearch.inoexamples/AutoResearch/AutoResearchRemote.cppexamples/AutoResearch/AutoResearchTest.hsrc/fl/channels/validation.cpp.hppsrc/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpptests/fl/channels/validation.cpptests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp
Summary
Verification
uv run python -m pytest ci/tests/test_autoresearch_phases.py -v- 47 passedbash test --cpp tests/fl/channels/validation.cpp- passedbash test --cpp tests/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp- passedgit diff --check- cleanbash autoresearch esp32s3 --lcd --upload-port COM22 --lanes 16 --strip-sizes 256 --skip-lint --timeout 180 --verboseon the attached ESP32-S3 without--no-filter; fbuild stalled during compile before upload/serial verification. Compiler processes stopped advancing CPU time and were cleaned up. Related filter issue filed separately: fix(ci): let AutoResearch esp32s3 pass example filters without --no-filter #2690.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests