GPU tests: root signatures made from each shader's RS string #2194

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

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


Several victory-gpu GPU tests fail under Wine and Proton before they test anything. They take the root signature from the compiled shader (CreateRootSignature(0, bytes)), and Wine's d3dcompiler_47 (vkd3d-shader) doesn't keep one: it logs W5302: Ignoring unknown attribute "RootSignature". It also has no rootsig_1_0 target (E_NOTIMPL), so the RS string can't be compiled alone either. CreateRootSignature then fails with E_FAIL.

The change

  • New #[cfg(all(windows, test))] module crate::test_root. It reads the #define RS "..." string each test shader already has, describes it as a D3D12_ROOT_SIGNATURE_DESC, and makes it with D3D12SerializeRootSignature, version 1.0, so every descriptor is volatile, the most permissive choice.
    • It covers the forms the tests use: descriptor tables of SRV/UAV/CBV ranges (numDescriptors, also unbounded, and space), root SRV/UAV/CBV, and RootConstants.
    • Two unit tests: one parses the strings without a GPU, the other makes every root signature the tests use on the host.
  • bindless::tests::compile and draw::tests::compile_cs pass that root signature with the pipeline, on every host. No shader source changes. On Windows the shader still carries its own root signature, and the pipeline uses the one passed in.

Results

RTX 3050 Laptop GPU, x86_64-pc-windows-msvc cross-build (lld-link + xwin), run under Proton Experimental's own Wine (11.0) with its vkd3d-proton and DXVK dxgi. This is the setup Linux users of VIctory have.

passed failed
main 129 14
this branch 135 10

Fixed: bindless::tests::heap_views_are_current, bindless::tests::heap_views_follow_writes_through_another_mapping, draw::tests::root_views_reach_their_copy_and_read_zeros_past_it, draw::tests::unordered_1d_and_3d_textures_keep_their_writes. The other two passes are the new tests. Nothing that passes on main fails here.

The 10 still failing, none of them from root signatures:

  • indirect::tests::* (5): the runtime argument clamp doesn't compile under Wine (RWByteAddressBuffer.Load): #170, #909, #2093.
  • draw::tests::a_depth_texture_written_through_unordered_views_reads_as_depth: "the conversion ran in the list". The runtime depth converter in twin.rs doesn't compile under Wine (#1860, #2093).
  • draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view: "round 0: one host texture" (left false). The host refuses the castable formats here, so VIctory falls back to two textures and a copy.
  • memory::tests::lists_share_a_table_and_copies_keep_their_views: Wine's compiler has no SM 5.1 resource arrays (Unbounded resource arrays not implemented), and that indexing is what the test is about. Left as it is.
  • descriptor::host::tests::dynamic_slots_are_held_until_released: the 1,000,000 view heap cap (#1835, #1744).
  • pipeline::library::tests::a_rejected_blob_gives_an_empty_library: #1722.

Under Ubuntu's Wine 10.0 these tests still fail, now at CreateComputePipelineState. That older compiler gives SM 5.1 resources a garbage register space, and vkd3d-proton reports dxil-spirv: Failed to remap SRV 17476:0.

Not run on Windows. I expect no change there, since the tests now pass the same root signature the shader embeds, but CI is the first Windows run. 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:6599438624 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2196). Originally posted by [winne42](https://github.com/winne42) on 2026-11-25T07:25:51Z. --- Several `victory-gpu` GPU tests fail under Wine and Proton before they test anything. They take the root signature from the compiled shader (`CreateRootSignature(0, bytes)`), and Wine's `d3dcompiler_47` (vkd3d-shader) doesn't keep one: it logs `W5302: Ignoring unknown attribute "RootSignature"`. It also has no `rootsig_1_0` target (`E_NOTIMPL`), so the `RS` string can't be compiled alone either. `CreateRootSignature` then fails with `E_FAIL`. ## The change - New `#[cfg(all(windows, test))]` module `crate::test_root`. It reads the `#define RS "..."` string each test shader already has, describes it as a `D3D12_ROOT_SIGNATURE_DESC`, and makes it with `D3D12SerializeRootSignature`, version 1.0, so every descriptor is volatile, the most permissive choice. - It covers the forms the tests use: descriptor tables of SRV/UAV/CBV ranges (`numDescriptors`, also `unbounded`, and `space`), root SRV/UAV/CBV, and `RootConstants`. - Two unit tests: one parses the strings without a GPU, the other makes every root signature the tests use on the host. - `bindless::tests::compile` and `draw::tests::compile_cs` pass that root signature with the pipeline, on every host. **No shader source changes.** On Windows the shader still carries its own root signature, and the pipeline uses the one passed in. ## Results RTX 3050 Laptop GPU, `x86_64-pc-windows-msvc` cross-build (lld-link + xwin), run under **Proton Experimental's own Wine (11.0)** with its vkd3d-proton and DXVK `dxgi`. This is the setup Linux users of VIctory have. | | passed | failed | |---|---|---| | `main` | 129 | 14 | | this branch | 135 | 10 | Fixed: `bindless::tests::heap_views_are_current`, `bindless::tests::heap_views_follow_writes_through_another_mapping`, `draw::tests::root_views_reach_their_copy_and_read_zeros_past_it`, `draw::tests::unordered_1d_and_3d_textures_keep_their_writes`. The other two passes are the new tests. Nothing that passes on `main` fails here. The 10 still failing, none of them from root signatures: - `indirect::tests::*` (5): the runtime argument clamp doesn't compile under Wine (`RWByteAddressBuffer.Load`): #170, #909, #2093. - `draw::tests::a_depth_texture_written_through_unordered_views_reads_as_depth`: "the conversion ran in the list". The runtime depth converter in `twin.rs` doesn't compile under Wine (#1860, #2093). - `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view`: "round 0: one host texture" (left `false`). The host refuses the castable formats here, so VIctory falls back to two textures and a copy. - `memory::tests::lists_share_a_table_and_copies_keep_their_views`: Wine's compiler has no SM 5.1 resource arrays (`Unbounded resource arrays` not implemented), and that indexing is what the test is about. Left as it is. - `descriptor::host::tests::dynamic_slots_are_held_until_released`: the 1,000,000 view heap cap (#1835, #1744). - `pipeline::library::tests::a_rejected_blob_gives_an_empty_library`: #1722. Under **Ubuntu's Wine 10.0** these tests still fail, now at `CreateComputePipelineState`. That older compiler gives SM 5.1 resources a garbage register space, and vkd3d-proton reports `dxil-spirv: Failed to remap SRV 17476:0`. **Not run on Windows.** I expect no change there, since the tests now pass the same root signature the shader embeds, but CI is the first Windows run. `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 08:06:19 +00:00 (Migrated from github.com)

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

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 draw::tests:: — 5 passed, 0 failed on RTX 5090
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok (184 files ok)

Clean test_root builder constructing root signatures directly from each test shader's RS string. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6053616277 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2196#pullrequestreview-6053616277). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T07:42:28Z. **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 draw::tests::` — **5 passed, 0 failed** on RTX 5090 - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok (`184 files ok`) Clean `test_root` builder constructing root signatures directly from each test shader's RS string. Looks good. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 08:06:20 +00:00 (Migrated from github.com)

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

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: root signatures from each shader's RS string — root-signature coverage tests; Windows-only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6053836365 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2196#pullrequestreview-6053836365). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T08:03:04Z. **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: root signatures from each shader's RS string — root-signature coverage tests; Windows-only.
Dathinel commented 2026-11-25 08:06:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T07:56:06Z.


Native Windows comparison on the same GPU model as the Proton report (RTX 3050 Laptop, driver 32.0.16.1062). The depth-UAV readback and cross-format placed-view tests both passed on parent 940d32f and PR 5c6a252. The selected draw, bindless and root-signature tests went from 8 passed on the parent to 10 passed on the PR, with no failures.

To check for silent skips, I repeated the PR run with a print immediately after successful CreateRootSignature in test_root. It ran 19 times, including in both tests above. This narrows the two remaining Proton failures: on this Windows setup the new root-signature path reaches the assertions and passes them.

Reproduce the unmodified run with cargo test --locked -p victory-gpu --lib -- draw::tests:: bindless::tests:: test_root:: --nocapture --test-threads=1. AI-assisted; synthetic inputs only.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7156416682 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2196#issuecomment-7156416682). Originally posted by [Dathinel](https://github.com/Dathinel) on 2026-11-25T07:56:06Z. --- Native Windows comparison on the same GPU model as the Proton report (RTX 3050 Laptop, driver 32.0.16.1062). The depth-UAV readback and cross-format placed-view tests both passed on parent `940d32f` and PR `5c6a252`. The selected draw, bindless and root-signature tests went from 8 passed on the parent to 10 passed on the PR, with no failures. To check for silent skips, I repeated the PR run with a print immediately after successful `CreateRootSignature` in `test_root`. It ran 19 times, including in both tests above. This narrows the two remaining Proton failures: on this Windows setup the new root-signature path reaches the assertions and passes them. Reproduce the unmodified run with `cargo test --locked -p victory-gpu --lib -- draw::tests:: bindless::tests:: test_root:: --nocapture --test-threads=1`. AI-assisted; synthetic inputs only.
ntgata1-dotcom commented 2026-11-25 11:05:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-25T10:15:30Z.


RX 9070 XT (RADV) under Wine 11.22: the same four tests fixed

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. Cross-built with cargo-xwin: cargo xwin test --locked --target x86_64-pc-windows-msvc --no-fail-fast -p victory-gpu, runner wine.

victory-gpu passed failed
main 940d32f 130 13
this PR 5c6a252 136 9
this PR + #2101, merged locally 138 8
this PR + #2101 + #1722, merged locally 139 7
  • The same four tests are fixed, and both test_root tests pass. Nothing that passes on main fails, here or in the merged runs.
  • The 9 left are your list without the heap-cap one: descriptor::host::tests::dynamic_slots_are_held_until_released passes on this card. The depth and placed-view tests fail with your messages ("the conversion ran in the list", "round 0: one host texture"), and memory with E5017.
  • With #2101 as well, draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view passes under Wine too. That fits the Windows run above: what's left in that test is the castable-format refusal (#2101), not the root signature.
  • Left with all three: the five indirect tests (#170, #1279), a_depth_texture_written_through_unordered_views_reads_as_depth (#1860) and memory::tests::lists_share_a_table_and_copies_keep_their_views. #1722 fixes the pipeline-library one.

Not run: Windows, clippy.

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159447816 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2196#issuecomment-7159447816). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-25T10:15:30Z. --- **RX 9070 XT (RADV) under Wine 11.22: the same four tests fixed** 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. Cross-built with cargo-xwin: `cargo xwin test --locked --target x86_64-pc-windows-msvc --no-fail-fast -p victory-gpu`, runner `wine`. | `victory-gpu` | passed | failed | |---|---|---| | `main` `940d32f` | 130 | 13 | | this PR `5c6a252` | 136 | 9 | | this PR + #2101, merged locally | 138 | 8 | | this PR + #2101 + #1722, merged locally | 139 | 7 | - The same four tests are fixed, and both `test_root` tests pass. Nothing that passes on `main` fails, here or in the merged runs. - The 9 left are your list without the heap-cap one: `descriptor::host::tests::dynamic_slots_are_held_until_released` passes on this card. The depth and placed-view tests fail with your messages ("the conversion ran in the list", "round 0: one host texture"), and `memory` with E5017. - With #2101 as well, `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` passes under Wine too. That fits the Windows run above: what's left in that test is the castable-format refusal (#2101), not the root signature. - Left with all three: the five `indirect` tests (#170, #1279), `a_depth_texture_written_through_unordered_views_reads_as_depth` (#1860) and `memory::tests::lists_share_a_table_and_copies_keep_their_views`. #1722 fixes the pipeline-library one. Not run: Windows, clippy. AI-assisted (Claude Code); numbers from my own runs.
Marvisak commented 2026-11-25 14:07:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T13:29:07Z.


Automated triage for the maintainers.

Needs work: needs the maintainer's decision. The PR adds a test-only module crates/victory-gpu/src/test_root.rs (about 250 lines) that parses each test shader's #define RS string into a version 1.0 root signature, and bindless::tests::compile / draw::tests::compile_cs now pass that instead of the one embedded in the compiled shader. By my reading it is correct for the RS forms the tests use, touches no runtime code, and CI (check) passes; a tester confirmed the affected tests still pass on native Windows. Its only purpose is to make the GPU tests run under Wine/Proton, whose compiler drops [RootSignature]; since VIctory targets native Windows, whether the project wants to carry a hand-written root-signature parser for Wine test runs is a scope decision for the maintainer. One side effect to weigh: on Windows these tests now run with version 1.0 (all-volatile) root signatures rather than the ones the shaders embed.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7163844328 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2196#issuecomment-7163844328). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T13:29:07Z. --- <!-- victory-triage v1 head=5c6a2528c281310286af29056467797211042c4b verdict=needs-work at=2026-11-25T13:36:00Z --> Automated triage for the maintainers. **Needs work: needs the maintainer's decision.** The PR adds a test-only module `crates/victory-gpu/src/test_root.rs` (about 250 lines) that parses each test shader's `#define RS` string into a version 1.0 root signature, and `bindless::tests::compile` / `draw::tests::compile_cs` now pass that instead of the one embedded in the compiled shader. By my reading it is correct for the RS forms the tests use, touches no runtime code, and CI (`check`) passes; a tester confirmed the affected tests still pass on native Windows. Its only purpose is to make the GPU tests run under Wine/Proton, whose compiler drops `[RootSignature]`; since VIctory targets native Windows, whether the project wants to carry a hand-written root-signature parser for Wine test runs is a scope decision for the maintainer. One side effect to weigh: on Windows these tests now run with version 1.0 (all-volatile) root signatures rather than the ones the shaders embed. --- _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/2196:upstream-pr/2196'
git switch 'upstream-pr/2196'

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