Repository navigation
build: tighten the release profile to fat LTO and one codegen unit - #1509
Conversation
`codegen-units` was left at its default of 16, which was the binding constraint on the existing thin LTO rather than the LTO mode itself. Measured on a 16-core clean build of both binaries: cgu=1 alone costs +5s (356s -> 361s) and takes ~16% off both; fat LTO on top costs +118s and lands `decdn-node` at 35.6 MB and `decdn` at 21.1 MB. CI never builds `--release`, so the extra time falls only on the release workflow's 10-way parallel matrix and the Docker image build. Also relax `strip` from `symbols` to `debuginfo` so the symbol table survives in the shipped binary and a `RUST_BACKTRACE` panic from an operator's node symbolizes to function names instead of bare addresses. That gives up 5.7 MB of the LTO win on `decdn-node` (35.6 -> 41.3 MB), still well below the 47.4 MB shipped today. `file:line` resolution is deliberately not bought here. It requires `strip = "none"`, which takes `decdn-node` to 91.8 MB, and it cannot be moved into a sidecar: under split DWARF the line-number program stays in the executable's `.debug_line`, so a stripped binary plus its `.dwp` resolves nothing -- verified with addr2line, which returned `:?` both with the 85 MB `.dwp` present and with it deleted. `debug` and `split-debuginfo` are therefore left off rather than generating sidecars that cannot symbolize the artifact being shipped. `panic = "abort"` is ruled out in the same pass: production code recovers from panics via unwinding in `chain_events::resumable_watcher` and `dht::chain_projection`, and the runtime, admin, and buyer-channel layers branch on `JoinError::is_panic`. Verified on the built artifacts: `.symtab` present, zero `.debug_*` sections, and addr2line resolves a live address to `decdn_node::receipt_log::...::record`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
Adjusts the workspace release profile to prioritize runtime performance and smaller binaries via fat LTO and a single codegen unit, while retaining symbol tables so operator panic backtraces can resolve function names.
Changes:
- Switch
profile.releasetolto = "fat"andcodegen-units = 1to enable whole-program optimization and maximize cross-crate inlining. - Relax
stripfromsymbolstodebuginfoso shipped release binaries keep symbol tables for function-name backtraces.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Coverage reportTotal: 80.23% (was 80.24%, ▼ 0.01%) — 53716/66954 lines No Rust files changed in this PR. History
|
main advanced with #1508 (origin-aware discovery), #1504 (event-log replay elimination), and #1509. One real conflict + one semantic reconciliation: - crates/node/src/slash_watcher.rs: #1504 replaced the SlashJudge.Slashed event with CapacityBond.SlashRecorded (no offenseType field), so the Phase A test fixture edit is obsolete — took main's structure. - crates/node/src/handlers/client/wire.rs: #1508 added a drop-instead-of-sign block for origin-held CacheMiss whose ENTIRE rationale was avoiding phantom-announcement evidence. With phantom retired and ok:false inert, that defense is unnecessary — removed it so origin-held CacheMiss signs like every other refusal. Blacklisted hashes still route to ChainHashDenied via the refuses() guard. Co-Authored-By: Claude Opus 4.8 <[email protected]>
What
codegen-unitswas left at its default of 16, which was the binding constraint on the existing thin LTO — not the LTO mode. This setslto = "fat"+codegen-units = 1, and relaxesstripfromsymbolstodebuginfoso shipped binaries produce symbolized panic backtraces.Measured
Clean builds of both binaries, 16 cores:
decdn-nodedecdnstrip = "debuginfo"(this PR)CI never builds
--release, so the added time falls only on the release workflow's 10-way parallel matrix and the Docker image build.Why
strip = "debuginfo"Under
strip = "symbols"a panic backtrace from an operator's node is bare addresses. Keeping the symbol table costs 5.7 MB ondecdn-nodeand resolves frames to function names.file:lineis deliberately not bought here — it needsstrip = "none"(91.8 MB fordecdn-node) and cannot be moved to a sidecar: under split DWARF the line-number program stays in the executable's.debug_line, so a stripped binary plus its.dwpresolves nothing. Verified with addr2line, which returned:?identically with the 85 MB.dwppresent and deleted.debug/split-debuginfoare therefore left off rather than generating 141 MB of sidecars that cannot symbolize the shipped artifact.panic = "abort"is ruled out in the profile comment: production code recovers from panics via unwinding inchain_events::resumable_watcher(hook dispatch) anddht::chain_projection(lock poisoning), and the runtime / admin / buyer-channel layers branch onJoinError::is_panic.Verification
Built both binaries on the final profile and inspected the artifacts:
.symtabpresent, zero.debug_*sectionsaddr2lineresolves a live address to<decdn_node::receipt_log::ChannelReceiptSink as ...ReceiptSink>::recordNot covered
--emit=metadata), but the macOS / Windows /crosslegs are not exercised until a real release runs.Follow-ups
file:linevia anobjcopy --only-keep-debugsidecar inrelease.yml, uploaded per-target. Needs a per-OS branch (objcopy/dsymutil/ MSVC PDB), and sincebuild-binariesis skipped underdry_run, a mistake would only surface during a real release.overflow-checks = truein release for the voucher / byte-offset arithmetic — a deliberate safety-vs-perf call, untouched here.🤖 Generated with Claude Code