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

Open
github-bot wants to merge 1 commit from github-bot/gh-2747 into main AGit
Owner

@⁠VlREX on GitHub · 2026-11-25 19:30 UTC · original
VlREX:fix/texture-test-device10-fallback → main · +3 −0 · 1 files · 1 commits · open

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.

**@⁠VlREX** on GitHub · 2026-11-25 19:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2747) `VlREX:fix/texture-test-device10-fallback` → `main` · +3 −0 · 1 files · 1 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:13:18 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 20:03 UTC · original

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.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 20:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7173123097) 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`.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 20:07 UTC · original

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.

**@⁠kotekompotek** on GitHub · 2026-11-25 20:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7173221240) 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.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 20:16 UTC · original

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.

**@⁠oni-swr** on GitHub · 2026-11-25 20:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7173423856) ## 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 23:25 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 23:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/2747#issuecomment-7177547865) <!-- 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)_
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 04:11 UTC · original · approved these changes

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

**@⁠Dukestar69** on GitHub · 2026-11-26 04:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/2747#pullrequestreview-6068442344) · **approved these changes** 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).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 12:07 UTC · original · approved these changes

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.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 12:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/2747#pullrequestreview-6073859993) · **approved these changes** 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2747'
git switch 'github-bot/gh-2747'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2747'
git switch 'github-bot/gh-2747'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2747'
git switch 'main'
git merge --squash 'github-bot/gh-2747'
git switch 'main'
git merge --ff-only 'github-bot/gh-2747'
git switch 'main'
git merge 'github-bot/gh-2747'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2747
No description provided.