Skip to content

feat(autoresearch): retire AutoResearchLpc.ino, fold into AutoResearch.ino low-memory mode (closes #3030) - #3041

Merged
zackees merged 1 commit into
masterfrom
feat/3030-retire-autoresearch-lpc
Jun 14, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/3030-retire-autoresearch-lpc

Conversation

@zackees

@zackees zackees commented Jun 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #3030. PR #3038 (integer-only IEEE 754 codec, FastLED #3022 phase 2) freed up enough flash on LPC845-BRK that the soft-FP cascade no longer blocks the main AutoResearch.ino. Consolidate the two harnesses so we do not maintain duplicate bring-up sketches that drift apart.

Changes

  • New examples/AutoResearch/AutoResearchLowMemory.h — the LPC bring-up RPC surface (echo, pinToggleRx, ws2812SctTest) extracted from the retired sketch. Same JSON-RPC contract; CSV column order preserved so ci/autoresearch/test_lpc_pin_toggle_rx.py and test_lpc_ws2812_loopback.py keep working unchanged.
  • examples/AutoResearch/AutoResearch.ino — gated at the top with FASTLED_AUTORESEARCH_LOW_MEMORY; auto-defines to 1 when FL_PLATFORM_HAS_LARGE_MEMORY == 0 (covers LPC8xx + classic Low-tier parts per FastLED Rename SKETCH_HAS_*_MEMORY macros to FL_PLATFORM_HAS_*_MEMORY #3000). Low-memory mode short-circuits the heavy LED-protocol matrix and just calls autoResearchLowMemorySetup() / autoResearchLowMemoryLoop(). Added lpc845brk, lpcxpresso845max, lpcxpresso804 to the @filter require: board: directive; dropped exclude: memory: low.
  • examples/AutoResearchLpc/AutoResearchLpc.ino — deleted.
  • ci/autoresearch/phases.py — removed the bring-up-env sketch dispatch; always points at examples/AutoResearch/.

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • AutoResearch example now includes automatic low-memory mode for ARM platforms, activating when memory is constrained.
  • Chores

    • Removed AutoResearchLpc example; functionality merged into AutoResearch for unified platform support and easier maintenance.

…h.ino low-memory mode (closes #3030)

Phase 2 of FastLED #3022 (integer-only IEEE 754 codec, PR #3038) freed up
enough flash on LPC845-BRK that the soft-FP cascade no longer blocks the
main AutoResearch sketch. Per #3030 we consolidate so we do not maintain
two bring-up harnesses that drift apart.

Layout:

  * `examples/AutoResearch/AutoResearchLowMemory.h` -- new header that holds
    the JSON-RPC echo + SCT-RX bring-up surface inherited from the retired
    LPC sketch (echo, pinToggleRx, ws2812SctTest). Same RPC contract; CSV
    column order preserved so the Python orchestrator (test_lpc_pin_toggle_rx
    and test_lpc_ws2812_loopback) keeps working as-is.
  * `examples/AutoResearch/AutoResearch.ino` -- gated at the top with
    `FASTLED_AUTORESEARCH_LOW_MEMORY`. Auto-defines to 1 when
    `FL_PLATFORM_HAS_LARGE_MEMORY == 0` (covers LPC8xx + classic Low-tier
    parts per FastLED #3000). In low-memory mode the main body is
    short-circuited and we just call `autoResearchLowMemorySetup()` /
    `autoResearchLowMemoryLoop()`.
  * `examples/AutoResearchLpc/` -- deleted. The board filter for
    `lpc845brk` / `lpcxpresso845max` / `lpcxpresso804` moves onto the
    consolidated `AutoResearch.ino`'s `@filter` directive.
  * `ci/autoresearch/phases.py` -- removes the bring-up-env sketch
    dispatch; always points at `examples/AutoResearch/`.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 14, 2026
@zackees
zackees merged commit 0543473 into master Jun 14, 2026
6 of 8 checks passed
@coderabbitai

coderabbitai Bot commented Jun 14, 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: bb4da6a4-e840-416e-995f-bbe373a804b3

📥 Commits

Reviewing files that changed from the base of the PR and between 76fe5e1 and 57eb23c.

📒 Files selected for processing (4)
  • ci/autoresearch/phases.py
  • examples/AutoResearch/AutoResearch.ino
  • examples/AutoResearch/AutoResearchLowMemory.h
  • examples/AutoResearchLpc/AutoResearchLpc.ino

📝 Walkthrough

Walkthrough

The PR consolidates the standalone AutoResearchLpc sketch into the main AutoResearch harness. A new AutoResearchLowMemory.h header implements the full low-memory bring-up surface (echo, pinToggleRx, ws2812SctTest RPC handlers). AutoResearch.ino now conditionally delegates to this header on low-memory targets. The CI phases dispatcher is simplified to always target AutoResearch/, and AutoResearchLpc.ino (455 lines) is deleted.

Changes

AutoResearch Low-Memory Consolidation

Layer / File(s) Summary
New low-memory bring-up header
examples/AutoResearch/AutoResearchLowMemory.h
Adds AutoResearchLowMemory.h with compile-time flags for debug suppression and SCT RX backends, platform-gated includes for LPC SCT RX and WS2812 timing, an LPC-only computeLowMemPeriodStats helper, autoResearchLowMemorySetup() binding echo/pinToggleRx/ws2812SctTest JSON-RPC handlers on fl::Remote, and autoResearchLowMemoryLoop().
AutoResearch.ino compile-time gate
examples/AutoResearch/AutoResearch.ino
Updates filter metadata comments, auto-defines FASTLED_AUTORESEARCH_LOW_MEMORY on low-tier targets (via FL_PLATFORM_HAS_LARGE_MEMORY == 0), includes AutoResearchLowMemory.h, and delegates setup()/loop() to the low-memory functions under an #else branch, with a closing #endif.
CI dispatch simplification + sketch deletion
ci/autoresearch/phases.py, examples/AutoResearchLpc/AutoResearchLpc.ino
phases.py removes the board-specific AutoResearchLpc sketch selection and unconditionally assigns sketch_path to examples/AutoResearch. The entire AutoResearchLpc.ino sketch (455 lines) is deleted.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #3030 (linked): This PR directly implements the proposal — folding AutoResearchLpc into AutoResearch.ino behind FASTLED_AUTORESEARCH_LOW_MEMORY, auto-detecting low-memory targets, updating phases.py, and deleting examples/AutoResearchLpc/.
  • AutoResearch: wire LPC845-BRK into bash autoresearch harness #3004: The PR implements the compile-time gating approach for LPC845-BRK support inside the unified AutoResearch harness, which corresponds to Option A described in that issue.

Possibly related PRs

  • FastLED/FastLED#3009: This PR directly reverses that PR's approach — phases.py now always selects examples/AutoResearch/ rather than dispatching to AutoResearchLpc, and the LPC-specific sketch flow is removed.
  • FastLED/FastLED#3031: The ws2812SctTest RPC handler previously in the deleted AutoResearchLpc.ino is now provided by AutoResearchLowMemory.h, directly affecting the Phase-2 loopback test orchestration that PR covers.
  • FastLED/FastLED#3014: That PR established the LPC845 bring-up flow with FL_WARN_LIT/echo harness markers; this PR migrates those same markers and handlers into AutoResearchLowMemory.h.

Poem

🐇 Hop hop, one sketch to rule them all,
The LPC file has answered the call —
Folded in neatly with #ifdef grace,
Low-memory targets now share the same space.
One harness, one path, no duplicate strain,
The rabbit has tidied the code once again! ✨

✨ 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/3030-retire-autoresearch-lpc

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.

@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 14, 2026
zackees added a commit that referenced this pull request Jun 14, 2026
…sign-off checklist (closes #2880) (#3042)

Stage 3.6 of #2845 is no longer hardware-gated -- PR #3041 retired
AutoResearchLpc.ino into the main AutoResearch.ino low-memory mode
(auto-engaged on LPC8xx via FL_PLATFORM_HAS_LARGE_MEMORY == 0). The
JSON-RPC contract (echo / pinToggleRx / ws2812SctTest) is identical
to what the standalone sketch shipped.

Stage 3.5 (linker memory-layout verification on real silicon) still
needs hardware sign-off, but every code-side prerequisite has shipped
and the no-soft-FP invariant from #3038 puts the LPC845 flash budget
back inside 64 KB. Adds a five-bullet sign-off checklist a community
maintainer can walk to close out #2880 with field evidence.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 14, 2026
… sketch retirement) (#3043)

Phase 3 of FastLED #3035 (decoder consolidation across the four
EdgeTime-based RX backends + AutoResearchLpc.ino retirement) is now
shipped end-to-end:

  * #3037 split the shared 4-phase WS2812 decoder into
    `src/fl/channels/rx/decode_ws2812.{h,cpp.hpp}` so the LPC SCT-RX
    and native paths share one implementation.
  * #3041 folded `examples/AutoResearchLpc/AutoResearchLpc.ino` into
    the main `examples/AutoResearch/AutoResearch.ino` low-memory mode
    (auto-engaged on FL_PLATFORM_HAS_LARGE_MEMORY == 0).
  * The `ci/autoresearch/phases.py` orchestrator dispatch updated to
    point at the unified sketch as part of #3041.

What remains in #3035 are Phases 1, 2a, 2b -- the hardware bench
validation work that needs real LPC845-BRK silicon + scope. That
hardware sign-off is shared with the #2880 checklist now in
`src/platforms/arm/lpc/README.md`.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 14, 2026
… driver header (#3044)

#2879 asked for multi-strip parallel WS2812 output on LPC845 via shared
SCT timebase + DMA. The issue is gated on Stage 2c (v1 single-strip
DMA path) hardware verification (#2880 sign-off), but the design space
is bounded and well-understood. This commit lands the extension sketch
directly inside `clockless_arm_lpc_pwm_dma.h` so the follow-up PR can
drop straight in once the bench is open -- no rediscovery cost.

Five concrete items captured:

  1. LANE_COUNT template parameter, default 1 (v1 ABI preserved).
  2. DMA channel sharing -- same 3 channels, descriptor chain per lane.
  3. Encode pass O(LANE_COUNT * leds), DMA time unchanged.
  4. Pin constraints unchanged from v1 (GPIO port 0 only).
  5. Test harness lands in examples/AutoResearch/AutoResearch.ino
     low-memory mode (post FastLED #3041 consolidation) next to the
     existing `ws2812SctTest` RPC.

Architectural template references already in the prior comment
(RP2040 PIO, Teensy 4.x FlexIO).

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 14, 2026
…mory.h (#3041 follow-up) (#3047)

PR #3041 retired AutoResearchLpc.ino into a header on the AutoResearch
side, but the LPC sketch's patterns (Serial.begin, deep platform include,
function-local static fl::Remote) tripped the example-side lint:

  * ExampleSerialChecker -- `Serial.begin(115200)` -> `fl::serial_begin(115200)`
    so the HWCDC-safe wrapper from #2669 (setTxTimeoutMs=0 + guarded flush
    + host-presence skip) is what runs on the LPC845 USART link instead
    of the raw HardwareSerial path.
  * PlatformIncludesChecker -- the `#include "platforms/arm/lpc/is_lpc.h"`
    is intentional (the RX SCT driver only exists on real LPC builds; the
    example DLL host-stub still has to compile this header). Suppressed
    inline with `// ok platform headers - LPC RX driver gate`.
  * StaticInHeaderChecker -- `static fl::Remote remote(...)` inside
    `autoResearchLowMemorySetup()` lifts to a single shared instance
    via the inline-ODR rule, which is the intended behavior. Suppressed
    with the canonical `// okay static in header` marker the checker
    recognises.

`bash lint --cpp` is clean after this commit.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 15, 2026
…A driver (#3057)

Three updates to the env:lpc845brk block:

1. Replaces the stale `examples/AutoResearchLpc/` dispatch comment with
   the consolidated `examples/AutoResearch/` (low-memory mode auto-
   engages on LPC8xx via FL_PLATFORM_HAS_LARGE_MEMORY == 0; FastLED
   #3030 / #3041).

2. Expands the build_flags comment block to document each flag's role:
   `-DRELEASE` (FL_DBG no-op), `-DFASTLED_LPC_PWM_DMA=1` (hardware
   SCT+DMA driver), `-DFASTLED_LPC_RX_SCT_WS2812=1` (commented-out
   loopback RPC binding; pulls <FastLED.h> and currently exceeds the
   64 KB flash budget by ~7.5 KB without further reduction work).

3. Default-enables the hardware-accelerated SCT+DMA WS2812 driver
   (`-DFASTLED_LPC_PWM_DMA=1`) plus the low-memory autoresearch mode
   (`-DFASTLED_AUTORESEARCH_LOW_MEMORY=1`). The bit-bang driver is
   still available with `build_unflags = -DFASTLED_LPC_PWM_DMA=1` per
   the LPC README's "Optional feature defines" section. This makes the
   canonical LPC845-BRK target exercise the hardware driver path that
   most users will want for production WS2812 output.

The previously parked `feat/lpc845-sct-dma-dev-unblock` developer
branch carried this change alongside a `[tool.uv.sources]` local
fbuild override that is no longer needed (PyPI 2.2.28 has the LPC
delegation). Splitting the developer override out lets the env
config land on master while the override is dropped.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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.

Retire AutoResearchLpc.ino — fold into AutoResearch.ino low-memory mode

1 participant