Tests: skip predication_e2e when the host runs predicated copies #1327

Open
github-bot wants to merge 1 commit from github-bot/gh-1327 into main AGit
Owner

@⁠vakaobr on GitHub · 2026-11-24 14:48 UTC · original
vakaobr:tests/predication-copy-skip → main · +59 −0 · 1 files · 1 commits · open

Part of #258. D3DMetal 3.0 skips predicated draws, dispatches and ExecuteIndirect, but runs predicated copies and clears (measured with a plain D3D12 program, and first reported in #258 by @⁠us3r40456). On main the Mac never reaches set_predication_buffer_state_and_kickoff (it skips with "no GPU UMA"). Once the unified memory copy path lands, it runs and fails. This PR adds a one-copy probe and skips the test with "host ignores SetPredication for copies" on such a host. It is meant to merge before the copy path, so no test regresses on the Mac.

What is in it

  • crates/xcl/tests/predication_e2e.rs: host_runs_predicated_copies(): a predicate of 0 with EQUAL_ZERO, one predicated 4-byte copy and one unpredicated control into a readback buffer; the test skips only when the predicated copy ran and the control did.

Tested

  • MacBook Pro M5 Pro (20-core GPU), 48 GB, macOS 27.2.1, CrossOver 26.3.0.39832 with D3DMetal 3.0 ("AMD Compatibility Mode"), Rosetta 2. Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64 GCC 16.2.0), debug, DXC 1.9.2609. Each test in its own process (<test exe> --exact <test> --test-threads=1 --nocapture).
  • On main with this PR (head 39f2504): set_predication_buffer_state_and_kickoff still skips with "no GPU UMA", because the probe is not reached without unified memory on this host.
  • With the copy path on top (the stack's head 4a11de6): it skips with "host ignores SetPredication for copies".
  • Independent run at this head: NVIDIA RTX 5070 Ti and the AMD Radeon iGPU of a Ryzen 9800X3D (RDNA2), Windows 11, debug, cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored on both; set_predication_buffer_state_and_kickoff ran and passed on both, the probe not skipping it on either native driver (@⁠futurepro62, https://github.com/ivall/xcl/pull/1327#issuecomment-7135126721).

Regression run

Test-only change in crates/xcl/tests/: no xcl-smoke blocks.

Not tested

  • Windows by me; see the independent run above, where the probe did not skip the test.

AI use

  • Claude Code with Claude Opus 5.5 measured D3DMetal's predication on this machine, wrote the probe and the skip, ran the tests above and wrote this description.
**@⁠vakaobr** on GitHub · 2026-11-24 14:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/1327) `vakaobr:tests/predication-copy-skip` → `main` · +59 −0 · 1 files · 1 commits · open Part of #258. D3DMetal 3.0 skips predicated draws, dispatches and `ExecuteIndirect`, but runs predicated copies and clears (measured with a plain D3D12 program, and first reported in #258 by @⁠us3r40456). On `main` the Mac never reaches `set_predication_buffer_state_and_kickoff` (it skips with "no GPU UMA"). Once the unified memory copy path lands, it runs and fails. This PR adds a one-copy probe and skips the test with "host ignores SetPredication for copies" on such a host. It is meant to merge before the copy path, so no test regresses on the Mac. **What is in it** - `crates/xcl/tests/predication_e2e.rs`: `host_runs_predicated_copies()`: a predicate of 0 with `EQUAL_ZERO`, one predicated 4-byte copy and one unpredicated control into a readback buffer; the test skips only when the predicated copy ran and the control did. **Tested** - MacBook Pro M5 Pro (20-core GPU), 48 GB, macOS 27.2.1, CrossOver 26.3.0.39832 with D3DMetal 3.0 ("AMD Compatibility Mode"), Rosetta 2. Rust 1.100.0, `x86_64-pc-windows-gnu` (mingw-w64 GCC 16.2.0), debug, DXC 1.9.2609. Each test in its own process (`<test exe> --exact <test> --test-threads=1 --nocapture`). - On `main` with this PR (head `39f2504`): `set_predication_buffer_state_and_kickoff` still skips with "no GPU UMA", because the probe is not reached without unified memory on this host. - With the copy path on top (the stack's head `4a11de6`): it skips with "host ignores SetPredication for copies". - Independent run at this head: NVIDIA RTX 5070 Ti and the AMD Radeon iGPU of a Ryzen 9800X3D (RDNA2), Windows 11, debug, `cargo test --workspace -- --test-threads=4`: 751 passed, 0 failed, 41 ignored on both; `set_predication_buffer_state_and_kickoff` ran and passed on both, the probe not skipping it on either native driver (@⁠futurepro62, https://github.com/ivall/xcl/pull/1327#issuecomment-7135126721). **Regression run** Test-only change in `crates/xcl/tests/`: no `xcl-smoke` blocks. **Not tested** - Windows by me; see the independent run above, where the probe did not skip the test. **AI use** - Claude Code with Claude Opus 5.5 measured D3DMetal's predication on this machine, wrote the probe and the skip, ran the tests above and wrote this description.
D3DMetal 3.0 applies SetPredication for draws, dispatches and
ExecuteIndirect but not for copies: a predicated CopyBufferRegion runs
unconditionally. The UMA shadow path (next commit) makes UMA available
on this host, so the predication test would run and fail.

A one-copy probe detects whether a predicated copy is skipped (Windows,
any real D3D12) or run (D3DMetal). When run, the test skips with
"host ignores SetPredication for copies" instead of failing.

Based on us3r40456's bisect and measurement in ivall/xcl#258.

Co-authored-by: Ahmet Dedeler <[email protected]>
Assisted-by: Claude Code (Claude Opus 4.6 ported it; Claude Opus 5.5 reviewed it)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:50:52 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 14:53 UTC · original · edited 2026-11-24 14:57 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 39f2504 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored, no skips.
  • tests/predication_e2e.rs: set_predication_buffer_state_and_kickoff ran and passed on both GPUs. The new host_runs_predicated_copies probe did not skip it on either native D3D12 driver (NVIDIA, AMD), as expected.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 14:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1327#issuecomment-7135126721) · edited 2026-11-24 14:57 UTC Full-suite run, since this PR has no test report yet. Tested exact head `39f2504` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **751 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - No new `#[test]` functions in the diff. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **751 passed, 0 failed, 41 ignored**, no skips. - `tests/predication_e2e.rs`: `set_predication_buffer_state_and_kickoff` ran and passed on both GPUs. The new `host_runs_predicated_copies` probe did not skip it on either native D3D12 driver (NVIDIA, AMD), as expected. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 15:09 UTC · original

A run where the host does ignore predication for copies: vkd3d-proton under Wine on Linux. The skip is taken here and the test no longer fails.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 39f2504 as it is (based on 930e8b4) and main 930e8b4, no uncommitted changes. The test binary runs under Wine, one test per process (--exact).
  • predication_e2e::set_predication_buffer_state_and_kickoff:
    • main 930e8b4: fails, predication_e2e.rs:360, EQUAL_ZERO(0) must skip dst[0], left: 2863267840. This is the same failure @⁠itsd-effex listed for Wine on #257.
    • this PR: ok, with SKIPPED set_predication_buffer_state_and_kickoff: host ignores SetPredication for copies.

Not tested

  • native Windows (where the skip must not fire); the rest of the suite on this head.

AI use

  • Claude Code (Claude Opus 5.5) built the commits, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 15:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/1327#issuecomment-7135561125) A run where the host does ignore predication for copies: vkd3d-proton under Wine on Linux. The skip is taken here and the test no longer fails. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `39f2504` as it is (based on `930e8b4`) and `main` `930e8b4`, no uncommitted changes. The test binary runs under Wine, one test per process (`--exact`). - `predication_e2e::set_predication_buffer_state_and_kickoff`: - `main` `930e8b4`: **fails**, `predication_e2e.rs:360`, `EQUAL_ZERO(0) must skip dst[0]`, `left: 2863267840`. This is the same failure @⁠itsd-effex listed for Wine on #257. - this PR: **ok**, with `SKIPPED set_predication_buffer_state_and_kickoff: host ignores SetPredication for copies`. **Not tested** - native Windows (where the skip must not fire); the rest of the suite on this head. **AI use** - Claude Code (Claude Opus 5.5) built the commits, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 15:14 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib -- --test-threads=1: 707 passed, 0 failed, 21 ignored. (The default parallel run aborted once with 0xc0000005 — same test-harness flake seen on unmodified main under load; single-threaded is clean.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 15:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/1327#issuecomment-7135693419) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib -- --test-threads=1`: 707 passed, 0 failed, 21 ignored. (The default parallel run aborted once with 0xc0000005 — same test-harness flake seen on unmodified `main` under load; single-threaded is clean.) Thanks!
Author
Owner

@⁠KOLESNiii on GitHub · 2026-11-24 15:58 UTC · original

A run on AMD RDNA 3.5 under Wine + vkd3d-proton. Here the host ignores predication for copies: main fails as in #1272 and this PR takes the skip.

Tested

  • AMD Ryzen AI 7 350 with Radeon 860M (RDNA 3.5, RADV KRACKAN1, Mesa 26.0.3), Ubuntu 26.04 LTS (kernel 7.0.0-43).
  • Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 with #257's patch and -Db_ndebug=true (built with #257's build-vkd3d-proton.sh), DXVK v3.1.1-209 dxgi from Proton, VKD3D_CONFIG=ignore_shared_fence, DXC 1.9.2609.
  • Rust 1.100.0, cross-built for x86_64-pc-windows-gnu (mingw-w64 GCC 13-posix), debug. Each test binary from a clean checkout of its commit (no uncommitted changes), run under Wine one test per process: <exe> set_predication_buffer_state_and_kickoff --exact --test-threads=1 --nocapture, 3 runs each.
  • main 930e8b4: fails 3/3 at predication_e2e.rs:360, EQUAL_ZERO(0) must skip dst[0], left: 2863267840, right: 286331153 (the copy ran), the same failure as in #1272.
  • this PR 39f2504: ok 3/3, SKIPPED set_predication_buffer_state_and_kickoff: host ignores SetPredication for copies.
  • With Proton's stock vkd3d-proton, main does not get as far as the predication part: Assertion failed: iface->lpVtbl == &d3d12_resource_vtbl (#241).

Not tested

  • native Windows (where the probe must not skip); the rest of the suite on this head; a release build.

AI use

  • Claude Code (Claude Opus 5.5) set up the Wine lane, built and ran the tests and wrote this report; I checked it.
**@⁠KOLESNiii** on GitHub · 2026-11-24 15:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1327#issuecomment-7136916165) A run on AMD RDNA 3.5 under Wine + vkd3d-proton. Here the host ignores predication for copies: `main` fails as in #1272 and this PR takes the skip. **Tested** - AMD Ryzen AI 7 350 with Radeon 860M (RDNA 3.5, RADV KRACKAN1, Mesa 26.0.3), Ubuntu 26.04 LTS (kernel 7.0.0-43). - Proton Experimental 11.0-20261112's Wine, vkd3d-proton v3.1 with #257's patch and `-Db_ndebug=true` (built with #257's `build-vkd3d-proton.sh`), DXVK v3.1.1-209 `dxgi` from Proton, `VKD3D_CONFIG=ignore_shared_fence`, DXC 1.9.2609. - Rust 1.100.0, cross-built for `x86_64-pc-windows-gnu` (mingw-w64 GCC 13-posix), debug. Each test binary from a clean checkout of its commit (no uncommitted changes), run under Wine one test per process: `<exe> set_predication_buffer_state_and_kickoff --exact --test-threads=1 --nocapture`, 3 runs each. - `main` `930e8b4`: **fails** 3/3 at `predication_e2e.rs:360`, `EQUAL_ZERO(0) must skip dst[0]`, `left: 2863267840`, `right: 286331153` (the copy ran), the same failure as in #1272. - this PR `39f2504`: **ok** 3/3, `SKIPPED set_predication_buffer_state_and_kickoff: host ignores SetPredication for copies`. - With Proton's stock vkd3d-proton, `main` does not get as far as the predication part: `Assertion failed: iface->lpVtbl == &d3d12_resource_vtbl` (#241). **Not tested** - native Windows (where the probe must not skip); the rest of the suite on this head; a release build. **AI use** - Claude Code (Claude Opus 5.5) set up the Wine lane, built and ran the tests and wrote this report; I checked it.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 15:58 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 15:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1327#issuecomment-7136921800) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib -- --test-threads=1`: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified `main`.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1327/head:github-bot/gh-1327'
git switch 'github-bot/gh-1327'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1327'
git switch 'github-bot/gh-1327'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1327'
git switch 'github-bot/gh-1327'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1327'
git switch 'main'
git merge --squash 'github-bot/gh-1327'
git switch 'main'
git merge --ff-only 'github-bot/gh-1327'
git switch 'main'
git merge 'github-bot/gh-1327'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.