GPU: drop the unordered-access permission a format cannot carry, before any call names it #1830

Open
fiestorra wants to merge 1 commit from upstream-pr/1832 into main
fiestorra commented 2026-11-24 23:08:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-24T23:08:43Z.


The device removal comes from a description we hand the host, and the rule only drops a permission the host cannot honour

The debug layer names the condition itself — this is the message that ends the device:

D3D12: 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_2. D3D12_RESOURCE_DESC::Format is
B5G5R5A1_UNORM. id=599 severity=1
→ host GPU device removed (0x887A0001)

Two things make it fatal where a creation ladder would not help:

  • it is raised in GetResourceAllocationInfo, a query we make before creating anything, so any retry of CreateCommittedResource — including the ladder in #1630 — happens after the device has already been removed;
  • severity=1 means it does not come back as a return code.

The change

host_desc — the one place a title description becomes a host description — asks the host whether the format or any format it can be cast to takes a typed unordered access view, and drops the flag only when the answer is no for all of them:

    if d.flags & UNORDERED != 0 && uav_of_element(d.format) == Some(false) {
        d.flags &= !UNORDERED;
        ... "dropping unordered access: neither this format nor one it can cast to takes a typed UAV"
    }

uav_of_element(format) is typed_uav over castable(format) plus the format itself; typed_uav asks CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT2) for UAV_TYPED_LOAD | UAV_TYPED_STORE. The answer is tri-state on purpose: when the host cannot be asked, the description is left exactly as the title wrote it. A typeless format is judged by the formats it casts to, which is what the debug layer does.

This mirrors the message's own wording — "a format that either can be used as unordered access, or cast to a format that could be" — which is also why GetResourceAllocationInfo needs no list from us: the cast set is a property of the format.

What the rule answers

format typed_uav uav_of_element host_desc of a 64×64 2D texture with ALLOW_UNORDERED_ACCESS
86 B5G5R5A1_UNORM Some(false) Some(true) format 86, flag kept
115 B4G4R4A4_UNORM Some(false) Some(true) format 115, flag kept
28 R8G8B8A8_UNORM Some(true) Some(true) format 28, flag kept
29 R8G8B8A8_UNORM_SRGB Some(false) Some(true) format 27, flag kept

Measured on an RTX 4070 Ti (Ada, driver 621.01, Windows 11) at 1a2057a, reported in the thread by @kalberts0089-hash. castable(86) is [49, 50, 51, 52, 54, 56, 57, 58, 59, 68, 69, 85, 115], and 68/69 take typed UAV, which is why 86 is kept. Over formats 1–132 the rule fires only for 5–8, 70–84, 94–99, 106 and 111–114 — formats whose whole element is colour-block or depth.

An earlier head asked only about the format itself (typed_uav(86) == Some(false)) and therefore dropped the flag for 86 and 27. That was an over-drop: it silenced the message, but it took a permission the host can honour. The rule here is the narrower one.

Verification

The removal, on the machine that has it (integrated AMD, main at 70564ae + this change, release, real window 3840×2160): main alone → 1× id=599, device removed at frame 128; with the change, three runs → 0 messages, no removal, 128/256/kept-presenting frames. That run was at the earlier head, where the rule was the broader one.

On NVIDIA Ada at this head (@kalberts0089-hash, RTX 4070 Ti, 621.01): the test suites agree with main except the two new tests, both passing; with the debug layer, resource::tests:: 20 passed including both; the queries above produce 0 stored debug-layer messages and GetDeviceRemovedReason is ok.

  • New tests: a_typeless_format_is_judged_by_the_formats_it_casts_to and the_permission_follows_the_whole_element, which assert the rule (the permission follows the answer) rather than a hard-coded table.
  • cargo test -p victory-gpu --lib and -p victory-shader --lib: the failures are the known NVIDIA ones on main, identical on both sides.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and with --all-features → clean.

What I am not claiming

  • That the removal is gone on Ada at this head. The AMD measurement above was at the earlier, broader rule. What is measured on Ada is the rule's answers and that nothing is logged; the title run on the machine that removes the device has not been repeated with the flag kept for 86 and 27. That is the open question this PR should answer before it is trusted.
  • The two red victory-gpu tests on NVIDIA in the suite are main's, not this change's.
  • It does not fix everything the same log shows: no host texture for the B4G4R4A4_UNORM 1440p target (that is #1630's ladder) and the view heap capped at 1,000,000 with 310,720 slots past it (its own issue).

No game data is involved: a description, a format number, warnings and counts only.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5481868566 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-24T23:08:43Z. --- **The device removal comes from a description we hand the host, and the rule only drops a permission the host cannot honour** The debug layer names the condition itself — this is the message that ends the device: ``` D3D12: 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_2. D3D12_RESOURCE_DESC::Format is B5G5R5A1_UNORM. id=599 severity=1 → host GPU device removed (0x887A0001) ``` Two things make it fatal where a creation ladder would not help: - it is raised in **`GetResourceAllocationInfo`**, a *query* we make before creating anything, so any retry of `CreateCommittedResource` — including the ladder in #1630 — happens after the device has already been removed; - `severity=1` means it does not come back as a return code. ### The change `host_desc` — the one place a title description becomes a host description — asks the host whether the format **or any format it can be cast to** takes a typed unordered access view, and drops the flag only when the answer is no for all of them: ```rust if d.flags & UNORDERED != 0 && uav_of_element(d.format) == Some(false) { d.flags &= !UNORDERED; ... "dropping unordered access: neither this format nor one it can cast to takes a typed UAV" } ``` `uav_of_element(format)` is `typed_uav` over `castable(format)` plus the format itself; `typed_uav` asks `CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT2)` for `UAV_TYPED_LOAD | UAV_TYPED_STORE`. The answer is tri-state on purpose: when the host cannot be asked, the description is left exactly as the title wrote it. A typeless format is judged by the formats it casts to, which is what the debug layer does. This mirrors the message's own wording — "a format that either can be used as unordered access, **or cast to a format that could be**" — which is also why `GetResourceAllocationInfo` needs no list from us: the cast set is a property of the format. ### What the rule answers | format | `typed_uav` | `uav_of_element` | `host_desc` of a 64×64 2D texture with `ALLOW_UNORDERED_ACCESS` | |---|---|---|---| | 86 `B5G5R5A1_UNORM` | `Some(false)` | `Some(true)` | format 86, **flag kept** | | 115 `B4G4R4A4_UNORM` | `Some(false)` | `Some(true)` | format 115, flag kept | | 28 `R8G8B8A8_UNORM` | `Some(true)` | `Some(true)` | format 28, flag kept | | 29 `R8G8B8A8_UNORM_SRGB` | `Some(false)` | `Some(true)` | format 27, flag kept | Measured on an RTX 4070 Ti (Ada, driver 621.01, Windows 11) at `1a2057a`, reported in the thread by @kalberts0089-hash. `castable(86)` is `[49, 50, 51, 52, 54, 56, 57, 58, 59, 68, 69, 85, 115]`, and 68/69 take typed UAV, which is why 86 is kept. Over formats 1–132 the rule fires only for 5–8, 70–84, 94–99, 106 and 111–114 — formats whose whole element is colour-block or depth. An earlier head asked only about the format itself (`typed_uav(86) == Some(false)`) and therefore dropped the flag for 86 and 27. That was an over-drop: it silenced the message, but it took a permission the host can honour. The rule here is the narrower one. ### Verification **The removal, on the machine that has it** (integrated AMD, `main` at `70564ae` + this change, release, real window 3840×2160): `main` alone → 1× `id=599`, device removed at frame 128; with the change, three runs → 0 messages, no removal, 128/256/kept-presenting frames. That run was at the earlier head, where the rule was the broader one. **On NVIDIA Ada at this head** (@kalberts0089-hash, RTX 4070 Ti, 621.01): the test suites agree with `main` except the two new tests, both passing; with the debug layer, `resource::tests::` 20 passed including both; the queries above produce 0 stored debug-layer messages and `GetDeviceRemovedReason` is ok. - New tests: `a_typeless_format_is_judged_by_the_formats_it_casts_to` and `the_permission_follows_the_whole_element`, which assert the rule (the permission follows the answer) rather than a hard-coded table. - `cargo test -p victory-gpu --lib` and `-p victory-shader --lib`: the failures are the known NVIDIA ones on `main`, identical on both sides. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and with `--all-features` → clean. ### What I am not claiming - **That the removal is gone on Ada at this head.** The AMD measurement above was at the earlier, broader rule. What is measured on Ada is the rule's answers and that nothing is logged; the title run on the machine that removes the device has not been repeated with the flag kept for 86 and 27. That is the open question this PR should answer before it is trusted. - The two red `victory-gpu` tests on NVIDIA in the suite are `main`'s, not this change's. - It does **not** fix everything the same log shows: `no host texture` for the `B4G4R4A4_UNORM` 1440p target (that is #1630's ladder) and the view heap capped at 1,000,000 with 310,720 slots past it (its own issue). No game data is involved: a description, a format number, warnings and counts only. Written with an AI assistant.
catminou4 commented 2026-11-24 23:47:36 +00:00 (Migrated from github.com)

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

Review: COMMENTED


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

Drop the unordered-access permission a format cannot carry: fourth leg of the host-capability gating (#1775/#1787/#1801/#1843) — keep them consistent.

<!-- greyfinch-sync:Marvisak/VIctory:review:6049281457 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#pullrequestreview-6049281457). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:47:36Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Drop the unordered-access permission a format cannot carry: fourth leg of the host-capability gating (#1775/#1787/#1801/#1843) — keep them consistent.
upipibi commented 2026-11-25 00:06:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-24T23:11:28Z.


Overlap for the reviewers: #1787 (22:33) also drops UNORDERED from a texture's host description in resource.rs when the host can't store the format (host_unordered_format), for the same B5G5R5A1_UNORM device removal. #1763, #1775, #1780 and #1801 handle the view side in descriptor/host.rs. This PR and #1787 edit the same resource.rs path, so one of the two is enough. From reading the file lists and descriptions; nothing built.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147117879 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7147117879). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T23:11:28Z. --- Overlap for the reviewers: #1787 (22:33) also drops `UNORDERED` from a texture's host description in `resource.rs` when the host can't store the format (`host_unordered_format`), for the same `B5G5R5A1_UNORM` device removal. #1763, #1775, #1780 and #1801 handle the view side in `descriptor/host.rs`. This PR and #1787 edit the same `resource.rs` path, so one of the two is enough. From reading the file lists and descriptions; nothing built. AI-assisted (Claude Code).
fiestorra commented 2026-11-25 00:06:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-24T23:16:07Z.


Tested against the real failure, and against the other two candidates: it is one of three causes

With the debug layer installed on a machine that reproduces the removal, the same scenario (session 1, window 3840×2160, empty cache, default adapter AMD Radeon(TM) Graphics, driver 32.0.21045.29003):

build id=599 id=1419 device removed
main 70564ae 1 0 yes, frame 128
+ this pull request 0 0 no
+ this and #1630 (texture ladder) 0 2 yes
+ this and #1778 (sampler heap) 0 0 no
+ all three 0 0 no, keeps presenting

So on this machine this change alone is enough to stop the removal, while the texture ladder alone is not — it removes the no host texture line and then uncovers a second rule violation (id 1419, the sampler heap) that was previously invisible because the run died at 599 first.

That is worth saying in the pull request rather than in a later comment: a reviewer testing only this change on an NVIDIA card may see the removal go away and a different one appear later, and it is the id 1419 of #1778 in that case.

Full write-up with the chain: https://github.com/Marvisak/VIctory/issues/1754#issuecomment-7147203080

Still in the log with all three, and a different problem: host view heap capped at 1000000 and 310,720 title slot past the host heap (https://github.com/Marvisak/VIctory/issues/1760). No removal on this machine, still costing frames.

No game data is involved.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147206278 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7147206278). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-24T23:16:07Z. --- **Tested against the real failure, and against the other two candidates: it is one of three causes** With the debug layer installed on a machine that reproduces the removal, the same scenario (session 1, window 3840×2160, empty cache, default adapter `AMD Radeon(TM) Graphics`, driver `32.0.21045.29003`): | build | `id=599` | `id=1419` | device removed | |---|---|---|---| | `main` `70564ae` | 1 | 0 | **yes**, frame 128 | | + this pull request | 0 | 0 | no | | + this and #1630 (texture ladder) | 0 | **2** | **yes** | | + this and #1778 (sampler heap) | 0 | 0 | no | | + all three | 0 | 0 | **no**, keeps presenting | So on this machine this change alone is enough to stop the removal, while the texture ladder alone is not — it removes the `no host texture` line and then uncovers a second rule violation (id 1419, the sampler heap) that was previously invisible because the run died at 599 first. That is worth saying in the pull request rather than in a later comment: **a reviewer testing only this change on an NVIDIA card may see the removal go away and a different one appear later**, and it is the id 1419 of #1778 in that case. Full write-up with the chain: https://github.com/Marvisak/VIctory/issues/1754#issuecomment-7147203080 Still in the log with all three, and a different problem: `host view heap capped at 1000000` and 310,720 `title slot past the host heap` (https://github.com/Marvisak/VIctory/issues/1760). No removal on this machine, still costing frames. No game data is involved. Written with an AI assistant.
fiestorra commented 2026-11-25 00:06:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-24T23:41:13Z.


Correction to my own measurements: those runs were on the RTX 4090, not on the integrated GPU

I have been writing "default adapter, integrated AMD Radeon(TM) Graphics, driver 32.0.21045.29003" on the runs I made in session 1. That attribution is wrong, and the cause is worth knowing because it is the exact trap this repository keeps warning about.

DXGI enumerates the adapters in a different order in the two sessions. Measured on this machine, same binary, same moment, with cargo test --release -p victory-gpu -- --ignored adapters:

session 0 (the agent's, services):
  adapter 0: "AMD Radeon(TM) Graphics"      vendor=0x1002  485 MiB
  adapter 1: "NVIDIA GeForce RTX 4090"      vendor=0x10de  24,138 MiB
  adapter 2: "Microsoft Basic Render Driver"

session 1 (the interactive desktop, where the title actually runs):
  adapter 0: "NVIDIA GeForce RTX 4090"      vendor=0x10de  24,138 MiB
  adapter 1: "AMD Radeon(TM) Graphics"      vendor=0x1002  485 MiB
  adapter 2: "Microsoft Basic Render Driver"

So the default adapter is the integrated AMD in the agent's session and the RTX 4090 in the session where the title runs, which is precisely where every number I published in the last few rounds came from. With my selector in place the run says it plainly:

INFO victory_gpu::host: host GPU adapter="AMD Radeon(TM) Graphics" index=1 vendor=0x1002 …

— index=1 is the AMD in session 1, the reverse of session 0, which is what made me notice.

What this changes, and what it does not:

  • The measurements stand, and they get stronger: the device removals, the 1,000,000-descriptor cap and the 310,720 slots past it were measured on an NVIDIA RTX 4090 (driver 32.0.16.2124), not on the integrated GPU — which is the same vendor as the machines in #1754, #1755, #1758 and #1760. The chain in https://github.com/Marvisak/VIctory/issues/1754#issuecomment-7147203080 is NVIDIA evidence, not AMD evidence.
  • The one open question I could not explain is now explained. I reported that in the run formats 27 and 86 answered "no typed UAV" while a direct query from the test process answered "yes" for 86. Those two ran on different adapters: the test in session 0 (integrated AMD, which does support a typed UAV view of B5G5R5A1_UNORM), the title in session 1 (RTX 4090, which does not). There was never a discrepancy — different device, different answer.
  • The corrections to apply elsewhere: the driver line in every comment where I wrote 32.0.21045.29003 for a session-1 run should read 32.0.16.2124 (NVIDIA GeForce RTX 4090). I will put this note on the threads where the numbers were used rather than editing old comments, so the record keeps both.
  • For anyone reproducing: an index in VICTORY_D3D12_ADAPTER is session-dependent, and a name substring is not. Use VICTORY_D3D12_ADAPTER=nvidia or =amd, and check the host GPU adapter= line rather than assuming which card the default is.

No game data is involved: adapter descriptions, vendor ids and memory sizes only.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147682035 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7147682035). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-24T23:41:13Z. --- **Correction to my own measurements: those runs were on the RTX 4090, not on the integrated GPU** I have been writing "default adapter, integrated `AMD Radeon(TM) Graphics`, driver `32.0.21045.29003`" on the runs I made in session 1. That attribution is wrong, and the cause is worth knowing because it is the exact trap this repository keeps warning about. **DXGI enumerates the adapters in a different order in the two sessions.** Measured on this machine, same binary, same moment, with `cargo test --release -p victory-gpu -- --ignored adapters`: ``` session 0 (the agent's, services): adapter 0: "AMD Radeon(TM) Graphics" vendor=0x1002 485 MiB adapter 1: "NVIDIA GeForce RTX 4090" vendor=0x10de 24,138 MiB adapter 2: "Microsoft Basic Render Driver" session 1 (the interactive desktop, where the title actually runs): adapter 0: "NVIDIA GeForce RTX 4090" vendor=0x10de 24,138 MiB adapter 1: "AMD Radeon(TM) Graphics" vendor=0x1002 485 MiB adapter 2: "Microsoft Basic Render Driver" ``` So the default adapter is the integrated AMD **in the agent's session** and the **RTX 4090 in the session where the title runs**, which is precisely where every number I published in the last few rounds came from. With my selector in place the run says it plainly: ``` INFO victory_gpu::host: host GPU adapter="AMD Radeon(TM) Graphics" index=1 vendor=0x1002 … ``` — `index=1` is the AMD *in session 1*, the reverse of session 0, which is what made me notice. What this changes, and what it does not: - **The measurements stand**, and they get *stronger*: the device removals, the 1,000,000-descriptor cap and the 310,720 slots past it were measured on an **NVIDIA RTX 4090** (driver `32.0.16.2124`), not on the integrated GPU — which is the same vendor as the machines in #1754, #1755, #1758 and #1760. The chain in https://github.com/Marvisak/VIctory/issues/1754#issuecomment-7147203080 is NVIDIA evidence, not AMD evidence. - **The one open question I could not explain is now explained.** I reported that in the run formats 27 and 86 answered "no typed UAV" while a direct query from the test process answered "yes" for 86. Those two ran on **different adapters**: the test in session 0 (integrated AMD, which does support a typed UAV view of `B5G5R5A1_UNORM`), the title in session 1 (RTX 4090, which does not). There was never a discrepancy — different device, different answer. - **The corrections to apply elsewhere**: the driver line in every comment where I wrote `32.0.21045.29003` for a session-1 run should read `32.0.16.2124` (`NVIDIA GeForce RTX 4090`). I will put this note on the threads where the numbers were used rather than editing old comments, so the record keeps both. - **For anyone reproducing**: an index in `VICTORY_D3D12_ADAPTER` is session-dependent, and a *name substring* is not. Use `VICTORY_D3D12_ADAPTER=nvidia` or `=amd`, and check the `host GPU adapter=` line rather than assuming which card the default is. No game data is involved: adapter descriptions, vendor ids and memory sizes only. Written with an AI assistant.
fiestorra commented 2026-11-25 00:06:52 +00:00 (Migrated from github.com)

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


On the card that refuses it: main dies at frame 64 with id 599, this branch reaches frame 256 with none

Re-ran the comparison on the RTX 4090 (driver 32.0.16.2124) with the D3D12 debug layer on, since that is the adapter where the rule fires — the integrated AMD here accepts the same description, which is why an AMD-only test cannot judge this. Session 1, real window 3840×2160, empty cache, diag build with VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1:

main 70564ae this branch
id=599 (ALLOW_UNORDERED_ACCESS on a B5G5R5A1_UNORM texture, in GetResourceAllocationInfo) yes, severity 1 0
id=1419 0 0
device removed yes no
last frame before the run ended 64 (draws= line) 256, draws=1636, still presenting
dropping unordered access — 2 (formats 27 and 86)

So on the NVIDIA card the change does exactly what it claims: the description is made without a permission the format cannot carry, before any device call names it, and the device survives.

The log line from main for the record, with the driver's own wording:

D3D12: 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_2. … B5G5R5A1_UNORM. id=599 severity=1
→ host GPU device removed …: ID3D12Device::GetResourceAllocationInfo: …

Why this cannot be fixed where the rest of the texture work happens: the message is raised by a query (GetResourceAllocationInfo), three calls before anything is created, so a retry ladder around CreateCommittedResource — including the one in #1630 — never gets to run. And severity=1 means it is not returned as an HRESULT.

Also worth saying plainly, because it decides how the fix should be judged: on this machine's integrated AMD the same main build shows no id 599, no cap and no removal, and ran 1,024 frames / 6,656 draws in the same 40 s (https://github.com/Marvisak/VIctory/issues/1754#issuecomment-7147748178). The failure is the NVIDIA driver's answer, so a reviewer with only an AMD card will see nothing here — the card to test this on is the one that refuses.

Still in the log after this change, and deliberately not touched: the capped view heap (host view heap capped at 1000000, 310,720 slots past it — #1760/#1779) and one no host texture (#1630). They no longer remove the device; they still cost the frame.

Verification of the branch: cargo test -p victory-gpu --locked 78 passed / 2 ignored, the ignored GPU test typed_uav_follows_the_format_not_the_request passing, clippy --workspace --all-targets --all-features -D warnings clean, rustfmt --check on resource.rs at the same 15 hunks as main.

No game data is involved: a format number, debug-layer ids, warnings and counts only.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147805904 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7147805904). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-24T23:47:54Z. --- **On the card that refuses it: `main` dies at frame 64 with id 599, this branch reaches frame 256 with none** Re-ran the comparison on the **RTX 4090** (driver `32.0.16.2124`) with the D3D12 debug layer on, since that is the adapter where the rule fires — the integrated AMD here accepts the same description, which is why an AMD-only test cannot judge this. Session 1, real window 3840×2160, empty cache, `diag` build with `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`: | | `main` `70564ae` | this branch | |---|---|---| | `id=599` (`ALLOW_UNORDERED_ACCESS` on a `B5G5R5A1_UNORM` texture, in `GetResourceAllocationInfo`) | **yes**, severity 1 | **0** | | `id=1419` | 0 | 0 | | device removed | **yes** | **no** | | last frame before the run ended | **64** (`draws=` line) | **256**, `draws=1636`, still presenting | | `dropping unordered access` | — | 2 (formats 27 and 86) | So on the NVIDIA card the change does exactly what it claims: the description is made without a permission the format cannot carry, before any device call names it, and the device survives. The log line from `main` for the record, with the driver's own wording: ``` D3D12: 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_2. … B5G5R5A1_UNORM. id=599 severity=1 → host GPU device removed …: ID3D12Device::GetResourceAllocationInfo: … ``` Why this cannot be fixed where the rest of the texture work happens: the message is raised by a **query** (`GetResourceAllocationInfo`), three calls before anything is created, so a retry ladder around `CreateCommittedResource` — including the one in #1630 — never gets to run. And `severity=1` means it is not returned as an `HRESULT`. Also worth saying plainly, because it decides how the fix should be judged: **on this machine's integrated AMD the same `main` build shows no id 599, no cap and no removal, and ran 1,024 frames / 6,656 draws in the same 40 s** (https://github.com/Marvisak/VIctory/issues/1754#issuecomment-7147748178). The failure is the NVIDIA driver's answer, so a reviewer with only an AMD card will see nothing here — the card to test this on is the one that refuses. Still in the log after this change, and deliberately not touched: the capped view heap (`host view heap capped at 1000000`, 310,720 slots past it — #1760/#1779) and one `no host texture` (#1630). They no longer remove the device; they still cost the frame. Verification of the branch: `cargo test -p victory-gpu --locked` 78 passed / 2 ignored, the ignored GPU test `typed_uav_follows_the_format_not_the_request` passing, `clippy --workspace --all-targets --all-features -D warnings` clean, `rustfmt --check` on `resource.rs` at the same 15 hunks as `main`. No game data is involved: a format number, debug-layer ids, warnings and counts only. Written with an AI assistant.
fiestorra commented 2026-11-25 00:06:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-24T23:50:43Z.


The 120-second run: frame 2,048, draws=13312, dispatches=1024, still no removal

Short follow-up to the table above, because 40 seconds does not prove the device stays: same card (RTX 4090, driver 32.0.16.2124), same diag build with the debug layer and DRED on, session 1, empty cache, but for 120 s:

id=599             0
id=1419            0
device removed     0
frame=2048 draws=13312 drawn=13312 dispatches=1024 dispatched=1024

versus main on the same card, which ends at frame 64 with id 599 and a removed device. So the skip is not a postponement: nothing else trips the layer in two minutes, and the draw and dispatch counters keep climbing.

That also fixes what the frame does to the card's load: 2,048 frames and 13,312 draws in two minutes means it is not sitting in a corner avoiding the texture that used to kill it.

Nothing else changed in the branch; the verification in the comment above still holds.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147858469 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7147858469). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-24T23:50:43Z. --- **The 120-second run: frame 2,048, `draws=13312`, `dispatches=1024`, still no removal** Short follow-up to the table above, because 40 seconds does not prove the device *stays*: same card (RTX 4090, driver `32.0.16.2124`), same `diag` build with the debug layer and DRED on, session 1, empty cache, but for **120 s**: ``` id=599 0 id=1419 0 device removed 0 frame=2048 draws=13312 drawn=13312 dispatches=1024 dispatched=1024 ``` versus `main` on the same card, which ends at frame 64 with id 599 and a removed device. So the skip is not a postponement: nothing else trips the layer in two minutes, and the draw and dispatch counters keep climbing. That also fixes what the frame does to the card's load: 2,048 frames and 13,312 draws in two minutes means it is not sitting in a corner avoiding the texture that used to kill it. Nothing else changed in the branch; the verification in the comment above still holds. Written with an AI assistant.
fiestorra commented 2026-11-25 02:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T01:54:51Z.


Measured both bit choices on the cards where this matters: they agree, so the queue has two pull requests for one fix

I ran the two format-support tests side by side on the RTX 4090 (driver 32.0.16.2124, session 1 — the adapter that refuses this format) and on the integrated AMD of the same machine (32.0.21045.29003, session 0):

format Support1 TYPED_UAV (0x100000) Support2 typed load/store (0xc0) this PR's answer
86 B5G5R5A1_UNORM 0xe4d3f0 clear 0x200 clear no
28 R8G8B8A8_UNORM 0x33fcd3f3 set 0x102c0 set yes
41 R32_FLOAT 0x6f4d7fb set 0x2c8 set yes
27 B8G8R8A8_UNORM_SRGB 0x1010f0 set 0x200 clear n/a — mapped to its UNORM family first

So for the format this is about, Support1 & TYPED_UNORDERED_ACCESS_VIEW (#1926) and Support2 & (UAV_TYPED_LOAD | UAV_TYPED_STORE) (#1832, mine) give the same answer, and the one format where they differ — the sRGB one — never reaches the check: host_desc maps sRGB with the unordered-access permission to its UNORM family before it, which is why the pair disagrees there harmlessly.

Two consequences, and the second is the one worth acting on:

  1. Nobody should "fix" one bit into the other later without re-measuring. Support1 is the flag the D3D12 documentation points at; Support2's typed load/store is what a shader actually does. On these two drivers they agree on the formats the title uses, and the sRGB case shows they will not always.
  2. There are two pull requests for one fix: #1832 (mine: one file, +116, host_desc drops the permission, tri-state when the host cannot be asked, measured on the 4090 — no GetResourceAllocationInfo refusal, no removal, 2,048 frames in 120 s) and #1926 (+214/−34 across nine files, which also carries CPU, pipeline and manifest changes). A maintainer should only have to review one of them.

I am not precious about which. Mine is smaller and was measured on the card that fails; yours is the one that reads the documented flag and additionally refuses the unsupported view at creation, which is a real improvement over dropping the permission alone. If you want yours in, say so and I close mine — I would only ask that the tri-state behaviour be kept: when the host cannot be asked, the description should stay as the title wrote it, because dropping a permission that was legal loses a texture's writes silently.

If it is easier the other way round, mine is MERGEABLE/CLEAN with a green check today and yours is too, so it is a choice and not a queue problem.

No game data is involved: formats, support masks and counts.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150105273 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7150105273). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-25T01:54:51Z. --- **Measured both bit choices on the cards where this matters: they agree, so the queue has two pull requests for one fix** I ran the two format-support tests side by side on the RTX 4090 (driver `32.0.16.2124`, session 1 — the adapter that refuses this format) and on the integrated AMD of the same machine (`32.0.21045.29003`, session 0): | format | `Support1` | `TYPED_UAV` (`0x100000`) | `Support2` | typed load/store (`0xc0`) | this PR's answer | |---|---|---|---|---|---| | 86 `B5G5R5A1_UNORM` | `0xe4d3f0` | **clear** | `0x200` | clear | no | | 28 `R8G8B8A8_UNORM` | `0x33fcd3f3` | set | `0x102c0` | set | yes | | 41 `R32_FLOAT` | `0x6f4d7fb` | set | `0x2c8` | set | yes | | 27 `B8G8R8A8_UNORM_SRGB` | `0x1010f0` | **set** | `0x200` | **clear** | n/a — mapped to its UNORM family first | So for the format this is about, **`Support1 & TYPED_UNORDERED_ACCESS_VIEW`** (#1926) and **`Support2 & (UAV_TYPED_LOAD | UAV_TYPED_STORE)`** (#1832, mine) give the same answer, and the one format where they differ — the sRGB one — never reaches the check: `host_desc` maps sRGB with the unordered-access permission to its UNORM family before it, which is why the pair disagrees there harmlessly. Two consequences, and the second is the one worth acting on: 1. **Nobody should "fix" one bit into the other later without re-measuring.** `Support1` is the flag the D3D12 documentation points at; `Support2`'s typed load/store is what a shader actually does. On these two drivers they agree on the formats the title uses, and the sRGB case shows they will not always. 2. **There are two pull requests for one fix**: #1832 (mine: one file, +116, `host_desc` drops the permission, tri-state when the host cannot be asked, measured on the 4090 — no `GetResourceAllocationInfo` refusal, no removal, 2,048 frames in 120 s) and #1926 (+214/−34 across nine files, which also carries CPU, pipeline and manifest changes). A maintainer should only have to review one of them. **I am not precious about which.** Mine is smaller and was measured on the card that fails; yours is the one that reads the documented flag and additionally refuses the unsupported *view* at creation, which is a real improvement over dropping the permission alone. If you want yours in, say so and I close mine — I would only ask that the tri-state behaviour be kept: when the host cannot be asked, the description should stay as the title wrote it, because dropping a permission that was legal loses a texture's writes silently. If it is easier the other way round, mine is `MERGEABLE`/`CLEAN` with a green check today and yours is too, so it is a choice and not a queue problem. No game data is involved: formats, support masks and counts. Written with an AI assistant.
SamuelGDMG commented 2026-11-25 03:03:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SamuelGDMG on 2026-11-25T02:38:30Z.


Tested this fix locally and it's working — it resolves the 0x887A0001 (DXGI_ERROR_INVALID_CALL) device removal on B5G5R5A1_UNORM and gets past the crash cleanly.

Specs: Windows 11 (10.0.26200), Ryzen 5 5500, RTX 3050 8 GB, driver 610.88. Running diag build on 940d32f with VICTORY_D3D12_DEBUG=1, and VICTORY_D3D12_DRED=1 (Series 1.0.2.1, 0 missing imports).

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150987439 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7150987439). Originally posted by [SamuelGDMG](https://github.com/SamuelGDMG) on 2026-11-25T02:38:30Z. --- Tested this fix locally and it's working — it resolves the `0x887A0001` (`DXGI_ERROR_INVALID_CALL`) device removal on `B5G5R5A1_UNORM` and gets past the crash cleanly. **Specs:** Windows 11 (10.0.26200), Ryzen 5 5500, RTX 3050 8 GB, driver 610.88. Running `diag` build on [940d32f](https://github.com/Marvisak/VIctory/commit/940d32f69b22265690a0b5a15d6ded572ba33baf) with `VICTORY_D3D12_DEBUG=1`, and `VICTORY_D3D12_DRED=1` (Series 1.0.2.1, 0 missing imports). Written with an AI assistant.
fiestorra commented 2026-11-25 05:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T04:14:19Z.


Merge check: the three GPU fixes together keep the suites where main has them

Nobody can run this from CI, so I did it here: main 940d32f with #1630, #1832 and #1778 merged into one tree (they touch resource.rs, the descriptor heap and the shader cache, and they do not conflict), then the tests and a boot.

main alone the three merged
cargo test --workspace --locked 26 suites ok, 1 failure 26 ok, 1 failure — the same one
cargo test -p victory-shader --locked --lib 247 passed, 3 ignored 247 passed, 3 ignored
cargo test -p victory-gpu --features diagnostics --lib 146 passed, 2 ignored 148 passed, 6 ignored
boot, 120 s, RTX 4090 32.0.16.2124, session 1 device removed ×2, dies at frame 64 0 removals, 2,048 frames, 13,312 draws

The one failure in both columns is victory-hle::modules::lifecycle::tests::showing_a_title_window_shows_its_stand_in, which fails on main too in a session without a desktop — it is the agent's environment, not the change.

The GPU suite gained two tests and four skips because those are the tests the three pull requests add (the ladder's attempts, the typed-UAV rule, the sampler fallback), and some of them skip without a host. That is why the counts differ and why they are written out instead of "all green".

So, for a reviewer deciding whether these can go in together: they do not regress the suites, and together they change what a boot does — which is the only reason to merge them as a set rather than one at a time.

What this check does not cover: it says nothing about the title beyond those 120 seconds, and the run still stops at the terms-of-service screen, which is not a GPU matter. It also does not cover other people's fixes: the cap (#1779) is untouched here and still logs host view heap capped at 1000000 once per run.

No game data is involved: test counts and frame numbers.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152658769 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7152658769). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-25T04:14:19Z. --- **Merge check: the three GPU fixes together keep the suites where `main` has them** Nobody can run this from CI, so I did it here: `main` `940d32f` with **#1630**, **#1832** and **#1778** merged into one tree (they touch `resource.rs`, the descriptor heap and the shader cache, and they do not conflict), then the tests and a boot. | | `main` alone | the three merged | |---|---|---| | `cargo test --workspace --locked` | 26 suites ok, 1 failure | **26 ok, 1 failure** — the same one | | `cargo test -p victory-shader --locked --lib` | 247 passed, 3 ignored | **247 passed, 3 ignored** | | `cargo test -p victory-gpu --features diagnostics --lib` | 146 passed, 2 ignored | **148 passed, 6 ignored** | | boot, 120 s, RTX 4090 `32.0.16.2124`, session 1 | device removed ×2, dies at frame 64 | **0 removals, 2,048 frames, 13,312 draws** | The one failure in both columns is `victory-hle::modules::lifecycle::tests::showing_a_title_window_shows_its_stand_in`, which fails on `main` too in a session without a desktop — it is the agent's environment, not the change. The GPU suite gained two tests and four skips because those are the tests the three pull requests add (the ladder's attempts, the typed-UAV rule, the sampler fallback), and some of them skip without a host. That is why the counts differ and why they are written out instead of "all green". So, for a reviewer deciding whether these can go in together: **they do not regress the suites, and together they change what a boot does** — which is the only reason to merge them as a set rather than one at a time. What this check does not cover: it says nothing about the title beyond those 120 seconds, and the run still stops at the terms-of-service screen, which is not a GPU matter. It also does not cover other people's fixes: the cap (#1779) is untouched here and still logs `host view heap capped at 1000000` once per run. No game data is involved: test counts and frame numbers. Written with an AI assistant.
Marvisak commented 2026-11-25 07:03:09 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Needs work. host_desc in crates/victory-gpu/src/resource.rs drops ALLOW_UNORDERED_ACCESS when typed_uav(d.format) (Support2 typed load/store) is false for the texture's own format. Issues:

  • It loses legal writes. The D3D12 rule you quote allows the flag when the texture can "cast to a format that could be used as unordered access". Host textures are made with castable(format), and for B5G5R5A1_UNORM (86) that list includes R16_UINT/R16_FLOAT, which take typed UAVs. With the flag dropped, fits in descriptor/host.rs refuses all unordered views of the texture, including those 16-bit aliases. The check needs to consider the castable formats the texture is actually created with.
  • Typeless formats. typed_uav also asks about typeless formats (for example 27 in the test). If a driver reports no typed-UAV support for a typeless format, its textures lose UAV access, even though every UAV view of them is typed. #1787 exempts typeless formats explicitly.
  • The removing call is already covered. In #1753's log, the removal follows CreateUnorderedAccessView (id 342), which #1763 (merge candidate) refuses. A log showing removal at resource creation with #1763 applied would show this is still needed.

#1787 overlaps this change. One of the two should carry it forward.

CI: check passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154659437 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7154659437). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:18:41Z. --- <!-- victory-triage v1 head=f1e53b87584f15a2ef1bf7aedbcc74d2e83fe86d verdict=needs-work at=2026-11-25T06:39:30Z --> Automated triage for the maintainers. **Needs work.** `host_desc` in `crates/victory-gpu/src/resource.rs` drops `ALLOW_UNORDERED_ACCESS` when `typed_uav(d.format)` (`Support2` typed load/store) is false for the texture's own format. Issues: - **It loses legal writes.** The D3D12 rule you quote allows the flag when the texture can "cast to a format that could be used as unordered access". Host textures are made with `castable(format)`, and for `B5G5R5A1_UNORM` (86) that list includes `R16_UINT`/`R16_FLOAT`, which take typed UAVs. With the flag dropped, `fits` in `descriptor/host.rs` refuses all unordered views of the texture, including those 16-bit aliases. The check needs to consider the castable formats the texture is actually created with. - **Typeless formats.** `typed_uav` also asks about typeless formats (for example 27 in the test). If a driver reports no typed-UAV support for a typeless format, its textures lose UAV access, even though every UAV view of them is typed. #1787 exempts typeless formats explicitly. - **The removing call is already covered.** In #1753's log, the removal follows `CreateUnorderedAccessView` (id 342), which #1763 (merge candidate) refuses. A log showing removal at resource creation with #1763 applied would show this is still needed. #1787 overlaps this change. One of the two should carry it forward. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
KainanP commented 2026-11-25 20:06:18 +00:00 (Migrated from github.com)

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


RTX 4060 Laptop (610.47), merged onto main 13f91cae with a reproduction test: B5G5R5A1 UAV half fixed (flag dropped, UAVs null so stores are lost), B4G4R4A4 target half still removes the device; no new failures in cargo test -p victory-gpu; also fixes the UAV half on Intel UHD, where main gets no host texture. 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:7172518331 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7172518331). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T19:35:58Z. --- RTX 4060 Laptop (610.47), merged onto main 13f91cae with a reproduction test: B5G5R5A1 UAV half **fixed** (flag dropped, UAVs null so stores are lost), B4G4R4A4 target half still removes the device; no new failures in `cargo test -p victory-gpu`; also fixes the UAV half on Intel UHD, where main gets no host texture. 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).
fiestorra commented 2026-11-26 13:04:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-26T12:18:02Z.


The rule now covers the formats a texture can cast to, and the typeless case with it

All three points are in, in host_desc (crates/victory-gpu/src/resource.rs), head 1a2057a3:

  • Legal writes are kept. The permission is dropped only when neither the texture's format nor any format it is made castable to takes a typed UAV. uav_of_element asks typed_uav across castable(format) and the format itself, and returns Some(true) on the first that answers yes, so a texture that legal casts to a UAV format keeps its flag — exactly the case the old rule lost.
  • Typeless formats. They are judged by the typed formats of their element (castable returns them), and the answer is the same for the typeless spelling and its family; a_typeless_format_is_judged_by_the_formats_it_casts_to pins that with 27, 24 and 16.
  • #1763 / the removing call. Fair: my evidence for removal at resource creation is the debug layer's rule text (id 599) in #1754's log, not an independent capture of a removal that follows CreateTexture rather than CreateUnorderedAccessView. If #1763 lands first, this change is a guard that never fires and I would rather close it than keep a second way to drop the flag; say so and I will.

the_permission_follows_the_whole_element checks that 115 and 86 — both two bytes a texel, and castable to each other — get the same answer, which is the property the old unconditional test asserted for one spelling only.

CI: passing locally (cargo test -p victory-gpu --lib -- resource::tests, 20 passed; clippy -D warnings). The pushed branch was rebased onto 842b0cb7 first, so it no longer carries the stale pc_format reverts the earlier head had.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7191824398 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7191824398). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-26T12:18:02Z. --- **The rule now covers the formats a texture can cast to, and the typeless case with it** All three points are in, in `host_desc` (`crates/victory-gpu/src/resource.rs`), head `1a2057a3`: - **Legal writes are kept.** The permission is dropped only when neither the texture's format nor any format it is made castable to takes a typed UAV. `uav_of_element` asks `typed_uav` across `castable(format)` and the format itself, and returns `Some(true)` on the first that answers yes, so a texture that legal casts to a UAV format keeps its flag — exactly the case the old rule lost. - **Typeless formats.** They are judged by the typed formats of their element (`castable` returns them), and the answer is the same for the typeless spelling and its family; `a_typeless_format_is_judged_by_the_formats_it_casts_to` pins that with 27, 24 and 16. - **#1763 / the removing call.** Fair: my evidence for removal at *resource creation* is the debug layer's rule text (id 599) in #1754's log, not an independent capture of a removal that follows `CreateTexture` rather than `CreateUnorderedAccessView`. If #1763 lands first, this change is a guard that never fires and I would rather close it than keep a second way to drop the flag; say so and I will. `the_permission_follows_the_whole_element` checks that 115 and 86 — both two bytes a texel, and castable to each other — get the same answer, which is the property the old unconditional test asserted for one spelling only. CI: passing locally (`cargo test -p victory-gpu --lib -- resource::tests`, 20 passed; clippy `-D warnings`). The pushed branch was rebased onto `842b0cb7` first, so it no longer carries the stale `pc_format` reverts the earlier head had. Written with an AI assistant.
kalberts0089-hash commented 2026-11-27 10:57:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kalberts0089-hash on 2026-11-27T10:57:45Z.


RTX 4070 Ti (Ada), driver 621.01, Windows 11: tests at head 1a2057a

Head 1a2057a3e16e207620d079c22df974f69cf06aa9, which sits directly on current main (63bcca4), so it was tested as is with nothing merged or changed locally. No run at this head was in the thread yet.

Confirmed

Suite main 63bcca4 #1832 1a2057a
cargo test -p victory-gpu --lib -- --test-threads=1 229 passed, 2 failed, 1 ignored 231 passed, 2 failed, 1 ignored
cargo test -p victory-shader --lib --no-fail-fast (one test skipped, below) 298 passed, 3 failed, 3 ignored 298 passed, 3 failed, 3 ignored
  • The only difference from main is the two new tests, both passing: a_typeless_format_is_judged_by_the_formats_it_casts_to and the_permission_follows_the_whole_element. Each also passes 3/3 alone with --exact --nocapture.
  • The failures are the known NVIDIA ones on main, same assertions on both sides, unrelated to this change: victory-gpu dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views; victory-shader a_heap_buffer_read_by_element_takes_the_views_stride, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros and gathers_at_a_level_match_the_hardware. heap_direct_texture_reads_mark_their_heap_index was skipped on both sides (#2571).
  • With the debug layer (--features diagnostics, VICTORY_D3D12_DEBUG=1): resource::tests:: 20 passed, including both new tests.

What the rule answers on this card

The new tests do not print the host's answers or read the debug layer's queue, so I added a throwaway test locally (not part of the PR, not committed, removed afterwards) that prints them:

format typed_uav uav_of_element host_desc of a 64x64 2D texture with ALLOW_UNORDERED_ACCESS
86 B5G5R5A1_UNORM Some(false) Some(true) format 86, flag kept
115 B4G4R4A4_UNORM Some(false) Some(true) format 115, flag kept
28 R8G8B8A8_UNORM Some(true) Some(true) format 28, flag kept
29 R8G8B8A8_UNORM_SRGB Some(false) Some(true) format 27, flag kept
  • 86's own answer matches the RTX 4090 table above (no typed UAV). Its element answers yes because of the formats it casts to: castable(86) is [49, 50, 51, 52, 54, 56, 57, 58, 59, 68, 69, 85, 115], of which 68, 69, 85 and 115 answer no and at least one of the 16-bit formats 49-59 answers yes.
  • Over formats 1 to 132, uav_of_element is Some(false) only for 5-8, 70-84, 94-99, 106 and 111-114. Those are the only formats the rule can drop the flag for on this card.
  • With the debug layer active on the device, after those queries: 0 stored messages, log_messages() is None, GetDeviceRemovedReason is ok.

So at this head, on this card, a B5G5R5A1_UNORM description with unordered access leaves host_desc the same as on main: the rule does not fire for it.

Questions

  • Is that the intended result for format 86 on NVIDIA? The description above measures the fix as the flag being dropped for 86 (no id 599, no removal), and those runs were at an earlier head. Has the removal been re-measured at 1a2057a?
  • The id 599 message was raised in GetResourceAllocationInfo, which takes no list of castable formats. Does the debug layer accept "cast to a format that could be used as unordered access" there for a format with no typeless family, when the cast is only possible through the list given at creation? I did not test this.
  • The description still shows the earlier rule (typed_uav(d.format) == Some(false)) and names a test, typed_uav_follows_the_format_not_the_request, that is not in this head. Is it meant to be updated?

Not tested

  • The device removal itself and id 599: I did not try to reproduce them, on main or on this head, so this report says nothing about whether the removal is fixed on Ada.
  • The title, or any run beyond the test suites.
  • Creating a texture in these formats: the local test only queried format support and called host_desc.
  • clippy, cargo xtask policy, other crates.

Synthetic tests only, no game files. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7216515348 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7216515348). Originally posted by [kalberts0089-hash](https://github.com/kalberts0089-hash) on 2026-11-27T10:57:45Z. --- **RTX 4070 Ti (Ada), driver 621.01, Windows 11: tests at head `1a2057a`** Head `1a2057a3e16e207620d079c22df974f69cf06aa9`, which sits directly on current `main` (`63bcca4`), so it was tested as is with nothing merged or changed locally. No run at this head was in the thread yet. ### Confirmed | Suite | `main` `63bcca4` | #1832 `1a2057a` | |---|---|---| | `cargo test -p victory-gpu --lib -- --test-threads=1` | 229 passed, 2 failed, 1 ignored | 231 passed, 2 failed, 1 ignored | | `cargo test -p victory-shader --lib --no-fail-fast` (one test skipped, below) | 298 passed, 3 failed, 3 ignored | 298 passed, 3 failed, 3 ignored | - The only difference from `main` is the two new tests, both passing: `a_typeless_format_is_judged_by_the_formats_it_casts_to` and `the_permission_follows_the_whole_element`. Each also passes 3/3 alone with `--exact --nocapture`. - The failures are the known NVIDIA ones on `main`, same assertions on both sides, unrelated to this change: victory-gpu `dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views`; victory-shader `a_heap_buffer_read_by_element_takes_the_views_stride`, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` and `gathers_at_a_level_match_the_hardware`. `heap_direct_texture_reads_mark_their_heap_index` was skipped on both sides (#2571). - With the debug layer (`--features diagnostics`, `VICTORY_D3D12_DEBUG=1`): `resource::tests::` 20 passed, including both new tests. ### What the rule answers on this card The new tests do not print the host's answers or read the debug layer's queue, so I added a throwaway test locally (not part of the PR, not committed, removed afterwards) that prints them: | format | `typed_uav` | `uav_of_element` | `host_desc` of a 64x64 2D texture with `ALLOW_UNORDERED_ACCESS` | |---|---|---|---| | 86 `B5G5R5A1_UNORM` | `Some(false)` | `Some(true)` | format 86, **flag kept** | | 115 `B4G4R4A4_UNORM` | `Some(false)` | `Some(true)` | format 115, flag kept | | 28 `R8G8B8A8_UNORM` | `Some(true)` | `Some(true)` | format 28, flag kept | | 29 `R8G8B8A8_UNORM_SRGB` | `Some(false)` | `Some(true)` | format 27, flag kept | - 86's own answer matches the RTX 4090 table above (no typed UAV). Its element answers yes because of the formats it casts to: `castable(86)` is `[49, 50, 51, 52, 54, 56, 57, 58, 59, 68, 69, 85, 115]`, of which 68, 69, 85 and 115 answer no and at least one of the 16-bit formats 49-59 answers yes. - Over formats 1 to 132, `uav_of_element` is `Some(false)` only for 5-8, 70-84, 94-99, 106 and 111-114. Those are the only formats the rule can drop the flag for on this card. - With the debug layer active on the device, after those queries: 0 stored messages, `log_messages()` is `None`, `GetDeviceRemovedReason` is ok. So at this head, on this card, a `B5G5R5A1_UNORM` description with unordered access leaves `host_desc` the same as on `main`: the rule does not fire for it. ### Questions - Is that the intended result for format 86 on NVIDIA? The description above measures the fix as the flag being dropped for 86 (no id 599, no removal), and those runs were at an earlier head. Has the removal been re-measured at `1a2057a`? - The id 599 message was raised in `GetResourceAllocationInfo`, which takes no list of castable formats. Does the debug layer accept "cast to a format that could be used as unordered access" there for a format with no typeless family, when the cast is only possible through the list given at creation? I did not test this. - The description still shows the earlier rule (`typed_uav(d.format) == Some(false)`) and names a test, `typed_uav_follows_the_format_not_the_request`, that is not in this head. Is it meant to be updated? ### Not tested - The device removal itself and id 599: I did not try to reproduce them, on `main` or on this head, so this report says nothing about whether the removal is fixed on Ada. - The title, or any run beyond the test suites. - Creating a texture in these formats: the local test only queried format support and called `host_desc`. - clippy, `cargo xtask policy`, other crates. Synthetic tests only, no game files. AI-assisted (Claude Code).
fiestorra commented 2026-11-28 22:30:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-28T22:30:47Z.


Thanks — this is the first NVIDIA run at this head, and it answers something the thread only had from the AMD machine.

Your first question: yes, keeping the flag for 86 at this head is intended. The debug layer's own sentence is the rule: a texture with ALLOW_UNORDERED_ACCESS 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". castable(86) includes 68 and 69, which do take a typed UAV on your card, so a B5G5R5A1_UNORM description with the flag satisfies the condition — and uav_of_element(86) == Some(true) is that sentence implemented.

The earlier run that dropped the flag for 86 was the broader, wrong rule: it asked typed_uav(d.format) and nothing else, so it took a permission the host can honour. It silenced the removal, which is why it looked like a fix; the narrower rule is the one in the head you tested.

Your second question: we supply no cast list, and we are not meant to. GetResourceAllocationInfo takes a description, and the cast set is a property of the format, which is why the message can name it without any input from us. That is also the reason the rule now asks over castable(format) instead of over the format alone: it is the same set the driver is going to check.

Your third question: the body was stale, and it is fixed — it now describes the rule in this head, names the two tests that exist, and credits your table. Thank you for flagging it; leaving a description that names a test the branch does not have is exactly how a reviewer is misled.

The one thing your report makes clear that the thread still owes: nobody has run the title on Ada at this head. The AMD measurement I posted was at the broader rule, and your run is the rule's answers plus "nothing logged, device fine" — which is necessary but not the same as the removal not happening. If you can run the title on the 4070 Ti with this head and VICTORY_D3D12_DEBUG=1, the pair (id=599 count, device removed or not) is the number that decides whether the narrow rule is enough there. If it turns out the removal recurs with 86's flag kept, the answer is not to go back to the broader rule — it would be to keep the flag only for formats whose element has a typed-UAV cast the driver actually accepts, and that is a different question from the one this PR asks.

The detail in your table I would keep an eye on: format 29 (R8G8B8A8_UNORM_SRGB) answers Some(false) for itself and Some(true) for its element, and host_desc turns it into format 27 with the flag kept. That is the sRGB-to-typless rule interacting with this one, and it is the case most likely to behave differently on another driver family.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7246787002 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1832#issuecomment-7246787002). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-28T22:30:47Z. --- Thanks — this is the first NVIDIA run at this head, and it answers something the thread only had from the AMD machine. **Your first question: yes, keeping the flag for 86 at this head is intended.** The debug layer's own sentence is the rule: a texture with `ALLOW_UNORDERED_ACCESS` 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**". `castable(86)` includes 68 and 69, which do take a typed UAV on your card, so a `B5G5R5A1_UNORM` description with the flag satisfies the condition — and `uav_of_element(86) == Some(true)` is that sentence implemented. The earlier run that dropped the flag for 86 was the **broader, wrong** rule: it asked `typed_uav(d.format)` and nothing else, so it took a permission the host can honour. It silenced the removal, which is why it looked like a fix; the narrower rule is the one in the head you tested. **Your second question: we supply no cast list, and we are not meant to.** `GetResourceAllocationInfo` takes a description, and the cast set is a property of the format, which is why the message can name it without any input from us. That is also the reason the rule now asks over `castable(format)` instead of over the format alone: it is the same set the driver is going to check. **Your third question: the body was stale, and it is fixed** — it now describes the rule in this head, names the two tests that exist, and credits your table. Thank you for flagging it; leaving a description that names a test the branch does not have is exactly how a reviewer is misled. The one thing your report makes clear that the thread still owes: **nobody has run the title on Ada at this head.** The AMD measurement I posted was at the broader rule, and your run is the rule's answers plus "nothing logged, device fine" — which is necessary but not the same as the removal not happening. If you can run the title on the 4070 Ti with this head and `VICTORY_D3D12_DEBUG=1`, the pair (`id=599` count, device removed or not) is the number that decides whether the narrow rule is enough there. If it turns out the removal recurs with 86's flag kept, the answer is not to go back to the broader rule — it would be to keep the flag only for formats whose element has a typed-UAV cast the driver actually accepts, and that is a different question from the one this PR asks. The detail in your table I would keep an eye on: format 29 (`R8G8B8A8_UNORM_SRGB`) answers `Some(false)` for itself and `Some(true)` for its element, and `host_desc` turns it into format 27 with the flag kept. That is the sRGB-to-typless rule interacting with this one, and it is the case most likely to behave differently on another driver family. Written with an AI assistant.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1832:upstream-pr/1832'
git switch 'upstream-pr/1832'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1832'
git switch 'upstream-pr/1832'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1832'
git switch 'upstream-pr/1832'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1832'
git switch 'main'
git merge --squash 'upstream-pr/1832'
git switch 'main'
git merge --ff-only 'upstream-pr/1832'
git switch 'main'
git merge 'upstream-pr/1832'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1830
No description provided.