GPU tests: placed R32_UINT -> R9G9B9E5 view does not share its host texture (Windows 10, RX 7800 XT) #1999

Open
opened 2026-11-26 04:51:07 +00:00 by github-bot · 6 comments
Owner

@⁠Calvix2k on GitHub · 2026-11-25 02:37 UTC · original

A pre-existing GPU test fails on hardware here, on unmodified main. No game files, no title run: synthetic textures and two compute shaders.

VIctory main 940d32f (also 4118f33)
Command cargo test -p victory-gpu --features diagnostics --lib a_texture_written_in_one_format_reads_in_another
OS Windows 10 22H2 19045
GPU RX 7800 XT (RDNA3), driver 32.0.32029.2010
Result 1 failed: draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view
thread 'draw::tests::…' panicked at crates\victory-gpu\src\draw.rs:2185:13:
assertion `left == right` failed: round 0: one host texture
  left: false
 right: true

Round 0 is the case the test says must share one host texture: a resource object written as R32_UINT (42) and read through a placed view as R9G9B9E5 (67), both 4 bytes per texel. On this machine the placed view gets a second HostTexture (so a copy at the read) instead of the object's. Round 1 (17 → 71, BC1 against plain, expected not shared) is not reached because the assertion stops the test.

Why this may matter beyond the test: HostTexture::castable is what lets a title's own R9G9B9E5 view of an R32_UINT allocation read the bytes the compute pass wrote without a copy. If the castable list is empty here because the view was first seen after the texture was made, real titles with the sky's table format pay the copy every frame — that is the pattern this test was written for.

What I cannot tell from one machine: whether the pair is meant to be castable from the DXGI format family rules (in which case the host texture's castable list should contain 67 regardless of registration order), or whether it depends on fits seeing the view first. CI passes this test, so it is either adapter-dependent or an ordering difference.

Is sharing for 42 ↔ 67 supposed to be platform-independent? If yes, I can dig into fits/castable and send a fix with this case as the regression; if it is a known gap on Windows 10, please say so and I will close this.

The whole victory-gpu diagnostics suite on this host is otherwise 147 passed, 1 failed, 2 ignored, and the failure is this one.

**@⁠Calvix2k** on GitHub · 2026-11-25 02:37 UTC · [original](https://github.com/Marvisak/VIctory/issues/1999) **A pre-existing GPU test fails on hardware here, on unmodified `main`.** No game files, no title run: synthetic textures and two compute shaders. | | | |---|---| | VIctory | `main` `940d32f` (also `4118f33`) | | Command | `cargo test -p victory-gpu --features diagnostics --lib a_texture_written_in_one_format_reads_in_another` | | OS | Windows 10 22H2 19045 | | GPU | RX 7800 XT (RDNA3), driver 32.0.32029.2010 | | Result | **1 failed**: `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` | ``` thread 'draw::tests::…' panicked at crates\victory-gpu\src\draw.rs:2185:13: assertion `left == right` failed: round 0: one host texture left: false right: true ``` Round 0 is the case the test says must share one host texture: a resource object written as **`R32_UINT` (42)** and read through a placed view as **`R9G9B9E5` (67)**, both 4 bytes per texel. On this machine the placed view gets a second `HostTexture` (so a copy at the read) instead of the object's. Round 1 (17 → 71, BC1 against plain, expected *not* shared) is not reached because the assertion stops the test. Why this may matter beyond the test: `HostTexture::castable` is what lets a title's own `R9G9B9E5` view of an `R32_UINT` allocation read the bytes the compute pass wrote without a copy. If the castable list is empty here because the view was first seen after the texture was made, real titles with the sky's table format pay the copy every frame — that is the pattern this test was written for. What I cannot tell from one machine: whether the pair is meant to be castable from the DXGI format family rules (in which case the host texture's `castable` list should contain 67 regardless of registration order), or whether it depends on `fits` seeing the view first. CI passes this test, so it is either adapter-dependent or an ordering difference. Is sharing for 42 ↔ 67 supposed to be platform-independent? If yes, I can dig into `fits`/`castable` and send a fix with this case as the regression; if it is a known gap on Windows 10, please say so and I will close this. The whole `victory-gpu` diagnostics suite on this host is otherwise **147 passed, 1 failed, 2 ignored**, and the failure is this one.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:51:07 +00:00
Author
Owner

@⁠BastienRodz on GitHub · 2026-11-25 02:39 UTC · original

This looks like the Windows 10 in-box runtime, not registration order. Host textures are made castable through ID3D12Device10::CreateCommittedResource3's castable-format list (resource.rs, the host texture constructor). When the host refuses it, host_texture logs the host refuses castable formats: textures of one memory in other formats get their own host texture and makes the texture with an empty castable list, so the placed 67 view can't share. Castable formats need D3D12_FEATURE_D3D12_OPTIONS12::RelaxedFormatCastingSupported (enhanced barriers), which the in-box D3D12 of Windows 10 22H2 doesn't provide; the Agility SDK or Windows 11 does. If that warning is in your diagnostics log on that run, that's the cause. The test would then want to skip round 0 when the device reports no relaxed format casting, rather than fail.

**@⁠BastienRodz** on GitHub · 2026-11-25 02:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/1999#issuecomment-7151007350) This looks like the Windows 10 in-box runtime, not registration order. Host textures are made castable through `ID3D12Device10::CreateCommittedResource3`'s castable-format list (`resource.rs`, the host texture constructor). When the host refuses it, `host_texture` logs `the host refuses castable formats: textures of one memory in other formats get their own host texture` and makes the texture with an empty castable list, so the placed 67 view can't share. Castable formats need `D3D12_FEATURE_D3D12_OPTIONS12::RelaxedFormatCastingSupported` (enhanced barriers), which the in-box D3D12 of Windows 10 22H2 doesn't provide; the Agility SDK or Windows 11 does. If that warning is in your diagnostics log on that run, that's the cause. The test would then want to skip round 0 when the device reports no relaxed format casting, rather than fail.
Author
Owner

@⁠AlanQiang0418 on GitHub · 2026-11-25 02:42 UTC · original

Sharing is optional here. The value the placed view reads is the invariant. PR #1765 already checks both outcomes and still performs the pixel readback on a host that takes the copy path. I applied its commit d02e007 to main at 940d32f and checked the registration-order question independently.

R32_UINT writer → R9G9B9E5 reader Host textures Alias copies Texels equal to [1, 0.5, 0.25, 1]
Normal creation on RTX 5080 (621.14) and WARP 1 0 4,096/4,096
Same devices, temporarily bypassing CreateCommittedResource3 to exercise the plain-resource fallback 2 1 4,096/4,096

Both rows held with the writer created first and with the placed SRV resolved first. In the normal writer-first run, the writer already had format 67 in its 21-format castable list before the reader existed. The BC1 control used two textures and one copy in all eight runs, with all 4,096 texels red.

I could not measure which path your Windows 10 machine took. One detail when checking the log: on this revision the refusal warning is inside the successful ID3D12Device10 interface-query branch. If that interface is unavailable, the code also falls back to plain creation, without emitting that warning. Host creation code

**@⁠AlanQiang0418** on GitHub · 2026-11-25 02:42 UTC · [original](https://github.com/Marvisak/VIctory/issues/1999#issuecomment-7151077509) Sharing is optional here. The value the placed view reads is the invariant. [PR #1765](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1765) already checks both outcomes and still performs the pixel readback on a host that takes the copy path. I applied its commit `d02e007` to `main` at `940d32f` and checked the registration-order question independently. | R32_UINT writer → R9G9B9E5 reader | Host textures | Alias copies | Texels equal to [1, 0.5, 0.25, 1] | | --- | ---: | ---: | ---: | | Normal creation on RTX 5080 (621.14) and WARP | 1 | 0 | 4,096/4,096 | | Same devices, temporarily bypassing CreateCommittedResource3 to exercise the plain-resource fallback | 2 | 1 | 4,096/4,096 | Both rows held with the writer created first and with the placed SRV resolved first. In the normal writer-first run, the writer already had format 67 in its 21-format castable list before the reader existed. The BC1 control used two textures and one copy in all eight runs, with all 4,096 texels red. I could not measure which path your Windows 10 machine took. One detail when checking the log: on this revision the refusal warning is inside the successful `ID3D12Device10` interface-query branch. If that interface is unavailable, the code also falls back to plain creation, without emitting that warning. [Host creation code](https://github.com/Marvisak/VIctory/blob/940d32f69b22265690a0b5a15d6ded572ba33baf/crates/victory-gpu/src/resource.rs#L1191-L1240)
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 02:44 UTC · original

Root cause found, and it is environmental rather than a sharing regression: this runtime has no ID3D12Device10, so resource::make_texture never gets to CreateCommittedResource3 and never records any castable format.

Debug output on main 940d32f (temporary prints, not committed):

DEBUG device10: no (Error { code: HRESULT(0x80004002), message: "Schnittstelle nicht unterstützt" })
DEBUG takes: uses_ok=true fam=false cast=false own=42 d=67 dflags=0x0 flags=0x4 castable=[]

make_texture does host.device.cast::<ID3D12Device10>(), and on failure it silently falls through to the plain CreateCommittedResource path, which clears castable_formats. So on a Windows 10 system D3D12 runtime (this is the same reason the SM 6.6 GPU suites cannot make a device, #1829/#1991) every view in another format gets its own HostTexture and a copy at the read — the fallback is working as designed, only the format pair the test picks cannot share without the castable list.

So the test is honest about the capability; what is missing is (a) the log, because a tester cannot see why sharing is off, and (b) a skip for this case like the other capability skips.

I have both in a branch: a one-time tracing::info! when the cast fails and Host::device10(), with the test skipping when it is false. I will open it as its own PR and link it here. With D3D12Core.dll from the Agility SDK next to the executable (as the releases stage), the same code takes the castable path and the test passes; CI shows that.

Closing this as environmental, tracked by the log/skip PR rather than a bug in sharing.

**@⁠Calvix2k** on GitHub · 2026-11-25 02:44 UTC · [original](https://github.com/Marvisak/VIctory/issues/1999#issuecomment-7151118856) Root cause found, and it is environmental rather than a sharing regression: **this runtime has no `ID3D12Device10`**, so `resource::make_texture` never gets to `CreateCommittedResource3` and never records any castable format. Debug output on `main 940d32f` (temporary prints, not committed): ``` DEBUG device10: no (Error { code: HRESULT(0x80004002), message: "Schnittstelle nicht unterstützt" }) DEBUG takes: uses_ok=true fam=false cast=false own=42 d=67 dflags=0x0 flags=0x4 castable=[] ``` `make_texture` does `host.device.cast::<ID3D12Device10>()`, and on failure it silently falls through to the plain `CreateCommittedResource` path, which clears `castable_formats`. So on a Windows 10 system D3D12 runtime (this is the same reason the SM 6.6 GPU suites cannot make a device, #1829/#1991) **every** view in another format gets its own `HostTexture` and a copy at the read — the fallback is working as designed, only the format pair the test picks cannot share without the castable list. So the test is honest about the capability; what is missing is (a) the log, because a tester cannot see why sharing is off, and (b) a skip for this case like the other capability skips. I have both in a branch: a one-time `tracing::info!` when the cast fails and `Host::device10()`, with the test skipping when it is false. I will open it as its own PR and link it here. With `D3D12Core.dll` from the Agility SDK next to the executable (as the releases stage), the same code takes the castable path and the test passes; CI shows that. Closing this as environmental, tracked by the log/skip PR rather than a bug in sharing.
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 10:40 UTC · original

Confirmed as the missing ID3D12Device10 (D3D12 1.7) and nothing else. With the Agility runtime staged for the test binaries — package 1.620.2, D3D12Core.dll in <profile>/D3D12/, the D3D12SDKVersion/D3D12SDKPath exports (the same opt-in #486 gives victory-shader) — on this machine (Windows 10 19045, RX 7800 XT):

cargo test -p victory-gpu --features diagnostics --lib
test result: ok. 147 passed; 0 failed; 2 ignored

including draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view, which without the runtime fails at draw.rs:2185, round 0: one host texture, left false / right true.

So the same device, driver and title give either result depending on whether the runtime in use has castable formats; the test's expectation (shared = true for round 0, and no ALIAS_COPIES movement) is only right with them. The host can answer that directly: ID3D12Device10 present, or D3D12_FEATURE_D3D12_OPTIONS12's castable-format support, decides which expectation the test derives — which is what #2251 is for. Without it the test is red on every Windows 10 machine that does not stage the runtime, and that includes CI if CI is Windows 10.

**@⁠Calvix2k** on GitHub · 2026-11-25 10:40 UTC · [original](https://github.com/Marvisak/VIctory/issues/1999#issuecomment-7160013054) Confirmed as the missing `ID3D12Device10` (D3D12 1.7) and nothing else. With the Agility runtime staged for the test binaries — package 1.620.2, `D3D12Core.dll` in `<profile>/D3D12/`, the `D3D12SDKVersion`/`D3D12SDKPath` exports (the same opt-in #486 gives `victory-shader`) — on this machine (Windows 10 19045, RX 7800 XT): ``` cargo test -p victory-gpu --features diagnostics --lib test result: ok. 147 passed; 0 failed; 2 ignored ``` including `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view`, which without the runtime fails at `draw.rs:2185`, `round 0: one host texture`, left `false` / right `true`. So the same device, driver and title give either result depending on whether the runtime in use has castable formats; the test's expectation (`shared = true` for round 0, and no `ALIAS_COPIES` movement) is only right with them. The host can answer that directly: `ID3D12Device10` present, or `D3D12_FEATURE_D3D12_OPTIONS12`'s castable-format support, decides which expectation the test derives — which is what #2251 is for. Without it the test is red on every Windows 10 machine that does not stage the runtime, and that includes CI if CI is Windows 10.
Author
Owner

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

Automated triage for the maintainers.

Confirmed in main (940d32f) as a test that does not account for the host's capabilities. draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view (crates/victory-gpu/src/draw.rs) asserts round 0 shares one host texture. But the texture constructor in crates/victory-gpu/src/resource.rs takes the castable-format path only when host.device.cast::<ID3D12Device10>() succeeds; otherwise it silently creates a plain resource with no castable formats. The Windows 10 in-box runtime has no ID3D12Device10, so the views get separate host textures (and a copy) and the assertion fails. With the Agility runtime staged, the suite passes on the same machine (comment above).

Open PRs: #2251 (derive the expectation from the host's capability) and #1765 (checks both outcomes by the value read). A one-time log line when the cast fails, as proposed above, would also help testers.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 12:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/1999#issuecomment-7162897711) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T10:40:14Z at=2026-11-25T12:53:00Z --> Automated triage for the maintainers. Confirmed in `main` (`940d32f`) as a test that does not account for the host's capabilities. `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` (`crates/victory-gpu/src/draw.rs`) asserts round 0 shares one host texture. But the texture constructor in `crates/victory-gpu/src/resource.rs` takes the castable-format path only when `host.device.cast::<ID3D12Device10>()` succeeds; otherwise it silently creates a plain resource with no castable formats. The Windows 10 in-box runtime has no `ID3D12Device10`, so the views get separate host textures (and a copy) and the assertion fails. With the Agility runtime staged, the suite passes on the same machine (comment above). Open PRs: #2251 (derive the expectation from the host's capability) and #1765 (checks both outcomes by the value read). A one-time log line when the cast fails, as proposed above, would also help testers. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠lerapeurdu62280-debug on GitHub · 2026-11-26 15:45 UTC · original

Same failure here on Windows 10 Pro 19045 with an RX 6600 (Adrenalin 32.0.21045), on main 63bcca4, with a different assertion: round 0: a placed texture. The cause on this PC is the Windows 10 D3D12 runtime without the Agility SDK: it stops at shader model 6.5 and has no ID3D12Device10. So CreateCommittedResource3 (castable formats) is never reached, the R32_UINT texture is not castable to R9G9B9E5, and the view's own texture (format 67 with the memory's unordered access) is refused with E_INVALIDARG. On your PC the texture was made but not shared, which fits the same missing castable path.

#3283 skips this test (and two others that need 6.6) on such a runtime. The real fix for the runtime itself is the Agility SDK (#2460 / #2878).

**@⁠lerapeurdu62280-debug** on GitHub · 2026-11-26 15:45 UTC · [original](https://github.com/Marvisak/VIctory/issues/1999#issuecomment-7196709971) Same failure here on Windows 10 Pro 19045 with an RX 6600 (Adrenalin 32.0.21045), on `main` 63bcca4, with a different assertion: `round 0: a placed texture`. The cause on this PC is the Windows 10 D3D12 runtime without the Agility SDK: it stops at shader model 6.5 and has no `ID3D12Device10`. So `CreateCommittedResource3` (castable formats) is never reached, the R32_UINT texture is not castable to R9G9B9E5, and the view's own texture (format 67 with the memory's unordered access) is refused with `E_INVALIDARG`. On your PC the texture was made but not shared, which fits the same missing castable path. #3283 skips this test (and two others that need 6.6) on such a runtime. The real fix for the runtime itself is the Agility SDK (#2460 / #2878).
This discussion has been locked. Commenting is limited to contributors.
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#1999
No description provided.