Repository navigation
perf(build): cut include cost, drop PlatformIO, ban stdlib subprocess - #4412
Merged
Merged
Conversation
Include-graph changes measured with clang -ftime-trace on host (median of 5): Blink TU 1.07 s -> 0.63 s, fl.gfx unity TU 2.03 s -> 1.65 s, fl.math unity TU 1.24 s -> 0.98 s, tests/fl/math/math.cpp 0.70 s -> 0.38 s. - fl/math/sin32.h no longer includes fl/math/simd.h; the four-lane sincos32_simd() moved to the new fl/math/sin32_simd.h (crgb.h -> ease.h -> fixed_point -> sin32 -> immintrin was 31% of every TU). - fl/stl/ostream.h forward-declares CRGB; operator<<(const CRGB&) is defined in ostream.cpp.hpp. - FastLED.h forward-declares UIAudio through fl/audio/audio_manager.h instead of pulling fl/ui/ui.h into every library TU, and fl/remote/remote.h is now opt-in for sketches (FL_INCLUDE_REMOTE, or include it directly). The Remote example and AutoResearch include it themselves. - fl::make_index_sequence builds in log depth (the 256-level recursion for the gamma LUT cost ~50 ms per TU). Build scripts: - build_info[_example].json is derived from fbuild's own outputs (build_info_<env>.json, else compile_commands.json + firmware.elf) instead of the PlatformIO metadata call (4.3 s per example; a warm no-change compile of esp32s3 Blink is now 2.0 s). - The libfastled build lock is keyed per build directory. - get_meson_executable() finds the venv executable on Linux/macOS, so the version-check mtime fast path applies (0.35 s per bash test). PlatformIO purge: the PlatformIO tool is gone from ci/, workflows, docs and tooling; fbuild is the only board backend. Board builds live under .build/fbuild/<board>. ci/lint/banned_build_tools.py fails bash lint on any spelling of the tool's name outside the documented allowlist (the project file name platformio.ini, PLATFORMIO_SRC_DIR, RP2040/SAM PIO peripheral code). The stdlib subprocess module is banned outright: every call site uses RunningProcess, and ci/lint_python/subprocess_capture_checker.py has no baseline and no noqa escape (SRC007 covers imports and attribute references; SRC004 also applies to RunningProcess captures without encoding=). Two GCC-16-specific codegen tests are marked xfail on fbuild's GCC 14.2 pico toolchain (see comments in the tests). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01M9rUkvoW2gVKYurtQJpi4i
|
Important Review skippedToo many files! This PR contains 340 files, which is 40 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (340)
You can disable this status message by setting the 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 |
- Missing executables raise RuntimeError under RunningProcess; the "tool not installed" fallbacks in wasm_build, autoresearch/net, ci-iwyu, compiled_size and bloat now catch it. - ESP32 build_info aliases resolve to fbuild's GNU xtensa/riscv binutils (found by the --target triple) instead of host llvm-* tools. - codec_cpu audit: match fbuild's toolchain directory names. - build_clone_and_compile.yml builds the root project's default env only, as the job did before. - Codegen tests end an objdump symbol body at the next header (captured output no longer carries blank lines). - tests/profile sincos32 sources include fl/math/sin32_simd.h. - subprocess ban: see through `import subprocess as sp`, `import os as o` and `from os import system/popen`. - rust_bridge captures stderr separately so Rust panics are shown. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01M9rUkvoW2gVKYurtQJpi4i
zackees
added a commit
that referenced
this pull request
Sep 13, 2026
The 3-way shard was added while fbuild rebuilt the framework for every sketch (FastLED/fbuild#1411/#1413, fixed in fbuild 2.5.22). Each shard now duplicates 5-8 minutes of framework + library warm-up on its own runner; measured on #4412's runs the per-example cost after warm-up is ~14 s, so one serial sweep is cheaper in runner minutes and comparable in wall clock. Claude-Session: https://claude.ai/code/session_01M9rUkvoW2gVKYurtQJpi4i Co-authored-by: Claude Fable 5.1 <[email protected]>
zackees
added a commit
that referenced
this pull request
Sep 14, 2026
- Bloat regression: re-baseline esp32s3 Blink to 390453 B. Since #4412 the gate builds through fbuild instead of the removed backend; CI measured exactly 390,453 B on all four runs since and 336,465 B on every run before, so the step is the backend switch, not code growth. The reason is recorded in the baseline file. - Project sync: ci/github_project_sync.py calls the GitHub GraphQL API with urllib instead of spawning the gh CLI. It runs in the pull_request_target job with a bare setup-python and no dependencies, so the running_process import from the subprocess ban made it crash on every PR and issue event. - Unit tests: the esp32s3 workflow test asserted the removed 3-way shard matrix; it now pins one job with smoke on PRs and all on master. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01M9rUkvoW2gVKYurtQJpi4i
This was referenced Sep 14, 2026
zackees
added a commit
that referenced
this pull request
Sep 18, 2026
…acros (#4427) The SparkFun XRP controller's pins_arduino.h (arduino-pico) defines S1..S4 as servo pin macros. index_sequence_concat, added with the log-depth make_index_sequence in #4412, used S1/S2 as its template parameter names. The macros expanded them and every sketch on that board failed to compile. The rp2350B SparkfunXRP workflow has been red on master since. Rename them to LhsSeq/RhsSeq (and the I1/I2 packs to Lhs/Rhs). Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Sep 18, 2026
project_drift_sync.yml checks out ci/ with a bare setup-python and installs nothing. When stdlib subprocess was banned (#4412), github_project_drift_sync.py moved onto running_process, which that job does not have, so every nightly run died with ModuleNotFoundError. #4418 fixed the sibling github_project_sync.py by talking to the API with urllib; do the same here. - graphql() POSTs over HTTPS with GH_TOKEN. It still exits on GraphQL errors, as `gh api graphql` did; the mutation callers catch that. - fetch_repo_items() uses the REST issues endpoint, which lists PRs too (marked by pull_request), capped at 1000 per kind as before. Add a test that both project scripts import only the standard library, so this fails on a pull request rather than in a scheduled job. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Sep 18, 2026
* fix(ci): run project drift sync on the standard library project_drift_sync.yml checks out ci/ with a bare setup-python and installs nothing. When stdlib subprocess was banned (#4412), github_project_drift_sync.py moved onto running_process, which that job does not have, so every nightly run died with ModuleNotFoundError. #4418 fixed the sibling github_project_sync.py by talking to the API with urllib; do the same here. - graphql() POSTs over HTTPS with GH_TOKEN. It still exits on GraphQL errors, as `gh api graphql` did; the mutation callers catch that. - fetch_repo_items() uses the REST issues endpoint, which lists PRs too (marked by pull_request), capped at 1000 per kind as before. Add a test that both project scripts import only the standard library, so this fails on a pull request rather than in a scheduled job. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(ci): address review on project drift sync - _request(): no default for data; the GET call site passes data=None. - Handle KeyboardInterrupt first in the request try block and notify the main thread with _thread.interrupt_main(), which is stdlib, so the script still imports nothing outside the standard library. - Annotate self in the stdlib-only test. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This was referenced Sep 18, 2026
zackees
added a commit
that referenced
this pull request
Sep 18, 2026
esp_extra_libs has failed on master since #4412 moved it from PlatformIO to `fbuild ci/kitchensink build`: build error: package error: library 'FS' not found in registry Three PlatformIO-only constructs in ci/kitchensink/platformio.ini: - FS, ArduinoOTA and ESPmDNS in lib_deps. They ship inside the ESP32 Arduino core; fbuild sends them to the registry (FastLED/fbuild#1442). Drop them; the LDF finds them from the sketch's #includes. - src_dir = symlink://../../../src plus the FASTLED_STUB_MAIN_INCLUDE_INO wrapper, which fbuild does not honour, so FastLED.h was not found. Use the root project's layout instead: the sketch is the source and FastLED comes in as FastLED=symlink://../../. - ArduinoJson becomes bblanchon/ArduinoJson (owner-qualified). With these, FastLED, WiFi, ESPmDNS, ArduinoOTA, AsyncTCP and ESPAsyncWebServer all resolve and link. The remaining failure is ArduinoJson.h not on the include path: fbuild fetches the header-only package but never adds it (FastLED/fbuild#1441). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Sep 18, 2026
esp_extra_libs has failed on master since #4412 moved it from PlatformIO to `fbuild ci/kitchensink build`: build error: package error: library 'FS' not found in registry Three PlatformIO-only constructs in ci/kitchensink/platformio.ini: - FS, ArduinoOTA and ESPmDNS in lib_deps. They ship inside the ESP32 Arduino core; fbuild sends them to the registry (FastLED/fbuild#1442). Drop them; the LDF finds them from the sketch's #includes. - src_dir = symlink://../../../src plus the FASTLED_STUB_MAIN_INCLUDE_INO wrapper, which fbuild does not honour, so FastLED.h was not found. Use the root project's layout instead: the sketch is the source and FastLED comes in as FastLED=symlink://../../. - ArduinoJson becomes bblanchon/ArduinoJson (owner-qualified). With these, FastLED, WiFi, ESPmDNS, ArduinoOTA, AsyncTCP and ESPAsyncWebServer all resolve and link. The remaining failure is ArduinoJson.h not on the include path: fbuild fetches the header-only package but never adds it (FastLED/fbuild#1441). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Sep 18, 2026
* chore(deps): pin fbuild 2.5.24 fbuild 2.5.24 carries the fixes for three CI jobs that went red when FastLED moved to fbuild (#4412): - clone and compile: .ino conversion hoisted Sailboat's Teensy-only `#include <Audio.h>` out of its #if (FastLED/fbuild#1440). - esp_extra_libs: relative project dirs broke downloaded-library include paths (FastLED/fbuild#1441), core-bundled lib_deps went to the registry (FastLED/fbuild#1442), and the pioarduino 51.x pin hit a 404 toolchain URL (FastLED/fbuild#1446). The kitchensink .ini port is #4429. - ThingPlusMatter_mgm240s: silabs-core submodules (FastLED/fbuild#1439). Verified locally with the released wheel: `fbuild build` on the root project (Sailboat, esp32s3) builds from clean and links at 1.07 MB. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore(deps): claim fbuild 2.5.24's ESP32-S3 saving; drop a banned tool name - The bloat gate measured ESP32-S3 Blink at 382,766 B, 7,706 B under the 390,472 B baseline. The saving comes from FastLED/fbuild#1434 (core linked as an archive, no -fno-omit-frame-pointer on Xtensa, __FILE__ prefix map); record it. - The pin history comment named the legacy build tool, which banned_build_tools rejects; reword it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Three things, all from the build-speed investigation earlier today:
Include-graph fixes (items 1, 2, 3 of the ledger) — measured per translation unit on host with
clang -ftime-trace, median of 5 runs, no PCH:fl.gfx+.cppunity TUfl.math+.cppunity TUtests/fl/math/math.cppfl/math/sin32.hno longer includesfl/math/simd.h; the four-lanesincos32_simd()lives in the newfl/math/sin32_simd.h. Thecrgb.h → ease.h → fixed_point → sin32 → immintrinchain was 31% of every TU.fl/stl/ostream.hforward-declaresCRGB; theoperator<<(const CRGB&)body moved toostream.cpp.hpp.FastLED.hgetsUIAudiofromfl/audio/audio_manager.h(a forward declaration) instead of pullingfl/ui/ui.hinto every library TU.fl/remote/remote.his now opt-in for sketches: include it directly or defineFL_INCLUDE_REMOTE.examples/Remoteand AutoResearch include it themselves.fl::make_index_sequencebuilds in log depth; the 256-deep recursion for the gamma LUT cost ~50 ms per TU.Build-script fixes (item 5):
build_info[_example].jsonis derived from fbuild's own outputs (build_info_<env>.jsonwhen fbuild emits it, elsecompile_commands.json+firmware.elf). The PlatformIO metadata call that produced it cost 4.3 s per example. A warm no-changebash compile esp32s3 --examples Blinkis now 2.0 s.get_meson_executable()finds the venv executable on Linux/macOS (it only knew the WindowsScripts/layout), which lets the version-check mtime fast path skip a 0.35 s child process on everybash test.PlatformIO is gone and the stdlib
subprocessmodule is banned.--backend/--platformio/--pioflags, the parity and flag-drift workflows and ~40 modules/tests are deleted; board builds live under.build/fbuild/<board>;pyproject.tomlno longer depends on theplatformiopackage.ci/lint/banned_build_tools.py: any spelling of the tool's name failsbash lint(error, no warn-only mode). Allowed: the project-file nameplatformio.ini, thePLATFORMIO_SRC_DIRenv var fbuild reads, RP2040/SAM PIO peripheral code, and a short list of user-facing docs.ci/lint_python/subprocess_capture_checker.pyis now a hard ban:import subprocess, anysubprocess.*reference,os.system,os.popenfail with no baseline and no# noqaescape. Every call site (~130 files) usesRunningProcess. SRC004 (capture withoutencoding=) now also applies toRunningProcesscalls.Verification (local)
bash lint: all stages green.bash test --cpp: 307/307 unit, 84/84 examples.pytest ci/tests tests: 1470 passed, 28 skipped, 2 xfailed.bash compile uno --examples Blink,bash compile esp32s3 --examples Blink,bash bloat esp32s3 --example Blink(fbuild ELF, no build flag) all succeed.Things to know
test_q16_inverse_calls_no_float_runtime,test_cortex_m33_divides_in_hardware) were written against GCC 16.1 from the old~/.platformiotoolchain. On fbuild's GCC 14.2 pico toolchain they fail (the Q16 inverse reaches the float runtime;s_divemits 4 divides instead of 2). They are markedxfailwith the reason; that is a real finding about the shipping toolchain worth its own issue.mcp_server.pydoes not import on this machine (installedmcpis 2.x, pinned>=1.12.2); pre-existing, untouched beyond the subprocess migration.RunningProcess.run(capture_output=True)merges stderr into stdout; call sites that need both streams passstdout=PIPE, stderr=PIPE.DEVNULLis not supported byrun().build_esp_extra_libs.ymlnow buildsci/kitchensinkwithfbuild; it needs one CI run to confirm fbuild honours that project'ssymlink://platform URL.ci/boards/*.jsonis now orphaned (only the deleted custom-board workflow read it).🤖 Generated with Claude Code
https://claude.ai/code/session_01M9rUkvoW2gVKYurtQJpi4i