GPU tests: cover texture alias fallback on runtimes without Device10 #2745

Open
VlREX wants to merge 1 commit from upstream-pr/2747 into main
VlREX commented 2026-11-25 19:30:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by VlREX on 2026-11-25T19:30:54Z.


Fixes the texture alias test expectation on Windows runtimes without ID3D12Device10 support.

Test environment:

  • Windows 10 Pro 22H2 (19045)
  • AMD Radeon RX 5700 XT
  • Driver: 32.0.21045.29003

Root cause: ID3D12Device10 returns E_NOINTERFACE (0x80004002).

Local diagnostic test results:

  • Before: 77 passed, 1 failed, 1 ignored.
  • After: 78 passed, 0 failed, 1 ignored.

Texture copy and pixel validation remain enabled. No production rendering code changes.

The equivalent diagnostic patch passed on physical hardware. CI verification of the final minimal patch is pending.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6612117492 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2747). Originally posted by [VlREX](https://github.com/VlREX) on 2026-11-25T19:30:54Z. --- Fixes the texture alias test expectation on Windows runtimes without ID3D12Device10 support. **Test environment:** - Windows 10 Pro 22H2 (19045) - AMD Radeon RX 5700 XT - Driver: 32.0.21045.29003 **Root cause:** ID3D12Device10 returns E_NOINTERFACE (0x80004002). **Local diagnostic test results:** - Before: 77 passed, 1 failed, 1 ignored. - After: 78 passed, 0 failed, 1 ignored. Texture copy and pixel validation remain enabled. No production rendering code changes. The equivalent diagnostic patch passed on physical hardware. CI verification of the final minimal patch is pending.
fuzeofficlal commented 2026-11-25 20:06:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T20:03:16Z.


Reviewed and verified 3892a538 on Windows 11 (RTX 5090 + WARP) against main (13f91ca).

  • Tightening shared with host.device.cast::<ID3D12Device10>().is_ok() accurately reflects the runtime condition for castable CreateCommittedResource3 sharing vs. the ALIAS_COPIES fallback path, keeping readback assertions intact without adding any shared test state.
  • WARP (VICTORY_D3D12_WARP=1, --features diagnostics --lib -- --test-threads=1): 198 passed, 0 failed, 1 ignored.
  • RTX 5090 (draw::tests): 11/11 passed both parallel and --test-threads=1.
  • cargo clippy -p victory-gpu --all-targets --locked (default and --features diagnostics): 0 warnings; cargo xtask policy: 184 files ok; clean git merge-tree against 13f91ca and #2726.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7173123097 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7173123097). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T20:03:16Z. --- Reviewed and verified `3892a538` on Windows 11 (RTX 5090 + WARP) against `main` (`13f91ca`). - Tightening `shared` with `host.device.cast::<ID3D12Device10>().is_ok()` accurately reflects the runtime condition for castable `CreateCommittedResource3` sharing vs. the `ALIAS_COPIES` fallback path, keeping readback assertions intact without adding any shared test state. - **WARP (`VICTORY_D3D12_WARP=1`, `--features diagnostics --lib -- --test-threads=1`)**: **198 passed, 0 failed, 1 ignored**. - **RTX 5090 (`draw::tests`)**: **11/11 passed** both parallel and `--test-threads=1`. - `cargo clippy -p victory-gpu --all-targets --locked` (default and `--features diagnostics`): **0 warnings**; `cargo xtask policy`: **184 files ok**; clean `git merge-tree` against `13f91ca` and `#2726`.
kotekompotek commented 2026-11-25 21:03:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T20:07:24Z.


Right fix for hardware variance: resource aliasing requires ID3D12Device10, so the Arc::ptr_eq assertion now keys off whether the legacy path is actually in use while still requiring the copy itself and the texel readback.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7173221240 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7173221240). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T20:07:24Z. --- Right fix for hardware variance: resource aliasing requires ID3D12Device10, so the Arc::ptr_eq assertion now keys off whether the legacy path is actually in use while still requiring the copy itself and the texel readback.
oni-swr commented 2026-11-25 21:03:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T20:16:19Z.


Independent WARP verification: PR head 3892a53

Environment: Windows 11, rustc/cargo 1.98.1, debug build, VICTORY_WARP=1 VICTORY_D3D12_WARP=1 (Microsoft WARP only, no physical GPU), Windows SDK 10.0.26100.0 dxil.dll 1.8.2502.11 on PATH. Tested the PR head itself (single commit directly on origin/main 13f91caee2, so identical to the merge tree). All commands cargo ... --locked.

Baseline on origin/main: test -p victory-gpu --lib: 195 passed, 0 failed, 1 ignored. --features diagnostics: 1 failure, memory::tests::a_submission_that_missed_leaves_the_copies_at_once (memory.rs:886), pre-existing and flaky on main (failed 3 of 4 repeated full runs, passes alone). clippy --all-targets --features diagnostics -D warnings: clean.

On this PR (test-only change):

  • test -p victory-gpu --lib: 195 passed, 0 failed, 1 ignored. --features diagnostics: 198 passed, 0 failed, 1 ignored.
  • clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean.
  • No production change, so no classic negative control. WARP here has Device10, so the new guard is a no-op on this machine. To exercise the fallback I temporarily replaced every host.device.cast::<ID3D12Device10>() in resource.rs and draw.rs with an E_NOINTERFACE error: with the PR's test, a_texture_written_in_one_format_reads_in_another_through_a_placed_view passes. With origin/main's test and only resource.rs patched, it fails (round 0: one host texture, left false, right true). Restored all files afterwards.

Review: the expectation that the pair shares a host texture is now conditional on Device10, matching resource.rs (castable formats are cleared on the legacy path). The readback texels and the 'a copy only where not shared' assertion are unchanged. Caveat: Device10 being present does not strictly guarantee CreatePlacedResource2 succeeds, so such a runtime would still fail the test. No other findings.

Not tested: a physical GPU, any retail title or game behavior, a release build, non-Windows targets.

AI disclosure: this verification was run by Claude Code (Claude Sonnet 5.5). No game files, dumps, shader names or retail hashes were used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7173423856 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7173423856). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T20:16:19Z. --- ## Independent WARP verification: PR head `3892a53` **Environment:** Windows 11, rustc/cargo 1.98.1, debug build, `VICTORY_WARP=1 VICTORY_D3D12_WARP=1` (Microsoft WARP only, no physical GPU), Windows SDK 10.0.26100.0 `dxil.dll` 1.8.2502.11 on `PATH`. Tested the PR head itself (single commit directly on `origin/main` 13f91caee25f2fdf2c062be5f7a27f058e51cbca, so identical to the merge tree). All commands `cargo ... --locked`. **Baseline on origin/main:** `test -p victory-gpu --lib`: 195 passed, 0 failed, 1 ignored. `--features diagnostics`: 1 failure, `memory::tests::a_submission_that_missed_leaves_the_copies_at_once` (`memory.rs:886`), pre-existing and flaky on main (failed 3 of 4 repeated full runs, passes alone). `clippy --all-targets --features diagnostics -D warnings`: clean. **On this PR (test-only change):** - `test -p victory-gpu --lib`: 195 passed, 0 failed, 1 ignored. `--features diagnostics`: 198 passed, 0 failed, 1 ignored. - `clippy --locked -p victory-gpu --all-targets --features diagnostics -- -D warnings`: clean. - **No production change, so no classic negative control.** WARP here has Device10, so the new guard is a no-op on this machine. To exercise the fallback I temporarily replaced every `host.device.cast::<ID3D12Device10>()` in `resource.rs` and `draw.rs` with an `E_NOINTERFACE` error: with the PR's test, `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` passes. With origin/main's test and only `resource.rs` patched, it fails (`round 0: one host texture`, left false, right true). Restored all files afterwards. **Review:** the expectation that the pair shares a host texture is now conditional on Device10, matching `resource.rs` (castable formats are cleared on the legacy path). The readback texels and the 'a copy only where not shared' assertion are unchanged. Caveat: Device10 being present does not strictly guarantee `CreatePlacedResource2` succeeds, so such a runtime would still fail the test. No other findings. **Not tested:** a physical GPU, any retail title or game behavior, a release build, non-Windows targets. AI disclosure: this verification was run by Claude Code (Claude Sonnet 5.5). No game files, dumps, shader names or retail hashes were used.
Marvisak commented 2026-11-26 00:03:30 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:25:47Z.


Automated triage for the maintainers. This is a test-only change to a_texture_written_in_one_format_reads_in_another_through_a_placed_view in crates/victory-gpu/src/draw.rs. The test now expects the castable pair to share one host texture only when the device casts to ID3D12Device10. That matches crates/victory-gpu/src/resource.rs, where the legacy CreatePlacedResource path clears the castable formats, so the test no longer fails on runtimes without Device10. The copy and texel readback assertions are unchanged. CI: check passing. This is a recommendation for a maintainer to look, not an approval.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177547865 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7177547865). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T23:25:47Z. --- <!-- victory-triage v1 head=3892a538176eeee8c443f36551e3c52fb6745b66 verdict=merge-candidate at=2026-11-25T23:25:36Z --> Automated triage for the maintainers. This is a test-only change to `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` in `crates/victory-gpu/src/draw.rs`. The test now expects the castable pair to share one host texture only when the device casts to `ID3D12Device10`. That matches `crates/victory-gpu/src/resource.rs`, where the legacy `CreatePlacedResource` path clears the castable formats, so the test no longer fails on runtimes without Device10. The copy and texel readback assertions are unchanged. CI: `check` passing. This is a recommendation for a maintainer to look, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
Dukestar69 commented 2026-11-26 05:03:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T04:11:15Z.

Review: APPROVED


Tested merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):

  • cargo test -p victory-gpu --lib draw::tests: 20 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6068442344 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2747#pullrequestreview-6068442344). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T04:11:15Z. **Review:** APPROVED --- Tested merged onto `origin/main` (`63bcca4`) on Windows 11 x64 (NVIDIA GeForce RTX 5090): - `cargo test -p victory-gpu --lib draw::tests`: **20 passed, 0 failed**. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal commented 2026-11-26 13:03:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T12:07:26Z.

Review: APPROVED


Reviewed and verified at head 3892a538 and merged onto origin/main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1):

  • Design & correctness: gating shared on host.device.cast::<ID3D12Device10>().is_ok() in a_texture_written_in_one_format_reads_in_another_through_a_placed_view (crates/victory-gpu/src/draw.rs:2396-2399) matches crates/victory-gpu/src/resource.rs:1328,1364, where the legacy creation path clears castable_formats. On ID3D12Device10 runtimes, round 0 stays shared == true with the exact same strictness; on runtimes without ID3D12Device10, shared becomes false so line 2415 (assert_eq!(copied, !shared, ...)) actively enforces that the ALIAS_COPIES fallback path runs and still checks every readback texel. Test-only with no production side effects.
  • Verification:
    • Clean git merge-tree against origin/main (63bcca43); cargo xtask policy (184 files ok); cargo clippy -p victory-gpu --all-targets -- -D warnings clean with default features and --all-features (both at 3892a538 and merged onto 63bcca43).
    • Normal Device10 path: draw::tests 11/11 passed on RTX 5090 (default), RTX 5090 + VICTORY_D3D12_DEBUG=1, and WARP + VICTORY_D3D12_DEBUG=1; merged onto 63bcca43, a_texture_written_in_one_format_reads_in_another_through_a_placed_view passed on RTX 5090 + VICTORY_D3D12_DEBUG=1.
    • Simulated non-Device10 probe (forcing host.device.cast::<ID3D12Device10>() to Err in resource.rs and draw.rs): passed on WARP + VICTORY_D3D12_DEBUG=1 through the ALIAS_COPIES fallback with exact texels and zero debug-layer warnings; reverting draw.rs to origin/main failed as expected at round 0: one host texture (left: false, right: true).
    • Non-blocking note for a separate follow-up: under the same simulated non-Device10 probe on RTX 5090 (with or without VICTORY_D3D12_DEBUG=1), round 0 fails earlier at round 0: a placed texture due to a pre-existing resource.rs:1238-1245 (shared_texture) quirk where R32_UINT and R9G9B9E5_SHAREDEXP share a MemoryKey and ALLOW_UNORDERED_ACCESS is ORed onto the fallback R9G9B9E5_SHAREDEXP texture (which NVIDIA rejects while WARP/AMD accept).

LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:review:6073859993 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2747#pullrequestreview-6073859993). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T12:07:26Z. **Review:** APPROVED --- Reviewed and verified at head `3892a538` and merged onto `origin/main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`): - **Design & correctness**: gating `shared` on `host.device.cast::<ID3D12Device10>().is_ok()` in `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` (`crates/victory-gpu/src/draw.rs:2396-2399`) matches `crates/victory-gpu/src/resource.rs:1328,1364`, where the legacy creation path clears `castable_formats`. On `ID3D12Device10` runtimes, round 0 stays `shared == true` with the exact same strictness; on runtimes without `ID3D12Device10`, `shared` becomes `false` so line `2415` (`assert_eq!(copied, !shared, ...)`) actively enforces that the `ALIAS_COPIES` fallback path runs and still checks every readback texel. Test-only with no production side effects. - **Verification**: - Clean `git merge-tree` against `origin/main` (`63bcca43`); `cargo xtask policy` (`184 files ok`); `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with default features and `--all-features` (both at `3892a538` and merged onto `63bcca43`). - Normal `Device10` path: `draw::tests` **11/11** passed on RTX 5090 (default), RTX 5090 + `VICTORY_D3D12_DEBUG=1`, and WARP + `VICTORY_D3D12_DEBUG=1`; merged onto `63bcca43`, `a_texture_written_in_one_format_reads_in_another_through_a_placed_view` passed on RTX 5090 + `VICTORY_D3D12_DEBUG=1`. - Simulated non-`Device10` probe (forcing `host.device.cast::<ID3D12Device10>()` to `Err` in `resource.rs` and `draw.rs`): passed on **WARP + `VICTORY_D3D12_DEBUG=1`** through the `ALIAS_COPIES` fallback with exact texels and zero debug-layer warnings; reverting `draw.rs` to `origin/main` failed as expected at `round 0: one host texture (left: false, right: true)`. - Non-blocking note for a separate follow-up: under the same simulated non-`Device10` probe on **RTX 5090** (with or without `VICTORY_D3D12_DEBUG=1`), round 0 fails earlier at `round 0: a placed texture` due to a pre-existing `resource.rs:1238-1245` (`shared_texture`) quirk where `R32_UINT` and `R9G9B9E5_SHAREDEXP` share a `MemoryKey` and `ALLOW_UNORDERED_ACCESS` is ORed onto the fallback `R9G9B9E5_SHAREDEXP` texture (which NVIDIA rejects while WARP/AMD accept). LGTM.
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/2747:upstream-pr/2747'
git switch 'upstream-pr/2747'

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