Build: thin LTO for release and diag builds #677

Open
wbkepler wants to merge 1 commit from upstream-pr/677 into main
wbkepler commented 2026-11-24 06:41:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T06:41:28Z.


Summary

Enables lto = "thin" in root Cargo.toml [profile.release] (inherited by [profile.diag]) so hot cross-crate calls between the shader translator, host GPU layer, and runtime can inline without the link-time cost of fat LTO.

Verification

  • cargo build --release -p victory — passed
  • cargo clippy --workspace --all-targets — passed
  • cargo clippy -p victory --features diagnostics --all-targets — passed
  • cargo test --workspace — passed
  • cargo xtask policy — passed (151 files ok)
<!-- greyfinch-sync:Marvisak/VIctory:issue:6576213206 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/677). Originally posted by [wbkepler](https://github.com/wbkepler) on 2026-11-24T06:41:28Z. --- ## Summary Enables `lto = "thin"` in root `Cargo.toml` `[profile.release]` (inherited by `[profile.diag]`) so hot cross-crate calls between the shader translator, host GPU layer, and runtime can inline without the link-time cost of fat LTO. ## Verification - `cargo build --release -p victory` — passed - `cargo clippy --workspace --all-targets` — passed - `cargo clippy -p victory --features diagnostics --all-targets` — passed - `cargo test --workspace` — passed - `cargo xtask policy` — passed (151 files ok)
catminou4 commented 2026-11-24 06:54:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:47:20Z.

Review: APPROVED


Verified locally on macOS 26 arm64, rustc 1.98.1 (aarch64-apple-darwin) at head 0284037:

  • cargo check on all macOS-buildable crates: clean.
  • The change is lto = "thin" in [profile.release]; [profile.diag] has inherits = "release", so the comment's claim that diag inherits it is accurate.

Thin LTO is a reasonable tradeoff here (cross-crate inlining for the translator/hot paths without fat-LTO build times). Approving.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034834489 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/677#pullrequestreview-6034834489). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:47:20Z. **Review:** APPROVED --- Verified locally on macOS 26 arm64, rustc 1.98.1 (aarch64-apple-darwin) at head 0284037: - `cargo check` on all macOS-buildable crates: clean. - The change is `lto = "thin"` in `[profile.release]`; `[profile.diag]` has `inherits = "release"`, so the comment's claim that diag inherits it is accurate. Thin LTO is a reasonable tradeoff here (cross-crate inlining for the translator/hot paths without fat-LTO build times). Approving.
LAKSHYA-cmd-tech commented 2026-11-24 06:54:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:47:50Z.

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. cargo check --release -p victory and workspace policies pass cleanly. Thin LTO provides critical cross-crate inlining between ictory-shader, ictory-gpu, and runtime without the massive build time penalty of full LTO.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034839492 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/677#pullrequestreview-6034839492). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:47:50Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. cargo check --release -p victory and workspace policies pass cleanly. Thin LTO provides critical cross-crate inlining between ictory-shader, ictory-gpu, and runtime without the massive build time penalty of full LTO.
mercuryVM commented 2026-11-24 11:03:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T10:39:02Z.

Review: APPROVED


Tested 0284037 on Windows 11, RTX 5070, MSVC: cargo build --release -p victory builds with lto = "thin". On the release binary, victory translate --validate --pipelines on the local title executable still reports 12 of 12 programs emitted, 12 validated and 12 pipelines.

  • Safety check: the only change is a profile key in the root Cargo.toml. No dependencies or build scripts change.
  • [profile.diag] inherits from release, so diagnostics builds pay the link-time cost too. That's the intended trade-off, and the comment says so.
  • No numbers in the PR show a speedup. A before/after ms/frame or translate wall-time figure would make it easier to justify keeping, though that's not a blocker for a one-line profile change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6037697095 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/677#pullrequestreview-6037697095). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T10:39:02Z. **Review:** APPROVED --- Tested 0284037 on Windows 11, RTX 5070, MSVC: `cargo build --release -p victory` builds with `lto = "thin"`. On the release binary, `victory translate --validate --pipelines` on the local title executable still reports 12 of 12 programs emitted, 12 validated and 12 pipelines. - Safety check: the only change is a profile key in the root `Cargo.toml`. No dependencies or build scripts change. - `[profile.diag]` inherits from release, so diagnostics builds pay the link-time cost too. That's the intended trade-off, and the comment says so. - No numbers in the PR show a speedup. A before/after ms/frame or translate wall-time figure would make it easier to justify keeping, though that's not a blocker for a one-line profile change. AI-assisted (Claude Code).
ErRusso commented 2026-11-24 12:04:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ErRusso on 2026-11-24T11:19:18Z.


Audit: ✅ Looks good

Reviewed this PR as part of an audit of mergeable PRs.

  • Scope: Cargo.toml [profile.release] (+4/-0). Adds lto = "thin" with a clear comment about cross-crate inlining (translator, host GPU layer, runtime) at far less build time than fat LTO. The diag profile inherits it via inherits = "release".

Correct and low-risk. The profile directive is inert on platforms/compilers that don't support it (falls back gracefully), and the CI already uses --locked.

No issues found.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7129946084 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/677#issuecomment-7129946084). Originally posted by [ErRusso](https://github.com/ErRusso) on 2026-11-24T11:19:18Z. --- ## Audit: ✅ Looks good Reviewed this PR as part of an audit of mergeable PRs. - **Scope:** `Cargo.toml` `[profile.release]` (+4/-0). Adds `lto = "thin"` with a clear comment about cross-crate inlining (translator, host GPU layer, runtime) at far less build time than fat LTO. The `diag` profile inherits it via `inherits = "release"`. Correct and low-risk. The profile directive is inert on platforms/compilers that don't support it (falls back gracefully), and the CI already uses `--locked`. No issues found.
Marvisak commented 2026-11-25 02:06:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:24:52Z.


Automated triage for the maintainers.

Needs work: needs the maintainer's decision. The change adds lto = "thin" to [profile.release] in the root Cargo.toml, and [profile.diag] inherits it. Triage does not pass build-configuration changes in Cargo.toml (anything beyond feature flags) on its own, so this one waits for the maintainer.

To support it, please add numbers to the PR:

  • release build time (clean and incremental) before and after, on the same machine;
  • a measured runtime effect, e.g. victory translate wall time on a fixed set of containers, or frame times in-game.

The comment says the crates "call each other in hot paths", but the PR shows no measurement. Without one, the cost (longer link times for every release and diag build) has no shown benefit to weigh against.

CI: not run on this head.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149520231 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/677#issuecomment-7149520231). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:24:52Z. --- <!-- victory-triage v1 head=0284037e045c50e457f3885427c7ca72a232ffe9 verdict=needs-work at=2026-11-25T01:24:50Z --> Automated triage for the maintainers. **Needs work: needs the maintainer's decision.** The change adds `lto = "thin"` to `[profile.release]` in the root `Cargo.toml`, and `[profile.diag]` inherits it. Triage does not pass build-configuration changes in `Cargo.toml` (anything beyond feature flags) on its own, so this one waits for the maintainer. To support it, please add numbers to the PR: - release build time (clean and incremental) before and after, on the same machine; - a measured runtime effect, e.g. `victory translate` wall time on a fixed set of containers, or frame times in-game. The comment says the crates "call each other in hot paths", but the PR shows no measurement. Without one, the cost (longer link times for every release and `diag` build) has no shown benefit to weigh against. CI: not run on this head. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/677:upstream-pr/677'
git switch 'upstream-pr/677'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/677'
git switch 'upstream-pr/677'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/677'
git switch 'upstream-pr/677'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/677'
git switch 'main'
git merge --squash 'upstream-pr/677'
git switch 'main'
git merge --ff-only 'upstream-pr/677'
git switch 'main'
git merge 'upstream-pr/677'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!677
No description provided.