Skip to content

docs(agents): check if target device is attached before deferring bench work (REQUIRED) - #3536

Merged
zackees merged 2 commits into
masterfrom
docs/check-bench-first-3516
Jul 1, 2026
Merged

zackees merged 2 commits into
masterfrom
docs/check-bench-first-3516

Conversation

@zackees

@zackees zackees commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

New REQUIRED rule in agents/docs/cpp-standards.md. Established during #3516 I2S driver rewrite. Agent had deferred Phase 2b-2e as bench-blocked while developer's WROOM was in fact attached on COM11. Rule captured so future agents check first via bash autoresearch , defer second.

Summary by CodeRabbit

  • New Features

    • Added clearer guidance for checking hardware availability before marking an AutoResearch task as bench-blocked, including what to do when devices are found or unavailable.
    • Improved device handling so unsupported mixed batches are now rejected earlier, with a clear error state.
  • Bug Fixes

    • Prevented invalid transmit attempts for unsupported batch types, reducing confusing behavior during hardware validation.
  • Tests

    • Added coverage for successful clockless runs and rejected mixed or SPI-only batches.

zackees and others added 2 commits July 1, 2026 10:54
…ase 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]>
…ch 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]>
@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: 593feecb-a0ef-4f78-969c-0ae50ab0e05a

📥 Commits

Reviewing files that changed from the base of the PR and between ba90771 and 7bf0b29.

📒 Files selected for processing (3)
  • agents/docs/cpp-standards.md
  • src/platforms/esp/32/drivers/i2s/channel_engine_i2s_esp32dev.cpp.hpp
  • tests/platforms/esp/32/drivers/i2s/channel_engine_i2s_esp32dev.cpp

📝 Walkthrough

Walkthrough

This PR adds Phase 2c per-batch mode dispatch to the ESP32dev I2S channel engine's show() method, rejecting SPI-only and mixed clockless+SPI batches with an error state while allowing clockless-only batches to proceed, plus corresponding tests and a documentation update on bench-check procedures.

Changes

Phase 2c Dispatch and Bench-Check Documentation

Layer / File(s) Summary
Phase 2c mode dispatch in show()
src/platforms/esp/32/drivers/i2s/channel_engine_i2s_esp32dev.cpp.hpp
Scans in-flight channels for clockless/SPI composition; rejects mixed and pure-SPI batches by clearing in-use flags and entering ERROR state, while clockless-only batches proceed to existing packing/transmit logic.
Phase 2c dispatch tests
tests/platforms/esp/32/drivers/i2s/channel_engine_i2s_esp32dev.cpp
Adds a SPI ChannelData test helper and tests validating clockless-only success, SPI-only rejection, and mixed-batch rejection with no peripheral transmit and cleared in-use state.
Bench-check documentation rule
agents/docs/cpp-standards.md
Documents a required procedure to run bash autoresearch against board-specific or auto-detected hardware before marking a task bench-blocked, with guidance for success and failure handling.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3430: Both target the unified clockless+SPI ChannelEngine architecture with Phase 2c dispatch/routing behavior.
  • FastLED/FastLED#3473: Extends the same ChannelEngineI2sEsp32Dev::show() path and Stage-1 test architecture introduced in that PR.
✨ 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 docs/check-bench-first-3516

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

❤️ Share

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

@zackees
zackees merged commit 3837c78 into master Jul 1, 2026
7 of 10 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Done to Triage in FastLED Tracker Jul 1, 2026
@zackees
zackees deleted the docs/check-bench-first-3516 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: Triage

Development

Successfully merging this pull request may close these issues.

1 participant