Skip to content

esp32dev binary-size gate red on master since #4387: Blink 340,235 B vs frozen 340,000 B #4402

Closed

Description

@zackees

check_esp32_size has failed on every master push since 2026-09-12 04:26. It is not flaky and it is not a tooling fault — the gate is working.

esp32dev size 340235 is greater than max size 340000
##[error]Compiled size exceeds maximum allowed size

235 B over. Raising the number is explicitly forbidden, so this needs a decision rather than a patch.

Attribution

run commit result
04:05 fix(bloat): analyse the ELF the build produced (#4386) success
04:26 feat(color): let HD108 consume the device drive (#4387) failure
05:34 → 08:38 every push since failure

It is cumulative rather than a single overshoot. #4368 (16-bit encoders consume the device drive, +231 B on esp32s3) landed at 03:38 and still passed; #4387 (+240 B on esp32s3) was the one that crossed. Both raised tests/data/esp32s3_bloat_baseline.txt with symbol-level justification. Neither updated this gate, because nothing connects the two — and check_esp32_size runs only on push to master, so neither PR could have gone red before merging.

Both PRs are mine; this is a regression I introduced and did not notice.

Why I have not just fixed it

.github/workflows/check_esp32_size.yml says, in the file:

FROZEN SIZE THRESHOLD — DO NOT RAISE TO MAKE CI GREEN. … The matching CodeRabbit rule … flags any raise as HIGH severity and requires an explicit issue reference + maintainer sign-off.

and ci/lint/check_size_thresholds.py is blunter still:

CI agents have repeatedly tried to "fix" red size-check workflows by raising the max_size thresholds instead of fixing the underlying regression. … the friction of touching two places in one PR forces a maintainer to actually consider whether the raise is justified.

That is this situation exactly, so the threshold stays where it is until someone decides otherwise. This issue is the "explicit issue reference" that policy asks for.

The options, with what each costs

  1. Sign off on a raise. The growth is the documented cost of the P8 deliverable: 16-bit encoders and HD108 now consume the solved device drive instead of an 8-bit copy widened by a gamma curve — a managed UCS7604-16 channel was putting 849 on the wire where the solve asked for 13933. If that cost is accepted, max_size moves here and in FROZEN_THRESHOLDS in ci/lint/check_size_thresholds.py (the mirror-lock fails bash lint otherwise), with this issue linked.

  2. Reclaim the bytes. The esp32s3 symbol diff attributes the feat(color): let HD108 consume the device drive too (P8, #4042/#4326) #4387 cost to PixelIterator::writeHD108<vector_psram<u8>> (+255 B) and PixelIterator::loadAndScaleRGB16 (+72 B), minus ~87 B recovered. These are statically reachable because fl::Channel::showPixels keeps every write* reference live so the encoder bodies link — the same reason UCS7604 has -DFASTLED_DISABLE_UCS7604=1. Making that set link-on-demand is P9 tree-shaking work, not a small patch.

  3. Defer the HD108 wide path until 2 lands. Cheapest for the gate, but gives back a P8 acceptance criterion ("native 16-bit encoders consume wide output").

Unknown

Whether max_size_apa102: 330000 is also breached. The job fails fast on the Blink step, so the Apa102 build never runs and its current size has not been measured since the regression.

Also worth fixing separately

The Blink step's failure is buried under ~20 lines of Error: ELF path … does not exist from the continue-on-error inspect steps, which look like the cause and are not. Those probe .pio/build/esp32dev/firmware.elf while the build produces an fbuild artifact — the same two-layout confusion fixed for bash bloat in #4386.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

Activity

  1. zackees commented on Sep 12, 2026

    @zackees
    MemberAuthor

    Partial progress merged in #4403: 340,235 → 340,183 B, 52 B of the 235 B needed. Still 183 B over; this stays open and master stays red on this gate.

    What came out, per the maintainer's call to reclaim bytes rather than raise the ceiling:

    hd108BrightnessHeader is (void)brightness_8bit followed by three constexpr gains of 31 — it returns 0xFF 0xFF for every input. Both HD108 encode paths were computing a brightness to feed it. encodeHD108_HD cached that constant per LED and dereferenced brightness_first each LED to feed the cache, through ScaledPixelIteratorBrightness, whose load() is out of line — a call per LED for a number that reached nothing. writeHD108's managed path built that adapter for the same purpose. With both gone the two encoders are the same function, so the call site collapsed to one.

    Output is unchanged by construction, not by measurement: every removed value fed only an argument cast to void. Two tests pin it.

    Measured on esp32s3 too: −66 B, baseline lowered to 342891.

    What is blocking the remaining 183 B

    The Symbol Analysis step in build_template_binary_size.yml reports Total symbols: 0 for esp32dev:

    Analyzing ELF file: .../.build/pio/esp32dev/.pio/build/esp32dev/firmware.elf
    Error running command: ...xtensa-esp32-elf-readelf -s ...  Exit code: 1
    Error running command: ...xtensa-esp32-elf-nm --print-size --size-sort ...  Exit code: 1
    Found 0 total symbols using enhanced analysis
      Total symbol size: 0 bytes (0.0 KB)
    

    It probes the PlatformIO layout while the build produces an fbuild artifact under .fbuild/, so every tool call exits 1 and the report comes out empty — under continue-on-error: true, so nothing says so. inspect_binary.py and inspect_elf.py fail the same way, and their Error: ELF path ... does not exist lines are what make a size-cap breach look like a tooling fault in the log.

    This is the same two-layout confusion fixed for bash bloat in #4386, and ci/compiled_size.py::_find_fbuild_elf already has the logic these tools need.

    Until that is fixed, finding the remaining 183 B is guesswork — which is how the second change in #4403 came to save 4 B where it looked like it should save a few hundred. Fixing the diagnostics is the next step here.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

  2. zackees commented on Sep 12, 2026

    @zackees
    MemberAuthor

    Diagnostics fixed in #4404. The esp32dev symbol report now works:

    Analyzing ELF Total symbols
    before .build/pio/esp32dev/.pio/build/esp32dev/firmware.elf 0 (0 bytes)
    after .build/pio/esp32dev/.fbuild/build/release/firmware.elf 4,780 (273.0 KB)

    A naming trap worth recording

    .build/pio/<board>/ reads like a PlatformIO directory and is not one — both backends write into it. ci/check_backend_flag_drift.py says so directly:

    both backends write into the same .build/pio/<board>/ directory because that's the convention

    The backend is the inner directory: .fbuild/ or .pio/. Every board in a local tree has both. So a path can contain pio twice and still be the fbuild artifact, and reading the outer one as the backend gets it exactly backwards.

    The log could not settle that question, which is now also fixed

    ci-check-compiled-size.py captured ci.compiled_size's output and used it only for a regex, so the one line that names the measured artifact never reached the log. It is echoed now:

    [compiled_size] measured fbuild ELF: .build/pio/esp32dev/.fbuild/build/release/firmware.elf (text+data=340183 B)
    Firmware size for esp32dev: 340183 bytes
    

    measured fbuild ELF, not falling through to pio size — so the gate's number and the symbol report are the same fbuild binary, stated rather than inferred.

    Where this leaves the issue

    Still 340,183 B against the 340,000 B ceiling — 183 B over, and master stays red on this gate. But the symbol report is now usable for finding them, which it was not when #4403 went hunting and turned up 4 B where a few hundred looked likely.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

  3. zackees commented on Sep 12, 2026

    @zackees
    MemberAuthor

    Gate back under the ceiling with #4407, merged as 4d2c468.

    esp32dev Blink esp32s3 Blink
    when this was filed 340,235 B (235 over) 342,957 B
    #4403 — drop dead brightness work 340,183 B 342,891 B
    #4407 — one loop in writeHD108 339,955 B (45 under) 342,709 B

    writeHD108 itself: 481 → 280 B. It had been two complete loops with duplicated framing, and the (now working, #4404) symbol report showed it as the largest encoder body in a Blink build — larger than writeWS2812, the only encoder Blink runs. Byte-identical by construction and pinned by a test that drives both paths through a real PixelIterator with binary dither on and a GRB order.

    The ceiling was never raised. Closing once master's own check_esp32_size run confirms the PR measurement on the merged tree.

    Follow-up worth its own issue, not this one

    The same report shows ~5.9 KB of per-colour-order code, of which a sketch uses one order: PixelIteratorAny holds a variant of six PixelController<EOrder> instantiations, each with a full vtable set (~870 B) plus a 127 B visit thunk. loadByte, dither, scale and loadAndScaleRGBW all compute per source channel and then permute, so a single PixelController<RGB> plus a runtime 3-byte permutation in the type-erased layer would be byte-identical. It touches the legacy hot path and the RGBW w_placement ordering, so it needs a design pass and an all-six-orders equivalence test — a separate PR, and unrelated to #3947's encoder-dispatch question.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01MLhWkMfzLjrnLTDMBE6Fj9

  4. zackees commented on Sep 12, 2026

    @zackees
    MemberAuthor

    master's own check_esp32_size run on 4d2c468 is green (run 34723724588). Blink 339,955 B against the unchanged 340,000 B ceiling; Apa102 325,487 B against 330,000 B. Closing. The ~5.9 KB per-colour-order follow-up is being done as its own PR.

  5. moved this from Triage to Done in FastLED Trackeron Sep 12, 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