GPU, HLE, loader and shader: 14 bug fixes, built and tested on Windows (replaces #460) #469

Open
GiovanniFadanelli wants to merge 17 commits from upstream-pr/469 into main
GiovanniFadanelli commented 2026-11-27 14:22:18 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by GiovanniFadanelli on 2026-11-27T14:22:18Z.


Replaces #460 (zocram4cc). The same 14 cherry-picked commits with their original authors (davutsimsekk, avt0m4t, AscilCH ×3, Peppacodes ×2, Vax, mynzjerko, libslibslibslibslibslibs), plus three fix-ups found by building and testing them:

  1. HLE/audio tests: the APU use-after-free test takes the module's test lock. heap_bytes_retains_allocation_across_apu_free was the only ApuAlloc test without CONTEXT_TESTS. After ApuFree, a parallel test could take the same APU address, so ApuMapApuAddress(apu).is_null() failed now and then (1 run in 8 here; also seen in a parallel workspace run on klbf-lab beta). CI runs tests in parallel.
  2. shader: the readfirstlane helper-lane select obeys VICTORY_HELPER_OWN (zocram4cc, cherry-picked). Answers the review point that the new select bypassed VICTORY_HELPER_OWN=0, which the shader cache keys on. The select now follows the switch, and it still covers the two-host-wave exchange path, where first_lane's result can come from the other half.
  3. Shader translator version 2. Five of the commits change the translation, and TRANSLATOR_VERSION's own comment asks for a bump. Without it, existing installs keep serving cached translations (the other review point).

One default-on behaviour change, as in #460: "GPU/resource: preserve 4 KiB texture alignment" keeps 4 KiB alignments in GetResourceAllocationInfo(2) instead of raising them to 64 KiB, so the title spaces its small textures as on the console. resource::tests::sizes_cover_every_mip covers it. Not measured in game.

Testing (Windows 11, RX 9070 XT, native MSVC toolchain 1.98.1; base 126acb35 vs this head)

Gate base 126acb35 this head
cargo check -p victory-gpu -p victory-hle -p victory-loader -p victory-shader -p victory --all-targets rc 0 rc 0
cargo test -p victory-shader (lib, one test skipped, see below) 301 / 0 / 4 ign 305 / 0 / 4 ign
victory-gpu lib, --test-threads 1 384 / 0 / 34 ign 386 / 0 / 34 ign
victory-hle lib, --test-threads 1 155 / 0 / 2 ign 157 / 0 / 2 ign
victory-loader lib + tests 52 + 4 52 + 5
victory (app) 21 / 0 21 / 0
cargo check -p victory-gpu --features diagnostics --all-targets rc 0 rc 0
cargo test --workspace --all-features -- --test-threads=1: victory-gpu 436 / 0 / 34 ign 438 / 0 / 34 ign
clippy -D warnings (default and --all-features, --keep-going) fails fails with the same errors as base: the loader transmute lints, plus list.rs open and watch.rs totals in victory-gpu, as #409 fixes

Red first: 11 of the 12 new or extended tests fail with their fix reverted and pass with it (for the queue use-after-free and the 16-bit gradient fix, by a hand revert of the fix itself). The exception is the APU heap test: its use-after-free half cannot be reverted without breaking the test's build, and its overflow assertion cannot fail at offset 0. For example: sizes_cover_every_mip left: AllocationInfo { size: 352256, alignment: 65536 }, release_waits_for_release_held_before_freeing_waiting_queue "queue::release freed queue while release_held lock was held", and float_compares_that_are_always_false_or_true WARP "device removed". Not red-first-able: the snapshot retry and the helper-lane readfirstlane commits carry no test.

Pre-existing on main and not from this PR: CI is red on every main run, both clippy steps fail (fixed by #409), and on an RX 9070 XT (RDNA 4) emit::size_tests::the_record_count_of_a_structured_buffer_read_by_index crashes the shader test process with an access violation (base and head alike, which ends cargo test --workspace early). That is the RDNA 4 compiler crash #55 addresses: on #55's head (whose base is the same 126acb35) the test passes on this card.

Not verified: in-game behaviour (no game runs) and the layout change in game.

AI-assisted (build, tests, red-first, the three fix-ups); the code of the 14 is the original authors'.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5528199810 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/469). Originally posted by [GiovanniFadanelli](https://github.com/GiovanniFadanelli) on 2026-11-27T14:22:18Z. --- Replaces #460 (zocram4cc). The same 14 cherry-picked commits with their original authors (davutsimsekk, avt0m4t, AscilCH ×3, Peppacodes ×2, Vax, mynzjerko, libslibslibslibslibslibs), plus three fix-ups found by building and testing them: 1. **HLE/audio tests: the APU use-after-free test takes the module's test lock.** `heap_bytes_retains_allocation_across_apu_free` was the only `ApuAlloc` test without `CONTEXT_TESTS`. After `ApuFree`, a parallel test could take the same APU address, so `ApuMapApuAddress(apu).is_null()` failed now and then (1 run in 8 here; also seen in a parallel workspace run on klbf-lab beta). CI runs tests in parallel. 2. **shader: the readfirstlane helper-lane select obeys `VICTORY_HELPER_OWN`** (zocram4cc, cherry-picked). Answers the review point that the new select bypassed `VICTORY_HELPER_OWN=0`, which the shader cache keys on. The select now follows the switch, and it still covers the two-host-wave exchange path, where `first_lane`'s result can come from the other half. 3. **Shader translator version 2.** Five of the commits change the translation, and `TRANSLATOR_VERSION`'s own comment asks for a bump. Without it, existing installs keep serving cached translations (the other review point). One default-on behaviour change, as in #460: "GPU/resource: preserve 4 KiB texture alignment" keeps 4 KiB alignments in `GetResourceAllocationInfo(2)` instead of raising them to 64 KiB, so the title spaces its small textures as on the console. `resource::tests::sizes_cover_every_mip` covers it. Not measured in game. ### Testing (Windows 11, RX 9070 XT, native MSVC toolchain 1.98.1; base 126acb35 vs this head) | Gate | base 126acb35 | this head | |---|---|---| | `cargo check -p victory-gpu -p victory-hle -p victory-loader -p victory-shader -p victory --all-targets` | rc 0 | rc 0 | | `cargo test -p victory-shader` (lib, one test skipped, see below) | 301 / 0 / 4 ign | 305 / 0 / 4 ign | | victory-gpu lib, `--test-threads 1` | 384 / 0 / 34 ign | 386 / 0 / 34 ign | | victory-hle lib, `--test-threads 1` | 155 / 0 / 2 ign | 157 / 0 / 2 ign | | victory-loader lib + tests | 52 + 4 | 52 + 5 | | victory (app) | 21 / 0 | 21 / 0 | | `cargo check -p victory-gpu --features diagnostics --all-targets` | rc 0 | rc 0 | | `cargo test --workspace --all-features -- --test-threads=1`: victory-gpu | 436 / 0 / 34 ign | 438 / 0 / 34 ign | | clippy `-D warnings` (default and `--all-features`, `--keep-going`) | fails | fails with the same errors as base: the loader `transmute` lints, plus `list.rs` `open` and `watch.rs` `totals` in victory-gpu, as #409 fixes | Red first: 11 of the 12 new or extended tests fail with their fix reverted and pass with it (for the queue use-after-free and the 16-bit gradient fix, by a hand revert of the fix itself). The exception is the APU heap test: its use-after-free half cannot be reverted without breaking the test's build, and its overflow assertion cannot fail at offset 0. For example: `sizes_cover_every_mip` `left: AllocationInfo { size: 352256, alignment: 65536 }`, `release_waits_for_release_held_before_freeing_waiting_queue` "queue::release freed queue while release_held lock was held", and `float_compares_that_are_always_false_or_true` WARP "device removed". Not red-first-able: the snapshot retry and the helper-lane readfirstlane commits carry no test. Pre-existing on main and not from this PR: CI is red on every main run, both clippy steps fail (fixed by #409), and on an RX 9070 XT (RDNA 4) `emit::size_tests::the_record_count_of_a_structured_buffer_read_by_index` crashes the shader test process with an access violation (base and head alike, which ends `cargo test --workspace` early). That is the RDNA 4 compiler crash #55 addresses: on #55's head (whose base is the same 126acb35) the test passes on this card. Not verified: in-game behaviour (no game runs) and the layout change in game. AI-assisted (build, tests, red-first, the three fix-ups); the code of the 14 is the original authors'. 🤖 Generated with [Claude Code](https://claude.com/claude-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/469:upstream-pr/469'
git switch 'upstream-pr/469'

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/469'
git switch 'upstream-pr/469'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/469'
git switch 'upstream-pr/469'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/469'
git switch 'main'
git merge --squash 'upstream-pr/469'
git switch 'main'
git merge --ff-only 'upstream-pr/469'
git switch 'main'
git merge 'upstream-pr/469'
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
avatarmanz/VIctory-7900XTX!469
No description provided.