Skip to content

perf(build): reuse native configurations and shared input graphs - #301

Closed
f0rr0 wants to merge 8 commits into
f0rr0/native-bazel-releasefrom
f0rr0/bazel-native-configuration-reuse
Closed

f0rr0 wants to merge 8 commits into
f0rr0/native-bazel-releasefrom
f0rr0/bazel-native-configuration-reuse

Conversation

@f0rr0

@f0rr0 f0rr0 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Superseded by #297, which contains these changes plus required Apple shipping regression checks and the current migration base. The completed Android measurement at f4fee98 is preserved in run 39257722374: the full package/device phase passed all 11 tests in 70m17s, versus 98m31s at e1b5e65 (28.7% lower elapsed time). Its authenticated artifact 12197041283 and installed-device artifact 12196462073 retain the source/tree and 39-extension ICU/lifecycle proof. The remaining superseded run was cancelled after that result to avoid duplicate construction.

Android release carriers, packaged inputs and APK native dependencies used different Bazel configurations, rebuilding the same libraries. Use the pinned upstream Android ABI split, share Linux producer configurations for packaged inputs, and carry registration plus the actual C++ library at the native compatibility floor. Raising an app's Java/Dex minimum SDK now reuses the released native libraries.

The Android reuse check compares actual selected archive Files for both ABIs at the app minimum SDK and a higher minimum. The strengthened Apple check requires every profile in both raw and framework branches. Both derive membership from existing carrier metadata; neither maintains object-file lists. Full qualifications and configured CI requests retain stock compact execution logs, including Linux diagnostic uploads.

Input capture also repeatedly sorted long shared SDK paths for each action. Rank paths once per graph and sort compact numeric ranks, then hash the same complete sorted path strings. The representative Apple projection falls from 36.5 to 16.5 seconds without profiling, with its complete serialized hash unchanged.

This stacks on #297. That PR's cold macOS measurement has completed: its 17 tests passed in 4 h 45 min with zero disk hits, and the five-hour job limit interrupted later capture. It integrates the migration branch's shared input traversal, physical/publication mode separation, authenticated retained executions, stock Merkle-tree reuse and targeted 4 GiB cache budgets for the three largest Linux/macOS cohorts. No tool/rule repins, custom cache service, removed qualification checks or shipping Xcode change.

Validation:

  • Same 94 shipping/qualification roots: planned C/C++ actions fall from 30,361 to 14,018 (53.8% fewer), including the required higher-SDK regression. Release/app libraries have one compilation context per ABI.
  • 215 unit tests, 22 source/workflow checks and the full release-metadata check pass on the combined changes. The existing generator refreshed the stale extension evidence source digest. All 11 legacy workflow transfer checks also pass under a simulated parent PR environment; the fixture now explicitly owns its Git revisions. Seven focused Android checks pass, including both real ELF/API contracts and the raised-SDK reuse check. The final Apple reuse check passes locally using installed Xcode 26.4.1 in an isolated source copy; shipping remains pinned to 26.5.
  • Negative checks prove missing Apple framework traversal, execution-config packaged inputs and a raised app minimum SDK each fail the corresponding reuse check before the fix.
  • A real Android archive plus generated PostgreSQL-header/tool closure executes 193 actions cold, then restores all 193 in a fresh output base. The unchanged upstream Bazel 8.8.1 converter confirms identical complete input digests, commands and environments. After deliberately collecting that isolated cache to 1 MiB, the same request reruns 190 actions with unchanged inputs.
  • Full local Android construction passed for all 95 roots, including both APKs and signature/ELF/static-extension proofs. Applying the final f4 source and its genuine CI public-input snapshot reused 25,277 actions in 67.7 seconds with zero compiler/linker/packaging spawns. The initial construction was deliberately interrupted and resumed for shared disk space, so it is not a clean cold wall-time benchmark.
  • Completed Linux CI run 39221761827 reports stock GC deleting 122,844/135,259 files and 3.7/5.7 GiB before saving its 2 GiB cache. This directly establishes retention pressure. The current budgets are targeted; compact execution logs allow per-action comparison against subsequent restored runs.
  • Real Apple diagnostic graph: full projection SHA-256 remains 534ef927885bb890f1853df840b5c16f8d739e3cecb1ada3cfd940a882fad668 after the capture optimization. The new regression covers Unicode ordering, duplicate paths, large artifact IDs and unrelated graph entries.

Exact-source Native CI 39257722374, installed Android execution and whole-job timing are pending. Mac cold compilation remains expensive on the three-CPU/7 GiB runner; the preceding run was cancelled during cache saving, and the measured run therefore started without a snapshot. A remaining host-tool configuration split differs only by the Android minimum-SDK flag; changing global Starlark propagation in pinned Bazel 8.8.1 would also affect Rust/Apple tool settings and is deliberately not bundled here. Planned action counts, construction-only benchmarks and controlled cache experiments are not whole-job timing or release admission.

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
oliphaunt-docs Ready Ready Preview Oct 19, 2026 1:10pm UTC

@f0rr0 f0rr0 changed the title perf(build): share Android native producer configurations perf(build): reuse native configurations and shared input graphs Oct 19, 2026
@f0rr0
f0rr0 changed the base branch from f0rr0/macos-bazel-performance to f0rr0/native-bazel-release October 19, 2026 14:34
@f0rr0 f0rr0 closed this Oct 19, 2026

This branch was successfully deployed

1 active deployment
Preview — f4fee98c Deployed Oct 19, 2026 by vercel[bot]
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