Skip to content

fix(memory): compact channel and color profile configuration layouts - #4750

Merged
zackees merged 1 commit into
masterfrom
fix/memory-4744-stm32
Oct 7, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/memory-4744-stm32

Conversation

@zackees

@zackees zackees commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Reorder ColorProfileBinding and ChannelOptions members to remove padding without changing defaults, ownership or supported settings.
  • Guard compact binding storage with a focused size regression test and preserve the tiny-tier no-growth probe.
  • Add the default STM32F103C8 image-flash/attributed-RAM budget.

Refs #4744 and #4737. Close the child after landed-master size verification and the cumulative parent comment; leave the meta open.

Measured local evidence

Starting master 8d6ed12ccbac48ccc9b3708b2d537ee3a2a6c921; historical 3.10.3 20667c3a6413ed46a828f78ec95fb57e58d753f8. fbuild 2.5.37, STM32duino 2.9.0, arm-none-eabi-gcc 15.2.1, identical board configuration and normal flags. Sequential builds in the existing .build/fbuild/stm32f103c8 project; no git worktrees, no CI Full.

workload 3.10.3 flash / RAM starting master candidate savings
published Blink 16092 / 3248 26368 / 3488 26356 / 3480 12 / 8
controlled GPIO3, one NEOPIXEL RGB LED, no Serial 16092 / 3248 25536 / 3488 25524 / 3480 12 / 8

Remaining historical gap: published +10264 B flash / +232 B RAM; controlled +9432 / +232. No claim of parity.

Image flash 26368 → 26356, attributed RAM 1940 → 1932; here both reductions agree with board totals. The controller symbol shrinks 140 → 132 bytes. Host binding shrinks 80 → 72 bytes. The first binding-only candidate saved 4 attributed bytes but rounded board totals stayed flat, so it was not claimed as a completed platform reduction.

Validation

  • 3.10.3/master fbuild bloat reports and matched symbol ledger, published and controlled examples, same framework/caches.

  • Focused binding-size test RED (80 > 72), immediately rerun with sanitizers before editing; all 52 color-profile sanitizer cases GREEN after final layout.

  • Starting master fails both new size ceilings; final candidate passes bash bloat stm32f103c8 --budget tests/data/stm32f103c8_bloat_budget.json.

  • Tiny-tier no-growth probe uses <= the frozen legacy layout; compact layouts may shrink. No thresholds raised.

  • Recompiled staged translation units with compile-only assertions to validate header changes after suspect incremental results; source/framework caches retained.

  • bash test --cpp: 319/319 unit targets and 95/95 examples passed.

  • bash lint passed; all changed files reviewed against repository code-review rules with no findings.

All fields and source APIs remain available, including RGBW/RGBWW, emitter profiles, gamma, typed buses and bus instance selection. As usual for C++ member-layout changes, consuming code must be rebuilt together with the library; no binary-layout compatibility claim.

Logging audit: STM32 clockless operational logging already uses categories; remaining warnings in peripheral implementations describe invalid configuration, unsupported hardware or failures. No fl::printf logging calls in STM32/channel implementation. Linked libc printf primarily remains for explicitly used Serial/framework behavior; no such features removed.

Shared-change local verification

already completed platform previous landed Blink flash / RAM this candidate additional savings
C3 403232 / 68540 403210 / 68540 22 / 0
C6 360494 / 18628 360474 / 18612 20 / 16

Both platforms passed their existing default budgets. Image-flash ceilings are ratcheted down again (C3 385622 → 385596; C6 403818 → 403794), with no RAM ceiling raised. C6 singleton storage is not represented in attributed RAM; its board totals show the additional 16-byte saving. All platform builds run locally and sequentially.

Summary by CodeRabbit

  • Performance
    • Reduced flash usage for the default Blink build on ESP32-C3 by 26 bytes and ESP32-C6 by 24 bytes, with RAM usage unchanged.
    • Recorded baseline flash and RAM measurements for the STM32F103C8 Blink build.
  • Compatibility
    • Updated internal size checks to allow compact channel configurations to use less memory without changing their behavior.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2718e151-c818-42ef-bae5-fd46a5869e20
📥 Commits

Reviewing files that changed from the base of the PR and between 8d6ed12 and cb0c47e.

📒 Files selected for processing (8)
  • agents/tasks/todo.md
  • src/fl/channels/color_profile.h
  • src/fl/channels/options.h
  • tests/data/esp32c3_bloat_budget.json
  • tests/data/esp32c6_bloat_budget.json
  • tests/data/stm32f103c8_bloat_budget.json
  • tests/fl/channels/color_profile.cpp
  • tests/fl/channels/color_profile_tiny_layout.cpp
 ___________________________________________
< My mommy says I'm the best code reviewer. >
 -------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit 28a41d6 into master Oct 7, 2026
118 of 119 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Oct 7, 2026
@zackees
zackees deleted the fix/memory-4744-stm32 branch November 5, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant