Skip to content

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

Closed
GamingRipperDoc wants to merge 3 commits into
Marvisak:mainfrom
GamingRipperDoc:shader/tests-agility-runtime
Closed

GamingRipperDoc wants to merge 3 commits into
Marvisak:mainfrom
GamingRipperDoc:shader/tests-agility-runtime

Conversation

@GamingRipperDoc

Copy link
Copy Markdown

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 Windows 10: load the D3D12 Agility SDK runtime for shader model 6.6 #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

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

kykifox1337-source and others added 2 commits November 23, 2026 20:23
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 (Marvisak#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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@jeremygold02

Copy link
Copy Markdown
Contributor

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

aycow added a commit to aycow/VIctory that referenced this pull request Nov 24, 2026
Detect the staged package on the first build and provide a tracked opt-in
after an earlier inbox build. Check the runtime selected by D3D12 and use
the binding fixtures on compatible newer inbox runtimes.

Derived from Marvisak#362 (19aec59 and f3c7333).
Co-authored-by: kykifox1337-source <kykifox1337@gmail.com>
Co-authored-by: GamingRipperDoc <3869080+GamingRipperDoc@users.noreply.github.com>
@steppergg

Copy link
Copy Markdown

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.

…y-runtime

# Conflicts:
#	apps/victory/src/main.rs
@niilun

niilun commented Nov 24, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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.

@Marvisak

Copy link
Copy Markdown
Owner

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 Marvisak closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants