GPU: no typed unordered view in a format the host cannot store to #2460

Merged
lhnizdo merged 2 commits from upstream-pr/2462 into main 2026-11-25 21:57:20 +00:00
lhnizdo commented 2026-11-25 14:02:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-25T14:02:14Z.


fits() asks the host whether it can store to a typed unordered view's format (typed_store) only when the view is cast to another format family. A view in the texture's own format goes to CreateUnorderedAccessView unchecked.

On an NVIDIA card (Windows 10), the title makes unordered views of B5G5R5A1_UNORM textures, a format that card can't use for unordered access. The device was removed with DXGI_ERROR_INVALID_CALL during loading. The debug layer reported:

ID3D12Device::CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View. This is because the current graphics implementation does not even support this Format.

followed by RemoveDevice.

Every typed unordered view is now checked, whatever its family. One the host can't store to is not made, like other views the host doesn't allow ("an unordered view in a format the host cannot store", logged once), and its slot stays null.

Checked on that machine: the view is refused once, the device is no longer removed there, and the run (with the Agility SDK and heap-limit PRs) went from frame 128 to past frame 1,700. Clippy is clean and the victory-gpu tests are unchanged.

🤖 Generated with Claude Code. The change was written by Claude Code (Claude Opus 5.5) in my session; the commit carries a Co-Authored-By: Claude line.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6606246533 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-25T14:02:14Z. --- `fits()` asks the host whether it can store to a typed unordered view's format (`typed_store`) only when the view is cast to another format family. A view in the texture's own format goes to `CreateUnorderedAccessView` unchecked. On an NVIDIA card (Windows 10), the title makes unordered views of `B5G5R5A1_UNORM` textures, a format that card can't use for unordered access. The device was removed with `DXGI_ERROR_INVALID_CALL` during loading. The debug layer reported: > ID3D12Device::CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View. This is because the current graphics implementation does not even support this Format. followed by `RemoveDevice`. Every typed unordered view is now checked, whatever its family. One the host can't store to is not made, like other views the host doesn't allow ("an unordered view in a format the host cannot store", logged once), and its slot stays null. **Checked** on that machine: the view is refused once, the device is no longer removed there, and the run (with the Agility SDK and heap-limit PRs) went from frame 128 to past frame 1,700. Clippy is clean and the `victory-gpu` tests are unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code). The change was written by Claude Code (Claude Opus 5.5) in my session; the commit carries a `Co-Authored-By: Claude` line.
DenRakEiw commented 2026-11-25 14:07:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T14:04:37Z.

Review: APPROVED


Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:

  • Rejecting typed unordered views for formats the host cannot store to builds cleanly and passes descriptor host tests.
  • cargo test -p victory-gpu descriptor::host::tests -- --skip dynamic_slots_are_held_until_released: 4/4 passed on RTX 5090, 4/4 passed on WARP.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6059057432 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#pullrequestreview-6059057432). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T14:04:37Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP: - Rejecting typed unordered views for formats the host cannot store to builds cleanly and passes descriptor host tests. - `cargo test -p victory-gpu descriptor::host::tests -- --skip dynamic_slots_are_held_until_released`: 4/4 passed on RTX 5090, 4/4 passed on WARP. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 15:03:51 +00:00 (Migrated from github.com)

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

Review: COMMENTED


No typed unordered view in a format the host cannot store (+8). 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. Small and precise; see overlap note on #2459.

<!-- greyfinch-sync:Marvisak/VIctory:review:6059181171 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#pullrequestreview-6059181171). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T14:11:30Z. **Review:** COMMENTED --- No typed unordered view in a format the host cannot store (+8). 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. Small and precise; see overlap note on #2459.
kotekompotek commented 2026-11-25 15:04:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:12:19Z.


Complements #2442 rather than overlapping it: #2442 legalizes the resource flag at creation, this guards the view-creation side — a typed UAV descriptor in a store-incapable format (incl. a cast view format, via typed = view when nonzero) is refused before fits can pass it to the host, where creation removes the device the same way. The view == 0 && typeless exemption is consistent — fits already returns !typeless there, so this skips a probe/log that cannot change the outcome. Both halves are needed: the title can request a UAV view whose declared format differs from the texture format.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164917176 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7164917176). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T14:12:19Z. --- Complements #2442 rather than overlapping it: #2442 legalizes the resource flag at creation, this guards the view-creation side — a typed UAV descriptor in a store-incapable format (incl. a cast view format, via `typed = view` when nonzero) is refused before `fits` can pass it to the host, where creation removes the device the same way. The `view == 0 && typeless` exemption is consistent — `fits` already returns `!typeless` there, so this skips a probe/log that cannot change the outcome. Both halves are needed: the title can request a UAV view whose declared format differs from the texture format.
Marvisak commented 2026-11-25 16:09:33 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Merge candidate. In crates/victory-gpu/src/descriptor/host.rs, fits now refuses any typed unordered view whose format the host cannot store to (typed_store, D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW), including views in the texture's own format. Before, only views cast to another family were checked, and the debug-layer message in the description shows the device being removed for one in the texture's own format. I checked the new typed choice against the rest of fits. A typed texture's view is made in its own format unless the requested format is castable, and a typeless texture's view is made in the requested format. The typeless case with no format keeps its old result. The later check for cast views is now redundant but harmless. CI check passes. It complements whichever host_desc flag fix is chosen (#2442 / #2459).

On your reply: the earlier nit is addressed. The check now looks at the format the view is actually made in.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167466649 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7167466649). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:57:40Z. --- <!-- victory-triage v1 head=a1ac77f37af067448ae9082fefd0fffabe9665ff verdict=merge-candidate at=2026-11-25T18:46:17Z --> Automated triage for the maintainers. **Merge candidate.** In `crates/victory-gpu/src/descriptor/host.rs`, `fits` now refuses any typed unordered view whose format the host cannot store to (`typed_store`, `D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW`), including views in the texture's own format. Before, only views cast to another family were checked, and the debug-layer message in the description shows the device being removed for one in the texture's own format. I checked the new `typed` choice against the rest of `fits`. A typed texture's view is made in its own format unless the requested format is castable, and a typeless texture's view is made in the requested format. The typeless case with no format keeps its old result. The later check for cast views is now redundant but harmless. CI `check` passes. It complements whichever `host_desc` flag fix is chosen (#2442 / #2459). On your reply: the earlier nit is addressed. The check now looks at the format the view is actually made in. --- _Generated by [Claude Code](https://claude.ai/code)_
fyernald commented 2026-11-25 18:02:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fyernald on 2026-11-25T17:06:17Z.

Review: APPROVED


Tested on an RTX 3080 (617.42), Windows 10 (19045), main 67e8ae1: cargo test -p victory-gpu --lib --locked -- --test-threads=1 gives 192 passed, 3 failed. Those 3 also fail on main here (heap cap FIND-9, Windows 10 castable test #1999). With #2319 merged as well: 193 passed, the same 3 failing.

The two go together. On this driver a UAV-flagged B5G5R5A1_UNORM texture isn't made at all on main (host_copy → None, no device removal). With #2319 it is made without the flag, and then this PR's check in fits is what keeps its typed unordered views from being made.

<!-- greyfinch-sync:Marvisak/VIctory:review:6061751838 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#pullrequestreview-6061751838). Originally posted by [fyernald](https://github.com/fyernald) on 2026-11-25T17:06:17Z. **Review:** APPROVED --- Tested on an **RTX 3080 (617.42), Windows 10 (19045)**, `main` `67e8ae1`: `cargo test -p victory-gpu --lib --locked -- --test-threads=1` gives 192 passed, 3 failed. Those 3 also fail on `main` here (heap cap `FIND-9`, Windows 10 castable test #1999). With #2319 merged as well: 193 passed, the same 3 failing. The two go together. On this driver a UAV-flagged `B5G5R5A1_UNORM` texture isn't made at all on `main` (`host_copy` → `None`, no device removal). With #2319 it is made without the flag, and then this PR's check in `fits` is what keeps its typed unordered views from being made.
lhnizdo commented 2026-11-25 19:06:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-25T18:07:29Z.


Thanks for testing on the RTX 3080, @fyernald, and for checking it together with #2319.

I've addressed the triage nit: the store check now looks at the format the view is actually made in. That's the texture's own format, unless the requested one is castable, which matches what fits does further down. Also rebased onto current main (13f91ca).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7170472956 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7170472956). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-25T18:07:29Z. --- Thanks for testing on the RTX 3080, @fyernald, and for checking it together with #2319. I've addressed the triage nit: the store check now looks at the format the view is actually made in. That's the texture's own format, unless the requested one is castable, which matches what `fits` does further down. Also rebased onto current `main` (13f91ca).
KainanP commented 2026-11-25 20:06:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T19:36:07Z.


RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half fixed (views refused), B4G4R4A4 target half still removes the device; no new failures. On Intel UHD the UAV half still fails because main gets no host texture there (creation refused), which a view check cannot help. Details and the side-by-side table with the other #1753 PRs: https://github.com/Marvisak/VIctory/issues/1753#issuecomment-7172510623. Tested with the help of an AI assistant (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7172521742 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7172521742). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T19:36:07Z. --- RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half **fixed** (views refused), B4G4R4A4 target half still removes the device; no new failures. On Intel UHD the UAV half still fails because main gets no host texture there (creation refused), which a view check cannot help. Details and the side-by-side table with the other #1753 PRs: https://github.com/Marvisak/VIctory/issues/1753#issuecomment-7172510623. Tested with the help of an AI assistant (Claude Code).
lhnizdo commented 2026-11-25 21:03:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by lhnizdo on 2026-11-25T21:01:42Z.


Thanks @KainanP for the RTX 4060 run and the side-by-side in #1753. The B5G5R5A1 unordered-view half being fixed with no new failures is exactly what this PR is for. The B4G4R4A4 render-target half, and Intel UHD where no host texture is made at all, need the creation-side fixes from the other #1753 PRs; a view check can't reach them.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7174510950 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7174510950). Originally posted by [lhnizdo](https://github.com/lhnizdo) on 2026-11-25T21:01:42Z. --- Thanks @KainanP for the RTX 4060 run and the side-by-side in #1753. The `B5G5R5A1` unordered-view half being fixed with no new failures is exactly what this PR is for. The `B4G4R4A4` render-target half, and Intel UHD where no host texture is made at all, need the creation-side fixes from the other #1753 PRs; a view check can't reach them.
upstream-sync closed this pull request 2026-11-25 22:03:44 +00:00
artor410 commented 2026-11-25 22:04:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by artor410 on 2026-11-25T21:53:20Z.


Tested on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Head a1ac77f (fast-forward on main).

  • cargo test -p victory-gpu (main: 193 passed, 2 failed: the known heap-cap pair dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views). With this PR: 193 passed, same 2 failed. No new test.
  • Probe (temporary test, not committed): 256x256 texture via create_placed with the UAV and/or RT flag, then descriptor::host::make_view(View::Unordered(..)) and Host::rtv(texture, None), then GetDeviceRemovedReason, one process per case. On main: UAV view of 86 or 115 crashes the test process (0xc0000005 inside the driver); RTV of 115 removes the device (0x887A0001); 115 with RT|UAV gets no host texture. CheckFeatureSupport here: 86 RT yes, typed UAV no; 115 RT no, typed UAV no.
  • With this PR: UAV views of 86 and 115 are null and the process survives. RTV of 115 still removes the device (0x887A0001); 115 with RT|UAV still gets no host texture.

UAV only: the B4G4R4A4 render-target half of #735 is not covered, and UAV writes are dropped. Same effect as #1946.

(Claude Code, Claude Opus 5.5.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7175667071 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7175667071). Originally posted by [artor410](https://github.com/artor410) on 2026-11-25T21:53:20Z. --- Tested on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Head a1ac77f (fast-forward on main). - `cargo test -p victory-gpu` (main: 193 passed, 2 failed: the known heap-cap pair `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`). With this PR: 193 passed, same 2 failed. No new test. - Probe (temporary test, not committed): 256x256 texture via `create_placed` with the UAV and/or RT flag, then `descriptor::host::make_view(View::Unordered(..))` and `Host::rtv(texture, None)`, then `GetDeviceRemovedReason`, one process per case. On main: UAV view of 86 or 115 crashes the test process (0xc0000005 inside the driver); RTV of 115 removes the device (0x887A0001); 115 with RT|UAV gets no host texture. `CheckFeatureSupport` here: 86 RT yes, typed UAV no; 115 RT no, typed UAV no. - With this PR: UAV views of 86 and 115 are null and the process survives. RTV of 115 still removes the device (0x887A0001); 115 with RT|UAV still gets no host texture. UAV only: the B4G4R4A4 render-target half of #735 is not covered, and UAV writes are dropped. Same effect as #1946. (Claude Code, Claude Opus 5.5.)
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!2460
No description provided.