GPU: drop ALLOW_UNORDERED_ACCESS when the format cannot be a UAV #2459

Open
github-bot wants to merge 6 commits from github-bot/gh-2459 into main AGit
Owner

@⁠roon9e on GitHub · 2026-11-25 13:57 UTC · original
roon9e:fix/uav-format-without-support → main · +73 −2 · 2 files · 6 commits · open

Fixes the world-load device removal on a GTX 1660 SUPER (Turing, driver 610.88) that the #1063 report hit on 940d32f.

The D3D12 debug layer named the invalid call:

ID3D12Device::GetResourceAllocationInfo: A texture that has D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS set in D3D12_RESOURCE_DESC::Flags must be created with a format that either can be used as unordered access, or cast to a format that could be used as unordered access. FeatureLevel is D3D_FEATURE_LEVEL_12_1. D3D12_RESOURCE_DESC::Format is B5G5R5A1_UNORM.

The console allows a texture flagged for unordered access in such a packed format; PC D3D12 does not, so the resource creation is invalid and the next submission device-removes (GetDeviceRemovedReason = 0x887A0001).

host_desc now asks the host device (D3D12_FEATURE_FORMAT_SUPPORT, UAV_TYPED_LOAD|UAV_TYPED_STORE) and drops ALLOW_UNORDERED_ACCESS when the format cannot be a UAV; its unordered views are then refused like any other use the host does not take.

Measured on 940d32f (GTX 1660 SUPER, own 1.0.2.1 copy, Agility 1.620.2 in D3D12\):

  • before: device-removes about 10 s into the world load (crashes.log: host GPU device removed … 0x887A0001);
  • after: the run is stable (25 min, crashes.log clean) and reaches the account-picker screen at 30 fps, then Game Running.

This is independent of the codec stop in #1063 — with this change the run reaches that stop instead of dying earlier — and it is independent of pipelines/contents tried before (a pre-built translate --cache --pipelines library, Series S, and disabling depth twins or large title-buffer copies all still device-removed until this format guard).

Thanks for VIctory.

**@⁠roon9e** on GitHub · 2026-11-25 13:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459) `roon9e:fix/uav-format-without-support` → `main` · +73 −2 · 2 files · 6 commits · open Fixes the **world-load device removal** on a GTX 1660 SUPER (Turing, driver 610.88) that the #1063 report hit on `940d32f`. The D3D12 debug layer named the invalid call: > `ID3D12Device::GetResourceAllocationInfo`: A texture that has `D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS` set in `D3D12_RESOURCE_DESC::Flags` must be created with a format that either can be used as unordered access, or cast to a format that could be used as unordered access. FeatureLevel is `D3D_FEATURE_LEVEL_12_1`. `D3D12_RESOURCE_DESC::Format` is `B5G5R5A1_UNORM`. The console allows a texture flagged for unordered access in such a packed format; PC D3D12 does not, so the resource creation is invalid and the **next** submission device-removes (`GetDeviceRemovedReason` = `0x887A0001`). `host_desc` now asks the host device (`D3D12_FEATURE_FORMAT_SUPPORT`, `UAV_TYPED_LOAD|UAV_TYPED_STORE`) and **drops `ALLOW_UNORDERED_ACCESS`** when the format cannot be a UAV; its unordered views are then refused like any other use the host does not take. Measured on `940d32f` (GTX 1660 SUPER, own 1.0.2.1 copy, Agility 1.620.2 in `D3D12\`): - **before**: device-removes about 10 s into the world load (`crashes.log`: `host GPU device removed … 0x887A0001`); - **after**: the run is stable (25 min, `crashes.log` clean) and reaches the account-picker screen at 30 fps, then `Game Running`. This is independent of the codec stop in #1063 — with this change the run reaches that stop instead of dying earlier — and it is independent of pipelines/contents tried before (a pre-built `translate --cache --pipelines` library, Series S, and disabling depth twins or large title-buffer copies all still device-removed until this format guard). Thanks for VIctory.
The D3D12 debug layer named the world-load device removal on a GTX 1660 SUPER (Turing): a texture with D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS must be created with a format that can be used as (or cast to) unordered access, but the layer asks for B5G5R5A1_UNORM. The console allows it; PC D3D12 refuses, so the resource creation is invalid and the next submission device-removes.

host_desc now asks the host device (D3D12_FEATURE_FORMAT_SUPPORT, UAV_TYPED_LOAD|UAV_TYPED_STORE) and drops ALLOW_UNORDERED_ACCESS when the format cannot be a UAV; unordered views of it are then refused like any other use the host does not take.

Measured on 940d32f: without this a run device-removes about 10 s into the world load; with it the run is stable (25 min, no fault) and reaches the account-picker screen.
Review of #2459 (kotekompotek, oni-swr): uav_format probed only the exact format with Support2 UAV_TYPED_LOAD|STORE, an operation-support bit, so the flag was dropped from typeless and sRGB textures (e.g. R8G8B8A8_TYPELESS 27, and 29 which host_desc maps to 27) that the host can legally create unordered through their castable formats.

Use the legality criterion instead: the format, or a format the texture is made castable to (the enhanced-barrier creation make_texture takes), must take a typed unordered view (descriptor::host::typed_store, D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW). The B5G5R5A1_UNORM case (no such format in its family on the device) still loses the flag.

Adds a host-derived test (unordered_flag_follows_the_castable_route).
host_desc keeps ALLOW_UNORDERED_ACCESS where a format the texture is made castable to takes a typed unordered view. But the cast-list creation (CreateCommittedResource3 / CreatePlacedResource2) can be refused (E_INVALIDARG), and the committed fallback then carried the flag on a format that cannot be a typed UAV itself, removing the device.

The fallback now clears the flag when the format itself cannot take a typed unordered view: with the cast list gone the flag is only legal where it can.
Triage was right: castable() groups by element size, so castable(B5G5R5A1_UNORM=86) includes 16-bit R16/R8G8 formats that take typed UAVs, and the flag was kept for 86 - the exact texture the report is about (probe on the GTX 1660 SUPER: typed_store(86)=false, yet castable(86)=[49,50,51,52,54,56,57,58,59,68,69,85,115] and all of [49,50,51,52,54,56,57,58,59] take typed UAVs).

Use the format's own family instead (family_formats: the typeless head and its typed/sRGB twins, i.e. every format sharing its family() head), which is what a UAV of the resource can reach without changing what the texels mean. B5G5R5A1 has no such family, so it loses the flag; typeless/sRGB keep it through their typed member. The test now checks 86 loses it.
Drop the hard-coded !takes(86) from unordered_flag_follows_the_format_family:
the rule (flag kept iff the format's family takes a typed UAV) is what the test
should pin, and a device that stores B5G5R5A1_UNORM typed (WARP, some AMD) keeps
the flag - the old assert panicked there, failing CI.

amily_formats scanned only 1..=115, so a format above 115 with no family
iterated nothing instead of ' alone' as its doc says; chain  itself.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:31 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 14:12 UTC · original

Heads-up for triage: #2442 fixes the same #2258 device removal, with two technical differences worth noting:

  • Probe kind: this PR checks Support2 UAV_TYPED_LOAD | UAV_TYPED_STORE (operation support). #2442 reuses the existing descriptor::host::typed_store, which checks Support1 TYPED_UNORDERED_ACCESS_VIEW — the "can a typed UAV of this format exist" bit, which is the legality criterion ALLOW_UNORDERED_ACCESS creation enforces (and is OR-ed here, so a load-only format would keep a flag it still cannot satisfy).
  • Cast list: this PR probes only d.format itself; #2442 also accepts the flag where ID3D12Device10 creation carries a cast list that can reach a typed-UAV format (the typeless → UNORM case), matching what takes() will do later. Here the flag is dropped in a case the resource could legally keep.
  • #2442 also ships a host-derived test (unordered_needs_a_format_unordered_views_take).
**@⁠kotekompotek** on GitHub · 2026-11-25 14:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7164911676) Heads-up for triage: #2442 fixes the same #2258 device removal, with two technical differences worth noting: - **Probe kind**: this PR checks `Support2` `UAV_TYPED_LOAD | UAV_TYPED_STORE` (operation support). #2442 reuses the existing `descriptor::host::typed_store`, which checks `Support1` `TYPED_UNORDERED_ACCESS_VIEW` — the "can a typed UAV of this format exist" bit, which is the legality criterion `ALLOW_UNORDERED_ACCESS` creation enforces (and is OR-ed here, so a load-only format would keep a flag it still cannot satisfy). - **Cast list**: this PR probes only `d.format` itself; #2442 also accepts the flag where `ID3D12Device10` creation carries a cast list that can reach a typed-UAV format (the typeless → UNORM case), matching what `takes()` will do later. Here the flag is dropped in a case the resource could legally keep. - #2442 also ships a host-derived test (`unordered_needs_a_format_unordered_views_take`).
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 14:12 UTC · original

Independent WARP verification of #2459 at 1679fbe

Commands (Rust 1.98.1, Windows 11, merged cleanly with origin/main 940d32f per git merge-tree): cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1, cargo clippy -p victory-gpu --all-targets -- -D warnings (with and without --features diagnostics), cargo xtask policy.

  • lib tests: 146 passed, 0 failed, 2 ignored; clippy clean both ways; policy OK. No unit tests are added by this PR, so no negative control applies.
  • Not a pass on behaviour: the probe below shows this PR also drops the flag from typeless / sRGB-mapped textures that main keeps it on (27, 29, 88, 90-93 on WARP). The code comment says "(and its castable family)" but uav_format only queries the exact format.

4-way comparison of the UAV-flag PRs (#2459 / #2442 / #2319 / #2432)

#2459 #2442 #2319 #2432
Approach drop ALLOW_UNORDERED_ACCESS in host_desc if CheckFeatureSupport(format) has no UAV typed load/store drop the flag unless typed_store(format) or (Device10 and a castable format has typed_store) drop the flag if family(f)==f && !typed_store(f), warns once no flag change: refuses unordered views the host cannot store typed (fits) and uses the live texture's GetDesc() in shared_texture
Typeless / cast-list textures (e.g. 27, and sRGB 29 which host_desc maps to 27) flag dropped (exact-format probe only) kept (cast-list aware) flag dropped (family(27)==27, typed_store(27) false) n/a
New tests none 1 (host-dependent) 1, but placed after the closing } of mod tests none
Conflicts #2442 and #2319 and #2459 all edit the same host_desc spot in resource.rs: pairwise merge conflicts; #2432 merges cleanly with each touches fits/shared_texture, complements a host_desc fix rather than replacing it

WARP probe of host_desc with flags=RENDER_TARGET|UNORDERED, input format -> UAV flag kept (main keeps it for all of these):

  • 27 R8G8B8A8_TYPELESS: #2459 dropped, #2442 kept, #2319 dropped
  • 29 R8G8B8A8_UNORM_SRGB (mapped to 27): #2459 dropped, #2442 kept, #2319 dropped
  • 88 / 90 / 91 / 92 / 93 (B8G8R8X8/B8G8R8A8 families): #2459 dropped 88, 90-93; #2319 dropped 90-93; #2442 kept all
  • 28, 85, 86, 87, 115, 10, 11, 2, 41, 56: kept by all three. WARP supports 86 (B5G5R5A1) as a typed UAV, so the NVIDIA device-removal format itself cannot be reproduced on WARP.

Reading: #2442 is the narrowest fix that still honours the cast-list route main already relies on for sRGB/typeless UAV textures. #2459 and #2319 look like they regress those on a device whose typeless format reports no typed UAV (WARP here; hardware may differ, I could not check). #2432 is a different layer (view refusal + allocation-info query) and could land alongside #2442. Suggest one of the host_desc PRs only.

AI-assisted verification by Claude Code (Claude Sonnet 5.5). Software-only: Microsoft Basic Render Driver (WARP, vendor 0x1414, forced by VICTORY_D3D12_WARP=1 + --features diagnostics; warp_adapter() refuses a non-software adapter), no physical GPU, no game files, dumps or hashes.

**@⁠oni-swr** on GitHub · 2026-11-25 14:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7164932614) **Independent WARP verification of #2459 at `1679fbe`** Commands (Rust 1.98.1, Windows 11, merged cleanly with `origin/main` `940d32f` per `git merge-tree`): `cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1`, `cargo clippy -p victory-gpu --all-targets -- -D warnings` (with and without `--features diagnostics`), `cargo xtask policy`. - lib tests: 146 passed, 0 failed, 2 ignored; clippy clean both ways; policy OK. No unit tests are added by this PR, so no negative control applies. - Not a pass on behaviour: the probe below shows this PR also drops the flag from typeless / sRGB-mapped textures that main keeps it on (27, 29, 88, 90-93 on WARP). The code comment says "(and its castable family)" but `uav_format` only queries the exact format. **4-way comparison of the UAV-flag PRs (#2459 / #2442 / #2319 / #2432)** | | #2459 | #2442 | #2319 | #2432 | |---|---|---|---|---| | Approach | drop `ALLOW_UNORDERED_ACCESS` in `host_desc` if `CheckFeatureSupport(format)` has no UAV typed load/store | drop the flag unless `typed_store(format)` or (Device10 and a castable format has `typed_store`) | drop the flag if `family(f)==f && !typed_store(f)`, warns once | no flag change: refuses unordered views the host cannot store typed (`fits`) and uses the live texture's `GetDesc()` in `shared_texture` | | Typeless / cast-list textures (e.g. 27, and sRGB 29 which `host_desc` maps to 27) | **flag dropped** (exact-format probe only) | kept (cast-list aware) | **flag dropped** (`family(27)==27`, `typed_store(27)` false) | n/a | | New tests | none | 1 (host-dependent) | 1, but placed after the closing `}` of `mod tests` | none | | Conflicts | #2442 and #2319 and #2459 all edit the same `host_desc` spot in `resource.rs`: pairwise merge conflicts; #2432 merges cleanly with each | | | touches `fits`/`shared_texture`, complements a `host_desc` fix rather than replacing it | WARP probe of `host_desc` with `flags=RENDER_TARGET|UNORDERED`, input format -> UAV flag kept (main keeps it for all of these): - 27 R8G8B8A8_TYPELESS: #2459 **dropped**, #2442 kept, #2319 **dropped** - 29 R8G8B8A8_UNORM_SRGB (mapped to 27): #2459 **dropped**, #2442 kept, #2319 **dropped** - 88 / 90 / 91 / 92 / 93 (B8G8R8X8/B8G8R8A8 families): #2459 dropped 88, 90-93; #2319 dropped 90-93; #2442 kept all - 28, 85, 86, 87, 115, 10, 11, 2, 41, 56: kept by all three. WARP supports 86 (B5G5R5A1) as a typed UAV, so the NVIDIA device-removal format itself cannot be reproduced on WARP. Reading: #2442 is the narrowest fix that still honours the cast-list route main already relies on for sRGB/typeless UAV textures. #2459 and #2319 look like they regress those on a device whose typeless format reports no typed UAV (WARP here; hardware may differ, I could not check). #2432 is a different layer (view refusal + allocation-info query) and could land alongside #2442. Suggest one of the `host_desc` PRs only. AI-assisted verification by Claude Code (Claude Sonnet 5.5). Software-only: Microsoft Basic Render Driver (WARP, vendor 0x1414, forced by `VICTORY_D3D12_WARP=1` + `--features diagnostics`; `warp_adapter()` refuses a non-software adapter), no physical GPU, no game files, dumps or hashes.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 14:28 UTC · original · edited 2026-11-25 22:21 UTC

Overlap check: four open PRs drop ALLOW_UNORDERED_ACCESS at resource creation in victory-gpu/src/resource.rs. Each uses a different rule for which formats lose the flag (read from the diffs against main 940d32f, not run):

PR opened the flag goes when
#2180 (n-romanovich) 07:06Z the format isn't typeless and its family lacks TYPED_UNORDERED_ACCESS_VIEW support. It also strips unsupported render-target flags.
#2319 (Calvix2k) 10:33Z the format is its own family head (family(f) == f: a typeless head, or a format with no family) and the host has no typed store for it (typed_store). Corrected: I first had this backwards.
#2442 (kotekompotek) 13:36Z no typed store, unless a castable UAV format exists (not for depth)
#2459 (this) 13:57Z (edited, at 9ff2c1a) no typed store for the format and none for any format it can be cast to (castable(f).any(typed_store)); that's #2442's rule, except that #2442 doesn't allow the castable route for depth resources

Added 20:35Z: two newer PRs for #2725 overlap these (read from the diffs, not run):

PR opened approach
#2773 (kais7654) 20:12Z (updated for c1fcd74) strips only the render-target use at creation, where the device refuses the resource (B4G4R4A4 on NVIDIA), and keeps the unordered-access use; typeless formats keep their description's uses; a typed UAV view whose format the device can't store (B5G5R5A1, B4G4R4A4) is held back (reads null, writes dropped), plus draw.rs / host.rs / list.rs changes
#2767 (narishaa) 20:07Z keeps the flags and instead makes B5G5R5A1 (86) and B4G4R4A4 (115) as R8G8B8A8_UNORM when the host lacks render-target or typed UAV support for them; buffer-to-texture copies into such a texture are expanded on the CPU (list.rs), and descriptor.rs handles the views

Added 21:52Z: two more, read from the diffs (not run):

PR opened approach
#2834 (kais7654) 21:42Z stacked on #2773: host_desc now also drops the unordered-access use when CheckFeatureSupport reports no TYPED_UNORDERED_ACCESS_VIEW for the format (B5G5R5A1, B4G4R4A4 on NVIDIA), as #2773 does for the render-target use; typeless formats keep every use. Rebased on main 61bfc77, whose descriptor::host::fits already holds back unordered views in formats the device doesn't store (the author's 21:46Z comment)
#2832 (legayclightning22) 21:40Z resource.rs only: where the host lacks render-target or typed UAV support, promotes 67 to 26, 115 to 87, and 86 to 87 (render target only), then drops a use the promoted format still lacks; a view now needs its exact format in the castable list rather than the same family

So #2834's unordered-access drop is the same creation-side change as the first four, with the device's own answer as the rule, and #2832 swaps formats like #2767 (87 there instead of 28).

Added 22:21Z: artor410 measured five of these on an RTX 3070 Ti with a synthetic probe (a UAV view of 86/115 and an RTV of 115, one process per case): #735. In it the RTV of 115 still removes the device with #2442, #2462 and #1946, not with #2767 or #2773. #2459, #2319, #2834 and #2832 are not in that table.

#2462 (lhnizdo) is the view-creation side. kotekompotek noted it complements #2442 rather than overlapping it.

They differ mainly for typeless formats. #2180 leaves typeless formats alone, #2319 applies its rule only to family heads (typeless ones included) and formats with no family, and #2442 keeps the flag when a castable UAV format exists. (Edited: the #2319 row was backwards.) One of the four should be picked; whichever is picked, #2462 still applies.

Edited after 9ff2c1a: #2459 and #2442 now use nearly the same rule. The difference is depth resources (#2442 keeps the castable route off for them).

AI-assisted (Claude Code, Claude Opus 5.5). Read from the diffs only.

**@⁠upipibi** on GitHub · 2026-11-25 14:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7165328287) · edited 2026-11-25 22:21 UTC Overlap check: four open PRs drop `ALLOW_UNORDERED_ACCESS` at resource creation in `victory-gpu/src/resource.rs`. Each uses a different rule for which formats lose the flag (read from the diffs against `main` `940d32f`, not run): | PR | opened | the flag goes when | |---|---|---| | #2180 (n-romanovich) | 07:06Z | the format isn't typeless and its family lacks `TYPED_UNORDERED_ACCESS_VIEW` support. It also strips unsupported render-target flags. | | #2319 (Calvix2k) | 10:33Z | the format is its own family head (`family(f) == f`: a typeless head, or a format with no family) and the host has no typed store for it (`typed_store`). Corrected: I first had this backwards. | | #2442 (kotekompotek) | 13:36Z | no typed store, unless a castable UAV format exists (not for depth) | | #2459 (this) | 13:57Z | (edited, at `9ff2c1a`) no typed store for the format and none for any format it can be cast to (`castable(f).any(typed_store)`); that's #2442's rule, except that #2442 doesn't allow the castable route for depth resources | **Added 20:35Z:** two newer PRs for #2725 overlap these (read from the diffs, not run): | PR | opened | approach | |---|---|---| | #2773 (kais7654) | 20:12Z | (updated for `c1fcd74`) strips only the render-target use at creation, where the device refuses the resource (B4G4R4A4 on NVIDIA), and keeps the unordered-access use; typeless formats keep their description's uses; a typed UAV view whose format the device can't store (B5G5R5A1, B4G4R4A4) is held back (reads null, writes dropped), plus `draw.rs` / `host.rs` / `list.rs` changes | | #2767 (narishaa) | 20:07Z | keeps the flags and instead makes B5G5R5A1 (86) and B4G4R4A4 (115) as `R8G8B8A8_UNORM` when the host lacks render-target or typed UAV support for them; buffer-to-texture copies into such a texture are expanded on the CPU (`list.rs`), and `descriptor.rs` handles the views | **Added 21:52Z:** two more, read from the diffs (not run): | PR | opened | approach | |---|---|---| | #2834 (kais7654) | 21:42Z | stacked on #2773: `host_desc` now also drops the unordered-access use when `CheckFeatureSupport` reports no `TYPED_UNORDERED_ACCESS_VIEW` for the format (B5G5R5A1, B4G4R4A4 on NVIDIA), as #2773 does for the render-target use; typeless formats keep every use. Rebased on `main` `61bfc77`, whose `descriptor::host::fits` already holds back unordered views in formats the device doesn't store (the author's 21:46Z comment) | | #2832 (legayclightning22) | 21:40Z | `resource.rs` only: where the host lacks render-target or typed UAV support, promotes 67 to 26, 115 to 87, and 86 to 87 (render target only), then drops a use the promoted format still lacks; a view now needs its exact format in the castable list rather than the same family | So #2834's unordered-access drop is the same creation-side change as the first four, with the device's own answer as the rule, and #2832 swaps formats like #2767 (87 there instead of 28). **Added 22:21Z:** artor410 measured five of these on an RTX 3070 Ti with a synthetic probe (a UAV view of 86/115 and an RTV of 115, one process per case): https://git.gtahub.st/github/Marvisak--VIctory/pulls/735. In it the RTV of 115 still removes the device with #2442, #2462 and #1946, not with #2767 or #2773. #2459, #2319, #2834 and #2832 are not in that table. #2462 (lhnizdo) is the view-creation side. kotekompotek noted it complements #2442 rather than overlapping it. They differ mainly for typeless formats. #2180 leaves typeless formats alone, #2319 applies its rule only to family heads (typeless ones included) and formats with no family, and #2442 keeps the flag when a castable UAV format exists. (Edited: the #2319 row was backwards.) One of the four should be picked; whichever is picked, #2462 still applies. Edited after `9ff2c1a`: #2459 and #2442 now use nearly the same rule. The difference is depth resources (#2442 keeps the castable route off for them). AI-assisted (Claude Code, Claude Opus 5.5). Read from the diffs only.
Author
Owner

@⁠roon9e on GitHub · 2026-11-25 14:49 UTC · original

Addressed the review feedback in 9ff2c1a (pushed to this branch).

kotekompotek / oni-swr were right: uav_format probed only the exact format with Support2 UAV_TYPED_LOAD | UAV_TYPED_STORE — an operation-support bit — so the flag was dropped from typeless and sRGB textures (R8G8B8A8_TYPELESS 27, and 29 which host_desc maps to 27), plus the B8G8R8X8/B8G8R8A8 families, on any device whose typeless format reports no typed UAV.

What changed:

  • Deleted host::uav_format; host_desc now uses the legality criterion descriptor::host::typed_store (D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW, the bit ALLOW_UNORDERED_ACCESS creation enforces), made pub(crate).
  • The flag is dropped only when neither the format itself nor any format the texture is made castable to (castable(d.format), the enhanced-barrier CreateCommittedResource3 list make_texture already passes) takes a typed unordered view. So typeless/sRGB textures that reach a typed-UAV format through the cast list keep the flag; the reported B5G5R5A1_UNORM case, whose family has no such format, still loses it.
  • Added a host-derived test, unordered_flag_follows_the_castable_route, asserting the flag matches typed_store(f) || castable(f).any(typed_store) for 27, 28, 29, 86, 87, 10.

Checks (GTX 1660 SUPER, Turing, Rust 1.98.1): cargo clippy -p victory-gpu --all-targets -- -D warnings clean; the new test passes against the real device. Note: cargo test -p victory-gpu --lib -- --test-threads=1 has 2 pre-existing failures on this machine (dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views) — I reproduced them on 1679fbe with this change stashed, so they are not from this PR.

This brings the rule in line with #2442 (same criterion, cast-list aware). If the maintainers prefer #2442, I'm happy to close this one — the difference now is only surface (where the guard sits, and typed_store exposure).

AI-assisted; verified on the physical Turing device noted above.

**@⁠roon9e** on GitHub · 2026-11-25 14:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7165873742) Addressed the review feedback in `9ff2c1a` (pushed to this branch). **kotekompotek / oni-swr were right:** `uav_format` probed only the exact format with `Support2` `UAV_TYPED_LOAD | UAV_TYPED_STORE` — an *operation-support* bit — so the flag was dropped from typeless and sRGB textures (`R8G8B8A8_TYPELESS` 27, and 29 which `host_desc` maps to 27), plus the B8G8R8X8/B8G8R8A8 families, on any device whose typeless format reports no typed UAV. **What changed:** - Deleted `host::uav_format`; `host_desc` now uses the legality criterion `descriptor::host::typed_store` (`D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW`, the bit `ALLOW_UNORDERED_ACCESS` creation enforces), made `pub(crate)`. - The flag is dropped only when **neither** the format itself **nor any format the texture is made castable to** (`castable(d.format)`, the enhanced-barrier `CreateCommittedResource3` list `make_texture` already passes) takes a typed unordered view. So typeless/sRGB textures that reach a typed-UAV format through the cast list keep the flag; the reported `B5G5R5A1_UNORM` case, whose family has no such format, still loses it. - Added a host-derived test, `unordered_flag_follows_the_castable_route`, asserting the flag matches `typed_store(f) || castable(f).any(typed_store)` for `27, 28, 29, 86, 87, 10`. **Checks (GTX 1660 SUPER, Turing, Rust 1.98.1):** `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean; the new test passes against the real device. Note: `cargo test -p victory-gpu --lib -- --test-threads=1` has 2 pre-existing failures on this machine (`dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`) — I reproduced them on `1679fbe` with this change stashed, so they are not from this PR. This brings the rule in line with #2442 (same criterion, cast-list aware). If the maintainers prefer #2442, I'm happy to close this one — the difference now is only surface (where the guard sits, and `typed_store` exposure). AI-assisted; verified on the physical Turing device noted above.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:56 UTC · original · edited 2026-11-26 07:22 UTC

Automated triage for the maintainers.

The head is unchanged (41bdc39), and thanks for passing on krcenov's RTX 3070 run. The open point from the last triage still stands: in host_desc (resource.rs), family_formats(90) does not include the linear twin 87, so unordered BGRA sRGB (91) textures lose the flag that main keeps. Verdict unchanged: needs work.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7167449931) · edited 2026-11-26 07:22 UTC <!-- victory-triage v1 head=41bdc394ea34e221df384124e8c812b40b0e8bfb verdict=needs-work at=2026-11-26T07:22:12Z --> Automated triage for the maintainers. The head is unchanged (`41bdc39`), and thanks for passing on krcenov's RTX 3070 run. The open point from the last triage still stands: in `host_desc` (`resource.rs`), `family_formats(90)` does not include the linear twin 87, so unordered BGRA sRGB (91) textures lose the flag that `main` keeps. Verdict unchanged: needs work. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠roon9e on GitHub · 2026-11-25 15:56 UTC · original

Updated this branch with two things:

  • Merged origin/main (da82e44) so the PR is current (clean merge).
  • 9a47d4a: the committed fallback now clears ALLOW_UNORDERED_ACCESS when the cast-list creation is refused. host_desc keeps the flag where a castable format takes a typed UAV, but if CreateCommittedResource3/CreatePlacedResource2 with that list is refused and the plain fallback then carries the flag on a format that cannot be a typed UAV itself, the device is removed. With the cast list gone the flag is only legal where the format itself can take the view, so the fallback drops it there.

Found while testing on the GTX 1660 SUPER: on da82e44 the world load now device-removes earlier, at a 2560×1440 B4G4R4A4_UNORM (115) render target (no UAV flag) — separate from this PR and reproduced without it; reported on #2258.

**@⁠roon9e** on GitHub · 2026-11-25 15:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7167451875) Updated this branch with two things: - **Merged `origin/main` (`da82e44`)** so the PR is current (clean merge). - **`9a47d4a`**: the committed fallback now clears `ALLOW_UNORDERED_ACCESS` when the cast-list creation is refused. `host_desc` keeps the flag where a castable format takes a typed UAV, but if `CreateCommittedResource3`/`CreatePlacedResource2` with that list is refused and the plain fallback then carries the flag on a format that cannot be a typed UAV itself, the device is removed. With the cast list gone the flag is only legal where the format itself can take the view, so the fallback drops it there. Found while testing on the GTX 1660 SUPER: on `da82e44` the world load now device-removes earlier, at a 2560×1440 `B4G4R4A4_UNORM` (115) **render target** (no UAV flag) — separate from this PR and reproduced without it; reported on #2258.
Author
Owner

@⁠roon9e on GitHub · 2026-11-25 16:06 UTC · original

Triage is right — thank you, that was a real bug in the change. Confirmed empirically on the GTX 1660 SUPER:

typed_store(86) = false
castable(86)    = [49,50,51,52,54,56,57,58,59,68,69,85,115]
  of those, typed_store = [49,50,51,52,54,56,57,58,59]   // all 16-bit R16/R8G8 twins

castable groups by element size, so castable(B5G5R5A1_UNORM) reaches typed-UAV 16-bit formats and the flag was kept for 86 — i.e. it did not cover the texture the report is about, and the stable run was 1679fbe, as you say.

Fixed in ce9d6fd: host_desc now uses the format's own family (family_formats, every format that shares its family() head — the typeless head and its typed/sRGB twins), not castable's element-size group. B5G5R5A1_UNORM has no such family, so it loses the flag (the case is covered again); typeless/sRGB keep it through their typed member. The comment no longer claims the B5G5R5A1 case loses it under the old rule, and the test now asserts !family_takes(86) plus the rule for 27/28/29/86/87/10, so a wrong rule fails it. 9a47d4a's creation-fallback guard stays.

On the re-run you suggested: I can't reach that texture on this head, because da82e44 device-removes earlier on this card — a 2560×1440 B4G4R4A4_UNORM (115) render target (no UAV flag), reported on #2258 and reproduced without this change. On 940d32f the new predicate gives the same drop for 86 that was stable there.

This now overlaps #2180/#2319/#2442 as you noted; I'm happy to close this in favour of whichever host_desc fix you pick.

AI-assisted; probe and predicate on the physical Turing device above.

**@⁠roon9e** on GitHub · 2026-11-25 16:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7167601892) Triage is right — thank you, that was a real bug in the change. Confirmed empirically on the GTX 1660 SUPER: ``` typed_store(86) = false castable(86) = [49,50,51,52,54,56,57,58,59,68,69,85,115] of those, typed_store = [49,50,51,52,54,56,57,58,59] // all 16-bit R16/R8G8 twins ``` `castable` groups by element size, so `castable(B5G5R5A1_UNORM)` reaches typed-UAV 16-bit formats and the flag was kept for 86 — i.e. it did **not** cover the texture the report is about, and the stable run was `1679fbe`, as you say. **Fixed in `ce9d6fd`:** `host_desc` now uses the format's **own family** (`family_formats`, every format that shares its `family()` head — the typeless head and its typed/sRGB twins), not `castable`'s element-size group. `B5G5R5A1_UNORM` has no such family, so it loses the flag (the case is covered again); typeless/sRGB keep it through their typed member. The comment no longer claims the B5G5R5A1 case loses it under the old rule, and the test now asserts `!family_takes(86)` plus the rule for `27/28/29/86/87/10`, so a wrong rule fails it. `9a47d4a`'s creation-fallback guard stays. On the re-run you suggested: I can't reach that texture on this head, because `da82e44` device-removes earlier on this card — a 2560×1440 `B4G4R4A4_UNORM` (115) **render target** (no UAV flag), reported on #2258 and reproduced without this change. On `940d32f` the new predicate gives the same drop for 86 that was stable there. This now overlaps #2180/#2319/#2442 as you noted; I'm happy to close this in favour of whichever `host_desc` fix you pick. AI-assisted; probe and predicate on the physical Turing device above.
Author
Owner

@⁠KainanP on GitHub · 2026-11-25 19:36 UTC · original

RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half fixed (flag dropped, UAVs null), B4G4R4A4 target half still removes the device; no new failures. By reading, assert!(!takes(86)) would fail on hosts that store 86 (WARP, AMD). Details and the side-by-side table with the other #1753 PRs: #1753. Tested with the help of an AI assistant (Claude Code).

**@⁠KainanP** on GitHub · 2026-11-25 19:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7172519822) RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half **fixed** (flag dropped, UAVs null), B4G4R4A4 target half still removes the device; no new failures. By reading, `assert!(!takes(86))` would fail on hosts that store 86 (WARP, AMD). Details and the side-by-side table with the other #1753 PRs: https://git.gtahub.st/github/Marvisak--VIctory/issues/1753. Tested with the help of an AI assistant (Claude Code).
Author
Owner

@⁠roon9e on GitHub · 2026-11-25 20:06 UTC · original

Fixed both triage points in 41bdc39.

  • CI / test: dropped the hard-coded assert!(!takes(86)) from unordered_flag_follows_the_format_family. That assert encoded this device's support; WARP (and some AMD) stores B5G5R5A1_UNORM typed and keeps the flag there, so the assert panicked on WARP. The test now pins only the rule, flag_kept == family_takes(format), for 27/28/29/86/87/10.
  • family_formats: it scanned only 1..=115, so a format above 115 with no family iterated nothing rather than "f alone" as its doc says. It now chains f itself for f > 115, and the test asserts family_formats(200) contains 200.

Local: cargo test -p victory-gpu --features diagnostics --lib resource::tests::unordered_flag_follows_the_format_family passes on the GTX 1660 SUPER; cargo clippy -p victory-gpu --all-targets -- -D warnings clean with and without --features diagnostics.

Still overlaps #2180/#2319/#2442; happy to close in favour of whichever host_desc fix is picked.

AI-assisted.

**@⁠roon9e** on GitHub · 2026-11-25 20:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7173207691) Fixed both triage points in `41bdc39`. - **CI / test:** dropped the hard-coded `assert!(!takes(86))` from `unordered_flag_follows_the_format_family`. That assert encoded *this* device's support; WARP (and some AMD) stores `B5G5R5A1_UNORM` typed and keeps the flag there, so the assert panicked on WARP. The test now pins only the rule, `flag_kept == family_takes(format)`, for `27/28/29/86/87/10`. - **`family_formats`:** it scanned only `1..=115`, so a format above 115 with no family iterated nothing rather than "`f` alone" as its doc says. It now chains `f` itself for `f > 115`, and the test asserts `family_formats(200)` contains `200`. Local: `cargo test -p victory-gpu --features diagnostics --lib resource::tests::unordered_flag_follows_the_format_family` passes on the GTX 1660 SUPER; `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with and without `--features diagnostics`. Still overlaps #2180/#2319/#2442; happy to close in favour of whichever `host_desc` fix is picked. AI-assisted.
Author
Owner

@⁠krcenov on GitHub · 2026-11-25 22:07 UTC · original

Tested this PR at 41bdc39 on an RTX 3070 (driver 32.0.16.1714), Windows 10 22H2 (19045). The only local change is an Agility SDK 1.620.2 export (D3D12SDKVersion/D3D12SDKPath), which Windows 10 needs; see #2563. It was a diag build with VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1.

  • Fixed: No device removal in a 5-minute run. On 940d32f without a fix, the device was removed at 40–66 s. It held a steady 30 fps on menus and loading screens.
  • Format 86 handled: The B5G5R5A1 texture is created without the unordered flag. The view is then refused instead of removing the device: view the host does not allow unordered=true format=86 flags=1.
  • Still reported, not fatal: The format-115 render target (id=817 / id=599, B4G4R4A4_UNORM) and NumDescriptors 2097152 (id=645).
**@⁠krcenov** on GitHub · 2026-11-25 22:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7175958277) Tested this PR at `41bdc39` on an RTX 3070 (driver 32.0.16.1714), Windows 10 22H2 (19045). The only local change is an Agility SDK 1.620.2 export (`D3D12SDKVersion`/`D3D12SDKPath`), which Windows 10 needs; see #2563. It was a `diag` build with `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`. - **Fixed:** No device removal in a 5-minute run. On `940d32f` without a fix, the device was removed at 40–66 s. It held a steady 30 fps on menus and loading screens. - **Format 86 handled:** The B5G5R5A1 texture is created without the unordered flag. The view is then refused instead of removing the device: `view the host does not allow unordered=true format=86 flags=1`. - **Still reported, not fatal:** The format-115 render target (id=817 / id=599, B4G4R4A4_UNORM) and `NumDescriptors 2097152` (id=645).
Author
Owner

@⁠roon9e on GitHub · 2026-11-26 05:51 UTC · original

Thanks @⁠krcenov — good to have an Ada confirmation at 41bdc39: no device removal, format 86 created without the unordered flag, and the view refused instead of the device going away. That matches what I see on the GTX 1660 SUPER.

One note for anyone reading this PR: the format-115 / id=817 line you saw is unrelated to the id=817 in #1063 (that one is a streaming codec id, not a resource id) — I chased both and they are different things.

For the record, a separate finding from the same machine (not part of this PR, no code change here): the world-load stop at +0x1330a44 in #1063 loads on the software adapter (VICTORY_D3D12_WARP=1) and is broken on the 1660's D3D12 path — so it is a GPU-path issue, not the runtime's file/decode plumbing. Details in #1063. Nothing here changes this PR.

AI-assisted.

**@⁠roon9e** on GitHub · 2026-11-26 05:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2459#issuecomment-7183869772) Thanks @⁠krcenov — good to have an Ada confirmation at `41bdc39`: no device removal, format 86 created without the unordered flag, and the view refused instead of the device going away. That matches what I see on the GTX 1660 SUPER. One note for anyone reading this PR: the format-115 / `id=817` line you saw is unrelated to the `id=817` in #1063 (that one is a streaming codec id, not a resource id) — I chased both and they are different things. For the record, a separate finding from the same machine (not part of this PR, no code change here): the world-load stop at `+0x1330a44` in #1063 **loads on the software adapter** (`VICTORY_D3D12_WARP=1`) and is broken on the 1660's D3D12 path — so it is a GPU-path issue, not the runtime's file/decode plumbing. Details in #1063. Nothing here changes this PR. AI-assisted.
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/2459/head:github-bot/gh-2459'
git switch 'github-bot/gh-2459'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2459'
git switch 'github-bot/gh-2459'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2459'
git switch 'github-bot/gh-2459'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2459'
git switch 'main'
git merge --squash 'github-bot/gh-2459'
git switch 'main'
git merge --ff-only 'github-bot/gh-2459'
git switch 'main'
git merge 'github-bot/gh-2459'
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!2459
No description provided.