Repository navigation
Description
2026-06-15 revision: original sub-issue list was based on a flawed map-parser methodology that overstated symbol sizes by 18-176×. Phantom sub-issues #3075 and #3078 have been closed as filed-in-error. The two surviving sub-issues (#3076 soft-FP, #3077 fl::function variant) are revised with real
nm --print-sizedata. Two new sub-issues (#3081 RPC dispatch, #3082 JSON parser) cover the actual top contributors. The 11 KB overage figure and the goal are unchanged.
Goal
Claw back the 11 KB flash overage on LPC845-BRK that today blocks the FASTLED_LPC_RX_SCT_WS2812=1 config — the hardware WS2812 loopback verification RPC binding for the AutoResearch bring-up harness. Once the overage clears, examples/AutoResearch/AutoResearch.ino with that flag enabled fits in the 64 KB FLASH region and the WS2812 SCT-RX loopback (#3021 Phase 2) becomes the default validation path on bash autoresearch lpc845brk.
Baseline measurement (2026-06-15, real nm data)
Built examples/AutoResearch/AutoResearch.ino with FASTLED_AUTORESEARCH_LOW_MEMORY=1 + FASTLED_LPC_PWM_DMA=1 + FASTLED_LPC_RX_SCT_WS2812=1 against fbuild 2.2.25 / arm-none-eabi-gcc 15.2.1, then ran arm-none-eabi-nm --print-size --size-sort on the ELF (after a temporary LD-script bump per FastLED/fbuild#594):
| Metric | Value |
|---|---|
| Flash used | 77,004 bytes (117.5% of 64 KB) |
| Linker-reported overage | +11,112 bytes |
| Top 10 .text symbols | dominated by RPC dispatch + JSON codec + soft-FP |
Real top-10 .text contributors
3,124 fl::Rpc::handle(fl::json const&)
2,996 fl::Remote::processRpc(fl::json const&)
2,828 autoResearchLowMemorySetup() [sketch-side]
2,340 fl::(anonymous namespace)::JsonBuilder::on_token
2,196 fl::TypedRpcBinding<fl::string(int,int,int,int)>::invokeWithReturn
2,088 __aeabi_dadd [soft-FP]
1,516 Reset_Handler [startup; normal]
1,392 __aeabi_dmul [soft-FP]
1,350 fl::JsonTokenizer::parse
1,172 __aeabi_fsub [soft-FP]
Bucket totals
| Bucket | Bytes | Sub-issue |
|---|---|---|
| RPC dispatch (Rpc::handle + processRpc + TypedRpcBinding + JsonArgConverter + rehash) | ~12,600 | #3081 |
| Soft-FP / libgcc cascade | ~8,300 | #3076 |
| fl::function variant clones (across signatures) | ~6,260 | #3077 |
| JSON codec (JsonBuilder + JsonTokenizer + ieee754 + kPow10Mant) | ~5,400 | #3082 |
| Sketch-side autoResearchLowMemorySetup + lambdas | ~4,700 | (no issue; user-side) |
Sub-issues to fix
| Sub-issue | Symptom | Target reduction |
|---|---|---|
| #3081 | RPC dispatch monolith — Rpc::handle 3.1K + Remote::processRpc 3.0K + TypedRpcBinding 2.2K each | ~7 KB |
| #3082 | JSON codec — JsonBuilder::on_token 2.3K + JsonTokenizer 1.35K + ieee754 LUT path 1.9K | ~3 KB |
| #3076 | 8.3 KB of soft-FP / libgcc cascade leaks past the no-soft-FP invariant | ~7 KB |
| #3077 | fl::function variant emits 6.3 KB of copy/move/destroy clones across RPC signatures | ~3 KB |
Total addressable: ~20 KB against an 11 KB deficit. Any one of #3081 or #3076 alone would clear the overage. #3081 has the largest leverage and the cleanest fix (de-templating dispatch glue).
Withdrawn sub-issues
- LPC845 bloat: fl::CRGB::computeAdjustment is 9.5 KB (12.5% of .text) on LowMemory + RX_SCT_WS2812 #3075 —
fl::CRGB::computeAdjustmentclaimed 9.5 KB; actual size 54 bytes. Closed as filed-in-error. - LPC845 bloat: fl::string::trim() is 2.9 KB single function; basic_string::operator[] 1.5 KB; sstream::operator<<(char) 1.25 KB #3078 —
fl::string::trim()claimed 2.9 KB; actual size 164 bytes. Closed as filed-in-error.
Tooling dependency
FastLED/fbuild#594 — bash bloat lpc845brk cannot run today because ci/bloat.py's BOARD_CHIP_MAP has no arm-none-eabi entry, and fbuild build has no "emit ELF on region overflow" mode. The methodology error that produced #3075 / #3078 was a direct consequence of working around #594 by parsing the linker map by hand. Closing this meta should not block on #594, but the bloat work cannot iterate efficiently without it, and a repeat methodology mistake is very easy without proper tooling.
How to measure progress (until #594 lands)
# 1. Apply the proposed reduction
# 2. Edit platformio.ini [env:lpc845brk] to enable -DFASTLED_LPC_RX_SCT_WS2812=1
# 3. If still over-budget, temporarily bump FLASH 64K -> 128K in the cached LD script:
# ~/.fbuild/prod/cache/platforms/zackees-ArduinoCore-LPC8xx/.../lpc845_flash.ld
# 4. Build:
# PLATFORMIO_SRC_DIR=examples/AutoResearch fbuild build -e lpc845brk
# 5. CANONICAL bloat measurement (NOT linker map address-delta):
# NM=~/.fbuild/prod/cache/toolchains/developer-gnu/.../arm-none-eabi-nm.exe
# "$NM" --print-size --size-sort --demangle .fbuild/build/lpc845brk/release/firmware.elf | \
# awk '$3=="t" || $3=="T"' | tail -25
# 6. Revert the LD script and platformio.ini
Acceptance for closing the meta
-
examples/AutoResearch/AutoResearch.inowithFASTLED_AUTORESEARCH_LOW_MEMORY=1+FASTLED_LPC_PWM_DMA=1+FASTLED_LPC_RX_SCT_WS2812=1links cleanly under the 64 KB LPC845 FLASH region -
platformio.ini [env:lpc845brk]defaultbuild_flagsenables-DFASTLED_LPC_RX_SCT_WS2812=1(no longer commented out) -
bash autoresearch lpc845brk --ws2812-loopbackworks against the consolidated AutoResearch sketch without any flash-budget workarounds - All four sub-issues (LPC845 bloat: 8.3 KB of soft-FP / integer-div leaks past the no-soft-FP invariant on LowMemory + RX_SCT_WS2812 #3076, LPC845 bloat: fl::function variant emits 6.3 KB of copy/move/destroy clones across RPC dispatch signatures #3077, LPC845 bloat: RPC dispatch surface is 12.6 KB (Rpc::handle 3.1K + Remote::processRpc 3.0K + TypedRpcBinding<sig>::invokeWithReturn 2.2K/sig) #3081, LPC845 bloat: JSON tokenizer/builder/ieee754 path is 5.4 KB (JsonBuilder::on_token 2.3K + JsonTokenizer::parse 1.35K + kPow10Mant LUT 824) #3082) are closed via merged PRs
Out of scope
- Adding new LED-protocol matrix support to the LPC LowMemory build (Low-memory targets stay RX-only + bit-bang/SCT-DMA TX)
- The LPC11Uxx / LPC15xx hardware bring-up (tracked under fbuild#456)
- Reworking the JSON-RPC contract (Retire AutoResearchLpc.ino — fold into AutoResearch.ino low-memory mode #3030 already consolidated; we are only resizing the existing surface)
Related work
- bash bloat / fbuild symbols: no arm-none-eabi path; can't measure LPC845 bloat from FastLED's wrapper fbuild#594 — tooling gap
- Rename SKETCH_HAS_*_MEMORY macros to FL_PLATFORM_HAS_*_MEMORY #3000 / refactor(system): introduce FL_PLATFORM_HAS_*_MEMORY canonical names (closes #3000) #3019 —
FL_PLATFORM_HAS_LARGE_MEMORYcanonical macro - fl::json: custom 64-bit packed tagged-number type (replaces variant<i64, float, double> in #3002) #3022 / feat(json): integer-only IEEE 754 codec replaces soft-FP cascade (refs #3022) #3038 — soft-FP elimination from
fl::json(already shipped; coverage gap is LPC845 bloat: 8.3 KB of soft-FP / integer-div leaks past the no-soft-FP invariant on LowMemory + RX_SCT_WS2812 #3076) - 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.inoretired, folded into low-memory mode of main sketch - feat(lpc): RX backend for LPC8xx via SCT input-capture — two-phase rollout #3021 — LPC SCT-RX two-phase rollout (this meta blocks Phase 2's default-on)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jun 15, 2026
/clud-fix 3079 status report (2026-06-15)
Investigation phase of
/clud-fixcomplete. Per the skill's intake-gate logic, sub-issues that fail "scope sanity" (open-ended design questions rather than well-scoped bug fixes) require an investigation report rather than a drive-by PR. After deep investigation, three of the four surviving sub-issues fail scope-sanity and need explicit design discussion before PR work.Per-sub-issue gate status
floatfromjson_value::variant_ton Low-memory, OR replacingieee754_format_decimalwith int-only codec. Both touch public API.#if !FL_PLATFORM_HAS_LARGE_MEMORYto drop 3 dead alternatives. ~3 KB savings. Cannot ship alone (would not clear the 11 KB overage).TypedRpcBinding::invokeWithReturnreworks the core abstraction. Cross-platform risk on ESP32 / Teensy / WASM.floatvariant alternative, most of this issue's bloat goes away as a side-effect. Re-measure after #3076 lands.Recommended path
Phase 1 (quick, low-risk):
#if !FL_PLATFORM_HAS_LARGE_MEMORYvariant collapse as one PR. Saves ~3 KB. Doesn't clear the overage alone but is incremental progress and well-scoped.Phase 2 (design discussion required, then PR sequence):
json_valuecan lose thefloatalternative on Low-memory targets (semantic change).Phase 3 (optional, only if budget still tight):
What this means for the goal
/clud-fix 3079cannot ship as a single-session goal. The meta needs:I have not opened any PRs against this meta because the scope-sanity gate fails for three of four sub-issues. Per /clud-fix:
Investigation reports posted as comments on each sub-issue. Awaiting design direction.
Caveats
The bloat measurements behind this meta and its sub-issues were taken using a manual LD-script-patching workaround because FastLED/fbuild#594 (tooling gap — no
bash bloatfor arm-none-eabi) is still open. Every subsequent fix PR will need to repeat the LD-script-patch + nm-measurement dance to verify byte targets, OR fbuild#594 should land first to make iteration tractable. Recommend prioritizing fbuild#594 if multiple bloat PRs are coming.fix(avr/math): undef Arduino's F() macro before fl::math polynomial t…
perf(fl::function): collapse callable variant to {free_fn, inlined_la…
perf(fl::json): route i64->float conversions through i32 to eliminate…
perf(fl::function): collapse callable variant to {free_fn, inlined_la…
perf(fl::json): route i64->float conversions through i32 to eliminate…
fix(video): add FL_NOEXCEPT to embeddedScreenMap accessors (#3090)
ci(lpc8xx): extend canary to Blink + DemoReel100 + FxEngine (closes f…
perf(rpc/lpc): gate schema generator + enable RX_SCT_WS2812 default o…
fix(examples/autoresearch): gate companion .cpp files on FASTLED_AUTO…
zackees commentedon Jun 18, 2026
Phase 2 follow-on filed: #3224 — LPC845 flash-budget Phase 2 — grow headroom from 1.4 KB to ~6-10 KB for feature capacity
Today's headroom after this meta closed is 1,420 B, which fits the WS2812 SCT-RX default-on binding but leaves no margin for new LowMemory feature work. The Phase 2 meta catalogs 8 outstanding reduction opportunities (Tier 1: single-prec soft-FP cascade, Remote::processRpc outlining, sketch-side lambda slimming; Tier 2: JSON codec slimming + unordered_map collapse; Tier 3: small wins + the deferred TypedRpcBinding de-templating).
Also calls out the still-open FastLED/fbuild#594 tooling gap as the iteration-velocity multiplier it became during this meta.