Repository navigation
fix(memory): reduce Uno RGB controller and banner footprint - #4751
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (15)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change updates RGBW enum representations, adjustment arithmetic, and AVR Blink string handling. It adds tests and size-budget records, and lowers the Uno Blink and Apa102 size thresholds. ChangesUno size ratchet
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The compact selectors, adjustment arithmetic, and AVR banner changes have no established behavior regression; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 7 files. (8 skipped: 8 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Summary
Refs #4742 and #4737. Close only the platform child after landed verification; the meta issue stays open.
EOrderWandRGBW_MODEselectors in one byte, preserving all named ordinals, fields and supported modes. RGBWW selectors already use this representation.(correction + 1) * brightnessfirst in 16 bits (maximum 65280), then multiply by(temperature + 1)in 32 bits. This is the same exact product/division and rounding; zero handling and NO_CORRECTION stay intact.Matched local measurements
All entries below are fbuild board flash / board RAM bytes, not symbol-attributed RAM. Normal default flags, no slim/size opt-ins. fbuild 2.5.37. Same cached board project in this checkout, no git worktrees; board builds run sequentially. Candidate source commit
81c9a6f694dcf031fdab59dcb9edd4e068bdc165. Starting master28a41d619f8a51952ef4e9fea127ac8eb10f45f9; historical source20667c3a6413ed46a828f78ec95fb57e58d753f8(3.10.3). Historical examples use their own revision; tooling/framework/config stay matched. The generated historical Arduino stub uses::delay(0)solely because 3.10.3 lacksfl::delay.Controlled sketch: one NEOPIXEL at GPIO3, red/black show and delay(1000), no Serial. Serial/HardwareSerial remain absent in the Apa102/control symbol reports. Blink retains Serial.begin(115200), all messages, and the same bytes including CRLF and UTF-8 status marker. Library reductions therefore appear independently of the banner change.
Uno toolchain: AVR GCC 7.3.0-atmel3.6.1-arduino7, Arduino AVR core 5.4.0, ATmega328P 16 MHz. Report source SHA before committing describes the starting tooling checkout; the candidate uses this PR's dirty source, then its head commit. Reports claiming historical source are identified by the archived library source, not that metadata SHA.
Symbol evidence / enforceable metrics
__muluhisi3and shrinks linkedCRGB::computeAdjustmentby 10 B. Controller static storage shrinks 2 B. Controlled RGB removes the same helper and shrinks its controller by 2 B; its adjustment caller grows 2 B, yielding the net 20 B flash saving.str1.1RAM pool shrinks 184 B and the controller shrinks 2 B. Flash Print overload costs are included in the measured net 20 B flash reduction.Shared effects (published Blink)
Controlled shared results: C3 384342 / 65468 → 384314 / 65452; C6 360208 / 18596 → 360168 / 18596; STM 25524 / 3480 → 25496 / 3472. C6 singleton RAM remains omitted from symbol attribution; its previously landed 2048-byte encoder-storage assertion remains in place. Framework/toolchain pins: C3 Arduino 3.1.0 / IDF 5.3.2 / GCC 13.2.0; C6 Arduino 3.3.5 / IDF 5.5.1 / GCC 14.2.0; STM32duino 2.9.0 / GCC 15.2.1.
Behavior and local validation
bash lintpasses; manual/code-reviewrules applied to every changed file, no blocking findings. No ownership/threading/driver/ISR/timing changes.bash bloatreports collected for all historical/starting/candidate workloads. CLI scoped budgets pass; starting reports are RED for both flash and RAM.fl::printflogging in AVR implementation. Existing ISR/controller FL_WARN sites describe invalid configuration, allocation failure or unsupported operations and are absent in default small-memory builds; preserve those diagnostics. RMT/PARLIO optimization remains covered by the earlier completed platform children and shared local measurements.Commands:
bash compile <board> --examples <example>,bash bloat <board> --example <example> --no-summary,bash bloat uno --example Blink --budget tests/data/uno_blink_bloat_budget.json,bash bloat uno --example Apa102 --budget tests/data/uno_apa102_bloat_budget.json,bash test fastled_core --debug,bash test tests/fl/gfx/rgbww.cpp --debug,bash test --cpp,bash lint. Historical/control staging uses the same fbuild runner wrapper with clean=True, preserving caches.Artifacts retained locally in
.build/memory-4737/uno/: historical/starting/candidate report.json/report.md files, build/bloat logs, symbol ledger, provenance, RED/GREEN budgets, exact banner proof, sanitizer/native/lint logs and manual review.Compatibility
All defined selector values and supported RGB/RGBW/RGBWW behavior remain. Narrowing selector storage changes Rgbw/controller ABI/layout: rebuild applications and the library together. No prebuilt binary ABI compatibility is claimed. Classic RGB EOrder remains unchanged.
Summary by CodeRabbit