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

Open
simplesmenterafael wants to merge 5 commits from upstream-pr/69 into main
simplesmenterafael commented 2026-11-24 21:08:49 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by simplesmenterafael on 2026-11-24T21:08:49Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:issue:6591455165 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/69). Originally posted by [simplesmenterafael](https://github.com/simplesmenterafael) on 2026-11-24T21:08:49Z. --- 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)
simplesmenterafael commented 2026-11-24 21:30:44 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by simplesmenterafael on 2026-11-24T21:21:35Z.


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).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7144824976 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7144824976). Originally posted by [simplesmenterafael](https://github.com/simplesmenterafael) on 2026-11-24T21:21:35Z. --- 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).*
avt0m4t48 commented 2026-11-24 23:09:37 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-24T22:37:44Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7146457290 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7146457290). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-24T22:37:44Z. --- 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.
HAL9000RELOADED commented 2026-11-25 02:10:12 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T01:52:08Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7150052045 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7150052045). Originally posted by [HAL9000RELOADED](https://github.com/HAL9000RELOADED) on 2026-11-25T01:52:08Z. --- 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.
domints commented 2026-11-25 10:11:16 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by domints on 2026-11-25T10:04:39Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7159190613 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/69#issuecomment-7159190613). Originally posted by [domints](https://github.com/domints) on 2026-11-25T10:04:39Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

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 'upstream-pr/69'
git switch 'upstream-pr/69'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/69'
git switch 'upstream-pr/69'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/69'
git switch 'main'
git merge --squash 'upstream-pr/69'
git switch 'main'
git merge --ff-only 'upstream-pr/69'
git switch 'main'
git merge 'upstream-pr/69'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!69
No description provided.