Skip to content

feat(autoresearch): add flexIoDeviceInfo RPC — Bus::FLEX_IO introspection (#3515 Phase B) - #3525

Merged
zackees merged 1 commit into
masterfrom
feat/autoresearch-flexio-3515b
Jul 1, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/autoresearch-flexio-3515b

Conversation

@zackees

@zackees zackees commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Summary

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)".

  • AutoResearchFlexIo.h — introspection helpers (siliconName, idfVersion, registeredDriverNames, firstDriverName, buildDeviceInfo).
  • New flexIoDeviceInfo RPC handler returning a JSON device-info structure.
  • On classic ESP32 currently reports `I2S_SPI` (that's what's on Bus::FLEX_IO, 0 today); 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.
  • CI: no behavioral change on non-AutoResearch builds — the header + RPC handler is only compiled into AutoResearch example TU.

What this does NOT do

Part of #3516 / #3515 Phase B (v1 introspection).

Summary by CodeRabbit

  • New Features
    • Added a new FLEX_IO device-info response that reports the selected driver, available drivers, platform/build details, and instance number.
    • Exposed a new remote call to retrieve this FLEX_IO device information with optional instance input.
    • Enabled the FLEX_IO integration in the standard remote build so the feature is available more broadly.

…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]>
@zackees
zackees merged commit 299985c into master Jul 1, 2026
6 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 1, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8b982fd0-1e63-4cd1-87fa-832990ead79f

📥 Commits

Reviewing files that changed from the base of the PR and between f612ff5 and af2cdb2.

📒 Files selected for processing (3)
  • examples/AutoResearch/AutoResearchFlexIo.h
  • examples/AutoResearch/AutoResearchRemote.cpp
  • examples/AutoResearch/AutoResearchRemoteMathMethods.cpp

📝 Walkthrough

Walkthrough

Adds a new AutoResearchFlexIo.h header defining helpers for FLEX_IO introspection (silicon name, IDF version, registered driver names, device info JSON). Wires the header into remote control implementation files and adds a new flexIoDeviceInfo RPC endpoint returning the device info JSON.

Changes

FLEX_IO Device Info

Layer / File(s) Summary
FLEX_IO introspection helpers
examples/AutoResearch/AutoResearchFlexIo.h
New header defines siliconName(), idfVersion(), registeredDriverNames(), firstDriverName(), and buildDeviceInfo(instance) building a JSON device-info payload from registered channel drivers.
RPC binding and includes
examples/AutoResearch/AutoResearchRemote.cpp, examples/AutoResearch/AutoResearchRemoteMathMethods.cpp
Includes the new header and adds a flexIoDeviceInfo RPC binding that parses an optional instance argument (clamped 0–255) and returns buildDeviceInfo results with success: true.

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
Loading

Possibly related PRs

  • FastLED/FastLED#3191: Both PRs modify examples/AutoResearch/AutoResearchRemoteMathMethods.cpp around AutoResearchRemoteControl::bindMathMethods, with this PR adding the flexIoDeviceInfo RPC handler into that same binding function.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/autoresearch-flexio-3515b

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

zackees 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]>
@zackees
zackees deleted the feat/autoresearch-flexio-3515b branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant