GPU tests: the library test's shaders compile with Wine's compiler too #2193

Open
winne42 wants to merge 1 commit from upstream-pr/2195 into main
winne42 commented 2026-11-25 07:25:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by winne42 on 2026-11-25T07:25:48Z.


Under Wine and Proton, pipeline::library::tests::pipelines_load_on_many_threads_at_once never runs: it returns at "no shader compiler here". Wine's d3dcompiler_47 (vkd3d-shader) refuses the test's shader with E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'. That happens with both Ubuntu's Wine 10.0 and Proton Experimental's Wine 11.0. A structured buffer doesn't help either (Structured buffers store is not implemented). And even a shader it does compile has no root signature in it, because it drops [RootSignature] (W5302), so CreateRootSignature(0, &codes[0]) would fail next.

The change

One test, in crates/victory-gpu/src/pipeline/library.rs. Nothing outside the test changes.

  • The test never dispatches. It only needs 96 different programs, so they now differ by group size alone: [numthreads(i + 1, 1, 1)] void main() {}, with no resources. A load with another program's description is still refused, as the test checks.
  • The empty root signature is made with D3D12SerializeRootSignature instead of being taken from the shader.

Depends on #1722 under vkd3d-proton

Once the test reaches the library, it calls open(&device, Vec::new()).expect("an empty library"). vkd3d-proton refuses that non-null empty blob, which is what #1722 fixes. So under vkd3d-proton this test now fails until #1722 is merged, where it used to return early. On Windows nothing changes, because the length alone is checked there.

Tested

Linux, x86_64-pc-windows-msvc cross-build (lld-link + xwin), Wine 10.0 with vkd3d-proton 3.1 and DXVK dxgi from Proton Experimental, RTX 3050 Laptop GPU. Not run on Windows.

  • With #1722 on top: cargo test -p victory-gpu --lib pipeline::library gives 8 passed. All 96 programs compile, are stored, and load.
  • Without #1722: this test fails at an empty library, as described above. a_rejected_blob_gives_an_empty_library fails the same way on main.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, with and without --all-features: clean.

No game data was used.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:5487039079 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2195). Originally posted by [winne42](https://github.com/winne42) on 2026-11-25T07:25:48Z. --- Under Wine and Proton, `pipeline::library::tests::pipelines_load_on_many_threads_at_once` never runs: it returns at "no shader compiler here". Wine's `d3dcompiler_47` (vkd3d-shader) refuses the test's shader with `E5005: Method 'Load' is not defined on type 'RWByteAddressBuffer'`. That happens with both Ubuntu's Wine 10.0 and Proton Experimental's Wine 11.0. A structured buffer doesn't help either (`Structured buffers store is not implemented`). And even a shader it does compile has no root signature in it, because it drops `[RootSignature]` (`W5302`), so `CreateRootSignature(0, &codes[0])` would fail next. ## The change One test, in `crates/victory-gpu/src/pipeline/library.rs`. Nothing outside the test changes. - The test never dispatches. It only needs 96 different programs, so they now differ by group size alone: `[numthreads(i + 1, 1, 1)] void main() {}`, with no resources. A load with another program's description is still refused, as the test checks. - The empty root signature is made with `D3D12SerializeRootSignature` instead of being taken from the shader. ## Depends on #1722 under vkd3d-proton Once the test reaches the library, it calls `open(&device, Vec::new()).expect("an empty library")`. vkd3d-proton refuses that non-null empty blob, which is what #1722 fixes. So under vkd3d-proton this test now **fails** until #1722 is merged, where it used to return early. On Windows nothing changes, because the length alone is checked there. ## Tested Linux, `x86_64-pc-windows-msvc` cross-build (lld-link + xwin), Wine 10.0 with vkd3d-proton 3.1 and DXVK `dxgi` from Proton Experimental, RTX 3050 Laptop GPU. Not run on Windows. - With #1722 on top: `cargo test -p victory-gpu --lib pipeline::library` gives 8 passed. All 96 programs compile, are stored, and load. - Without #1722: this test fails at `an empty library`, as described above. `a_rejected_blob_gives_an_empty_library` fails the same way on `main`. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`, with and without `--all-features`: clean. No game data was used. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DenRakEiw commented 2026-11-25 07:42:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T07:42:29Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib pipeline::library:: — 8 passed, 0 failed on RTX 5090
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean Wine shader compiler compatibility fix in pipeline/library.rs tests. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6053616554 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2195#pullrequestreview-6053616554). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T07:42:29Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu --lib pipeline::library::` — **8 passed, 0 failed** on RTX 5090 - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean Wine shader compiler compatibility fix in `pipeline/library.rs` tests. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 08:03:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T08:03:03Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

GPU tests: library shaders compile with Wine's compiler — Wine-compat test coverage; Windows-only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6053836160 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2195#pullrequestreview-6053836160). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T08:03:03Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. GPU tests: library shaders compile with Wine's compiler — Wine-compat test coverage; Windows-only.
ntgata1-dotcom commented 2026-11-25 12:03:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-25T11:20:10Z.


RX 9070 XT (RADV) under Wine 11.22: the test reaches the library, as described

Setup: Arch Linux, RX 9070 XT (RDNA4), RADV / Mesa 26.3.1. System Wine 11.22 with its builtin d3dcompiler_47. vkd3d-proton v3.1-83-gcae8353ed and DXVK dxgi from GE-Proton11-14. cargo xwin test --locked --target x86_64-pc-windows-msvc --no-fail-fast -p victory-gpu, runner wine.

victory-gpu passed failed pipelines_load_on_many_threads_at_once
main 940d32f 130 13 "ok", but it returns at "no shader compiler here" (checked with a temporary print)
this PR 55ac23f 129 14 fails at an empty library
this PR + #1722, merged locally 131 12 passes
  • Wine 11.22's compiler builds all 96 programs: without #1722 the test gets past the compile loop and stops at open, as you describe.
  • With #1722, all 8 pipeline::library tests pass. Outside pipeline::library, no test changes against main.

Not run: Windows.

AI-assisted (Claude Code); numbers from my own runs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7160909640 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2195#issuecomment-7160909640). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-25T11:20:10Z. --- **RX 9070 XT (RADV) under Wine 11.22: the test reaches the library, as described** Setup: Arch Linux, RX 9070 XT (RDNA4), RADV / Mesa 26.3.1. System Wine 11.22 with its builtin `d3dcompiler_47`. vkd3d-proton `v3.1-83-gcae8353ed` and DXVK `dxgi` from GE-Proton11-14. `cargo xwin test --locked --target x86_64-pc-windows-msvc --no-fail-fast -p victory-gpu`, runner `wine`. | `victory-gpu` | passed | failed | `pipelines_load_on_many_threads_at_once` | |---|---|---|---| | `main` `940d32f` | 130 | 13 | "ok", but it returns at "no shader compiler here" (checked with a temporary print) | | this PR `55ac23f` | 129 | 14 | fails at `an empty library` | | this PR + #1722, merged locally | 131 | 12 | passes | - Wine 11.22's compiler builds all 96 programs: without #1722 the test gets past the compile loop and stops at `open`, as you describe. - With #1722, all 8 `pipeline::library` tests pass. Outside `pipeline::library`, no test changes against `main`. Not run: Windows. AI-assisted (Claude Code); numbers from my own runs.
Marvisak commented 2026-11-25 13:02:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T12:38:50Z.


Automated triage for the maintainers.

Merge candidate (test only). pipelines_load_on_many_threads_at_once in crates/victory-gpu/src/pipeline/library.rs now makes its distinct programs by group size alone ([numthreads(i + 1, 1, 1)]) and uses an empty serialized root signature. Before, it used raw-buffer access and an embedded root signature, which Wine's d3dcompiler_47 refuses. The test exercises library loads on many threads, so the shader bodies don't matter, and on Windows it covers the same thing as before.

CI check passes, and the branch merges cleanly.

For the maintainers: under Wine this alone moves the test from silently skipped to failing at an empty library. It passes together with #1722 (RX 9070 XT run in the thread). Land it with or after #1722.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7162661091 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2195#issuecomment-7162661091). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T12:38:50Z. --- <!-- victory-triage v1 head=55ac23fb446abdd0a77e40e0acab70bdece05904 verdict=merge-candidate at=2026-11-25T13:51:00Z --> Automated triage for the maintainers. **Merge candidate (test only).** `pipelines_load_on_many_threads_at_once` in `crates/victory-gpu/src/pipeline/library.rs` now makes its distinct programs by group size alone (`[numthreads(i + 1, 1, 1)]`) and uses an empty serialized root signature. Before, it used raw-buffer access and an embedded root signature, which Wine's `d3dcompiler_47` refuses. The test exercises library loads on many threads, so the shader bodies don't matter, and on Windows it covers the same thing as before. CI `check` passes, and the branch merges cleanly. For the maintainers: under Wine this alone moves the test from silently skipped to failing at `an empty library`. It passes together with #1722 (RX 9070 XT run in the thread). Land it with or after #1722. --- _Generated by [Claude Code](https://claude.ai/code)_
fuzeofficlal commented 2026-11-26 01:04:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:01:26Z.


Code review and RTX 5090 + WARP verification at head 55ac23fb446a merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-gpu/src/pipeline/library.rs:608-660):
    • Simplifies pipelines_load_on_many_threads_at_once to [numthreads(i + 1, 1, 1)] void main() {} with an empty root signature (D3D12SerializeRootSignature), matching a_pipeline_loads_while_a_save_holds_the_library and avoiding Wine compiler issues with [RootSignature(RS)] + RWByteAddressBuffer.
    • Preserves full test strength: all 2 * N shaders still compile to distinct bytecodes, so concurrent load, mismatched-bytecode rejection, concurrent store, and Serialize locking remain fully exercised.
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy -p victory-gpu --all-targets -- -D warnings (default + --features diagnostics): 0 warnings
    • victory-gpu --lib -- pipeline::: 23/23 passed default on RTX 5090; 26/26 passed (--features diagnostics) on WARP.

LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179349023 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2195#issuecomment-7179349023). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T01:01:26Z. --- Code review and RTX 5090 + WARP verification at head `55ac23fb446a` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-gpu/src/pipeline/library.rs:608-660`)**: - Simplifies `pipelines_load_on_many_threads_at_once` to `[numthreads(i + 1, 1, 1)] void main() {}` with an empty root signature (`D3D12SerializeRootSignature`), matching `a_pipeline_loads_while_a_save_holds_the_library` and avoiding Wine compiler issues with `[RootSignature(RS)]` + `RWByteAddressBuffer`. - Preserves full test strength: all `2 * N` shaders still compile to distinct bytecodes, so concurrent `load`, mismatched-bytecode rejection, concurrent `store`, and `Serialize` locking remain fully exercised. - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default + `--features diagnostics`): 0 warnings - `victory-gpu --lib -- pipeline::`: **23/23 passed** default on RTX 5090; **26/26 passed** (`--features diagnostics`) on WARP. LGTM.
fuzeofficlal commented 2026-11-27 02:58:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T02:58:09Z.

Review: APPROVED


Reviewed at 55ac23fb446abdd0a77e40e0acab70bdece05904 — APPROVE.

Verification

  • rustfmt --edition 2024 --check (zero new diffs), cargo xtask policy (191 files ok), and all four cargo clippy -p victory-gpu targets (--lib, --tests, --all-targets, --all-features with -D warnings) passed cleanly.
  • Verified [numthreads(i + 1, 1, 1)] void main() {} emits distinct DXBC shader blobs for all 96 variants (0..2 * N) and D3D12SerializeRootSignature with D3D12_ROOT_SIGNATURE_DESC::default() builds a valid root signature while preserving all pipeline library serialization, reopening, mismatch rejection, and multi-threaded store/load checks.
  • Passed cargo test -p victory-gpu --lib pipeline::library::tests (11/11) on both RTX 5090 and WARP, including under --features diagnostics with VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_GBV=1.

Non-blocking note

  • Dropping the RWByteAddressBuffer / [RootSignature] binding from this fixture means this test no longer exercises resource-bound PSO round-trips through the library (crates/victory-gpu/src/pipeline/library.rs:613, 648); a separate resource-bound test can be kept if desired alongside this compiler-portable stress test.
<!-- greyfinch-sync:Marvisak/VIctory:review:6082891513 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2195#pullrequestreview-6082891513). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-27T02:58:09Z. **Review:** APPROVED --- Reviewed at `55ac23fb446abdd0a77e40e0acab70bdece05904` — **APPROVE**. ### Verification - `rustfmt --edition 2024 --check` (zero new diffs), `cargo xtask policy` (`191 files ok`), and all four `cargo clippy -p victory-gpu` targets (`--lib`, `--tests`, `--all-targets`, `--all-features` with `-D warnings`) passed cleanly. - Verified `[numthreads(i + 1, 1, 1)] void main() {}` emits distinct DXBC shader blobs for all 96 variants (`0..2 * N`) and `D3D12SerializeRootSignature` with `D3D12_ROOT_SIGNATURE_DESC::default()` builds a valid root signature while preserving all pipeline library serialization, reopening, mismatch rejection, and multi-threaded store/load checks. - Passed `cargo test -p victory-gpu --lib pipeline::library::tests` (11/11) on both RTX 5090 and WARP, including under `--features diagnostics` with `VICTORY_D3D12_DEBUG=1` and `VICTORY_D3D12_GBV=1`. ### Non-blocking note - Dropping the `RWByteAddressBuffer` / `[RootSignature]` binding from this fixture means this test no longer exercises resource-bound PSO round-trips through the library (`crates/victory-gpu/src/pipeline/library.rs:613, 648`); a separate resource-bound test can be kept if desired alongside this compiler-portable stress test.
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/2195:upstream-pr/2195'
git switch 'upstream-pr/2195'

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/2195'
git switch 'upstream-pr/2195'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2195'
git switch 'upstream-pr/2195'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2195'
git switch 'main'
git merge --squash 'upstream-pr/2195'
git switch 'main'
git merge --ff-only 'upstream-pr/2195'
git switch 'main'
git merge 'upstream-pr/2195'
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!2193
No description provided.