Skip to content

build: unify release LTO and symbol stripping - #5274

Merged
kixelated merged 7 commits into
mainfrom
quest/m1/release-profile
Oct 11, 2026
Merged

kixelated merged 7 commits into
mainfrom
quest/m1/release-profile

Conversation

@kixelated

@kixelated kixelated commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Release builders apply inconsistent optimization settings. The original unified profile also broke binding generation: stripping the regular ELF symbol table removes metadata read by UniFFI, and the Windows C++ generator cannot decode the release static archive's large object format.

Approach

Set fat LTO and one codegen unit in the workspace release profile. Remove duplicate overrides from FFI, C, C++ and Nix builders. Keep symbol stripping for binaries, with a narrow moq-ffi package override that strips debug information while retaining generation metadata. Explicitly retain symbols in both profiling profiles, including their inherited package overrides.

Generate C++ bindings from the linked cdylib on each platform, matching the other generators. Continue linking and packaging the static library for C++ consumers. Cargo supports separate symbol and debug-data stripping through its profile settings.

Impact

No public signatures, ABI, wire formats, package versions or release actions change. Release binaries use the common optimized profile and lose symbolized backtraces. FFI libraries retain the metadata needed by downstream generators; profiling builds keep debugging information. C++ applications still require no runtime shared-library deployment.

Alternatives

  1. Recommended: retain FFI symbol metadata through the package override, keeping one profile policy across Cargo, maturin and language packagers.
  2. Strip every symbol only after generation in each packager. This needs separate pre-generation artifacts and would make plain Cargo output unsuitable for downstream generators.
  3. Preserve symbols in every release package. This avoids the exception but gives up the planned binary-size reduction.

The narrow FFI exception revises the original stripping plan based on reproduced failures. Fat LTO and the default optimization level remain as selected in the quest.

Validation

The Linux x86_64 release matrix passed for all four packages. Artifact bytes:

Artifact Bytes
FFI shared library 28,666,872
FFI static library 59,674,722
C static library 59,331,644
Relay 36,141,368
CLI 50,390,336

The actual corrected FFI shared library generated nonempty Python and C++ bindings. These are current artifact measurements, not a controlled before/after size or link-cost comparison. Shared-host build wall times are retained locally but do not establish comparative build cost.

Full Nix just check passed, including 6,955 default Rust tests, the feature matrix, bindings and 76 Python tests. Local just test interop --all passed, including cross-language publish/consume, refusal and finite-tail checks. Hosted Swift, macOS, MSVC C++ and Linux aarch64 FFI builds passed on implementation commit 00f7bb8c0; the final commit only records quest evidence and passes quest validation.

Hosted interop reached TS compliance and failed duration fidelity: 3.12 seconds captured from 20.06 seconds (ratio 0.156). The existing investigation in #5292 has a reproduced stdin-throughput defect and local evidence, but hosted causality remains unproven. No unrelated candidate change is imported here.

On copies of the same ELF library, the official generator fails after full symbol stripping and generates Python bindings after debug-only stripping. The C++ generator silently produces no files for the fully stripped ELF, so validation checks output files as well as exit status.

Using this PR's Windows release artifact, C++ generation fails on moq_ffi.lib and succeeds on its companion DLL. A dependency-free Cargo probe reproduces the inherited package override stripping profiling data; the explicit profiling override retains it.

Follow-ups

The maintainer accepted the narrow moq-ffi strip exception (alternative 1, keeping UniFFI metadata). The remaining measurements follow in nightly rather than gating this PR: the size report quest (quest/m1/size-report.md) now covers the Linux aarch64 artifact matrix, per-artifact release build time and the Go mirror's 100 MB limit. This PR completes and deletes the release profile quest. The earlier macOS size table is planning evidence, not a new measurement of this iteration. No releases are performed by this work.

Hosted TS duration fidelity is tracked in #5292, independent of this change.

(Written by GPT-6 Astra, updated by Claude Opus 5.5)

kixelated and others added 2 commits October 10, 2026 14:04
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
kixelated and others added 5 commits October 10, 2026 19:23
@kixelated
kixelated marked this pull request as ready for review October 11, 2026 19:32
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

Merged main (including the FFI changes from #5264 and #5265) and completed the quest: the remaining Linux aarch64 artifact matrix and before/after build-cost measurements move to the nightly size report quest, as accepted by the maintainer along with the moq-ffi strip exception.

(Written by Claude Opus 5.5)

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e7a87bc-2041-42d7-98c3-1659427370cb

📥 Commits

Reviewing files that changed from the base of the PR and between 4d31a70 and 7a557dc.


📒 Files selected for processing (13)
  • Cargo.toml
  • cpp/moq/CMakeLists.txt
  • cpp/moq/build.sh
  • nix/overlay.nix
  • quest/m1/README.md
  • quest/m1/ffi-size-profile.md
  • quest/m1/go-mirror-delivery.md
  • quest/m1/perf/lock-profile.md
  • quest/m1/release-profile.md
  • quest/m1/size-report.md
  • rs/moq-c/build.sh
  • rs/moq-ffi/build.sh
  • sh/go/stage.sh

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T19:35:35.325194Z 7a557dc Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 7a557dc563

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary for 7a557dc56387bb20dbdb97f8ae0ad1e88fef61d9:

  • Merged main (including feat(ffi): expose demand before accepting a track #5264 and feat(ffi): run native drivers on a worker pool #5265) cleanly; no conflicts in Cargo.toml or nix/overlay.nix, and no new CARGO_PROFILE_RELEASE_* overrides appeared.
  • Decided by the maintainer: keep the narrow moq-ffi strip exception (strip = "debuginfo", retaining UniFFI metadata). The Linux aarch64 artifact matrix and a controlled before/after build-cost comparison follow in nightly via quest/m1/size-report.md, which now owns them. The release profile quest is complete and deleted, with its references removed.
  • Full local just check passes. All hosted checks pass, including Interop on a rerun; its first attempt hit the known "lagging latecomer" negative-control defect tracked in quest/m0/interop-latecomer-control.md.
  • Codex reviewed this head with no findings.

Locally, moq-tokio connection::tests::quic_winning_opens_one_session failed twice under full-suite load (WebSocket won the race) and passed 20 of 20 in isolation. It is pre-existing on main and unrelated to this change.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit be8d002 Oct 11, 2026
44 of 45 checks passed
@kixelated
kixelated deleted the quest/m1/release-profile branch October 11, 2026 21:10
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