Repository navigation
Conversation
|
Windows + GPU check: RTX 5080 + RTX 3070 Ti (NVIDIA 621.01) and AMD Radeon 610M iGPU (Ryzen 9 9950X3D, driver 32.0.13018.6), Windows 11, MSVC RelWithDebInfo/Ninja, CMake 4.4.5, glslang 16.6.0, spirv-tools v2026.4, llvm-mc via scripts/build_llvm_mc.ps1. Tested head 891b772 (base 4eb6155; PR currently conflicts with main).
Synthetic fixtures only, no game files. AI-assisted (opencode); runs on my machine. |
|
Tested 891b772 on an RX 9060 XT (RDNA4, GFX1200), RADV Mesa 27.0.0-devel, Nobara Linux (Fedora 44): pass This is the RADV run the description asks for. RADV reports
I didn't exercise the TYPELESS → R64 view path or a vertex/fragment-stage atomic, which the PR leaves out too. AI-assisted (Claude Code). |
891b772 to
620b1a5
Compare
|
Re-check after rebase. Windows + GPU check: NVIDIA GeForce RTX 5080 (driver 621.01) + AMD Radeon 610M iGPU (driver 32.0.13018.6), Windows 11, MSVC (VS BuildTools 18) + Ninja, RelWithDebInfo, Vulkan SDK headers fetched. Tested head The Build: clean, 214 targets. Targeted,
Python:
Full suite (
The PR's unstable CI state did not reproduce locally. Synthetic fixtures only, no game files. AI-assisted (opencode); runs on my machine. |
|
Tested 620b1a5 on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Tested |
|
Clash with #4312, found by merging open PRs that touch
Cause: #4312 (D3D-448) moves a D3D12 compute PSO's root arguments to start at s4. Every D3D12 test that reuses an Fix, for whichever of the two lands second (here once #4312 is in; or in #4312 if this one merges first): add_custom_command(
OUTPUT ${LEONIDA_ATOMIC64_FILES}
COMMAND ${CMAKE_COMMAND} -E env "LLVM_MC=${LEONIDA_LLVM_MC}" "LEONIDA_SPIRV_TOOLS=${LEONIDA_SPIRV_TOOLS_NATIVE}"
+ LEONIDA_USER_DATA_SHIFT=4
$<TARGET_FILE:Python3::Interpreter> -I ${CMAKE_CURRENT_SOURCE_DIR}/test/shaders/build.py
${LEONIDA_ATOMIC64_DIR} cs_imgatomic64With it, on AI-assisted (Claude Code). |
620b1a5 to
647ccef
Compare
|
@ddm-j Thanks for bisecting the #4312 clash. #4312 isn't on AI-assisted. |
|
Tested 647ccef on Intel UHD 770, driver 32.0.101.7088, Windows 11, MSVC: d3d12_imgatomic64_test builds and exits 77 (skip), with and without the Khronos validation layer (0 validation lines), printing "unsupported: D3D12 OPTIONS9 has no typed 64-bit atomics". The 64/64 texel readback therefore did not run on this GPU. The ctest entry, the translator tests and the GPU suite were not run. AI-assisted. |
|
Tested 647ccef on Intel UHD 630 (Coffee Lake GT2), Mesa 25.2.8 ANV, Ubuntu 24.04: the device reports VK_EXT_shader_image_atomic_int64 (revision 1) with shaderImageInt64Atomics = true and sparseImageInt64Atomics = false, so it can run the image Int64 atomic path (the Intel UHD 770 on Windows reports no typed 64-bit atomics and skips d3d12_imgatomic64_test). test_image_atomic64 and test_image_atomics_32 pass (6 tests) and the full build succeeds. run_gpu_tests.py --filter cs_imgatomic64 translates and passes spirv-val but skips with "the typed image atomic test uses the Windows D3D12 layer", and the control with a nonexistent device name skips identically, so d3d12_imgatomic64_test's 64/64 readback was not run here and has no Linux target. AI-assisted. |
|
Native RTX 4080 validation of
Synthetic fixtures only. AI-assisted. |
kacper-serewis
left a comment
There was a problem hiding this comment.
Native Windows RTX 5070, NVIDIA 616.56, at 647ccef: the D3D12 synthetic 2D and array UAV dispatches returned all 64 expected 64-bit texels. Changing a single expected high word while preserving its low word gave exactly one mismatch; restoring it returned 64/64. Vulkan advertised shaderImageInt64Atomics and atomic storage-image support for R64_UINT and R64_SINT, OPTIONS9 passed, and the emitted feature metadata and Vulkan validation agreed. All three translator tests passed. LLVM 21 under WSL assembled the fixture. AI-assisted independent review.
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
Claimed in the coordination issue as: D3D-251 (claim). Found by @KoertLichtendonk:
docs/d3d12_vulkan.md§8.2 question 10 lists 685 shaders declaringATOMIC_INT64_ON_TYPED_RESOURCEin SFI0 (finding).What and why
Implements 64-bit atomics on typed image UAVs across the runtime and the translator.
Runtime (
runtime/shims/d3d12_com.h,runtime/shims/d3d12_vulkan_device.cpp,runtime/src/shader_library.h,runtime/src/vulkan_bindless.h):VK_EXT_shader_image_atomic_int64, theshaderImageInt64Atomicsfeature, andSTORAGE_IMAGE_BIT | STORAGE_IMAGE_ATOMIC_BITfor bothVK_FORMAT_R64_UINTandVK_FORMAT_R64_SINT; enables the feature and advertises it in shader metadata.D3D12_OPTIONS9.AtomicInt64OnTypedResourceSupportedandAtomicInt64OnGroupSharedSupportedare now answered from the device instead of a hard-coded FALSE. For graphics PSOs that use 64-bit image atomics, the corresponding vertex/fragment atomic feature is also checked.DXGI_FORMAT_R32G32_UINTtyped UAV, creates two storage-only R64 views of the same image:R64ui/R64iat set 0 bindings 26/27 (2D) and 28/29 (2D array). Signed min/max use the signed view; add, sub, bitwise ops, unsigned min/max, exchange and compare-exchange use the unsigned view. The defaultR32G32_UINTview keeps the copy and ordinary load/store path; the R64 views share the image and are released with the bindless slot.Translator (
tools/rdna2spirv.py): adds 64-bit forms ofimage_atomic_add,sub,smin,smax,umin,umax,and,or,xorandcmpswap. DMASK0x3selects the 64-bit width (0xfforcmpswap); the operand is a low/high VGPR pair, followed by the comparand pair for compare-exchange; withglcthe old texel replaces only the first pair; lanes disabled by EXEC are skipped. Emission declaresInt64ImageEXTandInt64Atomicsand uses a typedOpImageTexelPointerplusOpAtomic*.inc/decand the A16, D16, TFE and LWE forms are explicitly rejected. The new rule and how it was confirmed are recorded in the contract table ofdocs/design.md("64-bit typed image atomics (D3D-251)").Behaviour change
The old translator emitted the 64-bit
image_atomic_cmpswapform as a 32-bit compare-exchange (a side-by-side run of the old and new translator on the same instruction shows it). It is now translated at 64 bits, and the forms this change does not cover (for example a compare-exchange whosedmaskselects one dword) are refused with an error instead of being translated silently.Scope
Only measured on NVIDIA; no RADV run yet. The TYPELESS → R64 view path is spec-legal but not exercised on a GPU here.
Out of scope: a corpus count of which instructions and formats the game shaders use — that needs a game copy, which is not available here, so that part of §8.2 question 10 stays open. Also out of scope: 1D/3D images, typed buffers, sparse and MSAA UAVs, and the rejected
inc/dec, A16, D16, TFE and LWE forms. The new GPU fixture exercises the compute stage only; no new vertex/fragment atomic fixture was added (existing wave64 shader coverage comes from the current suite). No game files, keys or decryption are involved; the fixture is built by hand in this repo.Rebase note
Rebased onto current
main(3faac557); the resulting head is647ccefa. Conflict resolutions kept both sides' intent. Inruntime/shims/d3d12_vulkan_device.cpp, upstream'sregister_literal_samplersguard and this PR'simage_int64_atomicsfeature check now sit side by side. Intools/rdna2spirv.py, upstream's routing of the remaining 32-bitimage_atomic_*ops toimage_miscwas reconciled with this PR's dmask-based dispatch (full mask →image_atomic64, narrow mask →image_misc), keeping upstream'sIMG_ATOMICS_EXTRAops and its newfcmpswapin the narrow-mask compare group. One stale expectation in upstream'stests/semantic/test_image_atomics_32.pywas removed: it listedimage_atomic_swap dmask:0x3("64-bit swap") as rejected, but this PR supports that form throughimage_atomic64→OpAtomicExchange(pinned positively by this PR's owntest_image_atomic64); the other rejected forms, including 64-bitinc, remain.Overlap with other open PRs
cs_imgatomic64needsLEONIDA_USER_DATA_SHIFT=4; whichever lands second adds it.Tested
Tested on: Windows 11 / MSVC / NVIDIA GeForce RTX 5070 Ti / NVIDIA driver (Vulkan SDK 1.4.363.0), Ninja RelWithDebInfo,
-j 4.python -m unittest discover -s tests/semantic -p 'test_image_atomic*.py' -v— 6/6 OK (three newtest_image_atomic64tests and threetest_image_atomics_32tests).647ccefa) versus 6,245 on cleanmain(3faac557); both report the same five pre-existing failures/errors (three failures and two errors, plus one skip and one expected failure) intest_loop_ballot_barrier. The three extra tests are this PR's newtest_image_atomic64cases and all pass; no new failure is introduced.python -m compileall -q make_game.py tools tests: clean.ctestwithLEONIDA_VK_VALIDATION=1: 100% passed, 178/178 run (8 skipped game-data/shader-corpus tests and 1 disabled), 0 failed, 0 VUID. The four required tests —d3d12_imgatomic64,d3d12_compute,d3d12_vulkan_deviceandvk_pipeline_check_cli— all pass, as do the known flaky tests (d3d12_draw,d3d12_fence_timing,run_tiny_game_dir,winhttp_offline) on this run.d3d12_imgatomic64_test, validation enabled): 64/64 texels exact, 0 VUID. It covers 32 lanes adding to one texel, carry/borrow across the word boundary, signed and unsigned min/max, bitwise ops, exchange and compare-exchange hit/miss, theglcreturn pair,glcoff, 2D-array layer range and the EXEC mask.python -I scripts/run_gpu_tests.py --filter cs_imgatomic64— 1/1 passed, 1 shader translated andspirv-valclean.AI-assisted.
Checklist
docs/design.md, with how it was confirmed (semantic fixture,spirv-valand the D3D12 GPU test on RTX 5070 Ti).