Windows 10 unit tests: a staged D3D12 Agility SDK gives them SM 6.6 #3315

Closed
github-bot wants to merge 4 commits from github-bot/gh-3315 into main AGit
Owner

@⁠TheSovietWaffle on GitHub · 2026-11-29 21:40 UTC · original
TheSovietWaffle:test/agility-unit-tests → main · +207 −18 · 15 files · 4 commits · closed without merging

Credit to #530 (flavor1337) for the .drectve export idea and the Windows 10 diagnosis; this is that change rebased onto current main, with the two both-device tests made explicit about an older WARP.

What it changes

Windows 10's in-box D3D12 stops at shader model 6.5 (WARP 6.2), so tests that build host devices find no SM 6.6 one: cargo test -p victory-shader --lib failed 51 tests at no SM 6.6 device available. D3D12 uses the runtime an executable names through D3D12SDKVersion / D3D12SDKPath, which victory.exe already exports (apps/victory/build.rs). This gives the two crates' unit-test executables the same exports, and only when the runtime is there:

  • crates/victory-shader/build.rs, crates/victory-gpu/build.rs: set cfg(agility_runtime) when <target>/<profile>/D3D12/D3D12Core.dll exists (msvc targets only).
  • crates/victory-shader/src/agility.rs, crates/victory-gpu/src/agility.rs (new): the D3D12SDKVersion (614) and D3D12SDKPath statics, plus a .drectve linker directive exporting them. Both are included as #[cfg(all(test, agility_runtime))] mod agility;, so only the unit-test executable carries the export; the integration tests link the library without it.
  • Staging uses the script that is already here: powershell -File scripts\get-d3d12.ps1 -To target\debug\D3D12 (Agility 1.614.1, package SHA-256 and Microsoft signature checked). Without that folder the cfg is off, no export is linked, and the in-box runtime is used exactly as before.
  • WARP: Windows 10's WARP stays at SM 6.2 even with the Agility runtime staged. The two tests that asked for both devices on SM 6.6 now say so and check the hardware half alone: intersect_tests.rs (ran == 2 became "at least one device, with a line when WARP is missing") and the WARP half of bitcode/opt.rs's LDS barrier test. CI's WARP is 6.6, so both still run there unchanged.
  • The SM 6.6 guard: require_direct_heaps (host.rs) ended the process with exit 3 and the plain reason a title needs. In a test binary that killed the whole run before any device test could skip, so the GPU half is now covered too: it returns the text, create() logs it and fails, host() is None. A title's run is unchanged.- A machine with no SM 6.6 device: every test that needs one now skips with a line instead of failing — valu_tests' runner, the two waterfall_tests samples, wave64_tests' helper and the NV05D1 readback, and four intersect_tests checks. The skip fires only when the device-creation error says the runtime stops below SM 6.6 (the device supports SM 0x65 only, WARP 0x62); a device that fails for any other reason still fails the test. The skips are no new false green: VICTORY_REQUIRE_HW_GPU=1, the switch bitcode::opt and wave64_tests already use, turns every one of them back into a failure (checked: it panics with VICTORY_REQUIRE_HW_GPU=1 but no SM 6.6 hardware device: the device supports SM 0x65 only), which is the loud answer #1360 asks for; CI's devices are SM 6.6, so a green CI still means the device tests ran. A bare Windows 10 checkout is green with nothing staged, and staging the runtime turns the same tests back on.

How it was tested

Windows 10 Pro 19045, RTX 3080, Rust 1.98.1, Agility 1.614.1 staged in target\debug\D3D12\:

  • cargo test -p victory-shader --lib: before 411 passed, 51 failed, 9 ignored; after 462 passed, 0 failed, 9 ignored, both with the Agility runtime staged and with target\debug\D3D12\ moved away (the device tests then skip with a line; without this change 50 of them failed).
  • cargo test -p victory-gpu --lib: 920 passed, 2 failed, 60 ignored with the runtime staged, and 914 passed, 1 failed with target\\debug\\D3D12\\ moved away. The one failure in both is shader_cache::tests::every_switch_of_the_translator_is_in_the_key, which fails alone on unmodified main too (a translator switch the cache key does not list); the second, with the runtime, is a known parallel-run flake (host::uav_pool, #2420 item 2; it passes alone). PR #3061 covers both.
  • cargo test --workspace --locked --no-fail-fast with nothing staged: every target is green except three that are already open work — the BCPack oracle (#2236/#3061), the shader key's stale switch name (#3210/#3061) and the asset-policy test (#2968). Before this branch the same run also lost the whole victory-gpu target to the exit-3 guard.- Composed with #3086 (the diagnostics-build fix) on a scratch branch, cargo check -p victory-gpu -p victory-shader --tests --profile diag --features diagnostics finishes, so the documented development profile keeps building with the runtime staged in target\diag\D3D12\.- cargo build --release --locked -p victory: Finished, with the same 18 victory-gpu warnings as main; the change is test-only.
  • With target\debug\D3D12\ moved aside, cargo check -p victory-shader -p victory-gpu --tests finishes, so the cfg-off path still compiles.
  • No title, GPU profile or game data is involved.

Checked for overlap

  • I searched the open pull requests for agility, D3D12SDKVersion and these build scripts. Related: #530 is the same idea (opened Nov 28, now mergeable=False, so this is the version that applies to main); #2792 and #3086 are the CI and diagnostics build repairs; #2500 is the F1-menu test isolation; nothing else touches these files.
**@⁠TheSovietWaffle** on GitHub · 2026-11-29 21:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3315) `TheSovietWaffle:test/agility-unit-tests` → `main` · +207 −18 · 15 files · 4 commits · closed without merging Credit to #530 (flavor1337) for the `.drectve` export idea and the Windows 10 diagnosis; this is that change rebased onto current `main`, with the two both-device tests made explicit about an older WARP. ## What it changes Windows 10's in-box D3D12 stops at shader model 6.5 (WARP 6.2), so tests that build host devices find no SM 6.6 one: `cargo test -p victory-shader --lib` failed 51 tests at `no SM 6.6 device available`. D3D12 uses the runtime an executable names through `D3D12SDKVersion` / `D3D12SDKPath`, which `victory.exe` already exports (`apps/victory/build.rs`). This gives the two crates' **unit-test executables** the same exports, and only when the runtime is there: - **`crates/victory-shader/build.rs`, `crates/victory-gpu/build.rs`**: set `cfg(agility_runtime)` when `<target>/<profile>/D3D12/D3D12Core.dll` exists (msvc targets only). - **`crates/victory-shader/src/agility.rs`, `crates/victory-gpu/src/agility.rs`** (new): the `D3D12SDKVersion` (614) and `D3D12SDKPath` statics, plus a `.drectve` linker directive exporting them. Both are included as `#[cfg(all(test, agility_runtime))] mod agility;`, so only the unit-test executable carries the export; the integration tests link the library without it. - **Staging** uses the script that is already here: `powershell -File scripts\get-d3d12.ps1 -To target\debug\D3D12` (Agility 1.614.1, package SHA-256 and Microsoft signature checked). Without that folder the cfg is off, no export is linked, and the in-box runtime is used exactly as before. - **WARP**: Windows 10's WARP stays at SM 6.2 even with the Agility runtime staged. The two tests that asked for *both* devices on SM 6.6 now say so and check the hardware half alone: `intersect_tests.rs` (`ran == 2` became "at least one device, with a line when WARP is missing") and the WARP half of `bitcode/opt.rs`'s LDS barrier test. CI's WARP is 6.6, so both still run there unchanged. - **The SM 6.6 guard**: `require_direct_heaps` (host.rs) ended the process with exit 3 and the plain reason a title needs. In a test binary that killed the whole run before any device test could skip, so the GPU half is now covered too: it returns the text, `create()` logs it and fails, `host()` is `None`. A title's run is unchanged.- **A machine with no SM 6.6 device**: every test that needs one now skips with a line instead of failing — `valu_tests`' runner, the two `waterfall_tests` samples, `wave64_tests`' helper and the NV05D1 readback, and four `intersect_tests` checks. The skip fires only when the device-creation error says the runtime stops below SM 6.6 (`the device supports SM 0x65 only`, WARP `0x62`); a device that fails for any other reason still fails the test. The skips are no new false green: `VICTORY_REQUIRE_HW_GPU=1`, the switch `bitcode::opt` and `wave64_tests` already use, turns every one of them back into a failure (checked: it panics with `VICTORY_REQUIRE_HW_GPU=1 but no SM 6.6 hardware device: the device supports SM 0x65 only`), which is the loud answer #1360 asks for; CI's devices are SM 6.6, so a green CI still means the device tests ran. A bare Windows 10 checkout is green with nothing staged, and staging the runtime turns the same tests back on. ## How it was tested Windows 10 Pro 19045, RTX 3080, Rust 1.98.1, Agility 1.614.1 staged in `target\debug\D3D12\`: - `cargo test -p victory-shader --lib`: before **411 passed, 51 failed, 9 ignored**; after **462 passed, 0 failed, 9 ignored**, both with the Agility runtime staged and with `target\debug\D3D12\` moved away (the device tests then skip with a line; without this change 50 of them failed). - `cargo test -p victory-gpu --lib`: **920 passed, 2 failed, 60 ignored** with the runtime staged, and **914 passed, 1 failed** with `target\\debug\\D3D12\\` moved away. The one failure in both is `shader_cache::tests::every_switch_of_the_translator_is_in_the_key`, which fails alone on unmodified `main` too (a translator switch the cache key does not list); the second, with the runtime, is a known parallel-run flake (`host::uav_pool`, #2420 item 2; it passes alone). PR #3061 covers both. - `cargo test --workspace --locked --no-fail-fast` with nothing staged: every target is green except three that are already open work — the BCPack oracle (#2236/#3061), the shader key's stale switch name (#3210/#3061) and the asset-policy test (#2968). Before this branch the same run also lost the whole `victory-gpu` target to the exit-3 guard.- Composed with #3086 (the diagnostics-build fix) on a scratch branch, `cargo check -p victory-gpu -p victory-shader --tests --profile diag --features diagnostics` finishes, so the documented development profile keeps building with the runtime staged in `target\diag\D3D12\`.- `cargo build --release --locked -p victory`: `Finished`, with the same 18 `victory-gpu` warnings as `main`; the change is test-only. - With `target\debug\D3D12\` moved aside, `cargo check -p victory-shader -p victory-gpu --tests` finishes, so the cfg-off path still compiles. - No title, GPU profile or game data is involved. ## Checked for overlap - [x] I searched the open pull requests for `agility`, `D3D12SDKVersion` and these build scripts. Related: #530 is the same idea (opened Nov 28, now `mergeable=False`, so this is the version that applies to `main`); #2792 and #3086 are the CI and diagnostics build repairs; #2500 is the F1-menu test isolation; nothing else touches these files.
The in-box D3D12 stops at shader model 6.5 (WARP 6.2), so the host-device
tests found no SM 6.6 device and 51 of the shader tests failed. D3D12 uses the
runtime an executable names when it exports D3D12SDKVersion and D3D12SDKPath,
as victory.exe does: the unit-test executables now export them too, but only
when scripts/get-d3d12.ps1 has staged the 1.614.1 runtime in
target\<profile>\D3D12\. Without it the exports are inert and the in-box
runtime is used, as before.

With the runtime staged, cargo test -p victory-shader --lib goes from 411
passed and 51 failed to 462 passed and 0 failed (9 ignored). The two tests
that ask for both hardware and WARP on SM 6.6 now say when WARP is older than
that (Windows 10's stays at 6.2) and check the hardware half alone; CI, whose
WARP is 6.6, runs both as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:44:24 +00:00
Windows 10's in-box D3D12 (6.5, WARP 6.2) still failed 50 of the shader tests
after the Agility wiring, because a handful of tests asserted that a device was
there instead of skipping. They now say so and return when the device-creation
error is the runtime's shader model; a device that fails for any other reason
still fails. With the runtime staged the same 462 tests run (319 s), and with
target\debug\D3D12\ moved away the suite is green with the device tests
skipping (58 s).
require_direct_heaps exits the process (3) with the plain reason a title's run
needs. In a unit-test binary that killed the whole run on a PC whose D3D12
stops below 6.6, before any device test could skip: cargo test -p
victory-gpu --lib ended with exit 3 and no results. It now returns the text,
create() logs it and fails, host() is None, and the device tests skip as they
do without an adapter. A title's run is unchanged: same text, same exit 3.

Three tests that reach a device through another door now skip with a line too:
the upload queue's, the stale shadow holder's (find makes the window's copy)
and the view-limit test's heap.
The skips added for a PC whose D3D12 stops below SM 6.6 could read as passed
having run nothing, which is the false green #1360 is about. The switch
bitcode::opt and wave64_tests already use now covers every one of them: with
it set, the shader runner and create() panic with the device's reason instead
of skipping. CI's devices are SM 6.6, so a green CI still means they ran.
github-bot force-pushed github-bot/gh-3315 from ecbe36897a to 859e2e38a1 2026-11-30 00:40:26 +00:00 Compare
github-bot closed this pull request 2026-12-01 18:58:54 +00:00

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/trustno1-coder--VIctory-NVIDIA!3315
No description provided.