[windows] opt-in local Agility SDK staging for SM 6.6 unit tests on Windows 10 #631

Open
RileyW wants to merge 1 commit from RileyW/Darner:pr/win10-test-agility into Main
First-time contributor

Tests-only opt-in tooling change (disabled unless DARNER_TEST_AGILITY_DIR is set; verified on Windows 10 22H2 + RTX 3080 with local Agility SDK 1.620, and verified zero impact when unset).

What it changes

  • The problem on main: on Windows 10 22H2, apps/darner exports D3D12SDKVersion and D3D12SDKPath so darner.exe loads D3D12\D3D12Core.dll (SM 6.6+), but cargo test binaries for darner-gpu and darner-shader do not export those symbols. As a result, system d3d12.dll caps unit test binaries at SM 0x65: darner-gpu tests that create a host device abort (exit code 3) and darner-shader GPU tests skip or fail on Windows 10 even when the developer has a local D3D12Core.dll.

This change adds an opt-in environment variable DARNER_TEST_AGILITY_DIR (pointing to a local folder containing Microsoft D3D12Core.dll, plus optional d3d12SDKLayers.dll / D3D12StateObjectCompiler.dll / d3d10warp.dll):

  1. When DARNER_TEST_AGILITY_DIR is unset (the default), nothing is emitted, no files are copied, and builds on Windows 11, Windows 10, and Linux are completely unchanged.
  2. When DARNER_TEST_AGILITY_DIR is set on Windows, crates/darner-shader/build.rs and crates/darner-gpu/build.rs detect the exact SDK version from D3D12Core.dll VS_FIXEDFILEINFO (same parser as apps/darner/src/main.rs, preventing 0x887E0003 version-mismatch errors across 1.614/1.618/1.620; overridable via DARNER_TEST_AGILITY_VERSION), stage the DLLs into target/profile/deps/D3D12/ (outside Git), and enable cfg(darner_test_agility).
  3. Under cfg(all(test, windows, darner_test_agility)), crates/darner-shader/src/lib.rs and crates/darner-gpu/src/lib.rs export D3D12SDKVersion and D3D12SDKPath for test binaries only (via .drectve on MSVC and cargo:rustc-link-arg-tests on GNU), so library targets and apps/darner never suffer LNK2005 duplicate-symbol conflicts. The internal rustc-env uses TEST_AGILITY_SDK_VERSION so DARNER_SHADER_SWITCHES and shader cache fingerprints remain untouched.

How it was tested

  • Tested revision: 9788a0a (based on c8258f9)
  • Commands and results:
    • Unset (default): cargo clippy --workspace --all-targets --locked -- -D warnings (0 warnings), cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (0 warnings), cargo xtask policy and cargo xtask policy --staged (ok)
    • With DARNER_TEST_AGILITY_DIR=D:\Darner\D3D12 (Agility SDK 1.620 on Windows 10 22H2 + RTX 3080):
      • cargo test -p darner-gpu --lib watch::tests::streamed_texture_written_through_an_alias_reaches_a_full_queue --locked -- --exact --nocapture -> 1 passed (GPU pixels 1024/1024 on pages 0 and 1)
      • cargo test -p darner-shader --lib emit::valu_tests::v_med3_f32_matches_rdna2_with_nan --locked -- --exact --nocapture -> 1 passed on hardware RTX 3080
      • cargo test -p darner-shader --lib every_rewrite_has_a_switch_in_the_fingerprint --locked -> 1 passed (confirms DARNER_SHADER_SWITCHES unchanged)
      • cargo clippy -p darner-shader -p darner-gpu -p darner --all-targets --all-features --locked -- -D warnings -> 0 warnings
      • cargo build -p darner --locked -> ok (confirms zero symbol collision with apps/darner)
  • Changes a default: no (strictly opt-in via DARNER_TEST_AGILITY_DIR).
  • A/B result: tests-only opt-in developer tooling; not a runtime performance claim.
  • Gates run on that revision: both workspace clippy gates, cargo xtask policy, cargo build -p darner, and SM 6.6 GPU unit tests.
  • Hardware dependence: Windows 10 host test binaries with a local Agility SDK D3D12Core.dll; no-op on Windows 11/Linux or when unset.
  • Coverage gaps: tested on MSVC (Windows 10 22H2 + RTX 3080, Agility SDK 1.620); the windows-gnu .def link-arg-tests path was checked by code inspection only.

Checklist

  • I ran this change in the game, or say below why it cannot be (tests-only build/test harness opt-in; verified with live SM 6.6 D3D12 unit tests on RTX 3080 and cargo build -p darner).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #594 (bundles a hardcoded DARNER_TEST_AGILITY=1 option inside a 28-file multi-fix PR; this PR isolates Win10 SM 6.6 test support as a single standalone change with automatic version detection and deps/D3D12 staging).
  • Replaces or overlaps: partial overlap with #594 test_agility only (cleaner standalone scope).
Tests-only opt-in tooling change (disabled unless DARNER_TEST_AGILITY_DIR is set; verified on Windows 10 22H2 + RTX 3080 with local Agility SDK 1.620, and verified zero impact when unset). ## What it changes - The problem on main: on Windows 10 22H2, apps/darner exports D3D12SDKVersion and D3D12SDKPath so darner.exe loads D3D12\D3D12Core.dll (SM 6.6+), but cargo test binaries for darner-gpu and darner-shader do not export those symbols. As a result, system d3d12.dll caps unit test binaries at SM 0x65: darner-gpu tests that create a host device abort (exit code 3) and darner-shader GPU tests skip or fail on Windows 10 even when the developer has a local D3D12Core.dll. This change adds an opt-in environment variable DARNER_TEST_AGILITY_DIR (pointing to a local folder containing Microsoft D3D12Core.dll, plus optional d3d12SDKLayers.dll / D3D12StateObjectCompiler.dll / d3d10warp.dll): 1. When DARNER_TEST_AGILITY_DIR is unset (the default), nothing is emitted, no files are copied, and builds on Windows 11, Windows 10, and Linux are completely unchanged. 2. When DARNER_TEST_AGILITY_DIR is set on Windows, crates/darner-shader/build.rs and crates/darner-gpu/build.rs detect the exact SDK version from D3D12Core.dll VS_FIXEDFILEINFO (same parser as apps/darner/src/main.rs, preventing 0x887E0003 version-mismatch errors across 1.614/1.618/1.620; overridable via DARNER_TEST_AGILITY_VERSION), stage the DLLs into target/profile/deps/D3D12/ (outside Git), and enable cfg(darner_test_agility). 3. Under cfg(all(test, windows, darner_test_agility)), crates/darner-shader/src/lib.rs and crates/darner-gpu/src/lib.rs export D3D12SDKVersion and D3D12SDKPath for test binaries only (via .drectve on MSVC and cargo:rustc-link-arg-tests on GNU), so library targets and apps/darner never suffer LNK2005 duplicate-symbol conflicts. The internal rustc-env uses TEST_AGILITY_SDK_VERSION so DARNER_SHADER_SWITCHES and shader cache fingerprints remain untouched. ## How it was tested - Tested revision: 9788a0a (based on c8258f9) - Commands and results: - Unset (default): cargo clippy --workspace --all-targets --locked -- -D warnings (0 warnings), cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (0 warnings), cargo xtask policy and cargo xtask policy --staged (ok) - With DARNER_TEST_AGILITY_DIR=D:\Darner\D3D12 (Agility SDK 1.620 on Windows 10 22H2 + RTX 3080): - cargo test -p darner-gpu --lib watch::tests::streamed_texture_written_through_an_alias_reaches_a_full_queue --locked -- --exact --nocapture -> 1 passed (GPU pixels 1024/1024 on pages 0 and 1) - cargo test -p darner-shader --lib emit::valu_tests::v_med3_f32_matches_rdna2_with_nan --locked -- --exact --nocapture -> 1 passed on hardware RTX 3080 - cargo test -p darner-shader --lib every_rewrite_has_a_switch_in_the_fingerprint --locked -> 1 passed (confirms DARNER_SHADER_SWITCHES unchanged) - cargo clippy -p darner-shader -p darner-gpu -p darner --all-targets --all-features --locked -- -D warnings -> 0 warnings - cargo build -p darner --locked -> ok (confirms zero symbol collision with apps/darner) - Changes a default: no (strictly opt-in via DARNER_TEST_AGILITY_DIR). - A/B result: tests-only opt-in developer tooling; not a runtime performance claim. - Gates run on that revision: both workspace clippy gates, cargo xtask policy, cargo build -p darner, and SM 6.6 GPU unit tests. - Hardware dependence: Windows 10 host test binaries with a local Agility SDK D3D12Core.dll; no-op on Windows 11/Linux or when unset. - Coverage gaps: tested on MSVC (Windows 10 22H2 + RTX 3080, Agility SDK 1.620); the windows-gnu .def link-arg-tests path was checked by code inspection only. ## Checklist - [x] I ran this change in the game, or say below why it cannot be (tests-only build/test harness opt-in; verified with live SM 6.6 D3D12 unit tests on RTX 3080 and cargo build -p darner). - [x] This PR contains one change based on main. - [x] The diff follows docs/asset-policy.md. - [x] I recorded this PR dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #594 (bundles a hardcoded DARNER_TEST_AGILITY=1 option inside a 28-file multi-fix PR; this PR isolates Win10 SM 6.6 test support as a single standalone change with automatic version detection and deps/D3D12 staging). - Replaces or overlaps: partial overlap with #594 test_agility only (cleaner standalone scope).
TrustNo1 changed title from [pr-tests][windows] opt-in local Agility SDK staging for SM 6.6 unit tests on Windows 10 to [windows] opt-in local Agility SDK staging for SM 6.6 unit tests on Windows 10 2026-12-06 03:25:53 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'pr/win10-test-agility:RileyW-pr/win10-test-agility'
git switch 'RileyW-pr/win10-test-agility'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'RileyW-pr/win10-test-agility'
git switch 'RileyW-pr/win10-test-agility'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'RileyW-pr/win10-test-agility'
git switch 'RileyW-pr/win10-test-agility'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'RileyW-pr/win10-test-agility'
git switch 'Main'
git merge --squash 'RileyW-pr/win10-test-agility'
git switch 'Main'
git merge --ff-only 'RileyW-pr/win10-test-agility'
git switch 'Main'
git merge 'RileyW-pr/win10-test-agility'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
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
TrustNo1/Darner!631
No description provided.