Windows 10: the D3D12 Agility SDK runtime for shader model 6.6 (upstream #362) #69

Open
github-bot wants to merge 5 commits from github-bot/gh-69 into main AGit
Owner

@⁠simplesmenterafael on GitHub · 2026-11-24 21:08 UTC · original
simplesmenterafael:gpu/agility-sdk-win10 → main · +453 −3 · 13 files · 5 commits · open

Brings Marvisak/VIctory#362 (stacked on Marvisak/VIctory#175, for Marvisak/VIctory#84) into this fork: Windows 10's in-box D3D12 runtime stops at shader model 6.5, so on Windows 10 no SM 6.6 device exists and every translated pipeline is refused. Both upstream PRs are still open; this takes them as they are, plus one manifest fix.

What is in it

  • Merge of upstream #362 (commits 19aec59, f3c7333 and its merge of upstream main, authors kept):
    • victory.exe exports D3D12SDKVersion = 620 and D3D12SDKPath = ".\D3D12\" (apps/victory/build.rs, apps/victory/src/agility.rs); victory config says whether the runtime is beside the executable.
    • victory-shader's test executables export the same two symbols (path ..\D3D12\), only when the runtime is in target\<profile>\D3D12\ (crates/victory-shader/build.rs, src/agility.rs). Without it nothing changes.
    • cargo xtask agility downloads Microsoft.Direct3D.D3D12 1.620.2 from nuget.org, checks the SHA-512 nuget.org publishes, and puts D3D12Core.dll and d3d12SDKLayers.dll in target\{debug,release,diag}\D3D12\. Nothing of Microsoft's enters the repository.
    • The SM 6.5 error message points at cargo xtask agility; the README's getting-started section (upstream part, upstream's own text) mentions it.
  • One conflict in crates/victory-shader/src/lib.rs: this fork's pub mod bvh; and the PR's mod agility;, both kept.
  • sha2 moved to [workspace.dependencies] (0.10.9, the version Cargo.lock already has; MIT OR Apache-2.0). The upstream PR named it in xtask/Cargo.toml only.

Tested

  • Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 3050 (driver 32.0.16.2124), AMD Ryzen 5 3600, 16 GB RAM.
  • rustc 1.98.1 (48a229cea 2026-09-01).
  • Before (main at 90228a7, no runtime): the RTX 3050 reports SM 0x65 and WARP SM 0x62 (checked with a small probe outside the repo). cargo test --workspace --locked --no-fail-fast: 474 passed, 22 failed, 7 ignored: all 22 are victory-shader GPU tests (no SM 6.6 device available). Separately, victory-loader's crash::tests::unwinds_like_the_system_walk fails intermittently on this machine (Marvisak/VIctory#742, unrelated; it passed in the runs counted here).
  • After (this branch, cargo xtask agility run): cargo test --workspace --locked --no-fail-fast: 498 passed, 0 failed, 7 ignored (the 2 extra tests are the new xtask agility ones); victory-shader 210 passed, 2 ignored, no device skipped (hardware and WARP both ran).
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.
  • cargo xtask policy: 174 files ok.

Before / after

Title run: NOT RUN at the time of opening (will be reported in a comment if done).

Not tested / known limits

  • Windows 11 is not tested here; there the in-box runtime is newer and D3D12 should keep using it.
  • The runtime has to be fetched once per target folder (cargo xtask agility); a fresh clone on Windows 10 still fails the GPU tests until it is.
  • Upstream reports Windows 10 + NVIDIA crashes later on (Marvisak/VIctory#741, #789, #998, #828); this does not address them.
  • No new VICTORY_* switch and no shortcut:.

Asset policy

cargo xtask policy passes. The Agility SDK DLLs and the NuGet package are kept under target\ only; nothing derived from the game is included.

AI use

Claude Code with Claude Opus 5.5: found the existing upstream work, read the PR's code before running it, merged it and resolved the conflict, moved sha2, ran the tests and checks above, and wrote this description. The user asked for the merge, the push and this PR.

🤖 Generated with Claude Code

**@⁠simplesmenterafael** on GitHub · 2026-11-24 21:08 UTC · [original](https://github.com/fxceless/victory-fork/pull/69) `simplesmenterafael:gpu/agility-sdk-win10` → `main` · +453 −3 · 13 files · 5 commits · open Brings Marvisak/VIctory#362 (stacked on Marvisak/VIctory#175, for Marvisak/VIctory#84) into this fork: Windows 10's in-box D3D12 runtime stops at shader model 6.5, so on Windows 10 no SM 6.6 device exists and every translated pipeline is refused. Both upstream PRs are still open; this takes them as they are, plus one manifest fix. ## What is in it - **Merge of upstream #362** (commits `19aec59`, `f3c7333` and its merge of upstream `main`, authors kept): - `victory.exe` exports `D3D12SDKVersion = 620` and `D3D12SDKPath = ".\D3D12\"` (`apps/victory/build.rs`, `apps/victory/src/agility.rs`); `victory config` says whether the runtime is beside the executable. - `victory-shader`'s test executables export the same two symbols (path `..\D3D12\`), only when the runtime is in `target\<profile>\D3D12\` (`crates/victory-shader/build.rs`, `src/agility.rs`). Without it nothing changes. - `cargo xtask agility` downloads `Microsoft.Direct3D.D3D12` 1.620.2 from nuget.org, checks the SHA-512 nuget.org publishes, and puts `D3D12Core.dll` and `d3d12SDKLayers.dll` in `target\{debug,release,diag}\D3D12\`. Nothing of Microsoft's enters the repository. - The SM 6.5 error message points at `cargo xtask agility`; the README's getting-started section (upstream part, upstream's own text) mentions it. - **One conflict** in `crates/victory-shader/src/lib.rs`: this fork's `pub mod bvh;` and the PR's `mod agility;`, both kept. - **`sha2` moved to `[workspace.dependencies]`** (0.10.9, the version `Cargo.lock` already has; MIT OR Apache-2.0). The upstream PR named it in `xtask/Cargo.toml` only. ## Tested - Windows 10 Pro 22H2 (19045), NVIDIA GeForce RTX 3050 (driver 32.0.16.2124), AMD Ryzen 5 3600, 16 GB RAM. - `rustc 1.98.1 (48a229cea 2026-09-01)`. - Before (`main` at `90228a7`, no runtime): the RTX 3050 reports SM 0x65 and WARP SM 0x62 (checked with a small probe outside the repo). `cargo test --workspace --locked --no-fail-fast`: 474 passed, **22 failed**, 7 ignored: all 22 are `victory-shader` GPU tests (`no SM 6.6 device available`). Separately, `victory-loader`'s `crash::tests::unwinds_like_the_system_walk` fails intermittently on this machine (Marvisak/VIctory#742, unrelated; it passed in the runs counted here). - After (this branch, `cargo xtask agility` run): `cargo test --workspace --locked --no-fail-fast`: **498 passed, 0 failed, 7 ignored** (the 2 extra tests are the new `xtask agility` ones); `victory-shader` 210 passed, 2 ignored, no device skipped (hardware and WARP both ran). - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: clean. - `cargo xtask policy`: 174 files ok. ## Before / after Title run: NOT RUN at the time of opening (will be reported in a comment if done). ## Not tested / known limits - Windows 11 is not tested here; there the in-box runtime is newer and D3D12 should keep using it. - The runtime has to be fetched once per target folder (`cargo xtask agility`); a fresh clone on Windows 10 still fails the GPU tests until it is. - Upstream reports Windows 10 + NVIDIA crashes later on (Marvisak/VIctory#741, #789, #998, #828); this does not address them. - No new `VICTORY_*` switch and no `shortcut:`. ## Asset policy `cargo xtask policy` passes. The Agility SDK DLLs and the NuGet package are kept under `target\` only; nothing derived from the game is included. ## AI use Claude Code with Claude Opus 5.5: found the existing upstream work, read the PR's code before running it, merged it and resolved the conflict, moved `sha2`, ran the tests and checks above, and wrote this description. The user asked for the merge, the push and this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Windows 10's in-box D3D12 stops at shader model 6.5 and refuses root
signatures with the directly indexed heap flags (c01), so every
translated pipeline was refused and nothing drew (#84).

victory.exe now exports D3D12SDKVersion (620) and D3D12SDKPath
(.\D3D12\), and `cargo xtask agility` fetches Microsoft.Direct3D.D3D12
1.620.2 from nuget.org, checks its published SHA-512, and puts
D3D12Core.dll and d3d12SDKLayers.dll in target\<profile>\D3D12\. The
DLLs never enter the repository. Windows 11, or a missing folder, keeps
the in-box runtime.

`victory config` reports whether the runtime is in place, and the SM 6.5
error names the command.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows 10 the victory-shader test executables had no D3D12SDKVersion
and D3D12SDKPath exports, so every host device stopped at shader model 6.5:
the 7 emit::valu_tests failed and the device-backed tests skipped.

The tests now export them (path ..\D3D12\, the folder `cargo xtask
agility` fills) only when D3D12Core.dll is there: D3D12 does not fall back
to the in-box runtime when the named one is missing. The build script
watches the DLL only when it exists, so a missing runtime does not rebuild
the crate every time; the xtask touches build.rs after installing it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	apps/victory/src/main.rs
Windows 10's in-box D3D12 stops at shader model 6.5, so no SM 6.6
device existed on this machine and 22 victory-shader GPU tests failed
("no SM 6.6 device available"). This merges Marvisak/VIctory#362
(stacked on #175): victory.exe and the victory-shader test executables
export D3D12SDKVersion/D3D12SDKPath, and `cargo xtask agility` fetches
Microsoft.Direct3D.D3D12 1.620.2 (SHA-512 checked) into
target/<profile>/D3D12/. Nothing of Microsoft's enters the repository.

One conflict, in crates/victory-shader/src/lib.rs: this fork's
`pub mod bvh;` and the PR's `mod agility;`; both kept.

Checked on Windows 10 19045, RTX 3050 (driver 32.0.16.2124),
Ryzen 5 3600, rustc 1.98.1: cargo test --workspace --locked
--no-fail-fast 498 passed, 0 failed, 7 ignored (was 22 failed);
both clippy runs from CI clean; cargo xtask policy ok. The title was
not run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The merged xtask agility command named sha2 = "0.10" in xtask's own
manifest; this repository keeps every external crate in
[workspace.dependencies]. Pinned at the version Cargo.lock already
has (0.10.9, MIT OR Apache-2.0), so the lock file does not change.

Checked with cargo test --workspace --locked (498 passed, 0 failed,
7 ignored), both clippy runs from CI and cargo xtask policy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:36 +00:00
Author
Owner

@⁠simplesmenterafael on GitHub · 2026-11-24 21:21 UTC · original

Title run with this branch (2cd8b02, release build, Series X profile) on the machine in the description. In words only, no captures.

  • Command: target\release\victory.exe run <game dir>\game_scarlett_master.exe --execute, with D3D12Core.dll 1.620.2 in target\release\D3D12\.
  • Boot and menus/loading: 30 fps, 33.3 ms/frame, 3–44 draws/frame, 3–6 ms on the GPU. XUserAddAsync (the point where Marvisak/VIctory#741/#789/#998 crash on Windows 10 + NVIDIA) went by without a crash.
  • After about 8.5 minutes the first heavy scene began (around 850–2,400 draws/frame): 16 samples from 521 to 6,883 ms/frame, median 782 ms (about 1 fps), 180–440 ms of it on the GPU, while about 760–1,200 host pipelines were still being made and 750–3,300 draws per frame were dropped for want of one.
  • Errors seen: 3 host pipelines refused (E_INVALIDARG), 1 shader that does not translate, no device removal, no crashes.log entry, no driver reset.
  • Memory: the process reached 17.2 GB private; system commit hit 41.9 of 42.9 GB with 0.2 GB of RAM free (16 GB of RAM, system-managed paging file growing). I stopped the run there, at about 10 minutes, to keep the machine usable. So it is not known what the scene looks like once the pipelines are all made.

Before (main): NOT RUN; on this machine main has no SM 6.6 device, so its pipelines would be refused (Marvisak/VIctory#84).

Run and written with Claude Code (Claude Opus 5.5).

**@⁠simplesmenterafael** on GitHub · 2026-11-24 21:21 UTC · [original](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7144824976) Title run with this branch (`2cd8b02`, release build, Series X profile) on the machine in the description. In words only, no captures. - Command: `target\release\victory.exe run <game dir>\game_scarlett_master.exe --execute`, with `D3D12Core.dll` 1.620.2 in `target\release\D3D12\`. - Boot and menus/loading: 30 fps, 33.3 ms/frame, 3–44 draws/frame, 3–6 ms on the GPU. `XUserAddAsync` (the point where Marvisak/VIctory#741/#789/#998 crash on Windows 10 + NVIDIA) went by without a crash. - After about 8.5 minutes the first heavy scene began (around 850–2,400 draws/frame): 16 samples from 521 to 6,883 ms/frame, median 782 ms (about 1 fps), 180–440 ms of it on the GPU, while about 760–1,200 host pipelines were still being made and 750–3,300 draws per frame were dropped for want of one. - Errors seen: 3 host pipelines refused (`E_INVALIDARG`), 1 shader that does not translate, no device removal, no `crashes.log` entry, no driver reset. - Memory: the process reached 17.2 GB private; system commit hit 41.9 of 42.9 GB with 0.2 GB of RAM free (16 GB of RAM, system-managed paging file growing). I stopped the run there, at about 10 minutes, to keep the machine usable. So it is not known what the scene looks like once the pipelines are all made. Before (`main`): NOT RUN; on this machine `main` has no SM 6.6 device, so its pipelines would be refused (Marvisak/VIctory#84). *Run and written with Claude Code (Claude Opus 5.5).*
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-24 22:37 UTC · original

I checked exact head 2cd8b023 with an MSVC-target build script and a minimal Windows PE made from the app's export definitions. It exports SDK version 620 and its path even when the local Core DLL is missing. On a machine whose inbox runtime is older than the exported version, the loader requires the local runtime. Microsoft Agility SDK loader specification

I tested a follow-up that gates the exports on the installed Core DLL at build time and makes the installer invalidate both Cargo build scripts. The PE and directive controls, installer-style invalidation fixture, six xtask tests, and Windows-target app check with blake3/pure passed. Native Windows D3D12 device creation remains unverified. Tested follow-up commit

AI-assisted using Codex.

**@⁠avt0m4t48** on GitHub · 2026-11-24 22:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7146457290) I checked exact head `2cd8b023` with an MSVC-target build script and a minimal Windows PE made from the app's export definitions. It exports SDK version 620 and its path even when the local Core DLL is missing. On a machine whose inbox runtime is older than the exported version, the loader requires the local runtime. [Microsoft Agility SDK loader specification](https://microsoft.github.io/DirectX-Specs/d3d/D3D12Redistributable.html#application-and-games) I tested a follow-up that gates the exports on the installed Core DLL at build time and makes the installer invalidate both Cargo build scripts. The PE and directive controls, installer-style invalidation fixture, six xtask tests, and Windows-target app check with `blake3/pure` passed. Native Windows D3D12 device creation remains unverified. [Tested follow-up commit](https://github.com/avt0m4t48/victory-fork/commit/9892d76ca03a670cec4f59d386577a38ecc734df) AI-assisted using Codex.
Author
Owner

@⁠HAL9000RELOADED on GitHub · 2026-11-25 01:52 UTC · original

A data point for this approach on AMD + Windows 10, and two notes. They come from #401, now closed as a duplicate of this PR.

Machine: Windows 10 Pro 22H2 (19045), Radeon RX 7900 XTX, Adrenalin 32.0.32015.7029, i7-13700KF, Rust 1.98.1. No game data used.

  • In-box runtime: SM 0x65.
  • With Microsoft.Direct3D.D3D12 1.620.2 in .\D3D12\ (D3D12SDKVersion = 620), checked with a standalone C probe:
    • D3D12CreateDevice succeeds, with D3D12Core.dll loaded from .\D3D12\.
    • HighestShaderModel = 0x69 and MeshShaderTier = 1.
  • victory-shader tests (on main with an equivalent patch): 22 failed (no SM 6.6 device available) became 210 passed on the card. On this machine WARP still reports below 6.6 and skips.
  • Whole workspace on current main (c96b4f2) plus the same patch and #742's stack-headroom test fix: 0 failed, and clippy with all features is clean.

Note 1: victory.exe without the runtime folder.

  • apps/victory/build.rs exports unconditionally.
  • apps/victory/src/agility.rs says that without the folder the in-box runtime is used. That is not what happens here: a probe exporting D3D12SDKVersion = 620 with no D3D12\ folder gets 0x887E0003 (D3D12_ERROR_INVALID_REDIST) from D3D12CreateDevice and no device.
  • So a victory.exe built without cargo xtask agility would have no host GPU. I have not checked Windows 11; there it presumably depends on whether the in-box runtime is at least 620.
  • crates/victory-shader/build.rs already says this in its comment and only exports when the runtime is present. The binary might want the same treatment, or a clear error naming cargo xtask agility.

Note 2: victory-gpu's tests get no exports here. victory-gpu's unit-test harness also creates host devices: host(), the mesh pipeline test in pipeline/host.rs, and the WARP harnesses in indirect.rs and inplace.rs. Without the exports, its SM 6.6 and mesh-dependent tests keep skipping silently on Windows 10.

**@⁠HAL9000RELOADED** on GitHub · 2026-11-25 01:52 UTC · [original](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7150052045) A data point for this approach on AMD + Windows 10, and two notes. They come from #401, now closed as a duplicate of this PR. **Machine:** Windows 10 Pro 22H2 (19045), Radeon RX 7900 XTX, Adrenalin 32.0.32015.7029, i7-13700KF, Rust 1.98.1. No game data used. - **In-box runtime:** SM `0x65`. - **With `Microsoft.Direct3D.D3D12` 1.620.2 in `.\D3D12\`** (`D3D12SDKVersion = 620`), checked with a standalone C probe: - `D3D12CreateDevice` succeeds, with `D3D12Core.dll` loaded from `.\D3D12\`. - `HighestShaderModel = 0x69` and `MeshShaderTier = 1`. - **victory-shader tests** (on `main` with an equivalent patch): 22 failed (`no SM 6.6 device available`) became 210 passed on the card. On this machine WARP still reports below 6.6 and skips. - **Whole workspace** on current `main` (`c96b4f2`) plus the same patch and #742's stack-headroom test fix: 0 failed, and clippy with all features is clean. **Note 1: `victory.exe` without the runtime folder.** - `apps/victory/build.rs` exports unconditionally. - `apps/victory/src/agility.rs` says that without the folder the in-box runtime is used. That is not what happens here: a probe exporting `D3D12SDKVersion = 620` with no `D3D12\` folder gets `0x887E0003` (`D3D12_ERROR_INVALID_REDIST`) from `D3D12CreateDevice` and no device. - So a `victory.exe` built without `cargo xtask agility` would have no host GPU. I have not checked Windows 11; there it presumably depends on whether the in-box runtime is at least 620. - `crates/victory-shader/build.rs` already says this in its comment and only exports when the runtime is present. The binary might want the same treatment, or a clear error naming `cargo xtask agility`. **Note 2: victory-gpu's tests get no exports here.** victory-gpu's unit-test harness also creates host devices: `host()`, the mesh pipeline test in `pipeline/host.rs`, and the WARP harnesses in `indirect.rs` and `inplace.rs`. Without the exports, its SM 6.6 and mesh-dependent tests keep skipping silently on Windows 10.
Author
Owner

@⁠domints on GitHub · 2026-11-25 10:04 UTC · original

This PR has merge conflicts.
Moreover adds unnecessary miniz_oxide back to the root Cargo.toml leaving app with two zip unpacking packages.

I suggest closing both this and #420 (which also has conflicts, but also doesn't resolve miniz_oxide problem) in favor of #402 which is minimal change, resolves conflicts and uses zlib-rs instead of just re-pulling miniz_oxide.

**@⁠domints** on GitHub · 2026-11-25 10:04 UTC · [original](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7159190613) This PR has merge conflicts. Moreover adds unnecessary `miniz_oxide` back to the root Cargo.toml leaving app with two zip unpacking packages. I suggest closing both this and #420 (which also has conflicts, but also doesn't resolve `miniz_oxide` problem) in favor of #402 which is minimal change, resolves conflicts and uses `zlib-rs` instead of just re-pulling `miniz_oxide`.
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/build.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/69/head:github-bot/gh-69'
git switch 'github-bot/gh-69'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-69'
git switch 'github-bot/gh-69'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-69'
git switch 'github-bot/gh-69'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-69'
git switch 'main'
git merge --squash 'github-bot/gh-69'
git switch 'main'
git merge --ff-only 'github-bot/gh-69'
git switch 'main'
git merge 'github-bot/gh-69'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.