Skip to content

Re-baseline the uniffi iOS and Android size budgets - #1414

Merged
pblazej merged 1 commit into
mainfrom
blaze/bump-uniffi-size
Sep 9, 2026
Merged

pblazej merged 1 commit into
mainfrom
blaze/bump-uniffi-size

Conversation

@pblazej

@pblazej pblazej commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The livekit-uniffi 0.1.10 release failed both size gates (run):

Gate Measured Old limit New limit Headroom
iOS (ios-arm64 framework binary) 1433 KiB 1152 KiB 1600 KiB 11.6%
Android (arm64-v8a .so) 1544 KiB 1536 KiB 1728 KiB 11.9%

These are two different failures.

iOS had a stale budget. Data streams v2 (#1286) measured the arm64-v8a slice and bumped ANDROID_SIZE_LIMIT_BYTES from 1280 KiB to 1536 KiB, but left SPM_SIZE_LIMIT_BYTES untouched at 1152 KiB. The same async foreign-trait machinery landed in the iOS slice too — Android's new budget absorbed it and iOS's did not, so the iOS limit had been a week stale by the time the release cut. The 281 KiB overage is that change arriving against an unbumped budget, not a new regression.

Android was ordinary creep, missing by 8 KiB.

Both limits are now re-baselined on the measured 0.1.10 sizes with 10% headroom, rounded up to a 64 KiB boundary, and each comment records the measurement it came from so the next bump has a baseline to reason from.

Worth a follow-up

The reason a forgotten bump stayed invisible for a week is that these gates only ever run at release time: uniffi-packages.yml triggers on release: [published] / workflow_dispatch, and uniffi-swift.yml / uniffi-android.yml are workflow_call-only. No PR executes swift-check-size, so a stale budget surfaces only once a release tag is already cut. Moving the gates earlier isn't free — it means building the xcframework and AAR on PRs touching livekit-uniffi (~8 min each in the release run), so it wants a path filter rather than running repo-wide. Left out of this patch deliberately.

@pblazej
pblazej requested a review from ladvoc as a code owner September 9, 2026 06:52
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Changeset ✓

This PR includes a changeset covering all affected packages:

Package Bump
livekit-uniffi patch

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

The livekit-uniffi 0.1.10 release failed both size gates. Data streams v2
(#1286) bumped only ANDROID_SIZE_LIMIT_BYTES, leaving the iOS budget at
1152 KiB while the same async foreign-trait machinery landed in that slice
too, so it measured 1433 KiB. Android was a separate, ordinary 8 KiB of
creep past its 1536 KiB limit at 1544 KiB.

Both limits are re-baselined on the measured 0.1.10 sizes with 10% headroom,
rounded up to a 64 KiB boundary.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pblazej
pblazej force-pushed the blaze/bump-uniffi-size branch from 18bd072 to 31ecd85 Compare September 9, 2026 07:05
@pblazej
pblazej requested review from 1egoman and davidliu September 9, 2026 07:05
@pblazej
pblazej merged commit cd44ef0 into main Sep 9, 2026
23 checks passed
@pblazej
pblazej deleted the blaze/bump-uniffi-size branch September 9, 2026 09:30
lukasIO added a commit that referenced this pull request Nov 4, 2026
The 0.13.3 Swift and Android packages were not published, because both
size gates failed in the "UniFFI packages" run for
`livekit-ffi/v0.13.3`. The iOS `ios-arm64` framework binary is 1926 KiB,
against a limit of 1600 KiB. The Android `arm64-v8a` `.so` is 2145 KiB,
against a limit of 1728 KiB. The growth comes from the signaling client
(#1521), which joined `core-modules` in 0.13.3. Swift and Android cannot
use the signaling client until a package with it is published.

## Change

Both budgets are re-baselined on the measured 0.13.3 sizes, with 10%
headroom rounded up to 64 KiB, as in #1414. `SPM_SIZE_LIMIT_BYTES` goes
to 2176 KiB, and `ANDROID_SIZE_LIMIT_BYTES` goes to 2368 KiB. Each
comment records its baseline. The changeset bumps `livekit-ffi` as a
patch, so the next release has the new budgets and can publish both
packages.

## Verified

I built the release slices locally with the same flags as CI:
`--no-default-features --features core-modules`, and `cargo ndk` with
`-C force-unwind-tables=no` for Android.

| Build | iOS dylib | Android `.so` |
|---|---|---|
| `livekit-ffi/v0.13.2` | 1448 KiB | 1557 KiB |
| `main` without the signaling module | 1484 KiB | 1592 KiB |
| `main` | 1926 KiB | 2146 KiB |

- The `main` sizes match the CI run to within 0.1%.
- Signaling adds 443 KiB on iOS and 554 KiB on Android. All other
changes since 0.13.2 add about 35 KiB.
- `cargo bloat --crates` on iOS shows that the code section grows by 266
KiB. The largest parts are `livekit_signaling` (81 KiB), `url` with
`idna` and `icu_normalizer` (49 KiB), `std` (34 KiB) and
`livekit_protocol` (21 KiB). The rest of the growth is data and unwind
tables.
- `livekit-signaling` enables the tokio features `net`, `signal` and
`io-util` but does not use them. Removing them saved less than 1 KiB on
iOS and 13 KiB on Android, so this PR does not change them.

## Not done yet

- `url` brings in the Unicode IDNA tables. Pinning `idna_adapter` to its
ASCII-only version can remove part of this cost, but it changes how
non-ASCII hostnames parse. I did not measure it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants