dxil: support 64-bit typed image_atomic_* via SM 6.6 heap atomics #1948
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!1948
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1948/head"
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?
@raylitebull on GitHub · 2026-11-24 23:47 UTC · original
raylitebull:feat/image-atomic-64→main· +218 −3 · 3 files · 1 commits · merged 2026-11-25 18:13 UTCSupports 64-bit typed
image_atomic_*instructions in the direct RDNA2 -> DXIL translator using SM 6.6Int64Ops+AtomicInt64Typed+AtomicInt64Heapdescriptor-heap atomics (RWTexture*<U64|I64>), instead of silently loweringDMASK=0x3(or0xFforcmpswap/fcmpswap) 64-bit typed image atomics as 32-bitRWTexture*<uint>atomics.Part of #1269 and #1833.
What is in it
crates/xcl/src/gpu/dxil/lower_image.rs&lower_mem.rs: detect 64-bit typed image atomics viaDMASK(comps.len() == 4forcmpswap/fcmpswap,comps.len() == 2for all otheratomic_*variants) while keeping 32-bitcmpswap(DMASK=0x3) untouched; addmimg_atomic64,texel_cas64, and IEEE-754f64texel_fcas64(viapub(super) fn feq_bits64inlower_mem.rs, matching#2011), passing#1969's OOB-guardedrunpredicate intomimg_atomic64(self.guarded(run, ...)) and supporting all 16 ops (add,sub,smin,umin,smax,umax,and,or,xor,swap,cmpswap,fcmpswap,inc,dec,fmin,fmax) withCompType::I64/CompType::U64resources,heap_typed_atomic64(), andGLC2-VGPR writeback.crates/xcl/src/gpu/dxil/ops_tests.rs: adddirect_image_atomic_64bit_validatescompiling and validating all 16 64-bit variants withdxil.dll 1.8and verifying 32-bitIMAGE_ATOMIC_CMPSWAP(DMASK=0x3) remainsatomicCompareExchange.i32.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly ontoaaa0936(d88bf95).d88bf95was rebased cleanly ontoaaa0936(resolving theops_tests.rsEOF append conflict via pure git during a local test hold) and is queued for GitHub ActionsBuild and test+ fresh AMD / NVIDIA verification (gpu::dxil::ops_tests::direct_image_atomic_64bit_validates).1e4f2bd(onto62265d3) passedcargo check --workspace --tests,gpu::dxil::ops_tests(21/21on AMD RX 9070 XT),XCL_REQUIRE_GPU=mesh cargo test --workspace(977/0/43on NVIDIA RTX 5070 Ti,@futurepro62), and 60 sscripts/smoke.ps1(1622/1629frames on RTX 3060,@Anon64).d88bf95:@futurepro62: NVIDIA RTX 5070 Ti (1140 passed, 0 failed, 44 ignored) and AMD Radeon RDNA2 iGPU (1151 passed, 0 failed, 46 ignored),direct_image_atomic_64bit_validatespassed on both.@WebIdentity1(NVIDIA RTX 3090):gpu_image_fcas64_preserves_ieee_and_guardspassed (1/0/0, 3 dispatches).@JJAutoCompare:direct_image_atomic_64bit_validatespassed (1/0/0, 2 DXIL containers validated).@Toons29: AMD Radeon RX 9070 60 sscripts/smoke.ps1pair passed (1629vs1628frames,0device removals,0crashes).Regression run
60 s
scripts/smoke.ps1pair on exact headd88bf95vsmain1a0bbe3a(AMD Radeon RX 9070, driver 32.0.32029.2010, Windows 11 26300, release,XCL_NETWORK=0on a retail title), contributed by@Toons29:main:
this PR:
Not tested
cargo check/gpu::dxil::ops_testsandscripts/smoke.ps1on rebased headd88bf95, independent AMD GPU runtime verification of 64-bit typed image atomics (XCL_DIRECT_DXIL=1), wave32-only AMD adapters, and Linux/Wine/vkd3d-proton.AI use
@futurepro62 on GitHub · 2026-11-24 23:57 UTC · original · edited 2026-11-25 00:04 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
1e4f2bd(on its base62265d3).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests: 977 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.direct_image_atomic_64bit_validates.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 986 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main62265d3too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@Anon64 on GitHub · 2026-11-25 00:18 UTC · original
Regression run for this PR: head
1e4f2bd, based onmain62265d3. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
62265d3:this PR:
No device removals or crashes; 99 % of main's frames, 99 % of its peak commit.
Not tested: the whole suite; the direct DXIL path this PR changes (these runs use the default HLSL path,
XCL_DIRECT_DXILunset).Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@raylitebull on GitHub · 2026-11-25 00:20 UTC · original
@Anon64 Thank you for the RTX 3060 60 s regression pair on 1e4f2bd (1622/1629 frames, 0 removals/crashes) — absorbed into the PR description! Also thanks @futurepro62 for the RTX 5070 Ti full-suite pass (977/0/43). Independent AMD verification is still invited before merging.
@upipibi on GitHub · 2026-11-25 00:25 UTC · original
Ran the 64-bit typed image atomics on a GPU, which the description lists as untested: RTX 3070 (Ampere, driver 616.56, 32-lane waves), Windows 11, debug, at
1e4f2bd.The local test is a wave64 compute program through
runner::run_code_with, with 64 lanes per op on oneR32G32_UINTtexel (T# format 62, 2D,UNORM=1):XCL_DIRECT_DXIL=1image_atomic_addDMASK=0x30x1_FFFF_FFFF(carry between the halves)0x7F_FFFF_FFC00x7f_ffff_ffc0✓image_atomic_umaxDMASK=0x3l << 32 | (64 - l)0x3F_0000_00010x3f_0000_0001✓image_atomic_sminDMASK=0x3-((l << 32) | l)-(0x3F_0000_003F)0xffffffc0_ffffffc1✓image_atomic_cmpswapDMASK=0xFGLC(0x8000_0000 | l) << 32 | (l + 1)0x80000000_00000001✓So the heap
RWTexture2D<uint64_t>path works on NVIDIA. The batch run also matchesmain:dxil::/bvh::units (124 passed) and thegpu_tests withXCL_DIRECT_DXIL=0/1(110 passed each).The same program on the HLSL path (
XCL_DIRECT_DXIL=0) still runs them as 32-bit atomics: add0xffffffc0, umax0x40, and no cmpswap winner. That's the HLSL side of #1485, which #1533 and #1541 fix. Both passed this kind of test here earlier.AI-assisted (Claude Code). Synthetic tests only.
@raylitebull on GitHub · 2026-11-25 01:54 UTC · original
Rebased
#1948cleanly onto0e45b97in commit5dc9a0f:#2011(990b9d4) and#1969(5195e27) by exposingpub(super) fn feq_bits64incrates/xcl/src/gpu/dxil/lower_mem.rs, adding IEEE-754f64texel_fcas64for 64-bitimage_atomic_fcmpswap(DMASK = 0xF, matching#2011'stexel_fcas), and passing#1969's OOB-guardedrunpredicate intomimg_atomic64(self.guarded(run, ...)).5dc9a0ffor GitHub ActionsBuild and testand fresh AMD + NVIDIA verification.@raylitebull on GitHub · 2026-11-25 02:09 UTC · original
Rebased
#1948cleanly ontoaaa0936in commitd88bf95, resolving thecrates/xcl/src/gpu/dxil/ops_tests.rsEOF append conflict while preserving#2011(texel_fcas64+feq_bits64) and#1969(self.guarded(run, ...)).Pushed
d88bf95for GitHub ActionsBuild and testand fresh verification.@DavidM1911 on GitHub · 2026-11-25 02:50 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@JJAutoCompare on GitHub · 2026-11-25 03:16 UTC · original
PR #1948 CPU validation of typed image atomics
Tested
At
d88bf95a8260fe4ab0e6f53f3ecb8add576459f4, the checked-indirect_image_atomic_64bit_validatestest passed. The checkout was clean before and after the run.atomicBinOp.i64,atomicCompareExchange.i64, and signed/unsigned 64-bitRWTexture2DandRWTexture2DArrayannotations. The second container is theDMASK=0x332-bit compare-swap control, which emittedatomicCompareExchange.i32and noatomicCompareExchange.i64.SKIPPEDlines in the combined log. The validator skip path emitsSKIPPEDon the test thread. The one selected test exercised CPU translation, validation, and disassembly.26200.9974, Rust1.100.0(0ef1bc386,x86_64-pc-windows-msvc), Cargo1.100.0. XCL reported loadingdxcompiler.dll1.9.2609.5(01b62ad4) anddxil.dll1.9.2609.5fromXCL_DXC_DIR.Commands
The test command ran via
cmd.exe /d /cwith stdout and stderr redirected to cargo-test.log. The toolchain, environment, and exit code are in environment.log. The revision was fetched withgit fetch --no-tags origin refs/pull/1948/headand selected withgit switch --detach d88bf95a8260fe4ab0e6f53f3ecb8add576459f4in the assigned checkout.git rev-parse HEAD,git status --porcelain=v1, andgit ls-remote origin refs/pull/1948/headconfirmed the clean local revision and exact remote head.Live PR and deduplication
At the final check around
2026-11-25 03:14 UTC, PR #1948 was open, GitHub returnedmergeable=true, and the pull ref still matched the tested SHA. The PR description and 7 discussion entries showed no matching empirical report for this head and toolchain. The prior test reports name1e4f2bd, the author’sd88bf95comment announces a rebase, and the RTX 3060 Ti comment reports a merge conflict without a test run. Related work links to issue #1485 and HLSL PRs #1533 and #1541. The report was saved locally for the coordinator. PR #1948 discussionNot tested
GPU dispatch and readback, device support for 64-bit typed atomics, runtime arithmetic results, compatibility on specific GPU drivers, extra input variations, other Cargo tests, and retail-title smoke runs were outside this CPU-only run.
AI use
T3 Code / Codex (
gpt-6.2-sol) ran the checked-in test and wrote this report.@WebIdentity1 on GitHub · 2026-11-25 04:11 UTC · original · edited 2026-11-25 04:14 UTC
Verified the rebased 64-bit image floating compare-exchange path on
d88bf95a8260fe4ab0e6f53f3ecb8add576459f4, including its EXEC and null-descriptor guards. This complements the older Ampere integer-atomic report above. The attached synthetic regression passes on the PR and fails on its parentaaa093657bd96a146c05c0c1a9b61149fe761453; no new runtime defect found in these cases.Tested
32.0.15.9174), Rust/Cargo 1.98.1 MSVC, DXC/DXIL 1.8.2502.11, debug. The test prints the selected adapter. Direct kernel translation is called explicitly; wave64 runs as two wave32 halves, with no HLSL fallback.cargo test --locked -p xcl --lib -- gpu::recomp::tests::gpu_image_fcas64_preserves_ieee_and_guards --exact --test-threads=1 --nocaptureR32G32_UINTUAVs and independent texels per lane. Cases: both signs of zero, quiet/signaling NaN payloads, smallest positive subnormal vs zero, equal/different finite numbers, and negative infinity. Expected floating equality is computed with hostf64 ==; integer equality uses exact bits. Both GLC words are checked. Inactive lanes retain destination registers; null descriptors leave both textures unchanged and return zero to active GLC destinations.0x8000000000000000to 0. Its later cases do not run; the head checks all three.Not tested: contention/retry-loop bounds, coordinate-out-of-range accesses, AMD/native wave64/Intel, full workspace, newer-main integration, other wide atomics, performance/peak memory, retail shaders or title smoke. No merge-readiness claim.
AI use: Codex (GPT-6), source investigation, regression-test preparation, native Windows verification and this report. Test-only patch; no competing implementation.
Portable test-only patch on
d88bf95(also applies to its parent)@Toons29 on GitHub · 2026-11-25 13:04 UTC · original
Regression run of
d88bf95aon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.@futurepro62 on GitHub · 2026-11-25 16:47 UTC · original
Retest on the rebased head
d88bf95(onaaa0936), following up on my earlier report on1e4f2bd, since the description invites fresh AMD and NVIDIA runs. Full suite, same setup as before.Tested
XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4with the same main-failing--skips as the earlier report: 1140 passed, 0 failed, 44 ignored.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1151 passed, 0 failed, 46 ignored.gpu::dxil::ops_tests::direct_image_atomic_64bit_validatespassed on both.06c9f55on this machine fails the same skipped tests (NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form, sixlower_dxilGPU tests, fourfuzz_validate_and_gpuseeds; AMD:fuzz_validate_and_gpu_1), not because of this PR.Not tested
AI use
@raylitebull on GitHub · 2026-11-25 18:12 UTC · original
Thanks @Toons29 for the exact-head RX 9070 60 s
scripts/smoke.ps1pair ond88bf95(1629vs1628frames,0device removals,0crashes) — added to the PR description! Thanks also to @futurepro62 (RTX 5070 Ti + AMD Radeon RDNA2 iGPU full-suite retest), @WebIdentity1 (RTX 3090 fcas64 verification), and @JJAutoCompare for verifyingd88bf95.@DavidM1911 on GitHub · 2026-11-26 00:42 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin