GPU: support D3D12_FEATURE_ARCHITECTURE1 and reject empty feature_levels #3467

Open
alexandruiulian201-bot wants to merge 1 commit from upstream-pr/3467 into main
alexandruiulian201-bot commented 2026-11-27 04:03:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by alexandruiulian201-bot on 2026-11-27T04:03:32Z.


Problem

In crates/victory-gpu/src/device.rs:

  1. CheckFeatureSupport implements D3D12_FEATURE_ARCHITECTURE (1) but returns E_NOTIMPL for D3D12_FEATURE_ARCHITECTURE1 (16), which newer D3D12 titles and middleware query instead of ARCHITECTURE.
  2. feature_levels (D3D12_FEATURE_FEATURE_LEVELS) returns DXGI_ERROR_UNSUPPORTED instead of E_INVALIDARG when NumFeatureLevels == 0 with a non-null pointer.

Fix

  • Support D3D12_FEATURE_ARCHITECTURE1 (20 bytes: non-tile-based, UMA, cache-coherent UMA, isolated MMU; rejecting NodeIndex != 0 with E_INVALIDARG).
  • Reject query.count == 0 in feature_levels with E_INVALIDARG.
  • Add unit test architecture1_reports_console_uma_and_rejects_other_nodes and cover count == 0 in feature_levels_pick_the_highest_supported.

Verification

  • cargo test -p victory-gpu --lib --locked device::tests::: all passed.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.
  • cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings: clean.
  • cargo run -p xtask --locked -- policy: 191 files ok.

AI-assisted. Synthetic unit tests only (no game files used).

<!-- greyfinch-sync:Marvisak/VIctory:issue:5520985838 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3467). Originally posted by [alexandruiulian201-bot](https://github.com/alexandruiulian201-bot) on 2026-11-27T04:03:32Z. --- ### Problem In `crates/victory-gpu/src/device.rs`: 1. `CheckFeatureSupport` implements `D3D12_FEATURE_ARCHITECTURE` (1) but returns `E_NOTIMPL` for `D3D12_FEATURE_ARCHITECTURE1` (16), which newer D3D12 titles and middleware query instead of `ARCHITECTURE`. 2. `feature_levels` (`D3D12_FEATURE_FEATURE_LEVELS`) returns `DXGI_ERROR_UNSUPPORTED` instead of `E_INVALIDARG` when `NumFeatureLevels == 0` with a non-null pointer. ### Fix - Support `D3D12_FEATURE_ARCHITECTURE1` (20 bytes: non-tile-based, UMA, cache-coherent UMA, isolated MMU; rejecting `NodeIndex != 0` with `E_INVALIDARG`). - Reject `query.count == 0` in `feature_levels` with `E_INVALIDARG`. - Add unit test `architecture1_reports_console_uma_and_rejects_other_nodes` and cover `count == 0` in `feature_levels_pick_the_highest_supported`. ### Verification - `cargo test -p victory-gpu --lib --locked device::tests::`: all passed. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings`: clean. - `cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings`: clean. - `cargo run -p xtask --locked -- policy`: `191 files ok`. AI-assisted. Synthetic unit tests only (no game files used).
oni-swr commented 2026-11-27 04:27:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T04:27:54Z.


WARP test report (victory-gpu, --lib --locked --no-fail-fast)

OS: Windows 11 Pro 10.0.26200 (build 26200.9974), x64
Host adapter: WARP only (VICTORY_WARP=1 and VICTORY_D3D12_WARP=1; d3d10warp.dll 10.0.26100.9818); no physical GPU used
dxil.dll: Windows SDK 10.0.26100.0, version 1.8.2502.11 (via VICTORY_DXIL)
rustc/cargo: 1.98.1 (48a229cea 2026-09-01)
Base: main 63bcca43c6
Head: 0a09c85d1b (merged onto main, no conflicts)

pass fail ignored
main 231 0 1
main + PR 232 0 1
  • The new test device::tests::architecture1_reports_console_uma_and_rejects_other_nodes runs and passes under WARP (not skipped), as does the extended device::tests::feature_levels_pick_the_highest_supported (now also checking count == 0 -> E_INVALIDARG).
  • All other device::tests still pass.

Review note: the 20-byte D3D12_FEATURE_DATA_ARCHITECTURE1 layout (NodeIndex, TileBasedRenderer, UMA, CacheCoherentUMA, IsolatedMMU) matches the writes, and a non-zero node returns E_INVALIDARG. No concerns.

AI-assisted (Claude). Aggregate counts only; no game files used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7209819172 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3467#issuecomment-7209819172). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-27T04:27:54Z. --- **WARP test report** (`victory-gpu`, `--lib --locked --no-fail-fast`) OS: Windows 11 Pro 10.0.26200 (build 26200.9974), x64 Host adapter: WARP only (VICTORY_WARP=1 and VICTORY_D3D12_WARP=1; d3d10warp.dll 10.0.26100.9818); no physical GPU used dxil.dll: Windows SDK 10.0.26100.0, version 1.8.2502.11 (via VICTORY_DXIL) rustc/cargo: 1.98.1 (48a229cea 2026-09-01) Base: main 63bcca43c6a0 Head: 0a09c85d1b34 (merged onto main, no conflicts) | | pass | fail | ignored | |---|---|---|---| | main | 231 | 0 | 1 | | main + PR | 232 | 0 | 1 | - The new test `device::tests::architecture1_reports_console_uma_and_rejects_other_nodes` runs and passes under WARP (not skipped), as does the extended `device::tests::feature_levels_pick_the_highest_supported` (now also checking `count == 0` -> `E_INVALIDARG`). - All other `device::tests` still pass. Review note: the 20-byte `D3D12_FEATURE_DATA_ARCHITECTURE1` layout (NodeIndex, TileBasedRenderer, UMA, CacheCoherentUMA, IsolatedMMU) matches the writes, and a non-zero node returns `E_INVALIDARG`. No concerns. AI-assisted (Claude). Aggregate counts only; no game files used.
cloph-dsp commented 2026-11-27 04:37:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T04:37:03Z.


Independent CPU-only verification on Windows (Rust 1.100.0/MSVC, worktree-local CARGO_TARGET_DIR, CARGO_BUILD_JOBS=2, no game data).

  • PR head 0a09c85d1b34da814fedec07d059da432896dc33, base 63bcca4.
  • cargo test --locked -p victory-gpu --lib -- device::tests::architecture1_reports_console_uma_and_rejects_other_nodes --exact --test-threads=1 --quiet -> test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 232 filtered out.
  • git diff --check 63bcca4 HEAD clean; negative-control git grep -c -F <test name> 63bcca4 -- crates/victory-gpu/src/device.rs found no match.

Note: only the named synthetic test was replayed (fake device, no GPU adapter). Full crate suite not run. GPU/driver: N/A. AI-assisted (Hy4 flash). No game data, assets, extracted shaders or DRM involved.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7209945260 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3467#issuecomment-7209945260). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T04:37:03Z. --- Independent CPU-only verification on Windows (Rust 1.100.0/MSVC, worktree-local `CARGO_TARGET_DIR`, `CARGO_BUILD_JOBS=2`, no game data). - PR head `0a09c85d1b34da814fedec07d059da432896dc33`, base `63bcca4`. - `cargo test --locked -p victory-gpu --lib -- device::tests::architecture1_reports_console_uma_and_rejects_other_nodes --exact --test-threads=1 --quiet` -> `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 232 filtered out`. - `git diff --check 63bcca4 HEAD` clean; negative-control `git grep -c -F <test name> 63bcca4 -- crates/victory-gpu/src/device.rs` found no match. Note: only the named synthetic test was replayed (fake device, no GPU adapter). Full crate suite not run. GPU/driver: N/A. AI-assisted (Hy4 flash). No game data, assets, extracted shaders or DRM involved.
futurepro62 commented 2026-11-27 09:37:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-27T09:37:00Z.


NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head 0a09c85 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: architecture1_reports_console_uma_and_rejects_other_nodes.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7214890862 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3467#issuecomment-7214890862). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-27T09:37:00Z. --- NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head `0a09c85` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **867 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `architecture1_reports_console_uma_and_rejects_other_nodes`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
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/3467:upstream-pr/3467'
git switch 'upstream-pr/3467'

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/3467'
git switch 'upstream-pr/3467'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3467'
git switch 'upstream-pr/3467'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3467'
git switch 'main'
git merge --squash 'upstream-pr/3467'
git switch 'main'
git merge --ff-only 'upstream-pr/3467'
git switch 'main'
git merge 'upstream-pr/3467'
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
Marvisak/VIctory!3467
No description provided.