Tests: predication_e2e cannot pass under vkd3d-proton: it does not predicate copies #1262

Open
opened 2026-11-24 14:04:22 +00:00 by crastinator · 4 comments
crastinator commented 2026-11-24 14:04:22 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T14:04:22Z.


set_predication_buffer_state_and_kickoff (crates/xcl/tests/predication_e2e.rs) fails under every Wine + vkd3d-proton setup I know of. The cause is on the vkd3d-proton side: it does not predicate copies. Every case in the test checks predication through CopyBufferRegion, so the test cannot pass there.

What happens (main 930e8b4)

thread 'set_predication_buffer_state_and_kickoff' panicked at crates/xcl/tests/predication_e2e.rs:360:9:
assertion `left == right` failed: EQUAL_ZERO(0) must skip dst[0]
  left: 2863267840
 right: 286331153

The copy ran: dst[0] holds the source value, not the initial one. #794's description lists the same failure on an RTX 4090 under Proton, so it does not depend on the GPU.

Why

  • D3D12 predicates copies. Predication lists CopyBufferRegion, CopyTextureRegion, CopyResource and CopyTiles among "the operations which can be predicated".
  • XCL's SetPredicationBufferX (hle/d3d12x/list_x.rs, apply_predication_copy) calls the host's SetPredication. That is correct on Windows.
  • vkd3d-proton implements predication with VK_EXT_conditional_rendering, plus a shader fallback for draws and dispatches. d3d12_command_list_CopyBufferRegion records vkCmdCopyBuffer2 without looking at the predicate. This is true in v3.1 and still on master today (ec207194), and I found no vkd3d-proton issue about it. VK_EXT_conditional_rendering covers draws and dispatches, not transfer commands.

Options I can see

  1. The test checks copy predication only on Windows (util::under_wine(), as in 8fde77a). That is test-only, but it means copy predication goes unchecked on Linux and macOS.
  2. XCL predicates copies itself when the host does not: for example, read the predicate and skip the copy on the CPU side for lists that are not yet submitted, or route predicated copies through a compute copy (vkd3d-proton predicates dispatches). That is a runtime change. Whether it is worth it depends on whether titles predicate copies at all, and I have not measured that.
  3. Report it to vkd3d-proton.

Which direction would you take? I can do 1 (or help with 2) once that's decided.

Tested

  • AMD Radeon RX 6700 XT (RDNA2, RADV NAVI22, Mesa 26.3.1), Linux 7.3.5, Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (with #775's dxil-spirv), DXVK v3.1.1-209 dxgi. XCL cross-built for x86_64-pc-windows-msvc, debug. cargo test -p xcl --test predication_e2e: fails as above every run.

AI use

  • Claude Code (Claude Opus 5.5) read the vkd3d-proton source, ran the test and wrote this; I checked it.
<!-- greyfinch-sync:ivall/xcl:issue:6583566902 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1272). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-24T14:04:22Z. --- `set_predication_buffer_state_and_kickoff` (`crates/xcl/tests/predication_e2e.rs`) fails under every Wine + vkd3d-proton setup I know of. The cause is on the vkd3d-proton side: it does not predicate copies. Every case in the test checks predication through `CopyBufferRegion`, so the test cannot pass there. **What happens** (`main` `930e8b4`) ``` thread 'set_predication_buffer_state_and_kickoff' panicked at crates/xcl/tests/predication_e2e.rs:360:9: assertion `left == right` failed: EQUAL_ZERO(0) must skip dst[0] left: 2863267840 right: 286331153 ``` The copy ran: `dst[0]` holds the source value, not the initial one. #794's description lists the same failure on an RTX 4090 under Proton, so it does not depend on the GPU. **Why** - D3D12 predicates copies. [Predication](https://learn.microsoft.com/en-us/windows/win32/direct3d12/predication) lists `CopyBufferRegion`, `CopyTextureRegion`, `CopyResource` and `CopyTiles` among "the operations which can be predicated". - XCL's `SetPredicationBufferX` (`hle/d3d12x/list_x.rs`, `apply_predication_copy`) calls the host's `SetPredication`. That is correct on Windows. - vkd3d-proton implements predication with `VK_EXT_conditional_rendering`, plus a shader fallback for draws and dispatches. `d3d12_command_list_CopyBufferRegion` records `vkCmdCopyBuffer2` without looking at the predicate. This is true in v3.1 and still on `master` today (`ec207194`), and I found no vkd3d-proton issue about it. `VK_EXT_conditional_rendering` covers draws and dispatches, not transfer commands. **Options I can see** 1. The test checks copy predication only on Windows (`util::under_wine()`, as in 8fde77a). That is test-only, but it means copy predication goes unchecked on Linux and macOS. 2. XCL predicates copies itself when the host does not: for example, read the predicate and skip the copy on the CPU side for lists that are not yet submitted, or route predicated copies through a compute copy (vkd3d-proton predicates dispatches). That is a runtime change. Whether it is worth it depends on whether titles predicate copies at all, and I have not measured that. 3. Report it to vkd3d-proton. Which direction would you take? I can do 1 (or help with 2) once that's decided. **Tested** - AMD Radeon RX 6700 XT (RDNA2, RADV NAVI22, Mesa 26.3.1), Linux 7.3.5, Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 + #257's patch (with #775's dxil-spirv), DXVK v3.1.1-209 `dxgi`. XCL cross-built for `x86_64-pc-windows-msvc`, debug. `cargo test -p xcl --test predication_e2e`: fails as above every run. **AI use** - Claude Code (Claude Opus 5.5) read the vkd3d-proton source, ran the test and wrote this; I checked it.
Diskuss commented 2026-11-24 15:05:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Diskuss on 2026-11-24T14:09:44Z.


Native Windows data point: AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32015.7029; Ryzen 7 5700X3D; 32 GB RAM; Windows 11 Pro build 26300.9974; Rust 1.100.0 x86_64-pc-windows-msvc; debug build.

At origin/main 930e8b49c1:

  • cargo test -p xcl --test predication_e2e -- --test-threads=1, 5 runs: 1 test ran each time (set_predication_buffer_state_and_kickoff), 5/5 passed, 0 failed, 0 SKIPPED printed. With --nocapture it ran to ok; the only debug-layer message is "debug layer requested but unavailable" (no Graphics Tools installed). No silent skip.
  • cargo test -p xcl --lib predication -- --test-threads=1: this filter matches one unit test (hle::d3d12x::list_x::tests::set_predication_buffer_state_transitions_and_lifecycle), 1 passed. The e2e test lives in crates/xcl/tests, so --lib does not run it.

This supports the explanation: the same test passes on native D3D12, including EQUAL_ZERO(0) must skip dst[0], so the failure comes from the Wine + vkd3d-proton layer. I did not test vkd3d-proton myself.

AI use: Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine.

<!-- greyfinch-sync:ivall/xcl:comment:7133935786 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/1272#issuecomment-7133935786). Originally posted by [Diskuss](https://github.com/Diskuss) on 2026-11-24T14:09:44Z. --- Native Windows data point: AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32015.7029; Ryzen 7 5700X3D; 32 GB RAM; Windows 11 Pro build 26300.9974; Rust 1.100.0 x86_64-pc-windows-msvc; debug build. At `origin/main` 930e8b49c1c2ec683d22c724a398b39111cd0e56: - `cargo test -p xcl --test predication_e2e -- --test-threads=1`, 5 runs: 1 test ran each time (`set_predication_buffer_state_and_kickoff`), 5/5 passed, 0 failed, 0 SKIPPED printed. With `--nocapture` it ran to `ok`; the only debug-layer message is "debug layer requested but unavailable" (no Graphics Tools installed). No silent skip. - `cargo test -p xcl --lib predication -- --test-threads=1`: this filter matches one unit test (`hle::d3d12x::list_x::tests::set_predication_buffer_state_transitions_and_lifecycle`), 1 passed. The e2e test lives in `crates/xcl/tests`, so `--lib` does not run it. This supports the explanation: the same test passes on native D3D12, including `EQUAL_ZERO(0) must skip dst[0]`, so the failure comes from the Wine + vkd3d-proton layer. I did not test vkd3d-proton myself. AI use: Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine.
wbnm77 commented 2026-11-24 15:05:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by wbnm77 on 2026-11-24T14:18:59Z.


Tested

XCL 930e8b49c1c2ec683d22c724a398b39111cd0e56 on native Windows 10 Pro 22H2 build 19045.6466, RTX 5060 Ti driver 621.24, Rust 1.98.1 MSVC, Agility SDK 1.620.2 and DXC 1.9.2602.17. I ran the built predication_e2e test binary with set_predication_buffer_state_and_kickoff --exact --test-threads=1 --nocapture in ten fresh processes. All ten passed and logged the real NVIDIA D3D12 backend, with no runtime test skip. The copy and readback assertions ran.

Not tested

Wine, retail games and D3D12 debug diagnostics. The debug layer was unavailable with 0x887A002D.

AI use

Codex (GPT-6) assisted with running the tests and writing this report from the local results.

<!-- greyfinch-sync:ivall/xcl:comment:7134177094 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/1272#issuecomment-7134177094). Originally posted by [wbnm77](https://github.com/wbnm77) on 2026-11-24T14:18:59Z. --- **Tested** XCL `930e8b49c1c2ec683d22c724a398b39111cd0e56` on native Windows 10 Pro 22H2 build 19045.6466, RTX 5060 Ti driver 621.24, Rust 1.98.1 MSVC, Agility SDK 1.620.2 and DXC 1.9.2602.17. I ran the built `predication_e2e` test binary with `set_predication_buffer_state_and_kickoff --exact --test-threads=1 --nocapture` in ten fresh processes. All ten passed and logged the real NVIDIA D3D12 backend, with no runtime test skip. The copy and readback assertions ran. **Not tested** Wine, retail games and D3D12 debug diagnostics. The debug layer was unavailable with `0x887A002D`. **AI use** Codex (GPT-6) assisted with running the tests and writing this report from the local results.
Royalflamejlh commented 2026-11-27 20:04:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-27T20:04:12Z.


On "whether titles predicate copies at all": the retail title called neither SetPredicationBufferX nor SetPredication with a buffer in 2 of 2 runs of 301 s under Wine, about 240 s of each after its world load began, so it recorded no predicated copy there. That speaks for a test-only change (option 1) as far as this title goes; #1327 is one, skipping the test on a host that runs a predicated copy.

Setup: our Linux branch linux/stack 8df733bd (main f9a0cb80 with open pull requests merged in) plus log lines only, not pushed: where SetPredicationBufferX sets a predication, at the standard SetPredication with a buffer, and at each title copy recorded while either is set (CopyBufferRegion, CopyTextureRegion, CopyResource, their flag variants, CopyMemoryX, the FillMemoryWith…X). RTX 4060 Ti 16 GB, NVIDIA 615.71.09, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with three local patches (relaxed vtable checks, a dxil-spirv patch, command pools released at Reset). XCL_DIRECT_DXIL=1 XCL_PREPARE=0 XCL_SKIP_BINK=1 XCL_PSO_DISK_CACHE=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_DXC_THREADS=4 XCL_ACTIVITY=1, and VKD3D_CONFIG=ignore_shared_fence in run 2 only. The first-run screens were completed once, no story progress.

Run Seconds Frames shown World load from Predications set Copies under one
Linux, run 1 301 1,386 61.4 s 0 0
Linux, run 2 301 1,322 58.7 s 0 0
Windows 11, RTX 2070 SUPER 8 GB (driver 621.01), main 6089122a + those lines without the one at SetPredication, XCL_PREPARE=0 XCL_SKIP_BINK=1, 1 run 110 1,848 not reached 0 0
  • Both Linux runs were still drawing at their end (1,425 and 2,080 draws in the last 2 s).
  • The picture in these runs is not right: credits over a black scene (#505), and a mostly green picture in 8 of run 2's 132 dumped frames (run 1 dumped none). It does not bear on the count.
  • The Windows run ended in the loading screens (loading from 40 s).

Not tested

  • Later than 301 s, story progress, other titles, the world on native Windows.
  • AMD and Intel GPUs.
  • A predication through a console command-list method XCL does not implement (XCL logs those and does nothing).

AI use: Claude Code (Claude Opus 5.5 and Claude Fable 5.2) wrote the log lines, read the runs and wrote this.

Posted without review by a person: the account owner was away and reads replies later.

<!-- greyfinch-sync:ivall/xcl:comment:7227144087 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1272#issuecomment-7227144087). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-11-27T20:04:12Z. --- On "whether titles predicate copies at all": the retail title called neither SetPredicationBufferX nor SetPredication with a buffer in 2 of 2 runs of 301 s under Wine, about 240 s of each after its world load began, so it recorded no predicated copy there. That speaks for a test-only change (option 1) as far as this title goes; #1327 is one, skipping the test on a host that runs a predicated copy. **Setup:** our Linux branch `linux/stack` `8df733bd` (`main` `f9a0cb80` with open pull requests merged in) plus log lines only, not pushed: where `SetPredicationBufferX` sets a predication, at the standard `SetPredication` with a buffer, and at each title copy recorded while either is set (`CopyBufferRegion`, `CopyTextureRegion`, `CopyResource`, their flag variants, `CopyMemoryX`, the `FillMemoryWith…X`). RTX 4060 Ti 16 GB, NVIDIA 615.71.09, Wine 11.21 Staging, vkd3d-proton `v3.1-90-g30b0eb9b` with three local patches (relaxed vtable checks, a dxil-spirv patch, command pools released at `Reset`). `XCL_DIRECT_DXIL=1 XCL_PREPARE=0 XCL_SKIP_BINK=1 XCL_PSO_DISK_CACHE=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_DXC_THREADS=4 XCL_ACTIVITY=1`, and `VKD3D_CONFIG=ignore_shared_fence` in run 2 only. The first-run screens were completed once, no story progress. | Run | Seconds | Frames shown | World load from | Predications set | Copies under one | |---|---|---|---|---|---| | Linux, run 1 | 301 | 1,386 | 61.4 s | 0 | 0 | | Linux, run 2 | 301 | 1,322 | 58.7 s | 0 | 0 | | Windows 11, RTX 2070 SUPER 8 GB (driver 621.01), `main` `6089122a` + those lines without the one at `SetPredication`, `XCL_PREPARE=0 XCL_SKIP_BINK=1`, 1 run | 110 | 1,848 | not reached | 0 | 0 | - Both Linux runs were still drawing at their end (1,425 and 2,080 draws in the last 2 s). - The picture in these runs is not right: credits over a black scene (#505), and a mostly green picture in 8 of run 2's 132 dumped frames (run 1 dumped none). It does not bear on the count. - The Windows run ended in the loading screens (loading from 40 s). **Not tested** - Later than 301 s, story progress, other titles, the world on native Windows. - AMD and Intel GPUs. - A predication through a console command-list method XCL does not implement (XCL logs those and does nothing). **AI use:** Claude Code (Claude Opus 5.5 and Claude Fable 5.2) wrote the log lines, read the runs and wrote this. Posted without review by a person: the account owner was away and reads replies later.
crastinator commented 2026-11-28 16:59:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by crastinator on 2026-11-28T16:59:31Z.


Thanks @Royalflamejlh, that points to option 1. #1327 does it with a probe instead of a Wine check, so it covers vkd3d-proton as well as D3DMetal. With it the test now skips under vkd3d-proton on RDNA2, RDNA 3.5 and an RTX 3060, and still runs and passes on native Windows. I'll close this issue when #1327 merges.

<!-- greyfinch-sync:ivall/xcl:comment:7242668907 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1272#issuecomment-7242668907). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-28T16:59:31Z. --- Thanks @Royalflamejlh, that points to option 1. #1327 does it with a probe instead of a Wine check, so it covers vkd3d-proton as well as D3DMetal. With it the test now skips under vkd3d-proton on RDNA2, RDNA 3.5 and an RTX 3060, and still runs and passes on native Windows. I'll close this issue when #1327 merges.
Sign in to join this conversation.
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
xcl-dev/xcl#1262
No description provided.