Skip to content

chore(memory): preserve rp2040 default flash/RAM gains (#4737) #4747

Closed

Description

@zackees

Context

Platform sub-issue of #4737. Already improved versus the available 3.10.6 baseline. Preserve the measured 350,128 B flash / 59,996 B RAM reference.

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.

example 3.10.3 3.10.6 master reference
Blink build failed 357808 / 60272 350128 / 59996

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/rp2040, 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 rp2040; retain both the published example and controlled RGB-workload measurements where applicable.
  • Recover a matched 3.10.3 measurement by applying the Arduino-Pico SDK’s required SdFat defines identically across revisions. Preserve the original failed cell as historical evidence and document the recovered measurement separately; never substitute 3.10.6 or zero usage.
  • Establish a regression budget for the existing gains and validate shared controller/channel/global-state changes from siblings.
  • Verify RP2040 LED timing/output and affected APIs; distinguish image-padding effects from actual symbol changes.
  • Keep allocated image flash and physical RAM at or below the matched original master reference under the same configuration; distinguish the raw GNU flash counter, which includes reserved heap/stack. Record the corrected measurements and preserve the frozen raw table as historical evidence.
  • 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

  • This platform has no measured remaining growth in the reference matrix; its role is preserving gains and validating shared changes.
  • Scope is this platform; shared fixes must be measured on affected siblings and tracked in the parent.
  • Budget failures require a focused fix and RED-to-GREEN evidence; passing validation does not require an unrelated code change.

Activity

  1. zackees commented on Oct 7, 2026

    @zackees
    MemberAuthor

    Recovered baseline and measured optimizations

    Matched 3.10.3 now builds and bloat succeeds: reported flash/RAM 376548/19656, allocated image/attributed RAM 123012/7422 for published Blink and controlled RGB. The original failed cell remains historical evidence. Arduino-Pico5.7.0 requires -DFILE_COPY_CONSTRUCTOR_SELECT=FILE_COPY_CONSTRUCTOR_PUBLIC -DUSE_UTF8_LONG_NAMES=1 -DDISABLE_FS_H_WARNING=1; fbuild2.5.37 omitted them. Applying the same SDK defines to both revisions fixes SDFS without altering released FastLED source; current master totals are unchanged by those defines.

    Starting master 893216fb2ce2cb7d370a401069319636da0b92ac: image135820/physicalRAM59980. Candidate published Blink: image135744/physicalRAM21564, saving 76 B allocated image /38416 B RAM. Native SPI routing saves32imagebytes with all1024pin combinations checked; on-use static RX capture storage removes38416unusedBSS and44imagebytes from TX-only Blink. Explicit SDK RX build retains full38416-byte aligned static storage plus4-byte singleton pointer and links the actual RpPioRxDevice::begin method. No heap allocation, buffer-capacity reduction or RX feature removal. Existing exclusive resource claim protects initialization/use. Physical waveforms are not measured by these compile/lifecycle checks.

    Flash metric correction: current GNU text+data388476 includes readonly NOBITS .heap250684 and .stack_dummy2048:135744+250684+2048=388476. Freeing BSS grows that heap reservation; it is not programmed flash. The existing bloat gate enforces allocated image135744 and attributedRAM8697. Keep raw reported totals separate from true image bytes; a growing heap reservation is not flash-code growth.

    Focused budget RED was recorded before each optimization; GREEN measured afterward. Native routing patch had319unit/95example checks passing; post-RX full validation and controlled measurement are still in progress. No closure yet. Native logging audit found no fl::printf in RP platform; genuine resource/pin failures retain warnings. Parent remains open.

  2. zackees commented on Oct 7, 2026

    @zackees
    MemberAuthor

    Landed PR #4757 at 41a6c284fcbbc8c6cb0a379bd994b98d017f78d1. Candidate and landed trees match; fresh landed local Blink build and scoped budget PASS: allocated image135744 / physicalRAM21564, attributedRAM8697. Compared with matched starting master135820/59980, saves 76imagebytes /38416RAMbytes. Controlled135572/59980→135496/21564 gives the same savings.

    Recovered 3.10.3 published/control image123012 /physicalRAM19656; identical SDK SdFat defines applied across revisions without patching released source. Remaining gap published+12732image/+1908RAM, controlled+12484image/+1908RAM; no parity claim. Fresh original-meta135876/59996 and3.10.6 image143784/60272 measured; frozen raw figures remain historical.

    GNU raw flash388476 includes readonly NOBITS heap250684 and stack_dummy2048; it is not programmed image size. The allocation budget enforces actual135744/8697. Full RX retains38416-byte aligned static pool with heap-free Singleton initialization after exclusiveclaim; explicitSDKRXbuild proves fullcapacity remains linked. SameSPIrouting decisions checked for1024pin combinations. Strictnative417/417unit/examplejobs, full lint, Pythonbudget checks, six-file review and local RP2350SDK build/bloat pass. Physical waveforms not claimed. No logging fl::printf inRPplatform, genuinewarnings retained. No features dropped, raisedceilings, newworkflow, worktrees or CI Full.

    All measurements and cumulative diff are posted on parent #4737; it remains OPEN. Final eleven-row matrix/acceptance audit follow separately.

  3. moved this from Triage to Done in FastLED Trackeron Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions