Windows 10: the Agility SDK exposes SM 6.6, and with it all seven valu_tests pass on hardware #473

Open
opened 2026-11-26 04:05:11 +00:00 by github-bot · 3 comments
Owner

@⁠naixue2233 on GitHub · 2026-11-24 03:49 UTC · original

Summary

Windows 10's in-box D3D12 runtime tops out at shader model 6.5, so Host::new returns Err and the seven emit::valu_tests panic on assert!(ran > 0). Nothing is wrong with the hardware — an RTX 3080 supports the feature set — the OS runtime simply does not expose it. The Agility SDK fixes it without touching a single shader:

before   62 passed; 7 failed
after    69 passed; 0 failed

The seven tests now execute on the GPU and check RDNA2 semantics (v_med3 with NaN, v_fract near 1.0, v_sin/v_cos turn reduction, bfe) against real hardware output.

Environment

OS Windows 10 Pro 22H2, build 19045.0
GPU NVIDIA RTX 3080 10 GB, driver 32.0.16.1742
Compiler MSVC 14.44.35207, Windows SDK 10.0.26100.0
Rust 1.98.1, x86_64-pc-windows-msvc
Commit d2a4bae
Agility SDK NuGet Microsoft.Direct3D.D3D12 1.610.5 (D3D12_SDK_VERSION 610)

Before

no SM 6.6 hardware device; skipped
no SM 6.6 warp device; skipped
panicked at crates\victory-shader\src\emit\valu_tests.rs:203:
neither hardware nor WARP SM 6.6 device available

Host::new (emit/host.rs:82-96) asks D3D12_FEATURE_SHADER_MODEL for >= 6.6; the in-box runtime on this build answers 6.5 for both the hardware adapter and WARP.

The patch

Three files, about thirty lines. crates/victory-shader/src/lib.rs gets one line, and the module is
#[cfg(test)] because the front end needs its own copy — two definitions in one binary would
collide at link time.

// crates/victory-shader/src/lib.rs
+ #[cfg(test)]
+ pub mod agility;

// apps/victory/src/main.rs
+ mod agility;
// crates/victory-shader/src/agility.rs  (new; apps/victory/src/agility.rs is identical)
#[allow(dead_code)]
#[unsafe(no_mangle)]
pub static D3D12SDKVersion: u32 = 610;

/// A `const char*`, not a char array: the loader dereferences this symbol.
#[allow(dead_code)]
#[unsafe(no_mangle)]
pub static D3D12SDKPath: &[u8; 9] = b".\\D3D12\\\0";
// build.rs, in both crates
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") {
    println!("cargo:rustc-link-arg=/EXPORT:D3D12SDKVersion,DATA");
    println!("cargo:rustc-link-arg=/EXPORT:D3D12SDKPath,DATA");
}

Then D3D12Core.dll ships next to the executable under D3D12\. /EXPORT: is used rather than a
.def file because .def is not on the asset-policy allowlist; cargo xtask policy reports
155 files ok with this change.

After

test emit::valu_tests::v_med3_f16_matches_rdna2_with_nan ... ok
test emit::valu_tests::v_fract_f16_never_returns_one ... ok
test emit::valu_tests::v_med3_f32_matches_rdna2_with_nan ... ok
test emit::valu_tests::v_fract_f32_never_returns_one ... ok
test emit::valu_tests::v_sin_and_v_cos_f16_reduce_large_turns ... ok
test emit::valu_tests::bfe_signed_and_unsigned_match_rdna2 ... ok
test emit::valu_tests::v_sin_and_v_cos_f32_reduce_large_turns ... ok
test result: ok. 69 passed; 0 failed

Four things that cost time

  • D3D12SDKPath must be a pointer. Exported as a byte array ([u8; 9]), the loader reads the
    first eight bytes as an address and the process dies in DllMain with 0xC0000142
    (STATUS_DLL_INIT_FAILED), before main runs.
  • D3D12SDKVersion must match the DLL exactly. With 610 in the code and 620 on disk, the
    loader silently falls back to the in-box runtime — no warning, and the seven tests fail again.
  • Once the exports exist, the DLL is mandatory. Without it D3D12CreateDevice returns
    0x887e0003 instead of falling back.
  • WARP stays below 6.6 even with the Agility runtime (no SM 6.6 warp device; skipped), so the
    software-adapter half of these tests is still skipped. Only hardware coverage improves.

Unrelated, same machine: victory-hle

net::tests::only_loopback_is_reachable panics with winhttp.dll lacks WinHttpGetProxySettingsEx. dumpbin /exports C:\Windows\System32\winhttp.dll on 19045 (file
version 10.0.19041.3636) lists WinHttpGetProxyForUrlEx, WinHttpReadProxySettings and
WinHttpGetProxySettingsVersion but not WinHttpGetProxySettingsEx, so the "every override names
a real export" assertion cannot hold on Windows 10. It means cargo test --workspace can never be
green there, even with everything else passing.

Questions

  1. Would you take a PR for this? Where should D3D12Core.dll live — checked in under
    apps/victory/D3D12/, fetched by a build script, or left to the packaging step? Distribution
    terms are in the SDK's distributable files.txt.
  2. Is Windows 10 meant to be supported? If yes, the requirements line could say "shader model 6.6,
    which on Windows 10 needs the Agility SDK"; if not, saying "Windows 11" outright would save
    people the dead end.
  3. Should the capability check skip rather than fail when 6.6 is absent? A Win10 contributor
    currently sees a red suite even though every test that can run passes.

Happy to verify any variant on this machine.

**@⁠naixue2233** on GitHub · 2026-11-24 03:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/473) ## Summary Windows 10's in-box D3D12 runtime tops out at shader model 6.5, so `Host::new` returns `Err` and the seven `emit::valu_tests` panic on `assert!(ran > 0)`. Nothing is wrong with the hardware — an RTX 3080 supports the feature set — the OS runtime simply does not expose it. The Agility SDK fixes it without touching a single shader: ``` before 62 passed; 7 failed after 69 passed; 0 failed ``` The seven tests now execute on the GPU and check RDNA2 semantics (`v_med3` with NaN, `v_fract` near 1.0, `v_sin`/`v_cos` turn reduction, `bfe`) against real hardware output. ## Environment | | | |---|---| | OS | Windows 10 Pro 22H2, build 19045.0 | | GPU | NVIDIA RTX 3080 10 GB, driver 32.0.16.1742 | | Compiler | MSVC 14.44.35207, Windows SDK 10.0.26100.0 | | Rust | 1.98.1, `x86_64-pc-windows-msvc` | | Commit | `d2a4bae` | | Agility SDK | NuGet `Microsoft.Direct3D.D3D12` 1.610.5 (`D3D12_SDK_VERSION` 610) | ## Before ``` no SM 6.6 hardware device; skipped no SM 6.6 warp device; skipped panicked at crates\victory-shader\src\emit\valu_tests.rs:203: neither hardware nor WARP SM 6.6 device available ``` `Host::new` (`emit/host.rs:82-96`) asks `D3D12_FEATURE_SHADER_MODEL` for `>= 6.6`; the in-box runtime on this build answers 6.5 for both the hardware adapter and WARP. ## The patch Three files, about thirty lines. `crates/victory-shader/src/lib.rs` gets one line, and the module is `#[cfg(test)]` because the front end needs its own copy — two definitions in one binary would collide at link time. ```rust // crates/victory-shader/src/lib.rs + #[cfg(test)] + pub mod agility; // apps/victory/src/main.rs + mod agility; ``` ```rust // crates/victory-shader/src/agility.rs (new; apps/victory/src/agility.rs is identical) #[allow(dead_code)] #[unsafe(no_mangle)] pub static D3D12SDKVersion: u32 = 610; /// A `const char*`, not a char array: the loader dereferences this symbol. #[allow(dead_code)] #[unsafe(no_mangle)] pub static D3D12SDKPath: &[u8; 9] = b".\\D3D12\\\0"; ``` ```rust // build.rs, in both crates if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") { println!("cargo:rustc-link-arg=/EXPORT:D3D12SDKVersion,DATA"); println!("cargo:rustc-link-arg=/EXPORT:D3D12SDKPath,DATA"); } ``` Then `D3D12Core.dll` ships next to the executable under `D3D12\`. `/EXPORT:` is used rather than a `.def` file because `.def` is not on the asset-policy allowlist; `cargo xtask policy` reports `155 files ok` with this change. ## After ``` test emit::valu_tests::v_med3_f16_matches_rdna2_with_nan ... ok test emit::valu_tests::v_fract_f16_never_returns_one ... ok test emit::valu_tests::v_med3_f32_matches_rdna2_with_nan ... ok test emit::valu_tests::v_fract_f32_never_returns_one ... ok test emit::valu_tests::v_sin_and_v_cos_f16_reduce_large_turns ... ok test emit::valu_tests::bfe_signed_and_unsigned_match_rdna2 ... ok test emit::valu_tests::v_sin_and_v_cos_f32_reduce_large_turns ... ok test result: ok. 69 passed; 0 failed ``` ## Four things that cost time - **`D3D12SDKPath` must be a pointer.** Exported as a byte array (`[u8; 9]`), the loader reads the first eight bytes as an address and the process dies in `DllMain` with `0xC0000142` (STATUS_DLL_INIT_FAILED), before `main` runs. - **`D3D12SDKVersion` must match the DLL exactly.** With 610 in the code and 620 on disk, the loader silently falls back to the in-box runtime — no warning, and the seven tests fail again. - **Once the exports exist, the DLL is mandatory.** Without it `D3D12CreateDevice` returns `0x887e0003` instead of falling back. - **WARP stays below 6.6** even with the Agility runtime (`no SM 6.6 warp device; skipped`), so the software-adapter half of these tests is still skipped. Only hardware coverage improves. ## Unrelated, same machine: `victory-hle` `net::tests::only_loopback_is_reachable` panics with `winhttp.dll lacks WinHttpGetProxySettingsEx`. `dumpbin /exports C:\Windows\System32\winhttp.dll` on 19045 (file version 10.0.19041.3636) lists `WinHttpGetProxyForUrlEx`, `WinHttpReadProxySettings` and `WinHttpGetProxySettingsVersion` but not `WinHttpGetProxySettingsEx`, so the "every override names a real export" assertion cannot hold on Windows 10. It means `cargo test --workspace` can never be green there, even with everything else passing. ## Questions 1. Would you take a PR for this? Where should `D3D12Core.dll` live — checked in under `apps/victory/D3D12/`, fetched by a build script, or left to the packaging step? Distribution terms are in the SDK's `distributable files.txt`. 2. Is Windows 10 meant to be supported? If yes, the requirements line could say "shader model 6.6, which on Windows 10 needs the Agility SDK"; if not, saying "Windows 11" outright would save people the dead end. 3. Should the capability check skip rather than fail when 6.6 is absent? A Win10 contributor currently sees a red suite even though every test that can run passes. Happy to verify any variant on this machine.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:05:11 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 03:51 UTC · original

Corroborating from the other side of the same gap: under Wine 11.22 (Wine's D3D12, no Agility SDK) on main d2a4bae, victory-shader gives exactly 62 passed / 7 failed, and all seven panic with neither hardware nor WARP SM 6.6 device available. Same seven names as here. Heads #433 (1106f43) and #458 (360f382) reproduce it unchanged.

Two connections:

  • #463 is the open PR that loads an app-local D3D12 Agility SDK runtime when present — i.e. the mechanism this issue needs. It currently does not build its tests against main (E0428: mod tests twice in crates/victory-gpu/src/host.rs, line 252 from main and 1974 from the branch), so it needs a rebase before it can serve as the fix.
  • #433 serialises the VALU tests; that only matters once a device actually runs them, which is exactly the “before/after” here (62→69). Worth landing both, but #463 first.

No game data used.

**@⁠DaviTostes** on GitHub · 2026-11-24 03:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/473#issuecomment-7121488798) Corroborating from the other side of the same gap: under **Wine 11.22** (Wine's D3D12, no Agility SDK) on `main` `d2a4bae`, `victory-shader` gives exactly **62 passed / 7 failed**, and all seven panic with `neither hardware nor WARP SM 6.6 device available`. Same seven names as here. Heads #433 (`1106f43`) and #458 (`360f382`) reproduce it unchanged. Two connections: - **#463** is the open PR that loads an app-local D3D12 Agility SDK runtime when present — i.e. the mechanism this issue needs. It currently **does not build its tests against `main`** (`E0428`: `mod tests` twice in `crates/victory-gpu/src/host.rs`, line 252 from main and 1974 from the branch), so it needs a rebase before it can serve as the fix. - **#433** serialises the VALU tests; that only matters once a device actually runs them, which is exactly the “before/after” here (62→69). Worth landing both, but #463 first. No game data used.
Author
Owner

@⁠naixue2233 on GitHub · 2026-11-24 03:58 UTC · original

Thanks — the Wine datapoint is the useful part here: it shows this is the runtime's shader-model cap rather than anything Windows-specific, and the same seven names reproducing on three different heads (d2a4bae, 1106f43, 360f382) makes it a clean reproduction.

Followed your pointer to #463. It is the right mechanism, and I had arrived at the same one before seeing it; I have opened #486 for the half it does not cover:

#463 exports the symbols from apps/victory only, so victory.exe gets 6.6 but cargo test -p victory-shader still runs against the in-box runtime and those seven valu_tests keep failing. #486 adds the opt-in to the shader crate's test targets: it looks for the runtime where #463 puts it (target/<profile>/D3D12/D3D12Core.dll), mirrors it into deps/ because the loader resolves D3D12SDKPath next to the running module, and does nothing at all when the file is absent. Disjoint files, so the two can land in either order.

With both halves on Windows 10 19045 + RTX 3080: victory-shader 62/7 → 69/0, and the seven now execute on the GPU rather than being skipped.

Two things that may be worth folding into #463's "runtime missing" path, both learned the hard way:

  • D3D12SDKPath must be exported as a const char*. As a byte array, the loader dereferences the first eight bytes and the process dies in DllMain with 0xC0000142, before main runs.
  • D3D12SDKVersion must match the shipped DLL exactly. With 610 in the code and 620 on disk, the loader silently falls back to the in-box runtime — no warning, and you are back at 6.5 wondering why nothing changed. #463 uses 614 and #486 uses 610; someone should pin one, ideally derived from the package version rather than typed.

One more: WARP stays below 6.6 even with the runtime present (no SM 6.6 warp device; skipped), so the software-adapter half of these tests is skipped either way. Only hardware coverage moves — which is exactly what 62→69 measures.

Noted on #433. I will wait for it rather than fight the intermittent hang locally.

For the record, a datapoint that matches your Wine run: with both binaries opting in, the menus render and respond at 30 fps here too (RTX 3080, same 19045 build). The world path is a separate wall on a 32-wide subgroup device — I will file that on its own rather than mix it into this issue.

**@⁠naixue2233** on GitHub · 2026-11-24 03:58 UTC · [original](https://github.com/Marvisak/VIctory/issues/473#issuecomment-7121584037) Thanks — the Wine datapoint is the useful part here: it shows this is the runtime's shader-model cap rather than anything Windows-specific, and the same seven names reproducing on three different heads (`d2a4bae`, `1106f43`, `360f382`) makes it a clean reproduction. Followed your pointer to #463. It is the right mechanism, and I had arrived at the same one before seeing it; I have opened #486 for the half it does not cover: **#463 exports the symbols from `apps/victory` only**, so `victory.exe` gets 6.6 but `cargo test -p victory-shader` still runs against the in-box runtime and those seven `valu_tests` keep failing. #486 adds the opt-in to the shader crate's test targets: it looks for the runtime where #463 puts it (`target/<profile>/D3D12/D3D12Core.dll`), mirrors it into `deps/` because the loader resolves `D3D12SDKPath` next to the running module, and does nothing at all when the file is absent. Disjoint files, so the two can land in either order. With both halves on Windows 10 19045 + RTX 3080: `victory-shader` 62/7 → 69/0, and the seven now execute on the GPU rather than being skipped. Two things that may be worth folding into #463's "runtime missing" path, both learned the hard way: - **`D3D12SDKPath` must be exported as a `const char*`.** As a byte array, the loader dereferences the first eight bytes and the process dies in `DllMain` with `0xC0000142`, before `main` runs. - **`D3D12SDKVersion` must match the shipped DLL exactly.** With 610 in the code and 620 on disk, the loader silently falls back to the in-box runtime — no warning, and you are back at 6.5 wondering why nothing changed. #463 uses 614 and #486 uses 610; someone should pin one, ideally derived from the package version rather than typed. One more: WARP stays below 6.6 even with the runtime present (`no SM 6.6 warp device; skipped`), so the software-adapter half of these tests is skipped either way. Only hardware coverage moves — which is exactly what 62→69 measures. Noted on #433. I will wait for it rather than fight the intermittent hang locally. For the record, a datapoint that matches your Wine run: with both binaries opting in, the menus render and respond at 30 fps here too (RTX 3080, same 19045 build). The world path is a separate wall on a 32-wide subgroup device — I will file that on its own rather than mix it into this issue.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:48 UTC · original

Automated triage for the maintainers.

Thanks for the clear before/after. Checked against main:

  • SM 6.5 on Windows 10: the underlying defect is tracked in #84 (confirmed there): the in-box runtime on Windows 10 stops at shader model 6.5, while the README lists "Windows 10/11 x64" with shader model 6.6. What this issue adds is the test side. crates/victory-shader/src/emit/valu_tests.rs, run_cases, still ends with assert!(ran > 0, …), so without an SM 6.6 device these tests fail instead of being skipped.
  • Open PRs: #463 (app-local Agility runtime for victory.exe, needs a rebase) and #486 (the same opt-in for the shader crate's test binaries). As noted in the thread, they pin different D3D12SDKVersion values (614 and 610), so one value has to be chosen before both land.
  • only_loopback_is_reachable on Windows 10: fixed in main by afc4641 ("net: skip newer-Windows-only exports"). crates/victory-hle/src/modules/net.rs now excludes WinHttpGetProxySettingsEx from that check.

Your three questions (where D3D12Core.dll should come from, whether Windows 10 stays a supported target, and whether run_cases should skip when no SM 6.6 device exists) are for the maintainers to decide.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/473#issuecomment-7149975410) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T03:58:02Z at=2026-11-25T01:48:05Z --> Automated triage for the maintainers. Thanks for the clear before/after. Checked against `main`: - **SM 6.5 on Windows 10:** the underlying defect is tracked in **#84** (confirmed there): the in-box runtime on Windows 10 stops at shader model 6.5, while the README lists "Windows 10/11 x64" with shader model 6.6. What this issue adds is the test side. `crates/victory-shader/src/emit/valu_tests.rs`, `run_cases`, still ends with `assert!(ran > 0, …)`, so without an SM 6.6 device these tests fail instead of being skipped. - **Open PRs:** #463 (app-local Agility runtime for `victory.exe`, needs a rebase) and #486 (the same opt-in for the shader crate's test binaries). As noted in the thread, they pin different `D3D12SDKVersion` values (614 and 610), so one value has to be chosen before both land. - **`only_loopback_is_reachable` on Windows 10:** fixed in `main` by afc4641 ("net: skip newer-Windows-only exports"). `crates/victory-hle/src/modules/net.rs` now excludes `WinHttpGetProxySettingsEx` from that check. Your three questions (where `D3D12Core.dll` should come from, whether Windows 10 stays a supported target, and whether `run_cases` should skip when no SM 6.6 device exists) are for the maintainers to decide. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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/Marvisak--VIctory#473
No description provided.