Build: thin LTO, x86-64-v3 on Windows, xxh3 for texture change detection #3009
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3011"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T03:24:40Z.
Three build-level changes for the CPU side, none of which changes behaviour.
Changes
diag, which inherits it).victory-gpu,victory-hleandvictory-shadercall each other on per-draw and per-page paths, and without LTO nothing inlines across those crate boundaries.codegen-unitsstays at its default to keep build times reasonable.target-cpu=x86-64-v3for 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 tox86_64-pc-windows-msvc, so builds on other hosts are unaffected. Side effect: the AVX2 check inrun.rsbecomes always-true, so a CPU without AVX2 would crash instead of getting the message; such a CPU couldn't run the title anyway.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-msvcpasses.victory-gpu's unit tests, cross-compiled in release with these flags and run under Wine: thetexturetests give the same results as on unmodifiedmain.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T03:38:36Z.
Review: CHANGES_REQUESTED
Code review on
8c4b2f77(static source inspection; no builds or runtime tests executed):target-cpu=x86-64-v3globally forx86_64-pc-windows-msvcdefeats the runtime CPU check and can fault on CLI commands (.cargo/config.toml:12-13,apps/victory/src/run.rs:29-35, 50-52):-C target-cpu=x86-64-v3allows LLVM/rustc to emit AVX2/BMI/FMA/MOVBE instructions in startup code,victory inspect/config, and beforecheck_cpu_features()runs — andis_x86_feature_detected!("avx2")can compile down to a constanttrueunderx86-64-v3, breaking the user-facing check/skip path inrun.rs.x86-64-v3features (FMA, BMI1/2, LZCNT, MOVBE) on constrained/virtualized CPUs.x86-64-v3globally in.cargo/config.toml).xxhash-rust(xxh3) in-memory texture change-detection switch (leaving persistent BLAKE3 cache keys untouched),Cargo.lock, and ThinLTO profile look clean.Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T03:53:34Z.
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
8c4b2f7(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo 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.#[test]functions in the diff.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#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_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T04:39:47Z.
Review: APPROVED
LGTM — v3 is justified (README already requires AVX2); scoped to msvc target so other hosts unaffected. xxhash-rust 0.8.21 is a stable release, fine for non-persistent change detection; thin LTO reasonable.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:17:37Z.
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
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T06:43:33Z.
Agreed on all four points. Next steps:
x86-64-v3for the whole binary makes therun.rscheck 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.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.