Skip to content

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

Open
TheSovietWaffle wants to merge 4 commits into
trustno1-coder:mainfrom
TheSovietWaffle:test/agility-unit-tests
Open

TheSovietWaffle wants to merge 4 commits into
trustno1-coder:mainfrom
TheSovietWaffle:test/agility-unit-tests

Conversation

@TheSovietWaffle

@TheSovietWaffle TheSovietWaffle commented Nov 29, 2026 •

Copy link
Copy Markdown

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 The WARP tests cannot skip in silence any more #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\:

Checked for overlap

@github-actions github-actions Bot added the pr-tests Pull request: tests only label Nov 29, 2026
@github-actions github-actions Bot changed the title [pr-tests] Windows 10 unit tests: a staged D3D12 Agility SDK gives them SM 6.6 Windows 10 unit tests: a staged D3D12 Agility SDK gives them SM 6.6 Nov 29, 2026
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.
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).
…t binary

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 trustno1-coder#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-tests Pull request: tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant