Skip to content

ci: measure ipcinfo growth by its sections, not its page-rounded file size - #251

Merged
widgetii merged 1 commit into
masterfrom
ci-ipcinfo-size-by-sections
Oct 17, 2026
Merged

widgetii merged 1 commit into
masterfrom
ci-ipcinfo-size-by-sections

Conversation

@widgetii

Copy link
Copy Markdown
Member

The ipcinfo size budget in pr-build-check.yml compared the file size of ipcinfo before and after a PR. That number is page-quantised, and on current master it has no slack at all, so every PR that adds a single byte of code to ipcinfo fails it.

Why

  • Each load segment must sit at the same offset within its page in the file as in memory: the RW segment's file offset must equal its address modulo 4096.
  • On master (5d678de, CI's toolchain), the code segment ends at file offset 0xae68, and the data segment starts at exactly 0xae68.
  • Any growth of the code segment therefore pushes the data segment a whole page further into the file.
base   : LOAD 0x000000 0x00000000 ... 0x0ae68 R E    LOAD 0x00ae68 0x0000be68 ... RW
#250   : LOAD 0x000000 0x00000000 ... 0x0ae80 R E    LOAD 0x00be68 0x0000be68 ... RW

Reproduced with toolchain.hisilicon-hi3516cv100.tgz, the same configure as the job:

file text data bss text+data+bss
base 5d678de 47356 44367 1484 968 46819
#249 51452 (+4096) 44379 1484 968 46831 (+12)
#250 51452 (+4096) 44391 1484 968 46843 (+24)

Change

Measure text + data + bss from size(1) (its dec column) instead: what the camera actually loads, which grows by the bytes a change adds. The budget and the base-commit comparison are unchanged.

… 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.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Measure ipcinfo size-budget growth by sections

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Replace page-rounded file-size measurements with text, data, and bss totals to avoid false budget
 failures.
• Keep the base-commit comparison and 1024-byte budget unchanged.
Diagram

graph TD
  Base["Base commit"] --> Build["Build ipcinfo"] --> Size["Cross size"] --> Gate{"1024-byte budget"}
  Head["PR head"] --> Build
Loading
High-Level Assessment

Use the cross-toolchain size utility's section total. It avoids ELF file-padding jumps while preserving the existing base-relative check; parsing ELF sections directly would add complexity without improving this measurement.

Files changed (1) +9 / -1

Bug fix (1) +9 / -1
pr-build-check.ymlUse section totals for the ipcinfo growth check +9/-1

Use section totals for the ipcinfo growth check

• Replaces stat-based file-size measurement with the cross-toolchain size utility's decimal text-plus-data-plus-bss total. Documents why ELF page alignment produced false failures; the comparison and 1024-byte threshold are unchanged.

.github/workflows/pr-build-check.yml

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit ae293a2 into master Oct 17, 2026
5 checks passed
@widgetii
widgetii deleted the ci-ipcinfo-size-by-sections branch October 17, 2026 11:04
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