Skip to content

perf(esp32): elide unused framework Serial0 startup - #4898

Closed
zackees wants to merge 2 commits into
feat/esp32-transitive-arduino-lintfrom
feat/esp32p4-lazy-framework-serial
Closed

zackees wants to merge 2 commits into
feat/esp32-transitive-arduino-lintfrom
feat/esp32p4-lazy-framework-serial

Conversation

@zackees

@zackees zackees commented Oct 22, 2026

Copy link
Copy Markdown
Member

Summary

Addresses #4892, a child of #4888. Stacked on #4897.

Arduino 3.3.11 framework startup strongly referenced Serial0.setPins, extracting
HardwareSerial even for applications using only native FastLED console output.
The two-file framework change uses a checked weak C startup hook whose strong
provider lives with Serial0. Real application Serial references preserve normal
archive extraction, constructors and original default-pin setup.

Upstream patch: espressif/arduino-esp32#13010

This repo integrates the immutable patched source archive with matching IDF 5.5.5
profiles for esp32dev, esp32s3 and esp32p4. P4 moves from IDF 5.5.1 to 5.5.5;
legacy IDF 4.4 profiles remain on their existing framework. No installed SDK edits,
NO_GLOBAL_SERIAL flags, new public library APIs or new workflow files.

Matched P4 results

Pristine versus patched Arduino 3.3.11, same IDF 5.5.5/GCC 14.2 and FastLED source.
All six controls built from public immutable framework archives.

Application Build flash delta Static RAM delta Attributed flash delta
Native UART, no app Serial -22,040 B -1,096 B -22,031 B
Native USB CDC, no app Serial -28,418 B -1,128 B -28,311 B
Explicit app Serial0 +26 B 0 B +26 B

bash bloat confirms no sized Serial0/HardwareSerial owners in native controls
and preserved real Serial0/startup-provider ownership in the explicit control.
Residual String through chip debug reporting and Stream through AutoResearch OTA
filesystem are independent owners, not claimed eliminated.

Physical runtime and test evidence

  • Classic ESP32 matched native-only AutoResearch: free heap 71,512 → 72,124 B
    (+612 B); zero per-cycle retention and valid integrity in all five cycles
    before and after. Build flash -11,472 B, static RAM -368 B.
  • Matched explicit Serial0 AutoResearch: 71,468 B free heap before and after,
    zero per-cycle retention in all five cycles. Static RAM unchanged; build
    flash +28 B (attributed flash +26 B).
  • Durable bash autoresearch esp32dev --serial-startup tests default pins,
    explicit GPIO16/17 changes and restoration, both initialization orders,
    exact alternating output, native-only symbol ownership and warm heap.
    The ELF provenance/path/hash gate binds bloat evidence to deployed firmware.
  • All three final consolidated modes pass five physical cycles each.
  • Real P4 ELF ownership RED → GREEN, profile/CLI RED → GREEN, and review-found
    output reordering/unexpected Arduino record regressions RED → GREEN.
  • Full Python: 2,022 passed, 47 skipped, 2 xfailed, 3,280 subtests passed.
  • Focused profile/CLI tests: 15 passed. Full bash lint passed.
  • Normal P4 and S3 Blink builds passed with production pins.
  • Independent code review findings fixed and re-reviewed.

See docs/ESP32_FRAMEWORK_SERIAL.md for full totals, separate accounting methods,
scope and reproducible hardware commands. Physical native USB runtime/heap and
ownership/reconnect matrix remain #4893; P4 compile/link is not physical USB
evidence. Full stack/master ci-full remains required before merging.

@zackees zackees added the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Oct 22, 2026
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · 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 commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Closing under the maintainer requirement that FastLED work with stock, unpatched Arduino/ESP-IDF installations. This PR installs a forked Arduino framework archive at 8ec18a5aee996356e906a759dbcc1e12b46fb0aa; its Serial0 footprint reduction depends on replacing the framework-owned strong startup reference with an optional hook. FastLED alone cannot eliminate that strong reference in stock framework startup. The custom framework dependency and claimed saving will not be merged. The stock-compatible storage, SPI, and lint changes remain separate PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run the complete release-equivalent CI matrix on this PR SHA

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant