Tests: GPU tests of 64-bit atomics skip where those atomics write nothing #983
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!983
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-983"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@vakaobr on GitHub · 2026-11-24 09:52 UTC · original
vakaobr:tests/int64-atomics-skip→main· +58 −17 · 1 files · 1 commits · openOn 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/InterlockedMax64on device memory. The adapter still reportsInt64ShaderOps,AtomicInt64OnTypedResourceSupported,AtomicInt64OnGroupSharedSupportedandAtomicInt64OnDescriptorHeapResourceSupportedas 1, so a one-thread kernel checks it instead: a returningInterlockedAdd64must 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). It skips withno 64-bit atomicsonly when the probe kernel ran and its results are wrong.gpu_atomic_fcmpswap_x2andgpu_atomic_fmin_fmax_x2return through it.GLOBAL_ATOMIC_{ADD,INC,DEC}_X2instructions and their asserts move unchanged fromgpu_more_atomics_sub_dword_scratch_valuinto a newgpu_global_atomic_add_inc_dec_x2, gated the same way, so the rest of the old test runs on such a host.Tested
gpu::recomp::tests::gpu_*atomic*test in its own process (<lib test exe> --exact <test> --test-threads=1 --nocapture).main6bac4b4: 4 passed, 3 failed (gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2,gpu_more_atomics_sub_dword_scratch_valu: "global_atomic_inc wraps at 10", 0 where 9 is expected).ab7ce43(onmain9aec53d): 8 passed, 0 failed, of which 3 areSKIPPED …: no 64-bit atomics(gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2,gpu_global_atomic_add_inc_dec_x2).gpu_more_atomics_sub_dword_scratch_valunow passes.membinding: a 32-bitStore, a 32-bitInterlockedAdd, 64-bit arithmetic withStore2andStore<uint64_t>all land. Add64, And64, Or64, Xor64, Exchange64, CompareExchange64, CompareStore64, signed Min64 / Max64 and returning unsigned Min64 / Max64 each leave the whole program's writes out, and so does any 64-bit atomic on groupshared. The translated*_X2atomics behave the same in their buffer, flat and global forms, except UMIN / UMAX with GLC=0.Interlocked*64memory-window accessors that a program never calls do not affect it.x86_64-pc-windows-gnullvm, release), base9aec53dand this head: the same three failures on the base; at this head the two gated tests skip andgpu_more_atomics_sub_dword_scratch_valupasses (@mikebuckets171, https://github.com/ivall/xcl/pull/983#issuecomment-7129605266).Regression run
Test-only change: no runtime file changed, no
xcl-smokeblocks.Not tested
cargo test --workspaceas a whole.XCL_REQUIRE_GPU=wave64/meshturns this skip into a failure, becauserunner::skip_testis unchanged.gpu_atomic_fcmpswap_x2andgpu_atomic_fmin_fmax_x2onno_doubles(), so the two PRs touch the sameiflines. Those two tests use no doubles (see https://github.com/ivall/xcl/pull/787#issuecomment-7127510124).AI use
On Apple's D3DMetal 3.0 (macOS, CrossOver) a compute program with a 64-bit atomic writes nothing at all: not the atomic, not its other stores, not even stores issued before it. Only non-returning unsigned InterlockedMin64 / InterlockedMax64 on device memory work. The adapter still reports Int64ShaderOps and every AtomicInt64On*Supported cap, so no_int64_atomics() runs one small kernel instead: a returning InterlockedAdd64 must carry into the high dword and give back the old value. It skips only when that kernel ran and its results are wrong. gpu_atomic_fcmpswap_x2 and gpu_atomic_fmin_fmax_x2 return through it. The three GLOBAL_ATOMIC_{ADD,INC,DEC}_X2 instructions and their asserts move unchanged from gpu_more_atomics_sub_dword_scratch_valu into gpu_global_atomic_add_inc_dec_x2, gated the same way, so the rest of the old test runs on such a host. (#258) Assisted-by: Claude Code (Claude Opus 5.5)@mikebuckets171 on GitHub · 2026-11-24 11:03 UTC · original
Verified on a second Apple silicon host, on the
gnullvmtarget: 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-gnullvmwith 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 is9aec53d, headab7ce43; the lib test binary reports 704 tests on the base and 705 at the head.9aec53dab7ce43gpu::recomp::tests::gpu_atomic_fcmpswap_x2tests.rs:4737:assertion left == right failed: lane 0: buffer cell,left: 4609434218613702656SKIPPED …gpu_atomic_fcmpswap_x2: no 64-bit atomics->ok. 1 passed; 0 failedgpu::recomp::tests::gpu_atomic_fmin_fmax_x2tests.rs:4868:assertion left == right failed: buffer: max of the lanes,left: -infSKIPPED …gpu_atomic_fmin_fmax_x2: no 64-bit atomics->ok. 1 passed; 0 failedgpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valutests.rs:4632:assertion left == right failed: global_atomic_inc wraps at 10,left: 0ok. 1 passed; 0 failedin 0.62 sThe 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_inccame 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: 4609434218613702656on 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: -infon 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 checksdescription job, which is main's ownpull_request_targetworkflow, so theCIjob 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 on GitHub · 2026-11-24 11:56 UTC · original
Test report from a second Mac, head
ab7ce43against its merge base9aec53d.Tested
x86_64-pc-windows-msvcwith 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).atomicin 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 withSKIPPED … no 64-bit atomics(gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2, and the newgpu_global_atomic_add_inc_dec_x2), 0 failed.gpu_more_atomics_sub_dword_scratch_valugoes from failed to passed (it runs, it does not skip).Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 12:34 UTC · original
Independent verification, merged onto current
main384f7f7locally (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 newskip_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 on GitHub · 2026-11-24 12:36 UTC · original
Native Windows + NVIDIA check that the new skip does not fire where 64-bit atomics work. Head
ab7ce43, merged locally ontomain47efa2e(clean merge, nothing pushed).Tested
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. TheInterlockedAdd64probe did not report a failure and no test printedskippingorSKIPPED: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_accessand the newgpu_global_atomic_add_inc_dec_x2all ran on the GPU and passed. Same filter onmain47efa2e: 12 passed (without the new test).cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (main: 741 / 0 / 41).main:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).Not tested
9aec53d; release build.AI use
@bjarngard on GitHub · 2026-11-24 13:05 UTC · original
Test report for head
ab7ce43(AMD, native wave64, and RTX 5080)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 725 passed, 0 failed, 41 ignored, no SKIPPEDXCL_REQUIRE_GPU=wave64:gpu_global_atomic_add_inc_dec_x2,gpu_more_atomics_sub_dword_scratch_valupassedgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwaregpu_global_atomic_add_inc_dec_x2andgpu_more_atomics_sub_dword_scratch_valuran and passed on both adapters; the newno 64-bit atomicsskip did not fire on eitherNot 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 on GitHub · 2026-11-24 13:32 UTC · original
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
mainon this stack.Tested
x86_64-pc-windows-gnu.ab7ce43as it is (merge base9aec53d) andmain47efa2e, no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact, 90 s cap).ab7ce43, every lib test withatomicin its name: 13 passed, 0 failed. 3 of them SKIPPEDno 64-bit atomics:gpu_atomic_fcmpswap_x2,gpu_atomic_fmin_fmax_x2,gpu_global_atomic_add_inc_dec_x2.InterlockedAdd64 probe: [0, 3, 0, 0]. So the add itself lands, carry included ([0, 3]), but the old valueInterlockedAdd64returns comes back as 0 ([0, 0]where[0xffffffff, 1]is expected). D3DMetal writes nothing at all.main47efa2e:maingpu_atomic_fcmpswap_x2gpu_atomic_fmin_fmax_x2gpu_atomic_fmin_fmax_negative_zerogpu_more_atomics_sub_dword_scratch_valukernel dispatch: GPU fence still pending after 10000 msgpu_global_atomic_add_inc_dec_x2mainmainhas had here ingpu_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.fcmpswap_x2andfmin_fmax_x2work onmainhere and are skipped with this PR, so on vkd3d-proton the skip also covers 64-bit atomics that work.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-26 03:32 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.