From 69ca7ade866ab039bb7a40459b503a2ee68816a5 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Sat, 17 Oct 2026 14:00:56 +0300 Subject: [PATCH] ci: measure ipcinfo growth by its sections, not its page-rounded file size The budget compared stat -c %s of ipcinfo before and after. That file is page-quantised: the RW segment's file offset has to equal its address modulo 4096, so it jumps a whole page whenever the code in front of it crosses a boundary. On master the code segment ends exactly where the data segment begins (0xae68 both), so the slack is zero bytes. A change adding 12 bytes of code (#249) and one adding 24 (#250) each "grew" ipcinfo by 4096 and failed the 1024-byte budget. Measure text + data + bss from size(1) instead: what the camera loads, growing by the bytes the change adds. With the CI toolchain those two PRs measure +12 and +24. --- .github/workflows/pr-build-check.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-check.yml b/.github/workflows/pr-build-check.yml index 2acdafa..0f741a9 100644 --- a/.github/workflows/pr-build-check.yml +++ b/.github/workflows/pr-build-check.yml @@ -70,6 +70,13 @@ jobs: # the boards use -- so an absolute ceiling here would describe no # shipped binary and would go stale the moment that URL moves. A # delta does not care which compiler measured it. + # + # The quantity is text + data + bss from size(1), not the file size. + # The file is page-quantised: the RW segment's file offset must equal + # its address modulo 4096, so it moves a whole page the moment the + # code before it crosses a boundary. On 5d678de the code segment ended + # exactly where the data segment began (both 0xae68), and a PR adding + # 12 bytes of code grew the file by 4096 and failed the budget. if: matrix.target == 'arm32' run: | export PATH=/opt/${{ matrix.toolchain_dir }}/bin:$PATH @@ -80,7 +87,8 @@ jobs: -DBUILD_SHARED_LIBS=ON -DSKIP_VERSION=ON \ -DIPCHW_VENDORS="$2" > /dev/null cmake --build "$out" --target ipcinfo > /dev/null - stat -c %s "$out/ipcinfo" + cc=${{ matrix.cc }} + "${cc%gcc}size" "$out/ipcinfo" | awk 'NR == 2 { print $4 }' } git worktree add -f /tmp/ipcinfo-base \ "${{ github.event.pull_request.base.sha }}" > /dev/null