Tests: verify 64-bit typed IMAGE_ATOMIC_* direct DXIL ops on the GPU #2478
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2488"
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?
Imported from ivall/xcl. Originally posted by microwave805 on 2026-11-25T20:09:12Z.
Part of #1269
PR #1948 added SM 6.6 64-bit typed
IMAGE_ATOMIC_*lowering ingpu/dxil/lower_image.rs(mimg_atomic64,texel_cas64,texel_fcas64), which was previously checked only by DXIL validation (ops_tests::direct_image_atomic_64bit_validates) without executing on a GPU.What is in it
crates/xcl/tests/gpu_image_atomic64_e2e.rswith three end-to-end GPU tests running all 16 64-bit typedMIMGatomic ops onDXGI_FORMAT_R32G32_UINTTexture2DandTexture2DArrayUAVs in both wave32 and wave64 (native or split) kernels:gpu_image_atomic64_integer_and_bitwise_ops_on_d2_and_d2array: contended 64-bitADD,SUB,AND,OR,XOR,UMIN,UMAX,SMIN,SMAX, andSWAPacross 32-bit carry/borrow boundaries and signed vs unsigned ordering, checkingGLC=1returned old-value histories,GLC=0non-clobbering, andEXEC=0inactive-lane preservation.gpu_image_atomic64_inc_dec_and_fmin_fmax_cas_loops: 64-bit CAS-loopINC,DEC(64-bit carry/borrow crossing the 32-bit boundary and threshold wraparound, checking returned old values), andFMIN/FMAX(f64values beyondf32range plusNaN).gpu_image_atomic64_cmpswap_fcmpswap_and_32bit_control: 64-bitCMPSWAPvsFCMPSWAP(DMASK=0xF) across IEEE-754 edge cases (-0.0 == +0.0,qNaN,sNaN, subnormal,-inf, high-32-bit mismatch), plus a 32-bitIMAGE_ATOMIC_CMPSWAP(DMASK=0x3) regression control.D3D12_OPTIONS9::AtomicInt64OnTypedResourceSupportedandD3D12_OPTIONS11::AtomicInt64OnDescriptorHeapResourceSupported, callingrunner::skip_testcleanly when unsupported.Tested
32.0.16.1742, wave32 + SM 6.6 + 64-bit typed/heap integer atomics, no native wave64), DXC1.9.2602.17(Windows SDK10.0.26100.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), debug profile, tested on commitffede12270d9.cargo test -p xcl --test gpu_image_atomic64_e2e -- --nocapture: 3 passed, 0 failed, 0 ignored..\scripts\test.ps1(withXCL_DXIL_CACHE=%TEMP%\xcl-test-dxil-cache): 1420 passed, 0 failed, 46 ignored (26SKIPPEDlines on this adapter: 21no wave64, 3 per-lane wave32 unsupported-op skips, 1no heap windows, 1cannot disable the driver cache (Windows Developer Mode is required)).Regression run
Not needed: test-only change under
crates/xcl/tests/(no runtime files modified).Not tested
OPTIONS9/OPTIONS1164-bit typed heap atomics.XCL_SAMPLE_*game-data tests (no unpacked Xbox Series game files available).AI use
Gemini 4 Neon).crates/xcl/tests/gpu_image_atomic64_e2e.rs, updatedINC_INITper review feedback, ran the targeted and full workspace test suites on commitffede12270d9, and updated this PR description.Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T20:41:49Z.
Update for head
ffede12: same result. Applied onmain8b957be,cargo test -p xcl --test gpu_image_atomic64_e2e -- --nocapture: 3 passed, 0 failed, no SKIPPED on both the RX 9070 XT (XCL_SPLIT_WAVE64unset) and the RTX 3060.Native wave64 run (listed as untested), plus an RTX 3060: all 3 new tests pass on both cards, with no skips.
Diff applied on
main6d12f58, debug, Windows 11 Pro 26200, card chosen withXCL_ADAPTER:cargo test -p xcl --test gpu_image_atomic64_e2e -- --nocapture: 3 passed, 0 failed, with noSKIPPEDline, so both cards report theOPTIONS9/OPTIONS1164-bit typed heap atomics. That holds on the RX 9070 XT (RDNA4, driver 32.0.32029.2010;XCL_SPLIT_WAVE64unset, sosupported_modes()takes the nativesplit = falsewave64 mode there) and on the RTX 3060 (driver 32.0.16.1088).cargo test -p xcl --lib -- gpu::: RTX 3060 700 passed, 0 failed; RX 9070 XT 698 passed, 2 failed. The 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain.Not tested:
XCL_SAMPLE_*game-data tests (no game files).AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T20:23:08Z.
Focused AMD verification of exact PR head
2e5d510baa78c8ab969e36beb6905f0614a9dbefin a clean detached worktree.Tested
30.0.13002.13003; Windows 11 build 26200; Rust1.99.0(stable-x86_64-pc-windows-msvc); DXC/DXIL1.8.2502.11.XCL_ADAPTER=6800M cargo test --locked -p xcl --test gpu_image_atomic64_e2e -- --test-threads=1 --show-output: 3 passed, 0 failed, 0 ignored, 0 skipped. The log confirmed XCL selected the real RX 6800M D3D12 backend. All three tests executed, including integer/bitwise operations, increment/decrement and min/max/CAS loops, and compare-swap/float compare-swap.Not tested
AI use
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T20:36:08Z.
Independent AMD RDNA4 (native wave64) test report on exact head
2e5d510baa78c8ab969e36beb6905f0614a9dbef(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1418 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record).tests/gpu_image_atomic64_e2e.rsran and passed on AMD RDNA4 with zero skips.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T20:37:10Z.
gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, and the promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Notegpu_depth_buffer_created_for_unordered_access_is_placedis green on main now, #2466 did its job on this lane.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:53:02Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-25T21:30:28Z.
Test report from Linux + Wine on AMD RADV. As far as I can see these tests have only been run on native Windows drivers so far; this is the Wine lane, where the DXIL goes through vkd3d-proton and dxil-spirv before the AMD Vulkan driver. Prepared with AI assistance (DeepSeek V4.1 Flash in OpenCode ran the commands and wrote this); no code was written or changed.
Setup
RADV GFX1201), AMD Radeon RX 9070 XT 16 GB (RDNA4, native wave64), Ryzen 9 9900X.WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b",VKD3D_CONFIG=ignore_shared_fence,WINEDEBUG=-all, DXC 1.9.2609.5.2e5d510on basemain6d12f58(clean checkout, no changes to tracked files; the diff only addscrates/xcl/tests/gpu_image_atomic64_e2e.rs, so there is no runtime tree to compare).RUSTFLAGS="-C target-feature=+crt-static" cargo xwin test -p xcl --release --locked --target x86_64-pc-windows-msvc --test gpu_image_atomic64_e2e --no-run; run under Wine with--test-threads=1 --nocapture.Result — two runs, identical:
There is no
SKIPPEDline: on this device vkd3d-proton answersD3D12_OPTIONS9/OPTIONS11with 64-bit typed heap atomics, so the tests take the real path and all 16IMAGE_ATOMIC_*forms compare equal.As a check that the GPU really executed them, a run with
VKD3D_SHADER_DUMP_PATHset wrote 6 SPIR-V modules that holdOpImageTexelPointer %_ptr_Image_ulongand 64-bitOpAtomic*instructions, from the compute shaders XCL emitted (the run logsxcl: [SHADER] cs ... format dxil). So these ops survive dxil-spirv and RADV unchanged.Not tested
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T20:45:17Z.
Source review of head
2e5d510b, no run. Ingpu_image_atomic64_inc_dec_and_fmin_fmax_cas_loops, the non-wrapping INC case asserts "INC 64-bit carry", butINC_INIT0x0000_0001_FFFF_FFF8 plus 5 increments ends at 0x0000_0001_FFFF_FFFD. The low dword never wraps, so a lowering that dropped the carry into the high dword would still pass. The DEC case does cross (0x2_0000_0004 - 5 = 0x1_FFFF_FFFF). Starting INC at 0x0000_0001_FFFF_FFFC (still belowINC_LIM) would end at 0x0000_0002_0000_0001 and test the carry.texel_cas64uses a 64-bit add today, so this is about test coverage, not a current bug.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by microwave805 on 2026-11-26T23:37:02Z.
@upipibi Good catch — updated
INC_INITto0x0000_0001_FFFF_FFFCso the 5 increments now cross the 32-bit boundary to0x0000_0002_0000_0001, and also asserted the sortedGLC=1old values across the carry (ffede12270d9). Re-rancargo test -p xcl --test gpu_image_atomic64_e2e(3 passed, 0 failed) and full.\scripts\test.ps1(1420 passed, 0 failed, 46 ignored, 26SKIPPEDon RTX 3070) and updated Tested in the description.(AI use: Antigravity (
Gemini 4 Neon) applied the edit, ran the tests, and drafted this comment.)Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T23:54:45Z.
@microwave805 thanks. Checked at
ffede122by reading:INC_INIT0x0000_0001_FFFF_FFFC plus 5 ends at 0x0000_0002_0000_0001 (gpu_image_atomic64_e2e.rs:335, :377), so the low dword now wraps and the carry into the high dword is tested. The GLC=1 old values across the carry are asserted at :380, andINC_LIM(:336) stays above the end value, so the wrap-to-zero path isn't hit. My review point is resolved. I didn't re-run it, since your 3070 run covers the same card.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:17:34Z.
Tested: Clean
ffede12270d9d5ce31bac0bda8fac26246bbb95e, Windows 11 build 26200, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC, debug.cargo test --locked -j 2 -p xcl --lib --test gpu_image_atomic64_e2e --no-run; ran the integration test executable withXCL_ADAPTER=A770 --test-threads=1 --nocapture(where the adapter was set in the environment). All three tests emittedSKIPPED … no 64-bit typed heap atomics. Libtest counts were 3 passed, 0 failed, 0 ignored, with 3 capability skips and zero GPU shader-execution passes.Not tested: Typed image atomic execution and the 32-bit control inside the skipped test, full suite or retail smoke.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and reran the checks and wrote this report.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:10:32Z.
Triage (#1607) – head
ffede12Main checks only that 64-bit image atomics validate (
direct_image_atomic_64bit_validatesin ops_tests.rs, from #1948). This PR runs all 16 of them on the GPU. #1712 covers the 32-bit ops, and #1533/#1541/#1551 change the implementation rather than test it, so none of them is the same change. 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.