Repository navigation
Description
Context
Platform sub-issue of #4737. +60,808 B flash / +5,060 B RAM versus 3.10.3.
Source measurements, flash / RAM in bytes, fbuild 2.5.37, per-version source/examples and constant per-board build configuration. Reference SHAs: 3.10.3 20667c3a64, 3.10.6 ebf8c2823c, master 0c2e9f7300.
Pinned ESP32 framework: Arduino-ESP32 3.1.0 / ESP-IDF 5.3.2.
| example | 3.10.3 | 3.10.6 | master reference |
|---|---|---|---|
| Blink | 342600 / 63512 | 433834 / 70332 | 403408 / 68572 |
Execution workflow
Work one checklist item and one platform sub-issue at a time across the entire #4737 project, in the existing repository checkout without git worktrees. Use a feature branch in that checkout and reuse .build/fbuild/esp32c3, toolchain/dependency caches and test caches. Run builds sequentially. Verify changed source/flags are reflected in the ELF; use the appropriate wrapper's --clean only when stale-output evidence requires it. Record each completed item's measurements, checks and commit/PR before moving on.
Checklist
- Reproduce this platform's current starting measurements with recorded SHA, flags and framework versions, and verify cache validity.
- Create matched symbol/link-map evidence using
bash bloat esp32c3; retain both the published example and controlled RGB-workload measurements where applicable. - Prioritize the 5,060 B RAM gap: identify channel/controller storage, buffers, global allocations and linked framework state.
- Audit RMT/channel dispatch, driver binding and unused encoder/subsystem linkage; coordinate with Eliminate memory usage from dynamic driver binding. #4733.
- Reduce the default footprint while preserving LED timing, power limiting and network coexistence.
- Land measured default flash and RAM reductions below the recorded master values for every example in this child, and quantify remaining gaps to 3.10.3.
- Add a focused size regression check. For any implementation, capture a failing budget/reproduction before coding (RED) and the passing result afterward (GREEN); run relevant tests, lint and code review.
- Ratchet applicable existing flash budgets and enforce RAM budgets through existing checks, preserving normal feature behavior and avoiding relaxed ceilings.
- Publish final before/after bytes, remaining gaps, source SHA, commands, flags, framework versions and landed commit/PR links; update meta(memory): reduce default flash/RAM usage across all measured platforms #4737's platform scorecard.
Decisions
- Default-build reductions are required; optional slim configurations supplement the work but do not satisfy this child.
- Scope is this platform; shared fixes must be measured on affected siblings and tracked in the parent.
- Any unmet reduction criterion needs an explicit maintainer-approved exception with exact bytes before closure.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 7, 2026
Local investigation and first measured candidate
Working sequentially in the main repository checkout on
fix/memory-4739-esp32c3, without worktrees or CI Full. Tooling/source starting SHA:0c2e9f730007e52758d4abc2b9ba356fb581d923; 3.10.3 source:20667c3a6413ed46a828f78ec95fb57e58d753f8. Arduino-ESP32 3.1.0 / ESP-IDF 5.3.2 / GCC 13.2, unchanged board configuration.bash bloat esp32c3 --no-summarywas run for both 3.10.3 and master and the candidate. Separate bloat metrics: image flash 307262 / 385822 / 385622 B, respectively; attributed RAM 24487 / 25653 / 25621 B. These are different metrics from fbuild's board totals and must not be mixed.The allocation record was 12 B because its byte fields bracketed
size_t. Reordering it makes it 8 B, saving 32 B in the unchanged eight-record ledger. A new compile-time two-machine-word budget first failed on hardware(12 <= 8), then passed after the reorder. The allocation-failure diagnostic now builds its message directly inFL_ERROR, retaining its text while avoiding an intermediate formatted copy. Recovery progress uses opt-inFL_LOG_RMT. Final failures remain errors.Matched symbol changes include the RMT singleton 176 → 144 B RAM; allocation-failure emitter 596 → 526 B flash; and removal of 48 B
basic_string::append(basic_string const&)code. Existing logger code already avoidsfl::printf; no new formatting engine is introduced.Validation so far: focused ledger/channel tests passed;
bash test --cpppassed 319/319 unit tests and 95/95 examples;bash lintpassed. Controlled RGB comparisons and further budget/publishing work remain. This is a candidate report, not closure: remaining published-example growth versus 3.10.3 is +60640 B flash / +5028 B RAM.Cache validity: incremental compilation falsely passed the deliberately failing record-size assertion without recompiling the changed header. Its output was rejected. fbuild project-clean rebuilds proved the RED and GREEN results while retaining reusable framework/toolchain caches. Historical source was staged from
git archiveinto the same cached board project; bloat's checkout SHA names the tooling checkout, so the archived source SHA is recorded separately.zackees commentedon Oct 7, 2026
Final C3 validation evidence (PR #4748)
The review follow-up at
3c549b4ea8retains the measured 403232 B flash / 68540 B RAM and passesbash bloat esp32c3 --budget tests/data/esp32c3_bloat_budget.json --no-summary. Bloat image flash remains 385622 B, attributed RAM 25621 B. Moving constructors into the implementation did not consume the savings. The new--compare --budgettest fails before its fix and passes afterward; all 49 bloat Python checks pass, focused ledger tests and lint pass. The preceding source change passed all 319 unit tests / 95 host examples. RMT-log-enabled C3 also compiles locally; the normal default build was restored and its budget rechecked.Remaining overhead audit
Matched 3.10.3/master symbols retain new channel-manager dispatch, channel data, buffer-pool/memory-ledger and RGBW/RGBWW iterator/encoder support. Examples include
ChannelManager::ChannelManager,ChannelEngineRMTImpl::beginTransmission/processPendingChannels,PixelIterator::writeWS2812and the RGBW/RGBWW virtual iterator functions. These are supported paths; this PR preserves them. The allocation-ledger capacity and dynamic spill are unchanged. Hardware channel state and logical strip queues remain distinct from the static linker totals.The controlled sketch separates Blink's new Serial banner from library overhead. At the same GPIO 3/one-LED workload and common historical-compatible
::delay(0)stub:Published Blink retains its banner and all its behavior. Its candidate-minus-3.10.3 gap is +60640 B flash / +5028 B RAM; controlled gap is +41772 / +1956 B. The Serial-enabled example therefore accounts for a substantial part of the published RAM gap. Map input sections also show added ring-buffer IRAM and framework/cache support; their section attribution is not interchangeable with nm's attributed-RAM total.
Driver-binding coordination: #4733 remains the separate runtime
fl::Channelbinding investigation. Blink uses the templatedFastLED.addLeds<NEOPIXEL, PIN_DATA>route, whose selected RMTBusTraitsdriver is linked directly.src/FastLED.cpp.hpp's explicit runtime channel overload deliberately enrolls all drivers to preserve runtime driver selection; that overload must not be silently narrowed to satisfy size goals. C3 registration/platform guards and the matched linked symbols were inspected; this PR changes no driver selection or encoder features.The pending broader RMT optimization PR #4736 belongs to the separate #4707 investigation. Its branch and work were left untouched. Additional shared savings from that work can be measured when they actually reach master; they are not counted here.
Cache/tooling and source details are in the prior comment and PR. Local artifacts remain in
.build/memory-4737/esp32c3/, including all six published/controlled reports, source provenance, failure/pass logs and the matched candidate symbol ledger. No git worktrees or CI Full were used. No physical-device execution was claimed.zackees commentedon Oct 7, 2026
Landed in #4748 (
e60f4fcf7feff2cd7e2959eca445e8746b9fd9f3). Local landed-master bloat and size budget pass. The complete performance diff is posted on #4737, which remains open. Published C3 savings: 152 B flash / 32 B RAM; controlled-workload savings: 148 / 32 B. Remaining gaps and validation limitations are quantified in the evidence comments.