Repository navigation
WIP perf(parlio): frame-level ping-pong overlap (negative result — does not pipeline; refs #2518) - #2521
Closed
zackees wants to merge 3 commits into
Closed
WIP perf(parlio): frame-level ping-pong overlap (negative result — does not pipeline; refs #2518)#2521zackees wants to merge 3 commits into
zackees wants to merge 3 commits into
Conversation
… mem/timing probe Route the AutoResearch console to HWCDC so `Serial` lands on the ESP32-P4-EV's USB-Serial-JTAG port (the only connector on the dev board). The env had ARDUINO_USB_MODE=1 but was missing ARDUINO_USB_CDC_ON_BOOT=1, so `Serial` went to UART0 pins and no bytes reached the host — the core's HardwareSerial.h selects HWCDCSerial only when both are set. This (with the fbuild bootloader-offset fix, FastLED/fbuild#278) unblocks `bash autoresearch esp32p4 --parlio` (FastLED #2510). Add a `measureParlio` RPC and free_sram/free_psram fields on `ping` so the PARLIO DMA buffer-sizing fix (#2519) can be validated live: it reports the internal-SRAM/PSRAM delta around channel allocation and steady-state show() us. Refs #2510, #2519, FastLED/fbuild#278
…yet realized) Implements Approach A from #2518: encode frame N into the inactive ping-pong slot while frame N-1 drains, reusing 2 of the 3 already-allocated full-frame DMA buffers (zero new memory). Guarded by mOverlapArmed so only the single-full-frame fast path overlaps; the multi-chunk streaming path is byte-identical to before. Adds a `measureParlio` pipelined_per_frame_us metric (tight show() loop, single drain) to measure the overlap directly. HARDWARE RESULT (ESP32-P4, 16x256, debug build): NO speedup yet. pipelined_per_frame_us = 31772 == total_avg_us (serialized) = 31772 Every show() still costs encode(~25ms)+wire(~6ms); frame N-1's DMA is NOT draining during frame N's encode. Root cause appears to be the mandatory per-frame peripheral disable()/enable() (reset of the PARLIO DMA state machine), which prevents N-1 from transmitting while N is reconfigured/encoded. Ping-pong buffers alone do not address this. No regression (60+ iterations stable, same memory). DO NOT MERGE until the overlap is demonstrated and WS2812 signal correctness is validated via RX loopback. Refs #2518
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
This was referenced May 28, 2026
zackees
added a commit
that referenced
this pull request
May 30, 2026
…ter) (#2605) All 9 binary-size workflows have been red on master since #2521 (`ci: make fbuild the default for board builds`). fbuild has two deficiencies that compound here: - FastLED/fbuild#297 - fbuild does not emit build_info_<example>.json, so ci/compiled_size.py can never find it (the visible CI error). - FastLED/fbuild#304 - fbuild links framework .o files directly instead of archiving them, so unused ISR symbols (Tone.cpp on attiny85) get pulled in, inflating Blink by +10.1% (342 bytes). Even after #297 lands, the budget is already exceeded. Both bugs are filed against fbuild. While they land, force ci-check-compiled-size.py to use the platformio backend by threading --backend platformio through to the inner ci.ci-compile call. This restores green to attiny85_binary_size and the seven check_teensy*_size + check_bluepill_size + check_uno_size workflows with a single ~6-line YAML diff. To revert once fbuild ships fixes: delete the three "--backend platformio" tokens in build_template_binary_size.yml.
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.
Draft / do-not-merge. Scaffolds Approach A from #2518 (frame-level ping-pong double-buffer) AND documents the hardware finding that it does not deliver the projected speedup, with the identified root cause.
What this does
parlio_engine: encode frame N into the inactive ping-pong slot while frame N-1 drains, reusing 2 of the 3 already-allocated full-frame DMA buffers (zero new memory). Guarded bymOverlapArmedso only the single-full-frame fast path overlaps; the multi-chunk streaming path is byte-identical to before. Safety: frame N never encodes into the in-flight buffer.examples/AutoResearch: adds ameasureParliopipelined_per_frame_usmetric (tightshow()loop, single drain) to measure overlap directly, plusfree_sram/free_psramonping.Hardware result (ESP32-P4, 16×256, debug build) — NO speedup
Every
show()still costs encode(~25ms)+wire(~6ms). Frame N-1's DMA is not draining during frame N's encode, so the ping-pong buffers don't pipeline.Root cause
beginTransmission()performs a mandatory per-framedisable()/enable()of the PARLIO peripheral ("required to reset the DMA state machine; without it consecutive transmissions silently fail"). That teardown serializes frames at the hardware level — N-1 cannot keep transmitting while N is reconfigured. Ping-pong buffering alone cannot overcome this.Implications for #2518
disable()/enable()so the peripheral can pipeline (or make the encoder faster via SIMD/2nd core). Tracked in perf(parlio): umbrella for ESP32-P4 PARLIO output and show timing work #2518.Validation status
show()iterations stable, identical memory.Stacks on #2519 (PARLIO buffer-sizing fix) and the autoresearch P4 enablement branch.