GPU: unordered views only in formats the host can store (#1753) #1774

Closed
JurajSimicevic wants to merge 2 commits from upstream-pr/1775 into main
JurajSimicevic commented 2026-11-24 22:20:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-24T22:20:49Z.


Fixes #1753.

What

fits checked the host's typed-store support (typed_store) only for an unordered view cast to a format of another family. An unordered view in the texture's own format, with or without a description, skipped it. The title makes one on a B5G5R5A1_UNORM texture a few seconds after start; NVIDIA has no typed UAVs of that format, and CreateUnorderedAccessView there removes the device (DXGI_ERROR_INVALID_CALL). So main stopped at boot on every NVIDIA host.

Now every unordered texture view is checked in the format it is actually made in: the requested one, or the texture's own where the view takes it (a typed texture's view in another format of its family it isn't castable to). A view the host can't store leaves the slot null, as the other refusals in fits do, logged once ("an unordered view in a format the host cannot store"). Shader views and buffer views are unchanged.

Tests

New descriptor::host::tests::unordered_views_only_in_formats_the_host_stores: an R8G8B8A8_UNORM texture allowing unordered access takes unordered views; a B5G5R5A1_UNORM one (made castable, as resource makes it) takes them only if typed_store says the host stores the format, with and without a description, and still takes shader views. With the old check put back, the test fails on the RTX 5080 (left: true, right: false); it skips where the host refuses such a texture. It also passes with --features diagnostics and VICTORY_D3D12_DEBUG=1.

cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings is clean. cargo test -p victory-gpu --locked: 78 passed; the 2 failures are the HEAP_VIEWS tests fixed by #1751 (failing on main on NVIDIA too).

In the game

RTX 5080 (driver 32.0.16.1742), Windows 11 26200, diag build with the debug layer and DRED, main at 70564ae plus this change, two runs:

  • The view is refused once (view=86 own=86) and the boot goes on: menus and loading at 30 fps, then into the world, where the title card of the first mission renders. Plain main stops ~6 s after start on the same machine.
  • Both runs end in the known NVIDIA world hang (#71, DXGI_ERROR_DEVICE_HUNG) after 1.5 to 5 minutes in the world.

Worth knowing, not from this change: in the world, GPU time per frame is now 4.8 to 6.9 s (median of the last six frame lines), against about 170 ms on ffe310e on the same machine. This change only leaves one view null; something in tonight's merges (between ffe310e and 70564ae) costs it, and on NVIDIA it wasn't visible before because the boot stopped first.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6592566985 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775). Originally posted by [JurajSimicevic](https://github.com/JurajSimicevic) on 2026-11-24T22:20:49Z. --- Fixes #1753. ## What `fits` checked the host's typed-store support (`typed_store`) only for an unordered view cast to a format of another family. An unordered view in the texture's own format, with or without a description, skipped it. The title makes one on a `B5G5R5A1_UNORM` texture a few seconds after start; NVIDIA has no typed UAVs of that format, and `CreateUnorderedAccessView` there removes the device (`DXGI_ERROR_INVALID_CALL`). So `main` stopped at boot on every NVIDIA host. Now every unordered texture view is checked in the format it is actually made in: the requested one, or the texture's own where the view takes it (a typed texture's view in another format of its family it isn't castable to). A view the host can't store leaves the slot null, as the other refusals in `fits` do, logged once ("an unordered view in a format the host cannot store"). Shader views and buffer views are unchanged. ## Tests New `descriptor::host::tests::unordered_views_only_in_formats_the_host_stores`: an `R8G8B8A8_UNORM` texture allowing unordered access takes unordered views; a `B5G5R5A1_UNORM` one (made castable, as `resource` makes it) takes them only if `typed_store` says the host stores the format, with and without a description, and still takes shader views. With the old check put back, the test fails on the RTX 5080 (`left: true, right: false`); it skips where the host refuses such a texture. It also passes with `--features diagnostics` and `VICTORY_D3D12_DEBUG=1`. `cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings` is clean. `cargo test -p victory-gpu --locked`: 78 passed; the 2 failures are the `HEAP_VIEWS` tests fixed by #1751 (failing on `main` on NVIDIA too). ## In the game RTX 5080 (driver 32.0.16.1742), Windows 11 26200, diag build with the debug layer and DRED, `main` at 70564ae plus this change, two runs: - The view is refused once (`view=86 own=86`) and the boot goes on: menus and loading at 30 fps, then into the world, where the title card of the first mission renders. Plain `main` stops ~6 s after start on the same machine. - Both runs end in the known NVIDIA world hang (#71, `DXGI_ERROR_DEVICE_HUNG`) after 1.5 to 5 minutes in the world. Worth knowing, not from this change: in the world, GPU time per frame is now 4.8 to 6.9 s (median of the last six frame lines), against about 170 ms on `ffe310e` on the same machine. This change only leaves one view null; something in tonight's merges (between `ffe310e` and `70564ae`) costs it, and on NVIDIA it wasn't visible before because the boot stopped first. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DenRakEiw commented 2026-11-24 23:05:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T22:27:02Z.

Review: APPROVED


Verified locally merged onto origin/main (70564ae, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu — all 77 passing tests (including unordered_views_only_in_formats_the_host_stores) pass on both RTX 5090 hardware and VICTORY_D3D12_WARP=1 (0 new failures; the 2 HEAP_VIEWS failures reproduce identically on untouched origin/main 70564ae)
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean format capability gating for unordered access views with host-verified test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6048389070 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775#pullrequestreview-6048389070). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T22:27:02Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`70564ae`, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu` — all 77 passing tests (including `unordered_views_only_in_formats_the_host_stores`) pass on both RTX 5090 hardware and `VICTORY_D3D12_WARP=1` (0 new failures; the 2 `HEAP_VIEWS` failures reproduce identically on untouched `origin/main` `70564ae`) - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean format capability gating for unordered access views with host-verified test coverage. Looks good. AI-assisted (Gemini 4 Neon).
BaggyALPHA commented 2026-11-24 23:05:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BaggyALPHA on 2026-11-24T22:47:35Z.

Review: COMMENTED


Independent RTX 3080 12 GiB boot A/B on Windows, driver 621.24. Both diagnostics builds used the same main revision, #1702 for scripted input, the Series X profile, the same test save and separate cold VIctory caches. DRED was enabled and descriptor warning output was suppressed in both runs. The typed-UAV patch was the sole runtime code change between builds.

Build First device removal Work reached
Baseline 9.5 s, DXGI_ERROR_INVALID_CALL, 1 submitted list Early boot, at most 3 draws/frame in the samples
#1775 74.3 s, DXGI_ERROR_DEVICE_HUNG, 26 submitted lists At most 195 draws/frame in the samples, with 35 successful mesh pipeline creations recorded earlier

Times are from the first trace event. The patched run logged a 7.58 s submission before device removal. The supplied typed-view unit test also passed here. This was one matched pair. It reproduces the startup fix on Ampere and records the later hang separately.

AI-assisted (Codex). Aggregate results only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048604595 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775#pullrequestreview-6048604595). Originally posted by [BaggyALPHA](https://github.com/BaggyALPHA) on 2026-11-24T22:47:35Z. **Review:** COMMENTED --- Independent RTX 3080 12 GiB boot A/B on Windows, driver 621.24. Both diagnostics builds used the same main revision, #1702 for scripted input, the Series X profile, the same test save and separate cold VIctory caches. DRED was enabled and descriptor warning output was suppressed in both runs. The typed-UAV patch was the sole runtime code change between builds. | Build | First device removal | Work reached | | --- | --- | --- | | Baseline | 9.5 s, DXGI_ERROR_INVALID_CALL, 1 submitted list | Early boot, at most 3 draws/frame in the samples | | #1775 | 74.3 s, DXGI_ERROR_DEVICE_HUNG, 26 submitted lists | At most 195 draws/frame in the samples, with 35 successful mesh pipeline creations recorded earlier | Times are from the first trace event. The patched run logged a 7.58 s submission before device removal. The supplied typed-view unit test also passed here. This was one matched pair. It reproduces the startup fix on Ampere and records the later hang separately. AI-assisted (Codex). Aggregate results only.
catminou4 commented 2026-11-24 23:05:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:03:17Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Unordered views only in formats the host can store (#1753 follow-up): view-format gating on the GPU side. Pairs with #1787/#1801 — same policy applied at texture creation vs view check; check the three land consistently.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048800205 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775#pullrequestreview-6048800205). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:03:17Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Unordered views only in formats the host can store (#1753 follow-up): view-format gating on the GPU side. Pairs with #1787/#1801 — same policy applied at texture creation vs view check; check the three land consistently.
DesertGamer commented 2026-11-24 23:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-24T22:23:56Z.


VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146180115 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775#issuecomment-7146180115). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-24T22:23:56Z. --- ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
JurajSimicevic commented 2026-11-24 23:06:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-24T22:50:47Z.


For the reviewers: #1763 makes the same change and was opened 11 minutes before this one (this one follows the claim in #1633 at 22:02). Either fixes #1753; this one adds the in-game check on the RTX 5080 and the reviews above (RTX 5090, RTX 3080). Happy for whichever reads better to go in.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146712497 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775#issuecomment-7146712497). Originally posted by [JurajSimicevic](https://github.com/JurajSimicevic) on 2026-11-24T22:50:47Z. --- For the reviewers: #1763 makes the same change and was opened 11 minutes before this one (this one follows the claim in #1633 at 22:02). Either fixes #1753; this one adds the in-game check on the RTX 5080 and the reviews above (RTX 5090, RTX 3080). Happy for whichever reads better to go in. AI-assisted.
Marvisak commented 2026-11-25 07:03:08 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Proposed close: duplicate of #1763. This changes fits in crates/victory-gpu/src/descriptor/host.rs so that every unordered view, not only a cast one, is checked with typed_store in the format the view is actually made in. That is the right fix for the B5G5R5A1_UNORM device removal in #1753. #1763 makes the same change to the same lines: the view == 0 arm and target = if !typeless && !cast { own } else { view }. It merges cleanly and was triaged first, with host tests for the typeless and castable cases.

If this PR covers a case #1763 misses, say which one and this verdict can be revisited.

CI: no check runs on the head commit.

This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154642126 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775#issuecomment-7154642126). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:17:40Z. --- <!-- victory-triage v1 head=b0799091b4f355d9d8727f9c32e0ab41ff060a1e verdict=proposed-close at=2026-11-25T06:36:00Z --> Automated triage for the maintainers. **Proposed close: duplicate of #1763.** This changes `fits` in `crates/victory-gpu/src/descriptor/host.rs` so that every unordered view, not only a cast one, is checked with `typed_store` in the format the view is actually made in. That is the right fix for the `B5G5R5A1_UNORM` device removal in #1753. #1763 makes the same change to the same lines: the `view == 0` arm and `target = if !typeless && !cast { own } else { view }`. It merges cleanly and was triaged first, with host tests for the typeless and castable cases. If this PR covers a case #1763 misses, say which one and this verdict can be revisited. CI: no check runs on the head commit. This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 08:05:41 +00:00
JurajSimicevic commented 2026-11-25 08:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-25T07:08:57Z.


Closing as a duplicate of #1763, which makes the same change to the same lines and came first (as the triage above says).

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155541283 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1775#issuecomment-7155541283). Originally posted by [JurajSimicevic](https://github.com/JurajSimicevic) on 2026-11-25T07:08:57Z. --- Closing as a duplicate of #1763, which makes the same change to the same lines and came first (as the triage above says). AI-assisted.

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!1774
No description provided.