Shader tests: use the Agility SDK runtime on Windows 10 (stacked on #175) #362

Closed
github-bot wants to merge 3 commits from gh-pr/362/head into gh-pr/362/base
Owner

@⁠GamingRipperDoc on GitHub · 2026-11-24 02:36 UTC · original
GamingRipperDoc:shader/tests-agility-runtime → main · +452 −3 · 12 files · 3 commits · closed without merging

Stacked on #175 (its commit 19aec59 is the first one here); review that first. Follows up its note that the 7 emit::valu_tests still fail on Windows 10.

Why they fail

D3D12 picks the Agility SDK runtime from exports on the process's executable. #175 adds them to victory.exe, but the victory-shader tests run in their own test executable, which has none. So on Windows 10 every host device stops at shader model 6.5, and:

  • the 7 emit::valu_tests fail (neither hardware nor WARP SM 6.6 device available);
  • emit::stub_pipeline_is_created and the diff_tests that need a device print no SM 6.6 device; skipped and pass without running.

What

  • crates/victory-shader/src/agility.rs (test builds only): the same two statics as apps/victory/src/agility.rs, with D3D12SDKPath = "..\D3D12\". Test executables are in <profile>\deps\; the runtime cargo xtask agility writes is in <profile>\D3D12\, so nothing is copied.
  • crates/victory-shader/build.rs: exports them (/EXPORT:…,DATA, MSVC only) only when <profile>\D3D12\D3D12Core.dll exists. D3D12 does not fall back to the in-box runtime when an executable names a newer one that is missing (D3D12_ERROR_INVALID_REDIST, as Proudnoob4 found on #175), so exporting unconditionally would break these tests on every machine that has not run the xtask, Windows 11 included. Without the runtime nothing is exported and the tests behave as on main.
    • rustc-link-arg-tests is refused for a package without a tests/ target, so it uses rustc-link-arg; the only executables this library links are its test executables.
    • It watches the DLL only when it is there. Watching a missing path makes Cargo rerun the script, and recompile the crate, on every build (checked). So:
  • cargo xtask agility updates build.rs's modification time after installing the runtime, so the next cargo test picks it up without a cargo clean.
  • The xtask test that keeps D3D12SDKVersion in step with the package now checks both copies.
  • README: one clause saying the tests use the runtime too.

Tested

Windows 10 22H2 (19045.7846), AMD RX 9070 XT, Rust 1.98.1:

victory-shader tests test executable exports no SM 6.6 device; skipped
this branch, runtime present 69 passed, 0 failed D3D12SDKPath, D3D12SDKVersion 0
this branch, target\debug\D3D12 removed 62 passed, 7 failed (same as main) none 1
  • Fresh flow: tests fail (62/7), cargo xtask agility, cargo test recompiles victory-shader once and passes 69/69.
  • Without the runtime, repeated cargo test -p victory-shader --no-run compiles nothing.
  • cargo test --workspace --no-fail-fast: the only failure left is net::only_loopback_is_reachable (#118, fixed by #152).
  • cargo clippy -p victory-shader -p xtask --all-targets --all-features: clean. rustfmt --check on the changed files: clean. cargo xtask policy --staged: 6 files ok. cargo test -p xtask: 6 passed.

Not tested on Windows 11. There nothing changes unless someone runs cargo xtask agility; then the tests use runtime 620 instead of the in-box one.

No game data used.

AI-assisted (Claude Code); I ran everything above on my machine.

🤖 Generated with Claude Code

**@⁠GamingRipperDoc** on GitHub · 2026-11-24 02:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/362) `GamingRipperDoc:shader/tests-agility-runtime` → `main` · +452 −3 · 12 files · 3 commits · closed without merging Stacked on #175 (its commit `19aec59` is the first one here); review that first. Follows up its note that the 7 `emit::valu_tests` still fail on Windows 10. ## Why they fail D3D12 picks the Agility SDK runtime from exports on the process's executable. #175 adds them to `victory.exe`, but the `victory-shader` tests run in their own test executable, which has none. So on Windows 10 every host device stops at shader model 6.5, and: - the 7 `emit::valu_tests` fail (`neither hardware nor WARP SM 6.6 device available`); - `emit::stub_pipeline_is_created` and the `diff_tests` that need a device print `no SM 6.6 device; skipped` and pass without running. ## What - `crates/victory-shader/src/agility.rs` (test builds only): the same two statics as `apps/victory/src/agility.rs`, with `D3D12SDKPath = "..\D3D12\"`. Test executables are in `<profile>\deps\`; the runtime `cargo xtask agility` writes is in `<profile>\D3D12\`, so nothing is copied. - `crates/victory-shader/build.rs`: exports them (`/EXPORT:…,DATA`, MSVC only) **only when `<profile>\D3D12\D3D12Core.dll` exists**. D3D12 does not fall back to the in-box runtime when an executable names a newer one that is missing (`D3D12_ERROR_INVALID_REDIST`, as Proudnoob4 found on #175), so exporting unconditionally would break these tests on every machine that has not run the xtask, Windows 11 included. Without the runtime nothing is exported and the tests behave as on `main`. - `rustc-link-arg-tests` is refused for a package without a `tests/` target, so it uses `rustc-link-arg`; the only executables this library links are its test executables. - It watches the DLL only when it is there. Watching a missing path makes Cargo rerun the script, and recompile the crate, on every build (checked). So: - `cargo xtask agility` updates `build.rs`'s modification time after installing the runtime, so the next `cargo test` picks it up without a `cargo clean`. - The xtask test that keeps `D3D12SDKVersion` in step with the package now checks both copies. - README: one clause saying the tests use the runtime too. ## Tested Windows 10 22H2 (19045.7846), AMD RX 9070 XT, Rust 1.98.1: | | `victory-shader` tests | test executable exports | `no SM 6.6 device; skipped` | |---|---|---|---| | this branch, runtime present | **69 passed, 0 failed** | `D3D12SDKPath`, `D3D12SDKVersion` | 0 | | this branch, `target\debug\D3D12` removed | 62 passed, 7 failed (same as `main`) | none | 1 | - Fresh flow: tests fail (62/7), `cargo xtask agility`, `cargo test` recompiles `victory-shader` once and passes 69/69. - Without the runtime, repeated `cargo test -p victory-shader --no-run` compiles nothing. - `cargo test --workspace --no-fail-fast`: the only failure left is `net::only_loopback_is_reachable` (#118, fixed by #152). - `cargo clippy -p victory-shader -p xtask --all-targets --all-features`: clean. `rustfmt --check` on the changed files: clean. `cargo xtask policy --staged`: 6 files ok. `cargo test -p xtask`: 6 passed. Not tested on Windows 11. There nothing changes unless someone runs `cargo xtask agility`; then the tests use runtime 620 instead of the in-box one. No game data used. AI-assisted (Claude Code); I ran everything above on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Windows 10's in-box D3D12 stops at shader model 6.5 and refuses root
signatures with the directly indexed heap flags (c01), so every
translated pipeline was refused and nothing drew (#84).

victory.exe now exports D3D12SDKVersion (620) and D3D12SDKPath
(.\D3D12\), and `cargo xtask agility` fetches Microsoft.Direct3D.D3D12
1.620.2 from nuget.org, checks its published SHA-512, and puts
D3D12Core.dll and d3d12SDKLayers.dll in target\<profile>\D3D12\. The
DLLs never enter the repository. Windows 11, or a missing folder, keeps
the in-box runtime.

`victory config` reports whether the runtime is in place, and the SM 6.5
error names the command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows 10 the victory-shader test executables had no D3D12SDKVersion
and D3D12SDKPath exports, so every host device stopped at shader model 6.5:
the 7 emit::valu_tests failed and the device-backed tests skipped.

The tests now export them (path ..\D3D12\, the folder `cargo xtask
agility` fills) only when D3D12Core.dll is there: D3D12 does not fall back
to the in-box runtime when the named one is missing. The build script
watches the DLL only when it exists, so a missing runtime does not rebuild
the crate every time; the xtask touches build.rs after installing it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	apps/victory/src/main.rs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:00:55 +00:00
github-bot closed this pull request 2026-11-26 04:00:55 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:28 UTC · original

Tested PR #362 at head f3c73334561b04cbbc2b00419f0a7d1ba777a9f9 (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at f3c73334561b04cbbc2b00419f0a7d1ba777a9f9.

  • cargo test --locked -p xtask agility::tests — passed (ok. 2 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s ); cases: agility::tests::version_matches_the_sdk_version_victory_exports, agility::tests::extracts_stored_and_deflated_files.

Behavior covered: Checks stored and deflated synthetic ZIP extraction and that the runtime SDK version matches both exported constants; no SDK download is run.
Code: xtask/src/agility.rs

**@⁠jeremygold02** on GitHub · 2026-11-24 04:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7122045497) Tested PR #362 at head `f3c73334561b04cbbc2b00419f0a7d1ba777a9f9` (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at `f3c73334561b04cbbc2b00419f0a7d1ba777a9f9`. - `cargo test --locked -p xtask agility::tests` — passed (ok. 2 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s ); cases: agility::tests::version_matches_the_sdk_version_victory_exports, agility::tests::extracts_stored_and_deflated_files. Behavior covered: Checks stored and deflated synthetic ZIP extraction and that the runtime SDK version matches both exported constants; no SDK download is run. Code: [xtask/src/agility.rs](https://github.com/Marvisak/VIctory/blob/f3c73334561b04cbbc2b00419f0a7d1ba777a9f9/xtask/src/agility.rs)
Author
Owner

@⁠steppergg on GitHub · 2026-11-24 09:14 UTC · original

Tested f3c7333 merged onto main 8e79c80 together with #89 and #420 on Windows 10 22H2 (19045.6036), RTX 4060 Ti, driver 621.24, Rust 1.98.1. No game data used.

cargo test -p victory-shader --lib passed failed
main 8e79c80 76 13 (no SM 6.6 device)
main + #89 + #420 76 13 (the same)
+ this PR, after cargo xtask agility 89 0

The one conflict with main is in apps/victory/src/main.rs (show_config): keep both the data_dir line and this PR's d3d12 sdk block.

With this in place I also added GPU tests for v_xnor_b32 and v_swap_b32 (#58), which had none: https://github.com/steppergg/VIctory/commits/valu-swap-xnor-tests (one commit on main, test-only; PRs are collaborator-only, so here as a branch). With this PR they pass on the RTX 4060 Ti (91 passed, 0 failed), and breaking swap on purpose makes its test fail.

AI-assisted (Claude Code); run on my machine.

**@⁠steppergg** on GitHub · 2026-11-24 09:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7127147203) Tested `f3c7333` merged onto main `8e79c80` together with #89 and #420 on Windows 10 22H2 (19045.6036), RTX 4060 Ti, driver 621.24, Rust 1.98.1. No game data used. | `cargo test -p victory-shader --lib` | passed | failed | |---|---|---| | main `8e79c80` | 76 | 13 (`no SM 6.6 device`) | | main + #89 + #420 | 76 | 13 (the same) | | + this PR, after `cargo xtask agility` | **89** | **0** | The one conflict with main is in `apps/victory/src/main.rs` (`show_config`): keep both the `data_dir` line and this PR's `d3d12 sdk` block. With this in place I also added GPU tests for `v_xnor_b32` and `v_swap_b32` (#58), which had none: https://github.com/steppergg/VIctory/commits/valu-swap-xnor-tests (one commit on main, test-only; PRs are collaborator-only, so here as a branch). With this PR they pass on the RTX 4060 Ti (91 passed, 0 failed), and breaking swap on purpose makes its test fail. AI-assisted (Claude Code); run on my machine.
Author
Owner

@⁠niilun on GitHub · 2026-11-24 13:00 UTC · original

Tested commit 1e33e88 on Windows 10 19045, NVIDIA GeForce RTX 3060 Ti, driver 610.88, Rust 1.98.1, debug profile, --test-threads=1 (no game data run)

Ran following command
cargo test -p victory-shader --lib -- --test-threads=1:

  1. main - 105 passed, 15 ignored, 1 miss
  2. this PR, without SDK - 105 passed, 15 ignored, 1 miss (15 are 13 valu_tests and 2 waterfall_tests)
  3. `this PR, with Agility SDK (after cargo xtask agility) - 120 passed, 0 ignored, 1 miss

Also there's a local patch that refuses validators older than 1.6. Without it, the test process dies with 0xc0000005 on main and on this PR with the SDK. The dxil.dll used is from the 10.0.19041 SDK

**@⁠niilun** on GitHub · 2026-11-24 13:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7132215673) Tested commit `1e33e88` on Windows 10 19045, NVIDIA GeForce RTX 3060 Ti, driver 610.88, Rust 1.98.1, debug profile, --test-threads=1 (no game data run) Ran following command `cargo test -p victory-shader --lib -- --test-threads=1`: 1. `main` - 105 passed, 15 ignored, 1 miss 2. `this PR, without SDK` - 105 passed, 15 ignored, 1 miss (15 are 13 `valu_tests` and 2 `waterfall_tests`) 3. `this PR, with Agility SDK (after cargo xtask agility) - 120 passed, 0 ignored, 1 miss Also there's a local patch that refuses validators older than 1.6. Without it, the test process dies with `0xc0000005` on `main` and on this PR with the SDK. The `dxil.dll` used is from the 10.0.19041 SDK
Author
Owner

@⁠Lemontea0075 on GitHub · 2026-11-24 18:08 UTC · original

Tested PR #362 on Windows 10 IoT Enterprise LTSC (build 19044).

Hardware:

  • NVIDIA GTX 1060 6GB
  • NVIDIA driver 560.94
  • AMD FX-8350
  • Rust 1.98.1

After the Agility SDK runtime was present:

Command:

cargo test -p victory-shader --lib -- --test-threads=1

Results:

  • 120 passed
  • 0 failed
  • 1 ignored

Before the runtime was available, 15 shader tests failed with:

neither hardware nor WARP SM 6.6 device available

After testing with the runtime, all 15 failures disappeared.

No GTA VI game data was used.

**@⁠Lemontea0075** on GitHub · 2026-11-24 18:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7140215548) Tested PR #362 on Windows 10 IoT Enterprise LTSC (build 19044). Hardware: - NVIDIA GTX 1060 6GB - NVIDIA driver 560.94 - AMD FX-8350 - Rust 1.98.1 After the Agility SDK runtime was present: Command: ```powershell cargo test -p victory-shader --lib -- --test-threads=1 ``` Results: - 120 passed - 0 failed - 1 ignored Before the runtime was available, 15 shader tests failed with: `neither hardware nor WARP SM 6.6 device available` After testing with the runtime, all 15 failures disappeared. No GTA VI game data was used.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:02 UTC · original

Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #486. Stacked on #175 and contains it (the curl downloader, sha2); its own part, the opt-in for test binaries, is what #486 does without them.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7148070468) Automated triage for the maintainers. Closing because another open pull request covers the same change. See #486. Stacked on #175 and contains it (the curl downloader, `sha2`); its own part, the opt-in for test binaries, is what #486 does without them. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!362
No description provided.