Repository navigation
Description
Sub-issues (loop-enumerable)
- [Type-Erasure] RPC dispatch: RuntimeRpcBinding -- replace TypedRpcBinding<Sig> with non-template + per-Sig trampoline (#3244 Tier 1A) #3246 — Tier 1A:
RuntimeRpcBinding(non-template binding + per-Sig trampoline) - [Type-Erasure] json: collapse JsonToInteger/Float/Bool/String visitors into json_convert_to_<X>_core (#3244 Tier 2E Phase 2) #3247 — Tier 2E Phase 2:
json_convert_to_<X>_corenon-template conversion-visitor cores - [Type-Erasure] chipsets: ClocklessControllerRuntime -- runtime-timing concrete class (#3244 Tier 2F) #3248 — Tier 2F:
ClocklessControllerRuntime(runtime-timing chipset class) - [Type-Erasure] variant: collapse trivial-destructor / trivial-copy thunks (#3244 Tier 3G) #3249 — Tier 3G: variant trivial-destructor / trivial-copy thunk collapse
- [Type-Erasure] deque: deque_basic shadow class (#3244 Tier 3H) #3250 — Tier 3H:
deque_basicshadow class - [Type-Erasure] json: outline visitor warning-string formatter (#3244 Tier 3I) #3251 — Tier 3I: visitor warning-string formatter outlining
- fl::function: investigate heap-allocation tradeoffs of the HeapHolder<F> + shared_ptr fallback (Option B follow-on) #3237 —
fl::functionHeapHolder<F>shared_ptr-vs-unique_ptr investigation (standalone) - Rename RPC envelope markers '__async' / '__skip' -- they look reserved-namespace but are public envelope-control fields #3228 — Rename
__async/__skipRPC envelope markers (standalone)
Cross-repo, informational only (not in the burn-down loop):
- fbuild daemon dies mid-build with 'error decoding response body' under multi-repo / multi-worktree concurrent use fbuild#627 — fbuild daemon contention (recurring tooling friction)
Goal
Continue FastLED's "smallest possible embedded footprint" arc. Predecessor metas #3224 (LPC845 Phase 2) and #3235 (type-erasure burn-down) shipped 11 PRs that cumulatively recovered ~17 KB of flash + ~3 KB of RAM on Low-memory targets and ~10 KB of flash + ~2 KB of RAM on a Large-memory target (Teensy 4). Several items in those metas were caught short — either because the audit-predicted leverage doesn't materialize at AutoResearch scale, or because the implementation surface is invasive enough to warrant its own focused PR series. This meta rolls them all into one open burn-down so future agents have a single page to look at instead of spelunking through closed-meta bodies.
Carry-forward from #3235 (unfiled sub-items)
| Tier | Title | Predicted savings | Difficulty | Notes |
|---|---|---|---|---|
| 1A | RuntimeRpcBinding -- replace TypedRpcBinding<Sig> with non-template binding + per-Sig trampoline |
~1.5-1.8 KB / Sig | medium-hard | Tier 3H from #3224, the original "deferred-as-invasive" item. Biggest single remaining leverage point. Per-Sig template tax -> per-Sig trampoline (50-150 B). Phase via FL_PLATFORM_HAS_LARGE_MEMORY opt-in; ESP32/Teensy hot path can keep templates if benchmarks show speed regression. |
| 2E (Phase 2) | json_convert_to_<int/bool/float/string>_core non-template visitor cores |
~2-3 KB on LPC845, ~5+ KB on Large-memory | medium | Phase 1 (Size + IsArray visitors -> tag-table lookups) landed in PR #3241 saving 416 B. Phase 2 is the bigger win: collapse JsonToIntegerVisitor<T> / JsonToFloatVisitor<T> / JsonToBoolVisitor / JsonToStringVisitor -- which each emit 10 per-alternative operator() overloads -- into 4 non-template conversion cores. |
| 2F | ClocklessControllerRuntime -- runtime-timing variant for ESP32/Teensy/RP2040/WASM |
~8-25 KB on Blink-style sketches with multiple chipsets | medium-hard | Preserves FastLED.addLeds<CHIPSET, PIN, ORDER>(...) user API surface. AVR / LPC8xx / ESP8266 keep template path (cycle-tight bit-banging needs compile-time constants). Gated via FL_USE_RUNTIME_CLOCKLESS. Different leverage axis (per-chipset, not per-Sig). |
| 3G | Variant trivial-destructor / trivial-copy collapse | ~2-3 KB on variant-heavy targets (json_value) | hard | Share destroy_fn across is_trivially_destructible<T> types (collapse to noop_destroy). Share copy_fn / move_fn across trivially-copyable types (one shared memcpy(storage, other, size) thunk parameterized at runtime by sizeof(T)). |
| 3H | deque_basic shadow class |
~150 B per future instantiation | easy | Mirror vector_basic / flat_map_basic pattern. Only 1-2 deque instantiations today (deque<char> for json, deque<u8> for parlio). Limited immediate ROI but cheap to land alongside any future deque addition. |
| 3I | Visitor warning-string outlining | ~1-2 KB across visitors | easy | Each visitor today inlines fl::to_string(value, 6) warning formatters that anchor basic_string machinery. Outline to a single format_warning_value(tag, storage) helper that only links if any visitor actually emits a warning at runtime. |
Open standalone follow-ons
| Issue | Title | Why it matters |
|---|---|---|
| #3237 | fl::function HeapHolder<F> shared_ptr-vs-unique_ptr investigation |
Filed when user flagged the heap allocation tradeoff during #3238 review. Determines whether copying an fl::function should refcount-increment (current behavior) or deep-copy the captured F. Affects every embedded target's RAM model. |
| #3228 | Rename __async / __skip RPC envelope markers |
Cosmetic / readability follow-on from #3224 Tier 1B. The __-prefix looks reserved-namespace but the fields are public envelope-control flags. No flash impact but improves code review velocity on RPC paths. |
| fbuild#627 | fbuild daemon crash under multi-worktree contention | Recurring bug that costs ~10 min/session on the type-erasure work. Not a FastLED-side issue but the friction directly affects iteration on this meta. |
| fbuild#594 | bash bloat arm-none-eabi path |
Mostly addressed by #3225 (arm support landed) and the --allow-overflow flag. Documented here so future agents know it's a usable workflow. |
Lessons learned from #3235 (worth re-stating up front)
-
The audit's per-tier savings predictions assumed "kitchen-sink" builds with ~30 distinct container instantiations. AutoResearch has 2 of each (flat_map, unordered_map). At that scale, per-call thunk overhead can equal or exceed per-instance savings. PR perf(flat_map): type-erase lower_bound / upper_bound binary search (#3235 Tier 2D) #3239 (flat_map_basic) was +72 B on LPC845; the infrastructure is correct and will pay back on bigger sketches, but agents reading the audit shouldn't expect immediate flash deltas on focused sketches.
-
fl::functionis the exception that proved the rule. Per-Sig variant tax compounds across the ~25-30 signatures every embedded build instantiates -- and PR perf(fl::function): Option B refactor -- single SBO + invoker + manager (#3235 Tier 1B, -9.2 KB Teensy 4) #3238 (Option B) measured −9.2 KB on Teensy 4 just as the audit predicted. The leverage axis (per-Sig × variant-alternative) is fundamentally denser than per-container. -
Big sketches matter for measurement. The 5-sketch matrix queue from the original meta investigation (AutoResearch / Animartrix / Chromancer / Json / FxNoiseRing) never completed because
bash bloat esp32s3 --buildhit fbuild#627 daemon wedges. A future agent should retry with one of the genuinely large WASM-compiler or full-RPC sketches before tackling Tier 1A/2F. -
FL_NO_INLINEon type-erased cores is load-bearing under LTO. Without it the compiler inlines the body back at each call site, defeating dedup. Lint gate exists (bare_noinline_checker.py) — use it.
Recommended priority order
- Tier 1A (
RuntimeRpcBinding) — biggest single PR leverage that hasn't been touched. AutoResearch already exercises 4 RPC signatures; LPC845 measurement should show ~6 KB savings if the audit's per-Sig estimate is correct. - fl::function: investigate heap-allocation tradeoffs of the HeapHolder<F> + shared_ptr fallback (Option B follow-on) #3237 investigation — orthogonal to flash work but blocks further
fl::functionevolution. Quick to resolve (1-2 hours of measurement + write-up). - Tier 2E Phase 2 — Phase 1 validated the dispatch-core approach (PR perf(json): SizeVisitor + IsArrayVisitor → direct tag checks (-416 B LPC845; #3235 Tier 2E) #3241, −416 B). The Phase 2 conversion-visitor cores are mechanically similar but bigger payoff.
- Tier 2F (
ClocklessControllerRuntime) — different leverage axis; sketches with multiple chipsets (Blink-style, RGBCalibrate) will demonstrate. Requires a non-AutoResearch target sketch for verification. - Tier 3 G/H/I — small wins; bundle into one cleanup PR or defer indefinitely.
Acceptance for closing this meta
Per-item acceptance, not a blanket count (lessons-learned from #3235):
- Each Tier 1/2 item closed via a merged PR OR explicitly deferred with a documented rationale comment.
- The PR for each Tier 1/2 item shows positive flash savings on at least one production sketch + board combination that exercises the item's leverage axis (not necessarily AutoResearch).
- Tier 3 items either closed individually or rolled forward to a Phase 4 meta if not addressed.
- Standalone follow-ons (fl::function: investigate heap-allocation tradeoffs of the HeapHolder<F> + shared_ptr fallback (Option B follow-on) #3237, Rename RPC envelope markers '__async' / '__skip' -- they look reserved-namespace but are public envelope-control fields #3228) resolved or formally deferred.
When ≥3 of the Tier 1/2 items are closed + at least one of #3237 / #3228 is resolved, the meta is considered burned down and may be closed.
Tooling status
- ✅
bash bloat <board> --example <sketch>works for ESP32-family + arm-none-eabi (LPC845, Teensy 4) post feat(bloat): delegate nm + ELF path resolution to fbuild symbols (arm support) #3225 - ✅
bash bloat <board> --allow-overflowflag lands an ELF even when the link region overflows ⚠️ fbuild#627 (daemon flakiness) — file workarounds inagents/docs/binary-size-analysis.mdif it bites again
Out of scope
- ESP32 RMT5 driver internals (already nearly fully type-erased post feat(channels): compile-time Bus binding via templated ChannelConfig (eliminates Channel API binary bloat) #2428)
- AVR bit-bang drivers (cycle-tight asm requires compile-time-constant timing)
fl::shared_ptr/fl::optional/fl::tuple(audit found them already optimal — savings would be < 100 B each)- Application-level / sketch-side bloat (user-owned)
- Cross-language WASM bundle size (out of the embedded firmware-size scope)
Predecessors
- Meta META: LPC845 64 KB flash bloat hunt -- clear 11 KB overage to unblock FASTLED_LPC_RX_SCT_WS2812=1 #3079 (closed 2026-06-15) — LPC845 64 KB flash bloat hunt; first surgical-gating arc
- Meta META: LPC845 flash-budget Phase 2 — grow headroom from 1.4 KB to ~6-10 KB for feature capacity #3224 (closed 2026-06-18) — LPC845 flash-budget Phase 2; 6 PRs, +14.6 KB headroom growth
- Meta META: type-erasure burn-down -- collapse template-instantiation taxes across containers / RPC / visitors / fl::function / chipset controllers #3235 (closed 2026-06-18) — type-erasure burn-down Phase 1; 4 PRs, −2.3 KB LPC845, −9.2 KB Teensy 4 (Option B)
This meta is Phase 3 of the same arc.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Jun 18, 2026
What is going wrong
The /clud-fix skill's meta workflow enumerates open sub-issues by parsing the meta body for markdown checklist items with issue references (e.g.
- [ ] #123,- [ ] owner/repo#456). This meta's body uses markdown tables to catalog the Phase 3 work items (Tier 1A, 2E Phase 2, 2F, 3 G/H/I), not checklist items. The enumerator finds nothing actionable.Concretely, the meta references 9 distinct work items but only 4 of them exist as filed GitHub issues:
RuntimeRpcBinding)ClocklessControllerRuntime)deque_basic)__asyncenvelope renameThe skill's documented "When Not To Use This" list catches this exact case:
Reproduction status
Not applicable (this isn't a code bug). The intake gate failed because the meta's structure doesn't match what the enumerator looks for. No code change happens; no PR is opened.
I am not going to auto-file the missing sub-issues from the meta's catalog. The skill's "Manufacturing meta-level work" failure mode explicitly forbids that:
This is the right call — sub-issues need their own intake-gate-passing repros / acceptance criteria, and several Phase 3 items (especially Tier 1A
RuntimeRpcBindingand Tier 2FClocklessControllerRuntime) are design exercises that warrant user-in-the-loop discussion before being filed against. Auto-filing would bypass the design step.Planned fix (what would unblock the burn-down)
The meta needs two structural changes before /clud-fix can drive it:
File the catalog items as separate issues. Each row in the "Carry-forward from META: type-erasure burn-down -- collapse template-instantiation taxes across containers / RPC / visitors / fl::function / chipset controllers #3235" table becomes its own issue with:
Convert the prose references to a markdown checklist in the meta's body, like:
That format is what the /clud-fix enumerator parses. The current table-based catalog reads better for humans but is invisible to the skill.
Open questions
Should I file the 6 unfiled Tier sub-issues now? They'd be one-shot mechanical files derived from the existing meta + sub-agent audit reports — no design judgment beyond what the audits already provided. Risk: each sub-issue might inherit the audit's "predicted ~X KB" framing rather than acknowledging the lesson-learned that those numbers don't hold at AutoResearch scale; that wording should be tightened per-issue rather than copy-pasted.
Or do you want to file them yourself, one at a time, gating each on a design conversation? Tier 1A is the highest-leverage and the most invasive — it deserves a conversation before being filed against. Tier 3H (
deque_basic) and 3I (visitor warning outline) are pure mechanical follow-ons that could be filed in bulk.Do you want the prose-only references converted to a checklist in the meta body, so future /clud-fix invocations enumerate correctly even if some items remain unfiled? That edit is safe and reversible.
What I'm NOT doing
Recommendation
The fastest path forward in this session is: confirm one of the above options. Most likely useful:
/goal clear. The meta stays open with its current structure; the next agent has a single page (META: memory & flash reduction -- Phase 3 burn-down (continues #3235) #3244) to start from.Either way, this comment exists so the next entry point (you or a future agent) has the precise state and the unblock plan in writing.
docs(clud-fix): enumerate child issues from tables and prose, not jus…
perf(json): collapse JsonToType<T> visitor dispatch into non-template…
perf(rpc): non-template RuntimeRpcBinding dispatch on low-memory targ…
refactor(rpc): delete unused JsonTo*Visitor classes (#3251 / #3244 Ti…
perf(variant): collapse trivial-destructor / trivial-copy thunks (#3249…
perf(deque): deque_basic ring-buffer + grow-policy helpers (#3250 / #…
feat(function): add FL_FUNCTION_NO_HEAP_FALLBACK opt-out macro (closes …
zackees commentedon Aug 20, 2026
Phase 3 burn-down is complete under this meta's stated terminal rules.
Final child disposition:
RuntimeRpcBinding).This satisfies the meta acceptance gate: every Tier 1/2 item is merged or explicitly deferred with rationale, at least three Tier 1/2 items have terminal dispositions, all Tier 3 items are closed, and both standalone follow-ons are resolved. Any future work on #3248 remains independently tracked and excluded from the actionable queue while labeled
deferred.