Repository navigation
Windows 10 unit tests: a staged D3D12 Agility SDK gives them SM 6.6 - #3315
Open
TheSovietWaffle wants to merge 4 commits into
Open
TheSovietWaffle wants to merge 4 commits into
TheSovietWaffle wants to merge 4 commits into
Conversation
1 task done
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.
TheSovietWaffle
force-pushed
the
test/agility-unit-tests
branch
from
November 30, 2026 00:37
ecbe368 to
859e2e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Credit to #530 (flavor1337) for the
.drectveexport idea and the Windows 10 diagnosis; this is that change rebased onto currentmain, 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 --libfailed 51 tests atno SM 6.6 device available. D3D12 uses the runtime an executable names throughD3D12SDKVersion/D3D12SDKPath, whichvictory.exealready 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: setcfg(agility_runtime)when<target>/<profile>/D3D12/D3D12Core.dllexists (msvc targets only).crates/victory-shader/src/agility.rs,crates/victory-gpu/src/agility.rs(new): theD3D12SDKVersion(614) andD3D12SDKPathstatics, plus a.drectvelinker 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.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.intersect_tests.rs(ran == 2became "at least one device, with a line when WARP is missing") and the WARP half ofbitcode/opt.rs's LDS barrier test. CI's WARP is 6.6, so both still run there unchanged.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()isNone. 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 twowaterfall_testssamples,wave64_tests' helper and the NV05D1 readback, and fourintersect_testschecks. The skip fires only when the device-creation error says the runtime stops below SM 6.6 (the device supports SM 0x65 only, WARP0x62); 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 switchbitcode::optandwave64_testsalready use, turns every one of them back into a failure (checked: it panics withVICTORY_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\: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 withtarget\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 withtarget\\debug\\D3D12\\moved away. The one failure in both isshader_cache::tests::every_switch_of_the_translator_is_in_the_key, which fails alone on unmodifiedmaintoo (a translator switch the cache key does not list); the second, with the runtime, is a known parallel-run flake (host::uav_pool, Tests after the clippy fixes: the asset policy refuses heap_sites/frame_users.rs, three parallel-run flakes, a diag-only compose test #2420 item 2; it passes alone). PR Tests: four races, the BCPack oracle, the shader key's stale names, and a loop-latch test #3061 covers both.cargo test --workspace --locked --no-fail-fastwith nothing staged: every target is green except three that are already open work — the BCPack oracle (BCPack: the test oracle reads BC7 dictionary entries as Tables::parse does #2236/Tests: four races, the BCPack oracle, the shader key's stale names, and a loop-latch test #3061), the shader key's stale switch name (gpu(shader_cache): drop stale VICTORY_SCALAR_SPLITS from KEYED #3210/Tests: four races, the BCPack oracle, the shader key's stale names, and a loop-latch test #3061) and the asset-policy test (Policy: the site tables name offsets and tags, not the title's bytes #2968). Before this branch the same run also lost the wholevictory-gputarget to the exit-3 guard.- Composed with Diagnostics-only barrier stats: six needless borrows the all-features gate refuses #3086 (the diagnostics-build fix) on a scratch branch,cargo check -p victory-gpu -p victory-shader --tests --profile diag --features diagnosticsfinishes, so the documented development profile keeps building with the runtime staged intarget\diag\D3D12\.-cargo build --release --locked -p victory:Finished, with the same 18victory-gpuwarnings asmain; the change is test-only.target\debug\D3D12\moved aside,cargo check -p victory-shader -p victory-gpu --testsfinishes, so the cfg-off path still compiles.Checked for overlap
agility,D3D12SDKVersionand these build scripts. Related: Enable D3D12 Agility SDK for Windows GPU and shader unit tests #530 is the same idea (opened Nov 28, nowmergeable=False, so this is the version that applies tomain); CI: repair Clippy gate after 11.29.01 combine #2792 and Diagnostics-only barrier stats: six needless borrows the all-features gate refuses #3086 are the CI and diagnostics build repairs; F1 menu tests: the ones that change the environment run one at a time #2500 is the F1-menu test isolation; nothing else touches these files.