Skip to content

test(parlio): #2548 add boot-time ISR-streaming functional validation - #2561

Merged
zackees merged 1 commit into
masterfrom
perf/parlio-stream-validate
May 30, 2026
Merged

zackees merged 1 commit into
masterfrom
perf/parlio-stream-validate

Conversation

@zackees

@zackees zackees commented May 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds AutoResearchParlioStream::validateAtBoot() — a self-contained boot-time test that exercises the production ISR-chunked streaming engine path (ParlioEngine 3-buffer ring + txDoneCallback ISR + BF1 from #2559) on real hardware.

Bypasses the testSimd RPC routing (broken on COM25 USB-Serial-JTAG, #2541) by reporting via esp_rom_printf so it works at boot without any host-side coordination. Opt-in via build flag -DFL_PARLIO_STREAM_VALIDATE_AT_BOOT=1.

Validated on ESP32-P4 v1.3

Canonical 16-lane × 256-LED WS2812B workload (forces the engine's 16-lane Wave8 branch → wave8Transpose_16x4_bf1_pipe4):

BENCH_PARLIO_STREAM_VALIDATE PASS  lanes=16 leds=256 iters=5
  iter0=23530 iter1=16998 iter2=17000 iter3=16997 iter4=17001
  steady_avg_us=16999  (WS2812B 16-lane TX=7680us)

5 back-to-back FastLED.show() + FastLED.wait() cycles all completed within the 200 ms timeout — 0 hangs, 0 stalls. The streaming engine + BF1 work correctly end-to-end.

Test plan

  • Lint clean
  • Live device (ESP32-P4 v1.3): PASS as shown above
  • CI: full matrix (will run on this PR — note: AutoResearch is compile-tested per-platform, the BENCH output only fires when FL_PARLIO_STREAM_VALIDATE_AT_BOOT=1 is set explicitly)

Files

 examples/AutoResearch/AutoResearch.ino           +12
 examples/AutoResearch/AutoResearchParlioStream.h +146

Note: encode vs frame timing

The ~17 ms steady-state per show() vs the 7.68 ms TX floor is a separate optimization opportunity — each show() currently serializes the engine's begin/wait/end + mPeripheral->disable()/enable() reset cycle. The BF1+pipe4 encode itself is 1.75 ms/frame (4.4× faster than TX) as measured by the bench harness on perf/parlio-l1l2l3. Closing the ~9 ms wait gap is future work (could potentially overlap two frames if the peripheral re-enable becomes optional).

Refs #2548. Validates #2559 in production.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added optional boot-time functional validation for PARLIO streaming on ESP32 targets, exercising the production streaming path and reporting performance metrics to the serial console when enabled.

Review Change Stack

Adds `AutoResearchParlioStream::validateAtBoot()` — a self-contained boot-time
test that exercises the engine's production ISR-chunked streaming path
(`ParlioEngine` 3-buffer ring + `txDoneCallback` ISR + BF1 from #2559) and
reports PASS/FAIL via `esp_rom_printf` to the USB-Serial-JTAG console (COM25
on the P4 dev board).

Workload: 16-lane × 256-LED WS2812B (canonical bench config, forces the
engine's 16-lane Wave8 branch → `wave8Transpose_16x4_bf1_pipe4`). 5 back-to-
back `FastLED.show() + FastLED.wait()` cycles, each timed.

Validated on real ESP32-P4 v1.3:
  BENCH_PARLIO_STREAM_VALIDATE PASS  lanes=16 leds=256 iters=5
    iter0=23530 iter1=16998 iter2=17000 iter3=16997 iter4=17001
    steady_avg_us=16999  (WS2812B 16-lane TX=7680us)

All 5 iterations completed within the 200ms timeout — 0 hangs, 0 stalls.
The streaming engine + BF1 work correctly. (The ~17ms steady-state per show
vs the 7.68ms TX floor is a separate optimization opportunity: each show()
serializes the begin/wait/end + disable/re-enable cycle. The BF1+pipe4
encode itself is 1.75ms/frame as measured by the bench harness.)

Bypasses the testSimd RPC routing (broken on COM25, #2541) so this works
at boot without any host-side coordination. Opt-in via build flag:
  `-DFL_PARLIO_STREAM_VALIDATE_AT_BOOT=1`

Refs #2548. Validates #2559 in production.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown

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: c2c24b44-336a-4e2b-b490-66eca9cf678d

📥 Commits

Reviewing files that changed from the base of the PR and between 84777a8 and f093b9b.

📒 Files selected for processing (2)
  • examples/AutoResearch/AutoResearch.ino
  • examples/AutoResearch/AutoResearchParlioStream.h

📝 Walkthrough

Walkthrough

This PR adds a boot-time functional benchmark for PARLIO streaming validation to FastLED examples. A new header implements a 16-lane timing benchmark that initializes FastLED PARLIO channels, fills LED buffers with a fixed pattern, runs show/wait iterations with timeout measurement, and reports pass/fail diagnostics. The benchmark is optionally invoked during setup() in the AutoResearch sketch.

Changes

PARLIO Streaming Validation Feature

Layer / File(s) Summary
PARLIO validation header implementation
examples/AutoResearch/AutoResearchParlioStream.h
New header defines validateAtBoot(int base_tx_pin) that initializes 16 PARLIO lanes with per-lane CRGB buffers, configures WS2812B V5 timing, runs FastLED.show()/FastLED.wait() iterations with microsecond timing measurements, and reports PASS/FAIL diagnostics including per-iteration timings and steady-state averages to the USB-Serial-JTAG console; early exit on channel creation failure or timeout; non-ESP builds compile as no-op.
Integration into AutoResearch sketch
examples/AutoResearch/AutoResearch.ino
Includes AutoResearchParlioStream.h and adds optional boot-time validation invocation guarded by FL_PARLIO_STREAM_VALIDATE_AT_BOOT in setup(), passing the configured TX pin to validate PARLIO streaming during startup.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A streaming path emerges from the lanes,
sixteen channels dance with LED refrains,
boot-time benchmarks whisper through the wire,
timing the pulses of a glowing spire.

✨ 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 perf/parlio-stream-validate

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.

@zackees
zackees merged commit 4621f23 into master May 30, 2026
4 of 5 checks passed
zackees added a commit that referenced this pull request May 30, 2026
…e to RPC (#2562)

Removes the `FL_PARLIO_STREAM_VALIDATE_AT_BOOT` boot-time hook landed in
#2561 and re-exposes the same functional test as a JSON-RPC handler
`parlioStreamValidate`, matching the convention of the other autoresearch
utility benches (`wave8ExpandBenchmark` #2539, `parlioEncodeBenchmark` #2547).

### Changes

- `AutoResearchParlioStream.h`:
  - `validateAtBoot()` (esp_rom_printf-based) → `validateParlioStreaming()`
    returning a `ValidateResult` struct (channels_ok, completed, per_iter_us[],
    steady_avg_us, failed_iter, etc.).
  - Caller-supplied `num_lanes`, `num_leds`, `iterations`, `timeout_ms` so the
    RPC can drive different workloads.
  - Static LED buffer sized for the canonical worst case (16 × 256) to avoid
    repeated allocation across RPC calls.

- `AutoResearch.ino`:
  - Drop the `#ifdef FL_PARLIO_STREAM_VALIDATE_AT_BOOT` boot-time hook.
  - Keep the header include for the RPC handler in AutoResearchRemote.cpp.

- `AutoResearchRemote.cpp`:
  - Add `parlioStreamValidate` bind: parses optional `numLanes`/`numLeds`/
    `iterations`/`timeoutMs` from args, calls `validateParlioStreaming()`,
    returns full result as JSON (`channelsOk`, `completed`, `lanes`,
    `ledsPerLane`, `iterations`, `perIterUs:[…]`, `steadyAvgUs`, `failedIter`,
    `timeoutMs`).
  - Register in `discoverFunctions` metadata (totalFunctions 24 → 25, Phase 4
    Utility, full args + returns docstring).

### Validation

- `bash lint --cpp` clean
- Build + flash on ESP32-P4 v1.3 (`bash autoresearch esp32p4 --simd --no-fbuild`)
  succeeds; handler is registered.
- On-device RPC invocation is blocked on P4 by the pre-existing
  #2541 (testSimd RPC over UART0 fails because the host connects via COM25
  USB-Serial-JTAG, different physical path). Same blocker that already affects
  `testSimd`, `wave8ExpandBenchmark`, and `parlioEncodeBenchmark`. The
  handler will be invokable from CI / other platforms once that infra
  issue is resolved.
- Functional correctness was previously demonstrated end-to-end via the
  boot-time variant in #2561: 5 back-to-back show()+wait() iterations,
  16-lane × 256-LED WS2812B, all completed within timeout (steady-state
  ~17 ms/frame, 0 hangs).

Refs #2548, #2541. Supersedes the boot-time hook from #2561.

Co-authored-by: Claude Opus 4.7 <[email protected]>
@zackees
zackees deleted the perf/parlio-stream-validate branch May 30, 2026 07:02
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.

1 participant