Build: thin LTO, x86-64-v3 on Windows, xxh3 for texture change detection #3011

Open
github-bot wants to merge 1 commit from github-bot/gh-3011 into main AGit
Owner

@⁠0xkn0wh3r3 on GitHub · 2026-11-26 03:24 UTC · original
0xkn0wh3r3:build/lto-avx2-xxh3 → main · +34 −5 · 5 files · 1 commits · open

Three build-level changes for the CPU side, none of which changes behaviour.

Changes

  • Thin LTO for release builds (and diag, which inherits it). victory-gpu, victory-hle and victory-shader call each other on per-draw and per-page paths, and without LTO nothing inlines across those crate boundaries. codegen-units stays at its default to keep build times reasonable.
  • target-cpu=x86-64-v3 for the Windows target (.cargo/config.toml). The README already requires an AVX2 CPU, but the host code was built for baseline x86-64 (SSE2). x86-64-v3 is what every AVX2 CPU has: AVX2, BMI1/2, FMA, LZCNT, MOVBE. It's scoped to x86_64-pc-windows-msvc, so builds on other hosts are unaffected. Side effect: the AVX2 check in run.rs becomes always-true, so a CPU without AVX2 would crash instead of getting the message; such a CPU couldn't run the title anyway.
  • xxh3-128 instead of blake3 for texture change detection (texture.rs). Every sampled texture's memory is hashed at each refresh to see whether it changed; a comment there records 8 ms a frame for one case. That hash is never stored across runs, so a fast non-cryptographic 128-bit hash is enough. blake3 stays for the cache keys that are saved to disk. New dependency: xxhash-rust (BSL-1.0, pure Rust).

Testing

  • cargo check --workspace --all-targets --target x86_64-pc-windows-msvc passes.
  • victory-gpu's unit tests, cross-compiled in release with these flags and run under Wine: the texture tests give the same results as on unmodified main.
  • Not measured on Windows hardware yet, so I don't have frame-time numbers for this.
**@⁠0xkn0wh3r3** on GitHub · 2026-11-26 03:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/3011) `0xkn0wh3r3:build/lto-avx2-xxh3` → `main` · +34 −5 · 5 files · 1 commits · open Three build-level changes for the CPU side, none of which changes behaviour. ## Changes - **Thin LTO for release builds** (and `diag`, which inherits it). `victory-gpu`, `victory-hle` and `victory-shader` call each other on per-draw and per-page paths, and without LTO nothing inlines across those crate boundaries. `codegen-units` stays at its default to keep build times reasonable. - **`target-cpu=x86-64-v3` for the Windows target** (`.cargo/config.toml`). The README already requires an AVX2 CPU, but the host code was built for baseline x86-64 (SSE2). x86-64-v3 is what every AVX2 CPU has: AVX2, BMI1/2, FMA, LZCNT, MOVBE. It's scoped to `x86_64-pc-windows-msvc`, so builds on other hosts are unaffected. Side effect: the AVX2 check in `run.rs` becomes always-true, so a CPU without AVX2 would crash instead of getting the message; such a CPU couldn't run the title anyway. - **xxh3-128 instead of blake3 for texture change detection** (`texture.rs`). Every sampled texture's memory is hashed at each refresh to see whether it changed; a comment there records 8 ms a frame for one case. That hash is never stored across runs, so a fast non-cryptographic 128-bit hash is enough. blake3 stays for the cache keys that are saved to disk. New dependency: `xxhash-rust` (BSL-1.0, pure Rust). ## Testing - `cargo check --workspace --all-targets --target x86_64-pc-windows-msvc` passes. - `victory-gpu`'s unit tests, cross-compiled in release with these flags and run under Wine: the `texture` tests give the same results as on unmodified `main`. - Not measured on Windows hardware yet, so I don't have frame-time numbers for this.
- Release (and diag, which inherits it) builds with thin LTO: the GPU, HLE
  and shader crates call each other on per-draw and per-page paths.
- The Windows target builds for x86-64-v3 (AVX2, BMI1/2, FMA, LZCNT,
  MOVBE). The title already needs an AVX2 CPU; until now the host code was
  built for baseline SSE2. Other hosts are unaffected.
- A sampled texture's memory is hashed at each refresh to see whether it
  changed (one comment records 8 ms a frame for a movie). That hash is
  never kept across runs, so xxh3-128 replaces blake3 there; blake3 stays
  for the cache keys that persist on disk.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:20:04 +00:00
github-bot force-pushed github-bot/gh-3011 from 8c4b2f772c to a48fb0a63b 2026-11-26 06:31:57 +00:00 Compare
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 03:53 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 8c4b2f7 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 866 passed, 0 failed, 10 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 03:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/3011#issuecomment-7182113448) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `8c4b2f7` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **866 passed, 0 failed, 10 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 06:17 UTC · original · edited 2026-11-26 07:19 UTC

Automated triage for the maintainers.

Thanks for the plan. The head is unchanged, so the verdict stays needs work; needs the maintainer's decision (new dependency, .cargo/config.toml, LTO). The split you describe, with numbers for the hash swap and the AVX2 message kept reachable, would let each piece be judged on its own.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 06:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/3011#issuecomment-7184285809) · edited 2026-11-26 07:19 UTC <!-- victory-triage v1 head=a48fb0a63ba6d81506470bd6e57c7d355ddd5578 verdict=needs-work at=2026-11-26T07:19:56Z --> Automated triage for the maintainers. Thanks for the plan. The head is unchanged, so the verdict stays **needs work; needs the maintainer's decision** (new dependency, `.cargo/config.toml`, LTO). The split you describe, with numbers for the hash swap and the AVX2 message kept reachable, would let each piece be judged on its own. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠0xkn0wh3r3 on GitHub · 2026-11-26 06:43 UTC · original

Agreed on all four points. Next steps:

  • Split: the three changes are independent, so they'll go in three PRs. The LTO and CPU-target ones are yours to decide as build-config changes. The hash one comes with numbers.
  • AVX2: x86-64-v3 for the whole binary makes the run.rs check unreachable, and a CPU without AVX2 crashes with an illegal instruction instead of getting the message. The CPU-target PR will either drop the global flag or keep the check in code built for baseline x86-64, so the message still appears. Otherwise I'll leave that change out.
  • Hash: before/after numbers for the texture refresh from a diagnostics run on Windows, so the xxh3 swap is judged on a profile, not on the comment's 8 ms.
  • Test report: a fresh one for the new heads.
**@⁠0xkn0wh3r3** on GitHub · 2026-11-26 06:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/3011#issuecomment-7184719225) Agreed on all four points. Next steps: - **Split:** the three changes are independent, so they'll go in three PRs. The LTO and CPU-target ones are yours to decide as build-config changes. The hash one comes with numbers. - **AVX2:** `x86-64-v3` for the whole binary makes the `run.rs` check unreachable, and a CPU without AVX2 crashes with an illegal instruction instead of getting the message. The CPU-target PR will either drop the global flag or keep the check in code built for baseline x86-64, so the message still appears. Otherwise I'll leave that change out. - **Hash:** before/after numbers for the texture refresh from a diagnostics run on Windows, so the xxh3 swap is judged on a profile, not on the comment's 8 ms. - **Test report:** a fresh one for the new heads.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3011/head:github-bot/gh-3011'
git switch 'github-bot/gh-3011'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3011'
git switch 'github-bot/gh-3011'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3011'
git switch 'github-bot/gh-3011'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3011'
git switch 'main'
git merge --squash 'github-bot/gh-3011'
git switch 'main'
git merge --ff-only 'github-bot/gh-3011'
git switch 'main'
git merge 'github-bot/gh-3011'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3011
No description provided.