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

Open
opened 2026-11-26 04:49:03 +00:00 by github-bot · 2 comments
Owner

@⁠crastinator on GitHub · 2026-11-24 14:04 UTC · original

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.
**@⁠crastinator** on GitHub · 2026-11-24 14:04 UTC · [original](https://github.com/xcl-dev/xcl/issues/1272) `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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:49:03 +00:00
Author
Owner

@⁠Diskuss on GitHub · 2026-11-24 14:09 UTC · original

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.

**@⁠Diskuss** on GitHub · 2026-11-24 14:09 UTC · [original](https://github.com/xcl-dev/xcl/issues/1272#issuecomment-7133935786) 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.
Author
Owner

@⁠wbnm77 on GitHub · 2026-11-24 14:18 UTC · original

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.

**@⁠wbnm77** on GitHub · 2026-11-24 14:18 UTC · [original](https://github.com/xcl-dev/xcl/issues/1272#issuecomment-7134177094) **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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.