Repository navigation
feat(autoresearch): add flexIoDeviceInfo RPC — Bus::FLEX_IO introspection (#3515 Phase B) - #3525
Merged
Merged
Conversation
…tion (#3515 Phase B) New peripheral-agnostic AutoResearch harness following the `Bus::FLEX_IO` runtime-selection convention documented in `agents/docs/cpp-standards.md` -> "Runtime driver selection is `Bus::FLEX_IO` — legacy chipset templates are not (REQUIRED)". ## What it does - **`examples/AutoResearch/AutoResearchFlexIo.h`** — helpers to introspect the `Bus::FLEX_IO` slot at runtime: - `siliconName()` — build-time platform ID (ESP32, ESP32-S3, Teensy-4.x, ...) - `idfVersion()` — ESP-IDF version string on ESP32 targets, "n/a" elsewhere - `registeredDriverNames()` — enumerate driver names via `fl::channelManager().getDriverInfos()` - `firstDriverName()` — convenience accessor - `buildDeviceInfo(instance)` — assembles the device-info JSON - **`AutoResearchRemoteMathMethods.cpp`** — new `flexIoDeviceInfo` RPC handler. Optional `{ "instance": N }` arg (echoed in response). Returns: ```json { "success": true, "bus": "FLEX_IO", "instance": 0, "driverName": "PARLIO", "registeredDriverNames": ["PARLIO", "UART"], "silicon": "ESP32-C6", "idfVersion": "5.5.4", "supportedByBuild": true } ``` ## Why this shape Per the agent-doc rule the classic-ESP32 I2S parallel-out driver is "just a `Bus::FLEX_IO` type." The harness deliberately does not name I2S — on classic ESP32 today the FLEX_IO slot routes to `I2S_SPI` (the parallel-SPI mode, not the Yves clockless). Once #3512 Phase 4 wires the Yves clockless into `BusTraits<Bus::FLEX_IO, 0>`, the same harness reports "I2S_PARALLEL" (or whichever name Phase 4 assigns) without harness changes. On ESP32-P4/C6/H2/C5 it already reports "PARLIO"; on ESP32-S3 "LCD_CLOCKLESS" / "LCD_RGB"; on Teensy 4.x "FLEX_IO" or "OBJECT_FLED". ## Verification - `bash test --cpp`: 344/344 pass. - `bash lint --cpp`: clean. ## What this does NOT do - Does NOT run a timing bench. Timing tests come once #3512 Phase 4 makes the classic-ESP32 Yves clockless reachable via the modern channel API — at that point the harness can drive `FastLED.show()` through `Bus::FLEX_IO, 0` and measure per-frame timing exactly the way `AutoResearchParlioStream.h` does for PARLIO today. - Does NOT reach for `ClocklessI2S<>` (or any legacy chipset template) directly — that would violate the agent-doc rule I just added. Part of #3516 / #3515 Phase B (v1 introspection). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a new ChangesFLEX_IO Device Info
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant RemoteClient
participant AutoResearchRemoteControl
participant FlexIoHelper as autoresearch::flex_io
participant ChannelManager as fl::channelManager
RemoteClient->>AutoResearchRemoteControl: call flexIoDeviceInfo(args)
AutoResearchRemoteControl->>AutoResearchRemoteControl: parse instance (0-255, default 0)
AutoResearchRemoteControl->>FlexIoHelper: buildDeviceInfo(instance)
FlexIoHelper->>ChannelManager: getDriverInfos()
ChannelManager-->>FlexIoHelper: driver info list
FlexIoHelper-->>AutoResearchRemoteControl: JSON device info
AutoResearchRemoteControl-->>RemoteClient: JSON with success=true
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
5 tasks
zackees
added a commit
that referenced
this pull request
Jul 1, 2026
…ch work (REQUIRED) (#3536) * feat(i2s): engine mode-dispatch scaffolding for SPI batches (#3526 Phase 2c prep) Adds per-channel mode dispatch in `ChannelEngineI2sEsp32Dev::show()` so mixed clockless+SPI batches and pure-SPI batches are refused cleanly with `DriverState::ERROR` instead of silently sending garbage through the clockless wave8 encoder. Sets up the Phase 2c architecture: the peripheral is the dispatch boundary (per the parallel-IO unified-engine rule in `agents/docs/cpp-standards.md`), and I2S1 can only run one mode at a time. The engine now recognizes each channel's mode and routes accordingly. ## Behavior matrix | Batch composition | Result | |---------------------------|-------------------------------------------| | All clockless (existing) | Wave8 encoding → peripheral transmit ✅ | | All SPI | ERROR state (Phase 2c-SPI stub) | | Mixed clockless + SPI | ERROR state (mixed batches never allowed) | The SPI-path stub is deliberate: the actual SPI transmit machinery (FIFO width reconfigure, DMA slot, clock rate) is bench-blocked because it needs WROOM validation. Once the Phase 2c-SPI PR lands with real transmit code, only the two ERROR-returning early-outs change to full `showSpi()` calls. Clockless behavior is preserved bit-identical — all 4 existing engine tests still pass unchanged. ## Test additions 3 new `FL_TEST_CASE`s in `channel_engine_i2s_esp32dev.cpp`: - Pure clockless batch still succeeds (regression protection) - Pure SPI batch rejected with ERROR + no peripheral transmit - Mixed batch rejected with ERROR + no peripheral transmit + both channels released from in-use marking New test helper `makeSpiChannelData(dataPin, clockPin, byte_count, fill_byte)` produces a channel with `SpiChipsetConfig` so the mode dispatch has real SPI channels to reject. ## What this does NOT do - Does NOT implement `showSpi()` — that's the real Phase 2c PR (bench-blocked). - Does NOT change the current clockless code path — pure clockless batches take the exact same wave8 encoding + peripheral transmit they did before. ## Verification - `bash test --cpp`: 345/345 pass (3 new subcases inside existing test file) - `bash lint --cpp`: clean Part of #3516 meta / #3526 Phase 2c prep. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(agents): check if target device is attached before deferring bench work (REQUIRED) New REQUIRED rule in `agents/docs/cpp-standards.md`: Before declaring any driver / peripheral / autoresearch task as "bench-blocked" or "requires physical hardware I don't have," agents must FIRST attempt on-device validation via `bash autoresearch <board>`. The AutoResearch harness is a first-class in-loop step — if the device is attached and reachable, autoresearch will compile via fbuild, flash, boot, and RPC-ping in one command. ## Origin Established 2026-07-01 during #3516 I2S driver rewrite. Agent had deferred Phases 2b–2e as "bench-blocked" across multiple rounds while the developer's ESP32-WROOM was in fact attached to COM11 and running. Developer prompted "the esp32wroom is attached" — one line unblocked a whole cluster of previously-deferred phases. Verified working during this session: - `bash autoresearch esp32dev` compiled + flashed + booted the AutoResearch example on COM11. - `RESULT: {"chip":"ESP32 (Xtensa)","type":"ready",...}` boot line in ~10s. - `Ping successful` RPC confirmed. - `flexIoDeviceInfo` RPC (from #3525) returned real peripheral binding data — confirmed classic ESP32 today routes `Bus::FLEX_IO, 0` to `I2S_SPI`, matching the agent-doc caveat. ## Rule shape Follows the same "check first, defer second" pattern as the Bus::FLEX_IO rule from #3519. Concrete commands for each supported platform, explicit failure signal to look for, guidance on what to write when hardware is genuinely absent (specific failure mode so next agent doesn't repeat the check). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New peripheral-agnostic AutoResearch harness following the
Bus::FLEX_IOruntime-selection convention documented inagents/docs/cpp-standards.md-> "Runtime driver selection isBus::FLEX_IO— legacy chipset templates are not (REQUIRED)".AutoResearchFlexIo.h— introspection helpers (siliconName,idfVersion,registeredDriverNames,firstDriverName,buildDeviceInfo).flexIoDeviceInfoRPC handler returning a JSON device-info structure.Bus::FLEX_IO, 0today); once I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 Phase 4 wires the Yves clockless into that slot, same harness reports it without any changes.Test plan
bash test --cpp: 344/344 pass.bash lint --cpp: clean.What this does NOT do
ClocklessI2S<>directly (would violate the agent-doc rule from docs+fix: Bus::FLEX_IO runtime-selection guardrail + restore Yves opt-in #3519).Part of #3516 / #3515 Phase B (v1 introspection).
Summary by CodeRabbit