Skip to content

fix(ci): size the firmware budget to each variant's own app partition - #1891

Open
clonea1 wants to merge 2 commits into
ruvnet:mainfrom
clonea1:contrib/firmware-size-gate
Open

clonea1 wants to merge 2 commits into
ruvnet:mainfrom
clonea1:contrib/firmware-size-gate

Conversation

@clonea1

@clonea1 clonea1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

firmware-ci.yml applies size_limit_kb: 1152 to all three build variants, whose ota_0 slots are very different sizes:

variant partition table ota_0 slot old limit new limit
esp32s3 / 8mb partitions_display.csv 2.00 MB (2048 KB) 1152 1638
esp32s3 / 4mb partitions_4mb.csv 1.81 MB (1856 KB) 1152 1484
esp32c6 / c6-4mb partitions_4mb.csv 1.81 MB (1856 KB) 1152 1484

New limits are ~80% of each slot, with size_warn_kb at ~90% of the limit, so real headroom is preserved rather than removed.

The current gate is not a hardware limit. main builds the 8MB variant at 1,171,248 bytes: 99.3% of the 1152 KB gate, but only 56% of the 2 MB partition it actually flashes into. Any feature addition trips a ceiling roughly half the size of the available space, which is what happened on #1827.

No other workflow logic is changed.

🤖 Generated with claude-flow

https://claude.ai/code/session_01PVWMiHQifoYXL7uL3bphrZ

All three matrix entries shared size_limit_kb=1152 regardless of their
actual ota_0 partition size, so the gate was meaningless for the two
variants whose slots are far larger than 1152 KB and correspondingly
loose for none of them in the way that mattered: it does not track
what "leaves headroom for OTA" actually means per partition table.

Set each variant's limit to ~80% of its own ota_0 slot and the warn
threshold to ~90% of the new limit:

  esp32s3 / 8mb   (partitions_display.csv, ota_0 0x200000 = 2048 KB) -> 1638 / 1474
  esp32s3 / 4mb   (partitions_4mb.csv,      ota_0 0x1D0000 = 1856 KB) -> 1484 / 1335
  esp32c6 / c6-4mb (partitions_4mb.csv, same table as esp32s3/4mb)    -> 1484 / 1335

Verified each variant's partition_table_name against the matrix before
computing its number rather than assuming; c6-4mb shares partitions_4mb.csv
with esp32s3/4mb, not a distinct C6 table.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01PVWMiHQifoYXL7uL3bphrZ
…zing

main had independently bumped the 8mb variant's size_limit_kb from 1152 to
1200 (dbaa3c7) as a stopgap while 4mb/c6-4mb stayed at 1152, conflicting
with this branch's bb22a8c fix that sizes every variant to ~80%/90% of its
own ota_0 OTA slot. Resolved by keeping the slot-based numbers (8mb
1638/1474 KB; 4mb and c6-4mb 1484/1335 KB), re-derived directly from
partitions_display.csv (ota_0 0x200000 = 2048 KiB) and partitions_4mb.csv
(ota_0 0x1D0000 = 1856 KiB) rather than trusting the prior commit's math,
which the CSVs happen to confirm exactly.

Co-Authored-By: claude-flow <ruv@ruv.net>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant