Tests: GPU tests of 64-bit atomics skip where those atomics write nothing #977

Open
vakaobr wants to merge 1 commit from upstream-pr/983 into main
vakaobr commented 2026-11-24 09:52:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-24T09:52:28Z.


On Apple's D3DMetal 3.0 (macOS, CrossOver 26.3), a compute program that contains a 64-bit atomic writes nothing at all: not the atomic, not its other stores, not even stores issued before it. The only exception is non-returning unsigned InterlockedMin64 / InterlockedMax64 on device memory. The adapter still reports Int64ShaderOps, AtomicInt64OnTypedResourceSupported, AtomicInt64OnGroupSharedSupported and AtomicInt64OnDescriptorHeapResourceSupported as 1, so a one-thread kernel checks it instead: a returning InterlockedAdd64 must carry into the high dword and give back the old value. Part of #258.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: no_int64_atomics(), the one-time probe (OnceLock), now pub(super). It skips with no 64-bit atomics only when the probe kernel ran and its results are wrong.
  • Same file: gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2 and gpu_float_cas_uses_ieee_equality return through it. So do gpu_linked_memory_accessors (link_tests.rs) and gpu_heap_windows_64bit_atomics_match_switch_form (heap_window_tests.rs).
  • Same file: the three GLOBAL_ATOMIC_{ADD,INC,DEC}_X2 instructions and their asserts move unchanged from gpu_more_atomics_sub_dword_scratch_valu into a new gpu_global_atomic_add_inc_dec_x2, gated the same way, so the rest of the old test runs on such a host.

Tested

  • Apple M5 Pro, macOS 27.2.1, CrossOver 26.3 with D3DMetal 3.0, Rust 1.100, x86_64-pc-windows-gnu, debug, DXC 1.9.2609; head 518398a on main 9dfbe3e. Each test in its own process (<lib test exe> --exact <test> --test-threads=1 --nocapture).
  • The probe reads [ffffffff, 1, 0, 0]: the buffer as it was before, so the kernel wrote nothing, its plain store included.
  • The GPU tests on main that use 64-bit atomics, plus gpu_global_atomics_and_sub_dword_access:
    • On main 9dfbe3e: 2 passed, 6 failed. The failures are gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2, gpu_more_atomics_sub_dword_scratch_valu ("global_atomic_inc wraps at 10"), gpu_float_cas_uses_ieee_equality ("ds_cmpst_rtn_f32"), gpu_linked_memory_accessors ("s_load from window 1") and gpu_heap_windows_64bit_atomics_match_switch_form ("64-bit add carry in w1").
    • At this head: 9 passed, 0 failed. 6 of them are SKIPPED …: no 64-bit atomics: the five gated ones and gpu_global_atomic_add_inc_dec_x2. gpu_more_atomics_sub_dword_scratch_valu passes.
  • The same cause shows in the two mixed tests. With only their 64-bit instructions taken out (a local build, not in the PR), gpu_linked_memory_accessors passes and gpu_float_cas_uses_ieee_equality gets past every 32-bit check.
  • Earlier, at ab7ce43 on main 9aec53d: the local probes of each 64-bit atomic, and @mikebuckets171's independent run on a second M5 Pro (https://github.com/ivall/xcl/pull/983#issuecomment-7129605266). Those results are unchanged from the previous version of this description.

Regression run

Test-only change: no runtime file changed, no xcl-smoke blocks.

Not tested

  • Windows and any adapter with working 64-bit atomics: not run. There the probe should pass and nothing should skip, but no run shows it.
  • cargo test --workspace as a whole.
  • The 32-bit checks in gpu_float_cas_uses_ieee_equality and gpu_linked_memory_accessors no longer run on a Mac. I can split them like gpu_more_atomics_sub_dword_scratch_valu if you prefer.
  • XCL_REQUIRE_GPU=wave64 / mesh turns this skip into a failure, because runner::skip_test is unchanged.
  • #787 gates gpu_atomic_fcmpswap_x2 and gpu_atomic_fmin_fmax_x2 on no_doubles(), so the two PRs touch the same if lines. Those two tests use no doubles (see https://github.com/ivall/xcl/pull/787#issuecomment-7127510124).
  • A runtime workaround for titles: a 64-bit compare-swap, exchange or min / max cannot be built correctly from 32-bit atomics without a lock, so this PR only reports the gap.

AI use

  • Claude Code with Claude Opus 5.5 ran the probes and tests on this machine, wrote the change and this description.
<!-- greyfinch-sync:ivall/xcl:issue:5469871329 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/983). Originally posted by [vakaobr](https://github.com/vakaobr) on 2026-11-24T09:52:28Z. --- On Apple's D3DMetal 3.0 (macOS, CrossOver 26.3), a compute program that contains a 64-bit atomic writes nothing at all: not the atomic, not its other stores, not even stores issued before it. The only exception is non-returning unsigned `InterlockedMin64` / `InterlockedMax64` on device memory. The adapter still reports `Int64ShaderOps`, `AtomicInt64OnTypedResourceSupported`, `AtomicInt64OnGroupSharedSupported` and `AtomicInt64OnDescriptorHeapResourceSupported` as 1, so a one-thread kernel checks it instead: a returning `InterlockedAdd64` must carry into the high dword and give back the old value. Part of #258. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: `no_int64_atomics()`, the one-time probe (`OnceLock`), now `pub(super)`. It skips with `no 64-bit atomics` only when the probe kernel ran and its results are wrong. - Same file: `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2` and `gpu_float_cas_uses_ieee_equality` return through it. So do `gpu_linked_memory_accessors` (`link_tests.rs`) and `gpu_heap_windows_64bit_atomics_match_switch_form` (`heap_window_tests.rs`). - Same file: the three `GLOBAL_ATOMIC_{ADD,INC,DEC}_X2` instructions and their asserts move unchanged from `gpu_more_atomics_sub_dword_scratch_valu` into a new `gpu_global_atomic_add_inc_dec_x2`, gated the same way, so the rest of the old test runs on such a host. **Tested** - Apple M5 Pro, macOS 27.2.1, CrossOver 26.3 with D3DMetal 3.0, Rust 1.100, `x86_64-pc-windows-gnu`, debug, DXC 1.9.2609; head `518398a` on `main` `9dfbe3e`. Each test in its own process (`<lib test exe> --exact <test> --test-threads=1 --nocapture`). - The probe reads `[ffffffff, 1, 0, 0]`: the buffer as it was before, so the kernel wrote nothing, its plain store included. - The GPU tests on `main` that use 64-bit atomics, plus `gpu_global_atomics_and_sub_dword_access`: - On `main` `9dfbe3e`: 2 passed, 6 failed. The failures are `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2`, `gpu_more_atomics_sub_dword_scratch_valu` ("global_atomic_inc wraps at 10"), `gpu_float_cas_uses_ieee_equality` ("ds_cmpst_rtn_f32"), `gpu_linked_memory_accessors` ("s_load from window 1") and `gpu_heap_windows_64bit_atomics_match_switch_form` ("64-bit add carry in w1"). - At this head: 9 passed, 0 failed. 6 of them are `SKIPPED …: no 64-bit atomics`: the five gated ones and `gpu_global_atomic_add_inc_dec_x2`. `gpu_more_atomics_sub_dword_scratch_valu` passes. - The same cause shows in the two mixed tests. With only their 64-bit instructions taken out (a local build, not in the PR), `gpu_linked_memory_accessors` passes and `gpu_float_cas_uses_ieee_equality` gets past every 32-bit check. - Earlier, at `ab7ce43` on `main` `9aec53d`: the local probes of each 64-bit atomic, and @mikebuckets171's independent run on a second M5 Pro (https://github.com/ivall/xcl/pull/983#issuecomment-7129605266). Those results are unchanged from the previous version of this description. **Regression run** Test-only change: no runtime file changed, no `xcl-smoke` blocks. **Not tested** - Windows and any adapter with working 64-bit atomics: not run. There the probe should pass and nothing should skip, but no run shows it. - `cargo test --workspace` as a whole. - The 32-bit checks in `gpu_float_cas_uses_ieee_equality` and `gpu_linked_memory_accessors` no longer run on a Mac. I can split them like `gpu_more_atomics_sub_dword_scratch_valu` if you prefer. - `XCL_REQUIRE_GPU=wave64` / `mesh` turns this skip into a failure, because `runner::skip_test` is unchanged. - #787 gates `gpu_atomic_fcmpswap_x2` and `gpu_atomic_fmin_fmax_x2` on `no_doubles()`, so the two PRs touch the same `if` lines. Those two tests use no doubles (see https://github.com/ivall/xcl/pull/787#issuecomment-7127510124). - A runtime workaround for titles: a 64-bit compare-swap, exchange or min / max cannot be built correctly from 32-bit atomics without a lock, so this PR only reports the gap. **AI use** - Claude Code with Claude Opus 5.5 ran the probes and tests on this machine, wrote the change and this description.
mikebuckets171 commented 2026-11-24 11:06:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mikebuckets171 on 2026-11-24T11:03:48Z.


Verified on a second Apple silicon host, on the gnullvm target: all three of the failures you name reproduce on the base, and at this head the two dedicated tests skip and the mixed one runs.

Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal (adapter reports "AMD Compatibility Mode"), Rosetta 2, Rust 1.100.0, x86_64-pc-windows-gnullvm with LLVM-MinGW 20261117 (clang 23.1.6), --release --locked, test binaries run under Wine, one test per process (--exact <full test path> --nocapture --test-threads=1). Base is 9aec53d, head ab7ce43; the lib test binary reports 704 tests on the base and 705 at the head.

test 9aec53d ab7ce43
gpu::recomp::tests::gpu_atomic_fcmpswap_x2 FAILED, tests.rs:4737: assertion left == right failed: lane 0: buffer cell, left: 4609434218613702656 SKIPPED …gpu_atomic_fcmpswap_x2: no 64-bit atomics -> ok. 1 passed; 0 failed
gpu::recomp::tests::gpu_atomic_fmin_fmax_x2 FAILED, tests.rs:4868: assertion left == right failed: buffer: max of the lanes, left: -inf SKIPPED …gpu_atomic_fmin_fmax_x2: no 64-bit atomics -> ok. 1 passed; 0 failed
gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu FAILED, tests.rs:4632: assertion left == right failed: global_atomic_inc wraps at 10, left: 0 ok. 1 passed; 0 failed in 0.62 s

The third row is the part worth having in the record: on this host the mixed test's own failure was the 64-bit atomic (global_atomic_inc came back 0), and after your change the test runs and passes - so taking the three 64-bit atomics out of it really does keep the rest of it working on a Mac host rather than trading one failure for a skip.

The left: 4609434218613702656 on the first row is what the cell holds when the atomic never writes: it is the value the test put there first, unchanged, which fits your "any 64-bit atomic writes nothing at all, other stores included" measurement. left: -inf on the second is the reduction over lanes that never got updated.

Not tested here: Windows (no Windows machine on this bench), and this PR's CI has not run on GitHub - every head of mine on this repo shows only the PR checks description job, which is main's own pull_request_target workflow, so the CI job still needs a maintainer's approval to start for a fork contribution.

Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna built both trees, ran the tests and drafted this comment; the codes, line numbers and assertion values are from those runs.

<!-- greyfinch-sync:ivall/xcl:comment:7129605266 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/983#issuecomment-7129605266). Originally posted by [mikebuckets171](https://github.com/mikebuckets171) on 2026-11-24T11:03:48Z. --- **Verified on a second Apple silicon host, on the `gnullvm` target: all three of the failures you name reproduce on the base, and at this head the two dedicated tests skip and the mixed one runs.** Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal (adapter reports "AMD Compatibility Mode"), Rosetta 2, Rust 1.100.0, `x86_64-pc-windows-gnullvm` with LLVM-MinGW 20261117 (clang 23.1.6), `--release --locked`, test binaries run under Wine, one test per process (`--exact <full test path> --nocapture --test-threads=1`). Base is `9aec53d`, head `ab7ce43`; the lib test binary reports 704 tests on the base and 705 at the head. | test | `9aec53d` | `ab7ce43` | |---|---|---| | `gpu::recomp::tests::gpu_atomic_fcmpswap_x2` | FAILED, `tests.rs:4737`: `assertion left == right failed: lane 0: buffer cell`, `left: 4609434218613702656` | `SKIPPED …gpu_atomic_fcmpswap_x2: no 64-bit atomics` -> `ok. 1 passed; 0 failed` | | `gpu::recomp::tests::gpu_atomic_fmin_fmax_x2` | FAILED, `tests.rs:4868`: `assertion left == right failed: buffer: max of the lanes`, `left: -inf` | `SKIPPED …gpu_atomic_fmin_fmax_x2: no 64-bit atomics` -> `ok. 1 passed; 0 failed` | | `gpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu` | FAILED, `tests.rs:4632`: `assertion left == right failed: global_atomic_inc wraps at 10`, `left: 0` | **`ok. 1 passed; 0 failed`** in 0.62 s | The third row is the part worth having in the record: on this host the mixed test's own failure was the 64-bit atomic (`global_atomic_inc` came back 0), and after your change the test runs and passes - so taking the three 64-bit atomics out of it really does keep the rest of it working on a Mac host rather than trading one failure for a skip. The `left: 4609434218613702656` on the first row is what the cell holds when the atomic never writes: it is the value the test put there first, unchanged, which fits your "any 64-bit atomic writes nothing at all, other stores included" measurement. `left: -inf` on the second is the reduction over lanes that never got updated. Not tested here: Windows (no Windows machine on this bench), and this PR's CI has not run on GitHub - every head of mine on this repo shows only the `PR checks` description job, which is main's own `pull_request_target` workflow, so the `CI` job still needs a maintainer's approval to start for a fork contribution. Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. **AI use**: GPT-6 Luna built both trees, ran the tests and drafted this comment; the codes, line numbers and assertion values are from those runs.
shortside commented 2026-11-24 12:05:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by shortside on 2026-11-24T11:56:52Z.


Test report from a second Mac, head ab7ce43 against its merge base 9aec53d.

Tested

  • MacBook Pro M5 Pro, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), Windows 10 bottle, D3DMetal; DXC 1.9.2609. Cross-built for x86_64-pc-windows-msvc with clang-cl / lld-link 23.1.6 and an xwin SDK 10.0.26100, Rust 1.100.0, debug. The lib test binary run under Wine, one test per process (--exact --nocapture, 60 s cap).
  • Every lib test with atomic in its name (12 on base, 13 on head): base 9 passed, 3 failed (gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2, gpu_more_atomics_sub_dword_scratch_valu); head 10 passed, 3 passed with SKIPPED … no 64-bit atomics (gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2, and the new gpu_global_atomic_add_inc_dec_x2), 0 failed.
  • gpu_more_atomics_sub_dword_scratch_valu goes from failed to passed (it runs, it does not skip).

Not tested

  • Windows (where none of these should skip), the rest of the suite.

AI use

  • Claude Code with Claude Fable 5.2 built both commits, ran the tests and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7130756438 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/983#issuecomment-7130756438). Originally posted by [shortside](https://github.com/shortside) on 2026-11-24T11:56:52Z. --- Test report from a second Mac, head `ab7ce43` against its merge base `9aec53d`. **Tested** - MacBook Pro M5 Pro, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), Windows 10 bottle, D3DMetal; DXC 1.9.2609. Cross-built for `x86_64-pc-windows-msvc` with clang-cl / lld-link 23.1.6 and an xwin SDK 10.0.26100, Rust 1.100.0, debug. The lib test binary run under Wine, one test per process (`--exact --nocapture`, 60 s cap). - Every lib test with `atomic` in its name (12 on base, 13 on head): base 9 passed, 3 failed (`gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2`, `gpu_more_atomics_sub_dword_scratch_valu`); head 10 passed, 3 passed with `SKIPPED … no 64-bit atomics` (`gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2`, and the new `gpu_global_atomic_add_inc_dec_x2`), 0 failed. - `gpu_more_atomics_sub_dword_scratch_valu` goes from failed to passed (it runs, it does not skip). **Not tested** - Windows (where none of these should skip), the rest of the suite. **AI use** - Claude Code with Claude Fable 5.2 built both commits, ran the tests and wrote this report.
DavidM1911 commented 2026-11-24 13:03:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T12:34:07Z.


Independent verification, merged onto current main 384f7f7 locally (clean merge).

Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.

  • cargo test -p xcl --lib atomic: 13 passed, 0 failed — the 64-bit atomic GPU tests still run and pass on this adapter (which does support them, so the new skip_test("no 64-bit atomics") guard is correctly not taken). The skip is gated on an actual probe, not assumed.

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

<!-- greyfinch-sync:ivall/xcl:comment:7131620890 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/983#issuecomment-7131620890). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T12:34:07Z. --- Independent verification, merged onto current `main` `384f7f7` locally (clean merge). **Machine:** Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug. - `cargo test -p xcl --lib atomic`: **13 passed, 0 failed** — the 64-bit atomic GPU tests still run and pass on this adapter (which does support them, so the new `skip_test("no 64-bit atomics")` guard is correctly not taken). The skip is gated on an actual probe, not assumed. AI use: test runs by Devin (Cognition, SWE-2); no code changes.
jesuarchive commented 2026-11-24 13:03:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jesuarchive on 2026-11-24T12:36:47Z.


Native Windows + NVIDIA check that the new skip does not fire where 64-bit atomics work. Head ab7ce43, merged locally onto main 47efa2e (clean merge, nothing pushed).

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.1088; AMD Ryzen 7 5800XT; Windows 11 Pro build 26300; rustc 1.95.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 from the Windows SDK; debug.
  • cargo test -p xcl --lib atomic -- --test-threads=1 --nocapture: 13 passed, 0 failed, 0 ignored. The InterlockedAdd64 probe did not report a failure and no test printed skipping or SKIPPED: gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2, gpu_atomic_fmin_fmax_negative_zero, gpu_more_atomics_sub_dword_scratch_valu, gpu_global_atomics_and_sub_dword_access and the new gpu_global_atomic_add_inc_dec_x2 all ran on the GPU and passed. Same filter on main 47efa2e: 12 passed (without the new test).
  • cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (main: 741 / 0 / 41).
  • SKIPPED on this adapter, the same two on main: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).

Not tested

  • A host where the skip should fire (no CrossOver / D3DMetal here); AMD and Intel GPUs; the head on its own base 9aec53d; release build.

AI use

  • Claude Code with Claude Opus 5.5: merged the branch, ran the commands above on this machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7131681656 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/983#issuecomment-7131681656). Originally posted by [jesuarchive](https://github.com/jesuarchive) on 2026-11-24T12:36:47Z. --- Native Windows + NVIDIA check that the new skip does not fire where 64-bit atomics work. Head `ab7ce43`, merged locally onto `main` `47efa2e` (clean merge, nothing pushed). **Tested** - NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.1088; AMD Ryzen 7 5800XT; Windows 11 Pro build 26300; rustc 1.95.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17 from the Windows SDK; debug. - `cargo test -p xcl --lib atomic -- --test-threads=1 --nocapture`: 13 passed, 0 failed, 0 ignored. The `InterlockedAdd64` probe did not report a failure and no test printed `skipping` or `SKIPPED`: `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2`, `gpu_atomic_fmin_fmax_negative_zero`, `gpu_more_atomics_sub_dword_scratch_valu`, `gpu_global_atomics_and_sub_dword_access` and the new `gpu_global_atomic_add_inc_dec_x2` all ran on the GPU and passed. Same filter on `main` `47efa2e`: 12 passed (without the new test). - `cargo test --workspace -- --test-threads=4`: 742 passed, 0 failed, 41 ignored (`main`: 741 / 0 / 41). - SKIPPED on this adapter, the same two on `main`: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). **Not tested** - A host where the skip should fire (no CrossOver / D3DMetal here); AMD and Intel GPUs; the head on its own base `9aec53d`; release build. **AI use** - Claude Code with Claude Opus 5.5: merged the branch, ran the commands above on this machine and wrote this report.
bjarngard commented 2026-11-24 14:06:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bjarngard on 2026-11-24T13:05:17Z.


Test report for head ab7ce43 (AMD, native wave64, and RTX 5080)

Tested

  • AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 725 passed, 0 failed, 41 ignored, no SKIPPED
  • With XCL_REQUIRE_GPU=wave64: gpu_global_atomic_add_inc_dec_x2, gpu_more_atomics_sub_dword_scratch_valu passed
  • RTX 5080 (Blackwell, wave32), driver 621.24: full suite 725 passed, 0 failed, 41 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
  • gpu_global_atomic_add_inc_dec_x2 and gpu_more_atomics_sub_dword_scratch_valu ran and passed on both adapters; the new no 64-bit atomics skip did not fire on either

Not tested: Intel.

AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.

<!-- greyfinch-sync:ivall/xcl:comment:7132330731 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/983#issuecomment-7132330731). Originally posted by [bjarngard](https://github.com/bjarngard) on 2026-11-24T13:05:17Z. --- Test report for head `ab7ce43` (AMD, native wave64, and RTX 5080) **Tested** - AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: 725 passed, 0 failed, 41 ignored, no SKIPPED - With `XCL_REQUIRE_GPU=wave64`: `gpu_global_atomic_add_inc_dec_x2`, `gpu_more_atomics_sub_dword_scratch_valu` passed - RTX 5080 (Blackwell, wave32), driver 621.24: full suite 725 passed, 0 failed, 41 ignored; SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` - `gpu_global_atomic_add_inc_dec_x2` and `gpu_more_atomics_sub_dword_scratch_valu` ran and passed on both adapters; the new `no 64-bit atomics` skip did not fire on either **Not tested:** Intel. **AI use:** the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
JoaoPauluu commented 2026-11-24 14:06:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T13:32:57Z.


A run on Linux with vkd3d-proton, NVIDIA: the probe fires here too, but for a different fault than D3DMetal's. And it skips two tests that pass on main on this stack.

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. ab7ce43 as it is (merge base 9aec53d) and main 47efa2e, no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact, 90 s cap).
  • ab7ce43, every lib test with atomic in its name: 13 passed, 0 failed. 3 of them SKIPPED no 64-bit atomics: gpu_atomic_fcmpswap_x2, gpu_atomic_fmin_fmax_x2, gpu_global_atomic_add_inc_dec_x2.
  • The probe printed InterlockedAdd64 probe: [0, 3, 0, 0]. So the add itself lands, carry included ([0, 3]), but the old value InterlockedAdd64 returns comes back as 0 ([0, 0] where [0xffffffff, 1] is expected). D3DMetal writes nothing at all.
  • The same tests on main 47efa2e:
test main this PR
gpu_atomic_fcmpswap_x2 ok SKIPPED
gpu_atomic_fmin_fmax_x2 ok SKIPPED
gpu_atomic_fmin_fmax_negative_zero ok ok
gpu_more_atomics_sub_dword_scratch_valu fails: kernel dispatch: GPU fence still pending after 10000 ms ok
gpu_global_atomic_add_inc_dec_x2 not on main SKIPPED
  • So on this stack the probe finds a real fault: a 64-bit atomic's returned value is lost. That would also explain the GPU hang main has had here in gpu_more_atomics_sub_dword_scratch_valu (the inc / dec x2 CAS loop never sees the old value), but I have not checked which instruction hangs.
  • But fcmpswap_x2 and fmin_fmax_x2 work on main here and are skipped with this PR, so on vkd3d-proton the skip also covers 64-bit atomics that work.

Not tested

  • whether the lost return value is in vkd3d-proton (dxil-spirv) or the NVIDIA driver; the other lib tests; native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built the commits, ran the tests and runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7132988697 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/983#issuecomment-7132988697). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T13:32:57Z. --- A run on Linux with vkd3d-proton, NVIDIA: the probe fires here too, but for a different fault than D3DMetal's. And it skips two tests that pass on `main` on this stack. **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`. `ab7ce43` as it is (merge base `9aec53d`) and `main` `47efa2e`, no uncommitted changes. The lib test binary runs under Wine, one test per process (`--exact`, 90 s cap). - `ab7ce43`, every lib test with `atomic` in its name: 13 passed, 0 failed. 3 of them SKIPPED `no 64-bit atomics`: `gpu_atomic_fcmpswap_x2`, `gpu_atomic_fmin_fmax_x2`, `gpu_global_atomic_add_inc_dec_x2`. - The probe printed `InterlockedAdd64 probe: [0, 3, 0, 0]`. So the add itself lands, carry included (`[0, 3]`), but the old value `InterlockedAdd64` returns comes back as 0 (`[0, 0]` where `[0xffffffff, 1]` is expected). D3DMetal writes nothing at all. - The same tests on `main` `47efa2e`: | test | `main` | this PR | |---|---|---| | `gpu_atomic_fcmpswap_x2` | ok | SKIPPED | | `gpu_atomic_fmin_fmax_x2` | ok | SKIPPED | | `gpu_atomic_fmin_fmax_negative_zero` | ok | ok | | `gpu_more_atomics_sub_dword_scratch_valu` | **fails**: `kernel dispatch: GPU fence still pending after 10000 ms` | ok | | `gpu_global_atomic_add_inc_dec_x2` | not on `main` | SKIPPED | - So on this stack the probe finds a real fault: a 64-bit atomic's returned value is lost. That would also explain the GPU hang `main` has had here in `gpu_more_atomics_sub_dword_scratch_valu` (the inc / dec x2 CAS loop never sees the old value), but I have not checked which instruction hangs. - But `fcmpswap_x2` and `fmin_fmax_x2` work on `main` here and are skipped with this PR, so on vkd3d-proton the skip also covers 64-bit atomics that work. **Not tested** - whether the lost return value is in vkd3d-proton (dxil-spirv) or the NVIDIA driver; the other lib tests; native Windows. **AI use** - Claude Code (Claude Opus 5.5) built the commits, ran the tests and runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
DavidM1911 commented 2026-11-26 04:07:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:32:11Z.


Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7181804422 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/983#issuecomment-7181804422). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:32:11Z. --- Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
github-actions[bot] commented 2026-11-30 08:42:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:42:09Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273236425 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/983#issuecomment-7273236425). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:42:09Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
vakaobr commented 2026-11-30 13:22:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-30T13:22:02Z.


Please keep this open: main has since reorganised the atomics test this PR splits. I'll check whether the skip is still needed on current main and rework it.

<!-- greyfinch-sync:ivall/xcl:comment:7279741770 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/983#issuecomment-7279741770). Originally posted by [vakaobr](https://github.com/vakaobr) on 2026-11-30T13:22:02Z. --- Please keep this open: `main` has since reorganised the atomics test this PR splits. I'll check whether the skip is still needed on current `main` and rework it.
vakaobr commented 2026-11-30 14:44:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-30T14:44:11Z.


Rebased on current main (518398a); the skip is still needed on D3DMetal and now also covers three tests added since. Description updated with the test runs.

<!-- greyfinch-sync:ivall/xcl:comment:7281848130 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/983#issuecomment-7281848130). Originally posted by [vakaobr](https://github.com/vakaobr) on 2026-11-30T14:44:11Z. --- Rebased on current `main` (`518398a`); the skip is still needed on D3DMetal and now also covers three tests added since. Description updated with the test runs.
Foniass commented 2026-12-01 04:35:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:35:42Z.


Triage (#1607) – head 518398a

No open or merged PR adds this skip: no_int64_atomics is not on main, and main's gpu_more_atomics_sub_dword_scratch_valu still contains the three *_X2 global atomics. Related but different: #1501 fixes the same D3DMetal behaviour in the runtime (it splits non-returning 64-bit atomics into 32-bit ones after a start-up probe runner::probe_int64_atomics). If both land, the two InterlockedAdd64 probes could be shared.
No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300893384 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/983#issuecomment-7300893384). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:35:42Z. --- **Triage (#1607)** – head 518398a No open or merged PR adds this skip: `no_int64_atomics` is not on main, and main's `gpu_more_atomics_sub_dword_scratch_valu` still contains the three `*_X2` global atomics. Related but different: #1501 fixes the same D3DMetal behaviour in the runtime (it splits non-returning 64-bit atomics into 32-bit ones after a start-up probe `runner::probe_int64_atomics`). If both land, the two `InterlockedAdd64` probes could be shared. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
grathepic commented 2026-12-03 00:37:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by grathepic on 2026-12-03T00:37:51Z.


merge-check

  • base: 078358a058
  • head: 518398a0e7
  • merge: clean (git diff --check exit 0)
  • build: cargo +1.98.1-x86_64-pc-windows-msvc build --offline --locked --workspace — exit 0 (36 pre-existing warnings in xcl lib)
  • tests:
    • Targeted 64-bit atomic verification under XCL_REQUIRE_GPU=mesh (cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked -p xcl --lib -- gpu_global_atomic_add_inc_dec_x2 gpu_more_atomics_sub_dword_scratch_valu gpu_atomic_fcmpswap_x2 gpu_atomic_fmin_fmax_x2 gpu_float_cas_uses_ieee_equality gpu_linked_memory_accessors gpu_heap_windows_64bit_atomics_match_switch_form --nocapture, with XCL_DXC_DIR=C:\VulkanSDK\1.4.363.0\Bin): 7 passed, 0 failed, 0 ignored (0.43s, 0 skips). Confirms no_int64_atomics() passes on Windows 11 + NVIDIA GeForce RTX 3080 and skips nothing.
    • Full workspace (cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked --workspace --no-fail-fast -- --test-threads=4, with XCL_DXC_DIR=C:\VulkanSDK\1.4.363.0\Bin): 3006 passed, 1 failed, 52 ignored across 44 harnesses; 27 SKIPPED (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 1 no dxil.dll, 1 cannot disable the driver cache (Windows Developer Mode required); 0 no 64-bit atomics skips). The single failure was the unrelated pre-existing late-release flake in tests\gpu_two_pass_cache_e2e.rs:584 (releasing the title PSOs releases their two-pass state, left: 1, right: 0), an external integration test binary that does not compile any of the three #[cfg(test)] modules modified by this PR.
  • title run: not required (Tier 0 test-only PR; modifies only #[cfg(test)] modules gpu/recomp/{tests,link_tests,heap_window_tests}.rs, zero production code or dependency changes)
  • review: Read full diff (+61/-20, 3 files). Confirmed all 3 modified files are #[cfg(test)] modules in crates/xcl/src/gpu/recomp/mod.rs:70-75. no_int64_atomics() runs once via OnceLock, probes returning InterlockedAdd64 carry (0x0000_0001_FFFF_FFFF + 0x0000_0001_0000_0001 -> 0x0000_0003_0000_0000 with old value [0xFFFF_FFFF, 1]), returns false on compile/run error so missing GPU/DXC is not misreported, and calls runner::skip_test("no 64-bit atomics") only on a mismatched result. Moving the three GLOBAL_ATOMIC_{ADD,INC,DEC}_X2 checks into gpu_global_atomic_add_inc_dec_x2 preserves all setup and assertions verbatim. No duplicates in #1607 (complements #1501).
  • performance: not applicable (test-only; OnceLock runs one 1-thread probe kernel once per test binary)
  • verdict: safe to merge
  • hardware / tool and model: NVIDIA GeForce RTX 3080 (driver 32.0.16.2140), AMD Ryzen 7 5800X3D, Windows 11 (10.0.26300.0), Rust 1.98.1-x86_64-pc-windows-msvc, DXC 1.9.0.5512 (VulkanSDK, no dxil.dll) / Antigravity, Gemini 4 Neon
<!-- greyfinch-sync:ivall/xcl:comment:7363409470 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/983#issuecomment-7363409470). Originally posted by [grathepic](https://github.com/grathepic) on 2026-12-03T00:37:51Z. --- merge-check - base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a - head: 518398a0e7463ea4133253e975e7a143f9e0f4f1 - merge: clean (`git diff --check` exit 0) - build: `cargo +1.98.1-x86_64-pc-windows-msvc build --offline --locked --workspace` — exit 0 (36 pre-existing warnings in `xcl` lib) - tests: - Targeted 64-bit atomic verification under `XCL_REQUIRE_GPU=mesh` (`cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked -p xcl --lib -- gpu_global_atomic_add_inc_dec_x2 gpu_more_atomics_sub_dword_scratch_valu gpu_atomic_fcmpswap_x2 gpu_atomic_fmin_fmax_x2 gpu_float_cas_uses_ieee_equality gpu_linked_memory_accessors gpu_heap_windows_64bit_atomics_match_switch_form --nocapture`, with `XCL_DXC_DIR=C:\VulkanSDK\1.4.363.0\Bin`): 7 passed, 0 failed, 0 ignored (0.43s, 0 skips). Confirms `no_int64_atomics()` passes on Windows 11 + NVIDIA GeForce RTX 3080 and skips nothing. - Full workspace (`cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked --workspace --no-fail-fast -- --test-threads=4`, with `XCL_DXC_DIR=C:\VulkanSDK\1.4.363.0\Bin`): 3006 passed, 1 failed, 52 ignored across 44 harnesses; 27 SKIPPED (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 1 no dxil.dll, 1 cannot disable the driver cache (Windows Developer Mode required); 0 `no 64-bit atomics` skips). The single failure was the unrelated pre-existing late-release flake in `tests\gpu_two_pass_cache_e2e.rs:584` (`releasing the title PSOs releases their two-pass state`, `left: 1, right: 0`), an external integration test binary that does not compile any of the three `#[cfg(test)]` modules modified by this PR. - title run: not required (Tier 0 test-only PR; modifies only `#[cfg(test)]` modules `gpu/recomp/{tests,link_tests,heap_window_tests}.rs`, zero production code or dependency changes) - review: Read full diff (`+61/-20`, 3 files). Confirmed all 3 modified files are `#[cfg(test)]` modules in `crates/xcl/src/gpu/recomp/mod.rs:70-75`. `no_int64_atomics()` runs once via `OnceLock`, probes returning `InterlockedAdd64` carry (`0x0000_0001_FFFF_FFFF + 0x0000_0001_0000_0001 -> 0x0000_0003_0000_0000` with old value `[0xFFFF_FFFF, 1]`), returns `false` on compile/run error so missing GPU/DXC is not misreported, and calls `runner::skip_test("no 64-bit atomics")` only on a mismatched result. Moving the three `GLOBAL_ATOMIC_{ADD,INC,DEC}_X2` checks into `gpu_global_atomic_add_inc_dec_x2` preserves all setup and assertions verbatim. No duplicates in #1607 (complements #1501). - performance: not applicable (test-only; `OnceLock` runs one 1-thread probe kernel once per test binary) - verdict: safe to merge - hardware / tool and model: NVIDIA GeForce RTX 3080 (driver 32.0.16.2140), AMD Ryzen 7 5800X3D, Windows 11 (10.0.26300.0), Rust 1.98.1-x86_64-pc-windows-msvc, DXC 1.9.0.5512 (VulkanSDK, no dxil.dll) / Antigravity, Gemini 4 Neon
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/983:upstream-pr/983'
git switch 'upstream-pr/983'

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/983'
git switch 'upstream-pr/983'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/983'
git switch 'upstream-pr/983'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/983'
git switch 'main'
git merge --squash 'upstream-pr/983'
git switch 'main'
git merge --ff-only 'upstream-pr/983'
git switch 'main'
git merge 'upstream-pr/983'
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
xcl-dev/xcl!977
No description provided.