Repository navigation
Description
Proposal
Retire the FASTLED_LPC_RX_SCT_WS2812 build flag. It's a relic from the period when the LPC845 LowMemory build couldn't fit <FastLED.h> + fl::Remote together in 64 KB; that's no longer true post-#3084 / #3085 / #3087 / #3088 / #3089, and #3089 already flipped the flag default-on in platformio.ini.
The flag survives in 12 places across the tree:
| File | Reference |
|---|---|
examples/AutoResearch/AutoResearchLowMemory.h:42, 64, 201, 299 |
gates <FastLED.h> + fl/chipsets/timing_traits.h include + the ws2812SctTest RPC handler body + the FASTLED_LPC_RX_SCT_DMA auto-enable |
platformio.ini:168, 180, 181 |
now-stale comment + default-on entry + commented-out warning about the 64 KB budget |
ci/autoresearch/args.py:351 |
docstring on --ws2812-loopback |
ci/autoresearch/phases.py:1250, 1698, 1716 |
docstring + user-facing reminder text |
ci/autoresearch/test_lpc_ws2812_loopback.py:31 |
docstring on "default off" |
All gated content (the ws2812SctTest handler, the <FastLED.h> pull-in, the fl::chipsets::timing_traits include) is needed only on the LPC845-BRK and similar SCT-equipped LPC8xx parts -- and is useless on parts that don't have an SCT input-capture peripheral. So the right gate is platform, not a manual user-set macro.
What "the right gate" looks like
The pieces we have to compose:
FL_IS_ARM_LPC_845(and siblings for the other LPC8xx variants) -- already defined inplatforms/arm/lpc/is_lpc.h. Tells us "this device has the SCT and the LPC SCT-RX driver."FL_PLATFORM_HAS_TINY_MEMORY/FL_PLATFORM_HAS_LARGE_MEMORYfrom Rename SKETCH_HAS_*_MEMORY macros to FL_PLATFORM_HAS_*_MEMORY #3000. Tells us "the target can fit the FastLED chipset matrix."
Today's AutoResearchLowMemory.h:64-67 is:
#if defined(FASTLED_LPC_RX_SCT_WS2812)
#include "FastLED.h"
#include "fl/chipsets/timing_traits.h"
#endifThe replacement should be unconditional on LPC845-BRK-class parts after the bloat sweep:
#if defined(FL_IS_ARM_LPC) && !defined(FL_PLATFORM_HAS_TINY_MEMORY_NO_FASTLED)
// LPC845-BRK and successors fit <FastLED.h> + fl::Remote post-#3084 sweep.
// Gate with the platform marker, NOT a user-set opt-in macro -- the
// macro was a relic from when this wouldn't fit in 64 KB.
#include "FastLED.h"
#include "fl/chipsets/timing_traits.h"
#endif
#if defined(FL_IS_ARM_LPC)
// ... ws2812SctTest RPC binding ...
#endif(The exact gate name above is illustrative -- the right answer is whichever FL_PLATFORM_HAS_* family member already exists and maps to "has enough flash for FastLED.h.")
If a future LPC variant truly can't fit (e.g. some smaller LPC family member with 32 KB flash), the gate auto-engages via FL_PLATFORM_HAS_TINY_MEMORY without needing a manual build flag.
Why this matters
- Cognitive load. The platformio.ini comment block today documents the macro as a 64-KB-budget gate even though current master fits without it. Anyone reading that comment will believe the macro is required when it isn't.
- One-platform builds break silently. If a
bash autoresearch lpc845brk --ws2812-loopbackjob ever runs against an environment that forgets to define the macro, the RPC isn't bound, the orchestrator getsMethod not found, and the failure trail leads nowhere useful. Auto-gating on platform removes that footgun. - Tree-shaking is the right mental model. The user-facing claim "code that isn't called is dropped by the linker" should be true here -- and it nearly is. The remaining 20 KB is
<FastLED.h>worth of EngineEvents registration + gamma LUT + global constructors that LTO can't eliminate because they have observable side effects. Those are fundamentally compile-time-gated -- but the gate should be derived from the target's properties, not from user opt-in.
Proposed sub-tasks
- Sub-1: Pick the platform predicate. Walk through
fl/system/sketch_macros.hto confirm which of theFL_PLATFORM_HAS_*family maps to "fits<FastLED.h>+fl::Remotetogether." Most likelyFL_PLATFORM_HAS_LARGE_MEMORYis too strict (excludes LPC845-BRK), so we may need a new tier (FL_PLATFORM_HAS_MEDIUM_MEMORY?) or use!FL_PLATFORM_HAS_TINY_MEMORYif the bloat budget allows. - Sub-2: Replace the macro in
AutoResearchLowMemory.hwith the predicate from Sub-1. - Sub-3: Delete the macro from
platformio.iniplus the stale comments around it. - Sub-4: Update the autoresearch test runner (
ci/autoresearch/phases.py,args.py,test_lpc_ws2812_loopback.py) so the "must be built with" advisory text goes away. - Sub-5: Confirm
bash autoresearch lpc845brk --ws2812-loopbackstill works end-to-end on hardware with zero build flags set.
Acceptance
This closes when:
- No reference to
FASTLED_LPC_RX_SCT_WS2812remains anywhere in the source tree (grep -r FASTLED_LPC_RX_SCT_WS2812 src/ examples/ ci/ platformio.inireturns empty). -
bash autoresearch lpc845brk --ws2812-loopback --upload-port COM<N>succeeds on real hardware with default platformio.ini. - The retirement is documented in the closing PR's description so future readers understand why the gate moved from "manual opt-in" to "platform-derived."
Refs
- LPC845 bloat: 8.3 KB of soft-FP / integer-div leaks past the no-soft-FP invariant on LowMemory + RX_SCT_WS2812 #3076 (closed today) -- the bloat hunt that freed the flash budget. Tested validation in this comment: LPC845 bloat: 8.3 KB of soft-FP / integer-div leaks past the no-soft-FP invariant on LowMemory + RX_SCT_WS2812 #3076 (comment)
- perf(fl::function): collapse variant to {free_fn, inlined_lambda} on Low-memory (closes #3077, -3.9 KB on LPC845) #3084 / perf(fl::json): i64->float via i32 to drop ~4 KB soft-FP cascade on no-FPU (closes #3076) #3085 / perf(fl::json): gate ieee754 float codec behind FL_PLATFORM_HAS_LARGE_MEMORY (-2.5 KB on LowMemory, closes #3082) #3087 / perf(rpc): gate rpc.discover + revert SBO bump to fix LowMemory regression (closes #3081) #3088 / perf(rpc/lpc): gate schema generator + enable RX_SCT_WS2812 default on lpc845brk (closes #3079) #3089 -- the per-subsystem fixes that landed in the sweep.
- Rename SKETCH_HAS_*_MEMORY macros to FL_PLATFORM_HAS_*_MEMORY #3000 --
FL_PLATFORM_HAS_*memory classification used as the right derivation source for Sub-1. - Retire AutoResearchLpc.ino — fold into AutoResearch.ino low-memory mode #3030 / feat(autoresearch): retire AutoResearchLpc.ino, fold into AutoResearch.ino low-memory mode (closes #3030) #3041 -- AutoResearchLpc.ino retirement that originally folded these RPCs into AutoResearch.ino with the macro gate carried along verbatim.
- meta(lpc845-brk): bench-validate the three on-hand-hardware checklists (deploy + #565-sidestep + SCT-RX phases) #3102 Section 1 -- bench validation meta where this macro keeps coming up as a friction point.
- fix(autoresearch): gate 6 companion .cpp files on FASTLED_AUTORESEARCH_LOW_MEMORY (refs #3076) #3123 -- companion
.cppfiles gating PR; same kind of platform-derived-not-user-opt-in pattern. - lpc845: pinToggleRx + ws2812SctTest handlers stack-overflow at runtime (8 KB stack buffer on 16 KB SRAM) #3125 -- runtime RAM bomb in the
pinToggleRxhandler; orthogonal but discovered in the same bench session.
🤖 Filed via Claude Code.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jun 17, 2026
Fixed by #3209, merged in 01d40ff.
Upgrade/use notes:
master(or use the next FastLED release containing fix(lpc): derive AutoResearch WS2812 loopback from platform #3209).FASTLED_LPC_RX_SCT_WS2812anymore; the AutoResearch LPC845 WS2812 loopback RPC is now derived from the LPC845 platform predicate.platform-nxplpc-arduinoplatform revision from fix(lpc): derive AutoResearch WS2812 loopback from platform #3209.