GPU: opt-in Agility SDK runtime for victory.exe #2381

Closed
makmatvey wants to merge 2 commits from upstream-pr/2383 into main
makmatvey commented 2026-11-25 12:22:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by makmatvey on 2026-11-25T12:22:32Z.


Summary

Opts victory.exe into an app-local DirectX 12 Agility SDK runtime so Windows 10 can run builds that need a newer D3D12 feature level / SM 6.6 without relying on the OS-shipped runtime alone.

Changes

  • Wire Agility SDK export/packaging through xtask (agility module) and victory build.rs / main.rs
  • Document the Agility-enabled build path in the README
  • Update Cargo lock/deps as needed for the opt-in path

Test plan

  • Standard (non-Agility) build still builds and runs on Windows 11 + SM 6.6
  • Agility-enabled build produces D3D12Core.dll next to victory.exe and runs on Windows 10
  • Confirm placing Agility DLL beside a standard victory.exe alone is still insufficient (as documented)

Related: #84, #2360

<!-- greyfinch-sync:Marvisak/VIctory:issue:5491238181 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2383). Originally posted by [makmatvey](https://github.com/makmatvey) on 2026-11-25T12:22:32Z. --- ## Summary Opts `victory.exe` into an app-local DirectX 12 Agility SDK runtime so Windows 10 can run builds that need a newer D3D12 feature level / SM 6.6 without relying on the OS-shipped runtime alone. ## Changes - Wire Agility SDK export/packaging through `xtask` (`agility` module) and victory `build.rs` / `main.rs` - Document the Agility-enabled build path in the README - Update Cargo lock/deps as needed for the opt-in path ## Test plan - [ ] Standard (non-Agility) build still builds and runs on Windows 11 + SM 6.6 - [ ] Agility-enabled build produces `D3D12Core.dll` next to `victory.exe` and runs on Windows 10 - [ ] Confirm placing Agility DLL beside a *standard* `victory.exe` alone is still insufficient (as documented) Related: #84, #2360
DenRakEiw commented 2026-11-25 12:31:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T12:31:10Z.

Review: APPROVED


Verified against origin/main (940d32f):

  • Opt-in Agility SDK staging (cargo xtask agility) and apps/victory/build.rs integration build and pass all xtask and victory tests cleanly without affecting default builds when no app-local D3D12Core.dll is present.
  • cargo test -p xtask: 8/8 passed (including agility::tests::package_constants_agree and sha256_of_known_bytes).
  • cargo test -p victory: 12/12 passed.
  • cargo clippy -p xtask -p victory --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 185 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6057631466 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2383#pullrequestreview-6057631466). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T12:31:10Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`): - Opt-in Agility SDK staging (`cargo xtask agility`) and `apps/victory/build.rs` integration build and pass all `xtask` and `victory` tests cleanly without affecting default builds when no app-local `D3D12Core.dll` is present. - `cargo test -p xtask`: 8/8 passed (including `agility::tests::package_constants_agree` and `sha256_of_known_bytes`). - `cargo test -p victory`: 12/12 passed. - `cargo clippy -p xtask -p victory --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 185 files ok. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 12:36:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T12:36:05Z.

Review: COMMENTED


Opt-in Agility SDK runtime: cargo xtask agility downloads Microsoft.Direct3D.D3D12 1.614.1 into target, build.rs exports D3D12SDKVersion/Path when D3D12Core.dll present (+382). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Legit mechanism for Windows 10 SM 6.6 support (#84); pairs with README #2360. Downloads an official Microsoft NuGet package — hash-pinning the package would harden the supply chain here.

<!-- greyfinch-sync:Marvisak/VIctory:review:6057697653 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2383#pullrequestreview-6057697653). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T12:36:05Z. **Review:** COMMENTED --- Opt-in Agility SDK runtime: cargo xtask agility downloads Microsoft.Direct3D.D3D12 1.614.1 into target, build.rs exports D3D12SDKVersion/Path when D3D12Core.dll present (+382). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Legit mechanism for Windows 10 SM 6.6 support (#84); pairs with README #2360. Downloads an official Microsoft NuGet package — hash-pinning the package would harden the supply chain here.
Calvix2k commented 2026-11-25 13:02:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Calvix2k on 2026-11-25T12:25:02Z.


Built and checked on the machine this is for: Windows 10 19045, MSVC 14.44.35207, CARGO_TARGET_DIR separate, cargo build --release -p victory, fa18d59.

With D3D12/D3D12Core.dll staged (I used package 1.620.2, not 1.614.1, on purpose):

1    0 0053E990 D3D12SDKPath = D3D12SDKPath
2    1 0053E9A4 D3D12SDKVersion = D3D12SDKVersion

With the folder removed and the crate rebuilt: no exports at all — so the build script really re-runs on the file's disappearance and a machine without the runtime keeps the in-box D3D12. Both test-plan boxes that do not need the title are ticked on Windows 10 here.

Two things worth keeping, and one to consider:

  1. rustc-link-arg-bins is the right form. #486 needed .drectve because cargo:rustc-link-arg applies to every target of the package and /EXPORT:D3D12SDKVersion,DATA fails with LNK2001 in a target that does not link the object (guard_runs). -bins scopes it to the binaries, so cargo build --benches stays clean. With #486 for the test binaries and this for the app, both halves are covered.
  2. D3D12SDKPath as a const char* static (your SdkPath wrapper) is what the loader dereferences — an array would export its contents, not the pointer. Same shape as #486's.
  3. Version 1.614.1 vs what people stage. It works with a newer DLL (my 1.620.2 staging above), but not with an older one: the loader refuses with 0x887e0003 and the first device creation dies. Since the README's audience will happily copy whatever Microsoft.Direct3D.D3D12 version they already have, one line — "the staged D3D12Core.dll must be 1.614.1 or newer" — would save the next person that error. (Optional: accept VICTORY_AGILITY_VERSION in build.rs for people who want to pin a newer announce.)
  4. check_runtime warns but continues. A build made with the exports cannot start without the DLL — d3d12.dll fails the process at load. The warning is right, but its wording ("copy D3D12Core.dll … or rebuild") reads as advice for a soft problem; say that the process will exit and where the error will come from (0x887e0003), or exit right there with that message instead of letting the loader produce it.

For the record, this is the piece Windows 10 users need that #2307 measures (0 → 26,641 pipelines) and that the guide in #1612 tracks; the same staging I used here is what let me validate today's shader work on the card.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7162343524 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2383#issuecomment-7162343524). Originally posted by [Calvix2k](https://github.com/Calvix2k) on 2026-11-25T12:25:02Z. --- Built and checked on the machine this is for: **Windows 10 19045, MSVC 14.44.35207**, `CARGO_TARGET_DIR` separate, `cargo build --release -p victory`, `fa18d59`. **With `D3D12`/`D3D12Core.dll` staged** (I used package 1.620.2, not 1.614.1, on purpose): ``` 1 0 0053E990 D3D12SDKPath = D3D12SDKPath 2 1 0053E9A4 D3D12SDKVersion = D3D12SDKVersion ``` **With the folder removed and the crate rebuilt:** no exports at all — so the build script really re-runs on the file's disappearance and a machine without the runtime keeps the in-box D3D12. Both test-plan boxes that do not need the title are ticked on Windows 10 here. Two things worth keeping, and one to consider: 1. **`rustc-link-arg-bins` is the right form.** #486 needed `.drectve` because `cargo:rustc-link-arg` applies to every target of the package and `/EXPORT:D3D12SDKVersion,DATA` fails with LNK2001 in a target that does not link the object (`guard_runs`). `-bins` scopes it to the binaries, so `cargo build --benches` stays clean. With #486 for the test binaries and this for the app, both halves are covered. 2. **`D3D12SDKPath` as a `const char*` static** (your `SdkPath` wrapper) is what the loader dereferences — an array would export its contents, not the pointer. Same shape as #486's. 3. **Version 1.614.1 vs what people stage.** It works with a newer DLL (my 1.620.2 staging above), but not with an older one: the loader refuses with `0x887e0003` and the first device creation dies. Since the README's audience will happily copy whatever `Microsoft.Direct3D.D3D12` version they already have, one line — "the staged `D3D12Core.dll` must be 1.614.1 or newer" — would save the next person that error. (Optional: accept `VICTORY_AGILITY_VERSION` in `build.rs` for people who want to pin a newer announce.) 4. **`check_runtime` warns but continues.** A build made with the exports cannot start without the DLL — `d3d12.dll` fails the process at load. The warning is right, but its wording ("copy D3D12Core.dll … or rebuild") reads as advice for a soft problem; say that the process will exit and where the error will come from (`0x887e0003`), or exit right there with that message instead of letting the loader produce it. For the record, this is the piece Windows 10 users need that #2307 measures (0 → 26,641 pipelines) and that the guide in #1612 tracks; the same staging I used here is what let me validate today's shader work on the card.
makmatvey commented 2026-11-25 13:02:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by makmatvey on 2026-11-25T12:38:30Z.


Thanks @Calvix2k — addressed in f40129a:

  1. README now requires staged D3D12Core.dll ≥ 1.614.1 (older → 0x887e0003).
  2. build.rs accepts VICTORY_AGILITY_VERSION to announce a newer SDK.
  3. check_runtime fails early with that HRESULT instead of a soft warning.

Kept rustc-link-arg-bins and the SdkPath / const char* export shape.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7162653311 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2383#issuecomment-7162653311). Originally posted by [makmatvey](https://github.com/makmatvey) on 2026-11-25T12:38:30Z. --- Thanks @Calvix2k — addressed in f40129a: 1. README now requires staged `D3D12Core.dll` ≥ 1.614.1 (older → `0x887e0003`). 2. `build.rs` accepts `VICTORY_AGILITY_VERSION` to announce a newer SDK. 3. `check_runtime` fails early with that HRESULT instead of a soft warning. Kept `rustc-link-arg-bins` and the `SdkPath` / `const char*` export shape.
Marvisak commented 2026-11-25 15:04:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:57:31Z.


Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main (conflict in apps/victory/src/main.rs). It will be reviewed again once it is rebased.

From the earlier needs-work note: it needs the maintainer's decision (new build.rs, a tempfile dependency, and cargo xtask agility, which downloads and runs external programs); #2460 and #2429 address the same problem.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166080572 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2383#issuecomment-7166080572). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T14:57:31Z. --- <!-- victory-triage v1 head=f40129ab5e6efce17b32d9d2c16da9bc55e916a1 verdict=needs-rebase at=2026-11-25T22:30:35Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main` (conflict in `apps/victory/src/main.rs`). It will be reviewed again once it is rebased. From the earlier needs-work note: it needs the maintainer's decision (new `build.rs`, a `tempfile` dependency, and `cargo xtask agility`, which downloads and runs external programs); #2460 and #2429 address the same problem. --- _Generated by [Claude Code](https://claude.ai/code)_

Pull request closed

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
Marvisak/VIctory!2381
No description provided.