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

Closed
GamingRipperDoc wants to merge 3 commits from upstream-pr/362 into main
GamingRipperDoc commented 2026-11-24 02:36:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by GamingRipperDoc on 2026-11-24T02:36:49Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6573352032 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/362). Originally posted by [GamingRipperDoc](https://github.com/GamingRipperDoc) on 2026-11-24T02:36:49Z. --- 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)
jeremygold02 commented 2026-11-24 06:55:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:28:02Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7122045497 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7122045497). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T04:28:02Z. --- 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)
steppergg commented 2026-11-24 10:03:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by steppergg on 2026-11-24T09:14:37Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7127147203 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7127147203). Originally posted by [steppergg](https://github.com/steppergg) on 2026-11-24T09:14:37Z. --- 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.
niilun commented 2026-11-24 13:02:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by niilun on 2026-11-24T13:00:21Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7132215673 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7132215673). Originally posted by [niilun](https://github.com/niilun) on 2026-11-24T13:00:21Z. --- 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
Lemontea0075 commented 2026-11-24 19:04:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Lemontea0075 on 2026-11-24T18:08:27Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140215548 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7140215548). Originally posted by [Lemontea0075](https://github.com/Lemontea0075) on 2026-11-24T18:08:27Z. --- 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.
upstream-sync closed this pull request 2026-11-25 00:05:25 +00:00
Marvisak commented 2026-11-25 00:06:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:02:26Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148070468 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/362#issuecomment-7148070468). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:02:26Z. --- 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

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