Repository navigation
Description
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_sizethresholds 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
-
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_sizemoves here and inFROZEN_THRESHOLDSinci/lint/check_size_thresholds.py(the mirror-lock failsbash lintotherwise), with this issue linked. -
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) andPixelIterator::loadAndScaleRGB16(+72 B), minus ~87 B recovered. These are statically reachable becausefl::Channel::showPixelskeeps everywrite*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. -
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
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
perf(hd108): call one encoder, not two copies of the same one (#4402)
chore(bloat): lock in the 66 B the HD108 cleanup recovered (#4402)
perf(hd108): stop computing a constant brightness header per LED (par…
zackees commentedon Sep 12, 2026
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:
hd108BrightnessHeaderis(void)brightness_8bitfollowed by threeconstexprgains of 31 — it returns0xFF 0xFFfor every input. Both HD108 encode paths were computing a brightness to feed it.encodeHD108_HDcached that constant per LED and dereferencedbrightness_firsteach LED to feed the cache, throughScaledPixelIteratorBrightness, whoseload()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.ymlreportsTotal symbols: 0for esp32dev: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 — undercontinue-on-error: true, so nothing says so.inspect_binary.pyandinspect_elf.pyfail the same way, and theirError: ELF path ... does not existlines 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 bloatin #4386, andci/compiled_size.py::_find_fbuild_elfalready 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
fix(ci): point the binary-size diagnostics at the ELF the build wrote (…
zackees commentedon Sep 12, 2026
Diagnostics fixed in #4404. The esp32dev symbol report now works:
.build/pio/esp32dev/.pio/build/esp32dev/firmware.elf.build/pio/esp32dev/.fbuild/build/release/firmware.elfA 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.pysays so directly:The backend is the inner directory:
.fbuild/or.pio/. Every board in a local tree has both. So a path can containpiotwice 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.pycapturedci.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:measured fbuild ELF, notfalling 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
chore(bloat): lock in the 182 B the one-loop HD108 encoder recovered (#…
perf(hd108): one loop for both sources, not two copies of the framing (…
zackees commentedon Sep 12, 2026
Gate back under the ceiling with #4407, merged as 4d2c468.
writeHD108writeHD108itself: 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 thanwriteWS2812, the only encoder Blink runs. Byte-identical by construction and pinned by a test that drives both paths through a realPixelIteratorwith binary dither on and a GRB order.The ceiling was never raised. Closing once master's own
check_esp32_sizerun 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:
PixelIteratorAnyholds avariantof sixPixelController<EOrder>instantiations, each with a full vtable set (~870 B) plus a 127 B visit thunk.loadByte,dither,scaleandloadAndScaleRGBWall compute per source channel and then permute, so a singlePixelController<RGB>plus a runtime 3-byte permutation in the type-erased layer would be byte-identical. It touches the legacy hot path and the RGBWw_placementordering, 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
zackees commentedon Sep 12, 2026
master's own
check_esp32_sizerun 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.chore(bloat): lock in the 6,245 B one controller per channel recovered (
perf(channels): one PixelController per channel, not one per colour o…