Skip to content

Runtime + translator: 64-bit typed image atomics (D3D-251) - #2033

Open
requiemsnkrp wants to merge 7 commits into
ItsNotRexed:mainfrom
requiemsnkrp:d3d-251-int64-atomics
Open

requiemsnkrp wants to merge 7 commits into
ItsNotRexed:mainfrom
requiemsnkrp:d3d-251-int64-atomics

Conversation

@requiemsnkrp

@requiemsnkrp requiemsnkrp commented Nov 22, 2026 •

Copy link
Copy Markdown

What and why

D3D-251, layer and translator half (claim). The layer answered D3D12_OPTIONS9.AtomicInt64OnTypedResourceSupported = FALSE on every GPU and the translator's image atomics were 32-bit only. The corpus count (which instructions and formats the 685 ATOMIC_INT64_ON_TYPED_RESOURCE shaders use) is not part of this PR: it needs the game's shaders, and it stays open in §8.2 question 10.

  • Device: enables VK_EXT_shader_image_atomic_int64 (shaderImageInt64Atomics) when present; recorded in VulkanDeviceInfo; the test device helper can enable it.
  • Bindless set: new bindings 26 (2D) and 27 (3D), R64ui storage arrays sized like the r32ui bindings 4/7, appended after the MS bindings so no number moves, present only when the feature is on (their fallbacks need it). They count against the storage limits (bindless_sizing_test covers it).
  • Layer: R32G32_UINT/SINT/TYPELESS UAV textures (2D, 3D) are created mutable with R64_UINT in the format list (and in the castable list when one is given); an R32G32 UINT/SINT UAV gets an extra R64 storage view in binding 26/27. Also fixes an existing bug where, with a castable list, the image create info could chain the format list to itself.
  • OPTIONS9: AtomicInt64OnTypedResourceSupported stays FALSE (review): D3D12 covers typed/raw/structured buffers and 3D textures by it and the layer exposes no buffer or 3D texture UAV yet. Group-shared and OPTIONS11.AtomicInt64OnDescriptorHeapResourceSupported stay FALSE too (no 64-bit LDS / raw-buffer atomics in the translator). No UAV atomic bit in FORMAT_SUPPORT for R32G32, as on the host.
  • Translator (gfx1013): a MIMG atomic is 64-bit when DMASK is 0x3 (0xf for image_atomic_cmpswap), the only masks llvm-mc 21.1.8 accepts for the 64-bit register counts (reference: LLVM SIISelLowering::lowerImage). Supported 64-bit, 2D and 3D: add, sub, smin, smax, umin, umax, and, or, xor, swap, cmpswap; VGPR pair low dword first, glc returns the old value. Emits Int64ImageEXT, Int64Atomics, SPV_EXT_shader_image_int64; the index lists shaderImageInt64Atomics. Not done: inc/dec, 2D arrays. Contract row added in docs/design.md.

Host probe (RTX 3060, NVIDIA 32.0.16.1714, with and without the debug layer)

SM 6.8; OPTIONS1.Int64ShaderOps 1; OPTIONS9.AtomicInt64OnTypedResource 1, AtomicInt64OnGroupShared 1; OPTIONS11.AtomicInt64OnDescriptorHeapResource 1; FORMAT_SUPPORT Support2 R32G32_UINT 0x3c0, R32G32_SINT 0x2c0 (no UAV atomic bit); R32G32_UINT/SINT/TYPELESS UAV textures 2D and 3D create with S_OK, their UAVs without debug-layer messages.

Tested (RTX 3060, driver 32.0.16.1714, Windows 11, MSVC 19.51, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8)

  • GPU test cs_imgatomic64.asm (hand-written RDNA2) through vk_store_test words64 with LEONIDA_VK_VALIDATION=1, judged by check.py: pass, 0 validation errors. 17 cases on an 8x8 image (carries/borrows across the halves, min/max and compare cases a per-half version gets wrong, no-glc, 63 lanes off, 64 threads adding to one texel) and 6 on a 4x4x4 volume. Full check.py: 123/158 pass, 35 skipped, 0 fail.
  • d3d12_image_atomic64_test (new) with validation: OPTIONS9 FALSE without the extension and TRUE with it; 64-bit add, max, compare-exchange, exchange through binding 26 on UINT, SINT, TYPELESS and castable UINT 2D textures: 16/16 texels and returned values exact, 0 validation errors.
  • bindless_sizing_test: pass with the 26/27 cases. Semantic suite: 1653 tests OK (2 skipped); new tests/semantic/test_image_atomics_64.py (9 tests) fails if the dword order is swapped. tests/test_shader_checks.py, compileall, regen_fixtures --check: clean.
  • Full ctest without the window tests: 105/107. d3d12_compute (line 515, device_proxy_ref_count(device.p) == 1) and d3d12_draw (bundle blend pixel 127,0,127,255, expected red 64) fail the same way on origin/main 6a6704d without this branch, so they are not from this PR.

Not checked through D3D12: binding 27 (the layer creates no 3D UAV views yet, an older limitation); it is covered by the GPU and semantic tests. Not run on RDNA2 hardware.

No game files used. AI-assisted (Claude).

- Device: VK_EXT_shader_image_atomic_int64 (shaderImageInt64Atomics) enabled where present, recorded in
  VulkanDeviceInfo::shader_image_int64_atomics; the test device helper enables it too.
- Bindless set 0: bindings 26/27, 2D/3D r64ui storage images sized like the r32ui ones, only with the feature
  (R64_UINT fallbacks), and StorageViews::r64ui.
- Layer: R32G32_UINT/SINT/TYPELESS UAV textures (2D, 3D) are mutable with R64_UINT in their format list; their
  R32G32_UINT/SINT UAV views get an R64_UINT storage view in the r64ui binding. OPTIONS9
  AtomicInt64OnTypedResourceSupported follows the device (host RTX 3060 answers TRUE); group-shared and OPTIONS11
  stay FALSE. A castable list no longer chains the format list onto itself.
- rdna2spirv.py: image atomics with DMASK 0x3 (0xf for cmpswap) are 64-bit (add, sub, smin, smax, umin, umax, and,
  or, xor, swap, cmpswap) on an R64ui image (Int64ImageEXT, Int64Atomics, SPV_EXT_shader_image_int64); index
  feature shaderImageInt64Atomics; vk_pipeline_check knows it.
- Tests: cs_imgatomic64.asm (vk_store_test words64, LEONIDA_VK_VALIDATION support), d3d12_image_atomic64_test,
  bindless_sizing_test cases, tests/semantic/test_image_atomics_64.py with its fixture, check.py / run_gpu_tests.py.
- Docs: design.md contract row, d3d12_vulkan.md OPTIONS9 / bindings / section 8.2 question 10.

AI-assisted.

@Flyander Flyander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OPTIONS9 bit is broader than the implementation. Microsoft defines AtomicInt64OnTypedResourceSupported for typed-resource 64-bit integer atomics, and the DXIL 6.6 valid-resource tables include RWTexture3D and typed, raw, and structured buffers. Here the bit is TRUE when shader_image_int64_atomics and bindless are available, but CreateUnorderedAccessView rejects buffer resources and only accepts Texture2D/Texture2DArray. A caller that sees TRUE can therefore request typed-resource atomic forms this layer cannot expose. Please keep the bit FALSE until the advertised typed-resource set is supported, or establish a narrower API contract that justifies returning TRUE. References: https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_d3d12_options9 and https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst#L1705-L1755

…w does

main replaced the Vulkan 1.3 feature struct enable13 with vulkan13_features.h, whose next() is where later
feature structs go (it also handles a 1.2 device with the dynamic rendering and synchronization2 extensions).
VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT was still linked through enable13.pNext, so after the merge
vk_test_device.h no longer compiled ("'enable13' was not declared in this scope"), and neither would the D3D12
shim. Both now use *v13_.next() / *v13.next(), like the FMA and host-copy features next to them.
@richardsenra

Copy link
Copy Markdown
Contributor

Independent synthetic verification at bb7b345eee3da47d0f2b8d5c0f908354e41d60d9 (AI-assisted with Codex), Windows 11 Pro 26300, native MSVC 19.44.35230, Windows SDK 10.0.26100.0 and Vulkan headers 1.4.363.

  • RTX 3050 6GB Laptop, 617.14 / 32.0.16.1714: d3d12_image_atomic64 and bindless_sizing pass with validation enabled. The four UINT/SINT/TYPELESS/castable cases report 16/16 texels and returned values exact. The feature-disabled control reports OPTIONS9 FALSE; with the extension enabled it reports TRUE, while the group-shared and descriptor-heap flags stay FALSE.
  • Intel UHD, 31.0.101.4146, no shaderInt64/image-int64 extension: both CTests pass. The D3D12 test verifies OPTIONS9 FALSE and creates the R32G32 UAV resources/views; its GPU atomic section is explicitly skipped. No validation warnings/errors on either device.
  • Built the existing hand-written cs_imgatomic64 fixture using native AMDGPU llvm-mc 23.1.6: 1/1 translated and spirv-val-valid. On NVIDIA, vk_store_test ... words64 exits 0 and the repository's store_words_problem judge matches all five 64-word images, including the R64 2D image and volume. On Intel, this fixture returns the expected 77 with shaderInt64=0.
  • The nine tests/semantic/test_image_atomics_64.py tests pass.

Scope: the existing layer and translator synthetic tests above, without source changes. No full-suite or retail-corpus run, and no RDNA2 hardware measurements.

@itsonlysimbo

Copy link
Copy Markdown
Contributor

Tested bb7b345e on RTX 4070, NVIDIA 621.14, Windows 11 (10.0.26300), MSVC 19.44, Vulkan SDK 1.4.363, llvm-mc 23.1.6.

Merged onto current main 4eb6155d it no longer compiles. Git merges it cleanly, but:

runtime\shims\d3d12_vulkan_device.cpp(6421): error C2065: 'enable13': undeclared identifier
runtime\shims\d3d12_vulkan_device.cpp(6422): error C2065: 'enable13': undeclared identifier

#1706 (6eb5bce3, "accept a Vulkan 1.2 device…") removed enable13, so the image_int64 struct needs chaining into the feature chain main builds now. A rebase should show it.

At its own head (base 6a6704df) it passes:

AI-assisted (Claude Code).

@Flyander Flyander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fresh current-main build report found a second merge blocker: after merging this head onto 4eb6155, compilation fails because runtime/shims/d3d12_vulkan_device.cpp references enable13 at lines 6421-6422, which #1706 removed. This branch still builds only against its old base. Please rebase and chain the image-int64 feature into the feature chain current main uses before treating the reported head checks as merge-ready.

@crastinator

Copy link
Copy Markdown
Contributor

Tested bb7b345 merged into main 4eb6155d on an AMD Radeon RX 6700 XT, RADV Mesa 26.3.1, Linux, GCC 16.2.1. The merge is clean, but the result doesn't compile: runtime/test/vk_test_device.h:465: 'enable13' was not declared in this scope. main replaced enable13 with vulkan13_features.h (v13.next()) since this PR was written. The D3D12 shim has the same two lines.

@requiemsnkrp I've opened requiemsnkrp#1 against your branch (crastinator:int64-atomics-main-merge). It merges main and links the int64 image-atomics features through *v13_.next() / *v13.next(). With it, cs_imgatomic64 passes on RADV, the whole GPU suite passes (168/181, the skips as on main), and ctest passes 36/36.

AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): no regression. RTX 4080 SUPER: 112/114. Not from this PR: d3d12_draw (fixed by #1995) and d3d12_compute (#1714's refcount, passes on newer main). The Intel UHD 770 failures are the known ones (#2078).

@SpositoDouglas

Copy link
Copy Markdown
Contributor

Tested bb7b345e on AMD Radeon RX 9060 XT (RDNA4), AMD Software 26.11.2 (32.0.32029.2010, Vulkan 1.4.359), Windows 11 Pro 26H2 (26300.9974), MSVC 19.44, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8: pass. This adds AMD's Windows driver to the runs above.

  • d3d12_image_atomic64_test: pass, with and without LEONIDA_VK_VALIDATION=1 (0 validation errors). The driver enables VK_EXT_shader_image_atomic_int64, OPTIONS9 reports AtomicInt64OnTypedResourceSupported 1, and formats 17, 18, 15 and castable 17 give 16/16 texels and returned values exact through binding 26.
  • run_gpu_tests.py --filter imgatomic: cs_imgatomic, cs_imgatomic3d, cs_imgatomic64 and ps_imgatomic pass, native wave64 and with LEONIDA_W64_EMULATE=1.
  • bindless_sizing_test: pass.
  • ctest -C RelWithDebInfo: 112/114, the same with validation. d3d12_compute and d3d12_draw fail, the two that also fail on this PR's base 6a6704df on this GPU (the device reference check and the bundle-blend fence); both pass on current main.
  • Build (scripts/build_runtime.ps1, RelWithDebInfo): no warnings.

GitHub now reports a conflict with main.

AI-assisted (Claude Code). Synthetic tests only, no game data.

D3D12 covers typed, raw and structured buffers and 3D textures by that bit, and the layer exposes no buffer UAV and no 3D texture UAV yet (review on ItsNotRexed#2033). The 2D texture path (binding 26) and the translator's 3D one (binding 27) stay in place. AI-assisted.
@requiemsnkrp

Copy link
Copy Markdown
Author

Thanks @Flyander, @crastinator, @itsonlysimbo.

  • Merge with main: I took @crastinator's Merge main into #2033 and chain the int64 image atomics features through v13.next() requiemsnkrp/Leonida#1 as is (merge of main 4eb6155 + the int64 features chained through v13.next()), so the build blocker is gone.
  • OPTIONS9: agreed, the bit covers typed/raw/structured buffers and 3D textures and the layer exposes neither buffer UAVs nor 3D texture UAVs yet. c0dbff11 keeps AtomicInt64OnTypedResourceSupported FALSE (group-shared and OPTIONS11 were already FALSE). The 2D R64 views (binding 26), the 3D binding (27) and the translator rule stay, ready for when those views exist; the test now expects FALSE with and without the extension, and docs say why.

Retested on the RTX 3060 (driver 32.0.16.1714): d3d12_image_atomic64_test with validation: 16/16 texels and returned values exact through binding 26 on UINT, SINT, TYPELESS and castable 2D textures, 0 validation errors; d3d12_vulkan_device_test pass. Full ctest without the window tests: 103/106, failing only d3d12_com (segfault), d3d12_indirect_rt (segfault) and d3d12_draw, which fail the same way on main 4eb6155 without this PR (#1995 fixes d3d12_draw).

AI-assisted (Claude).

@NRXM

NRXM commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested bb7b345 (on main 6a6704d; the head has since moved to c0dbff1, not re-run) on an NVIDIA RTX 4090 (621.24) and an AMD Radeon iGPU (Ryzen 7000, RDNA2 gfx1036, driver 26.11.2 / Vulkan 2.0.353), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, RelWithDebInfo: pass for this PR.

(AI-assisted test run.)

Conflicts, both sides kept:
- tools/rdna2spirv.py: main reads image-atomic coordinates through a helper that unpacks a16 (two 16-bit ones per VGPR). It becomes the method image_atomic_coords, and image_atomic_64 reads its coordinates through it too, so a 64-bit atomic with a16 gets the same coordinates as a 32-bit one (test_image_atomics_64.test_a16_coordinates).
- docs/design.md: main's a16 LOD row and its updated image-atomics row, then this branch's 64-bit row.
- runtime/test/bindless_sizing_test.cpp: the r64ui block and main's MoltenVK block.
- runtime/test/vk_test_device.h: main's custom border color extension and VK_EXT_shader_image_atomic_int64.
- tests/semantic/regen_fixtures.py: cs_cvt_pk_u8 and cs_imgatomic64.
- tests/test_shader_checks.py: STORE64_WORDS with main's count of five compute fixtures.
@requiemsnkrp

Copy link
Copy Markdown
Author

Merged main ec8ec4c into this branch (1eee0c4). Six files conflicted:

  • tools/rdna2spirv.py: main now reads image-atomic coordinates through a helper that unpacks a16. That helper became the method image_atomic_coords, and image_atomic_64 uses it too, so a 64-bit atomic with a16 gets the same coordinates as a 32-bit one. New test_image_atomics_64.test_a16_coordinates checks this in 2D and 3D.
  • docs/design.md: main's a16 LOD row and its updated image-atomics row, then this PR's 64-bit row.
  • bindless_sizing_test.cpp, vk_test_device.h, regen_fixtures.py: kept both sides (the r64ui block next to the MoltenVK block; the custom-border-color extension next to VK_EXT_shader_image_atomic_int64; cs_cvt_pk_u8 and cs_imgatomic64).
  • test_shader_checks.py: STORE64_WORDS with main's count of five compute fixtures.

Retested on RTX 3060 with LEONIDA_VK_VALIDATION=1:

  • d3d12_image_atomic64_test: OPTIONS9: AtomicInt64OnTypedResourceSupported 0, 16/16 texels and returned values exact through binding 26 for all four formats, OK (0 validation errors)
  • bindless_sizing_test: r64ui bindings: 4096 (2D) and 256 (3D) storage indices; at a 3584 storage limit 2D holds 224 with them and 256 without
  • python -m unittest discover -s tests/semantic: 4146 tests OK (skipped=3), plus the new a16 test
  • python -I tests/test_shader_checks.py: 70 tests OK

Full ctest (-E "present|swapchain|frame_pacer"): 104/117 (this PR adds d3d12_image_atomic64). The only failures are the 13 d3d12_* tests that segfault at startup (multithread, d24_support, debug_markers, fence_timing, fence_events, method_variants, rgb96, depth_resolve, resource_desc, node_mask, indirect_zero, stencil_copy, query_rules). main ec8ec4c without this PR fails the same 13 (103/116).

AI-assisted (Claude).

@Kev-Ball

Copy link
Copy Markdown

The retail 1.0.2.1 census narrows the 64-bit MIMG path to unsigned max on 2D images. I joined the SFI0 flags to the corresponding listings for all 26,503 shaders, then independently scanned every listing using this PR’s 64-bit DMASK criterion (0xf for compare-swap, 0x3 for other image atomics).

Stage Flagged shaders 64-bit unsigned-max sites Sites with GLC
Pixel 683 952 1
Compute 2 2 0

All 685 flagged shaders have at least one such site. The other 25,818 shaders have zero wide MIMG atomics by that criterion. All 954 sites specify 2D. Within the flagged set, 681 shaders also use the narrow unsigned-min and OR forms (681 sites each, DMASK 0x1).

For coverage, a 2D unsigned-max case with GLC clear exercises the common path (953 sites), and one with GLC set covers the return form seen once. The census establishes operation, width and dimension. The exact DXGI format of the view bound at draw or dispatch is still unmeasured. Counts only, AI-assisted.

Merged origin/main 98fa503. Nine files conflicted; both sides kept in each:
- tools/rdna2spirv.py: main now translates the remaining 32-bit image atomics (swap, inc, dec, fmin, fmax,
  fcmpswap: IMG_ATOMICS_EXTRA, emit_image_atomic_extra), so this branch's "image_atomic_swap (32-bit)" refusal and
  its own swap entries in the dispatch lists are dropped for main's; 64-bit atomics still go first through
  image_atomic_64, and 3D coordinates through image_atomic_coords. Capabilities, extensions and the feature index
  list both Int64ImageEXT/Int64Atomics and main's ShaderClockKHR / DrawParameters.
- runtime/shims/d3d12_vulkan_device.cpp, d3d12_com.h: VK_EXT_shader_image_atomic_int64 and main's
  VK_KHR_shader_clock are both chained and enabled (the int64 check now uses main's has_device_extension). The
  shader_image_int64_atomics comment no longer says OPTIONS9 reports the bit: it stays FALSE.
- runtime/test/vk_pipeline_check.cpp: both optional features are requested.
- runtime/test/vk_store_test.cpp: the 64-bit readback copies, then main's host-read barrier after every copy.
- tests/test_shader_checks.py, tests/semantic/regen_fixtures.py: main's counts and fixtures plus this branch's.
- tests/semantic/test_image_atomics_32.py: main listed a dmask 0x3 swap among the rejected 32-bit forms; it is
  this branch's 64-bit swap now, so it is dropped there (the 64-bit form is tested in test_image_atomics_64.py).
- docs/design.md: main's rows plus the 64-bit row. docs/d3d12_vulkan.md: main dropped a duplicate open-question
  row 10; the D3D-251 sentence moved to the remaining row, now saying OPTIONS9 stays FALSE.

AI-assisted.
…orm (D3D-251)

@Kev-Ball's census of the 1.0.2.1 listings (ItsNotRexed#2033): the game's only 64-bit MIMG atomics are image_atomic_umax on 2D
images, 953 of 954 sites without glc. The GPU fixture covered 2D umax only with glc and the no-return form only for
add.

- cs_imgatomic64.asm: 2D cases 17 to 19, umax dmask:0x3 without glc: the high dword decides 17 (a per-dword max
  would give 0x0000001300000001) and keeps 19 (0x00000014ffffffff), the low dword decides 18; their data pairs,
  left alone, are stored to uint/sint texels 22..24. Header table and fills updated; fixture regenerated.
- check.py (STORE64_WORDS), tests/test_shader_checks.py: the new words.
- test_image_atomics_64.py: test_game_form_umax_2d_without_glc (high / low dword decides, kept, unsigned, inactive
  lane).

AI-assisted.
@requiemsnkrp

Copy link
Copy Markdown
Author

Merged main 98fa503 into this branch (1a42b82). 9 files conflicted: tools/rdna2spirv.py, runtime/shims/d3d12_vulkan_device.cpp, runtime/shims/d3d12_com.h, runtime/test/vk_pipeline_check.cpp, runtime/test/vk_store_test.cpp, tests/test_shader_checks.py, tests/semantic/regen_fixtures.py, docs/design.md and docs/d3d12_vulkan.md. I kept both sides in each:

  • main now translates the remaining 32-bit image atomics (IMG_ATOMICS_EXTRA), so this branch's 32-bit swap refusal is gone. 64-bit atomics still go through image_atomic_64 first.
  • VK_EXT_shader_image_atomic_int64 and main's VK_KHR_shader_clock are both chained and enabled. The int64 check now uses has_device_extension.
  • vk_store_test does the 64-bit readbacks first, then main's host-read barrier.
  • The counts, fixtures and design rows are combined.
  • main dropped a duplicate open-question row 10. The D3D-251 sentence moved to the remaining row, which now says OPTIONS9 stays FALSE. The d3d12_com.h comment also no longer says OPTIONS9 reports the bit.

main's test_image_atomics_32.test_rejected_forms listed a dmask:0x3 swap as rejected. That is this PR's 64-bit swap, so I removed it from that list.

Re-ran on NVIDIA GeForce RTX 3060, driver 32.0.16.1714, Windows 11, MSVC 19.51, Vulkan SDK 1.4.363.0, validation on:

OPTIONS9: AtomicInt64OnTypedResourceSupported 0, AtomicInt64OnGroupSharedSupported 0; OPTIONS11: AtomicInt64OnDescriptorHeapResourceSupported 0
format 17 (UAV 17): 16/16 texels and returned values exact through binding 26, index 1
format 18 (UAV 18): 16/16 texels and returned values exact through binding 26, index 2
format 15 (UAV 17): 16/16 texels and returned values exact through binding 26, index 3
format 17 (UAV 17, castable): 16/16 texels and returned values exact through binding 26, index 4
d3d12_image_atomic64_test: OK (0 validation errors)
r64ui bindings: 4096 (2D) and 256 (3D) storage indices; at a 3584 storage limit 2D holds 224 with them and 256 without

scripts/run_gpu_tests.py with validation and llvm-mc 21: 171/218 passed, 47 skipped, 0 failed (cs_imgatomic64: "all 64 words of every image the tool prints exact"). tests/test_shader_checks.py OK, regen_fixtures.py --check clean, compileall clean. Full ctest (without present/swapchain/frame_pacer): 160/160 passed (9 skipped, gameinput disabled). The semantic suite (6255 tests) still has failures in test_loop_ballot_barrier (3 failing subtests of test_divergent_loop_wave64_emulate_and_native_cs and 2 errors). This PR does not touch that file. I'm running the same suite on main to compare.

AI-assisted (Claude).

@requiemsnkrp

Copy link
Copy Markdown
Author

@Kev-Ball thanks for the census. It changed what the fixture needed to cover.

73eedd6 adds the game's form to cs_imgatomic64.asm: three 2D image_atomic_umax ... dmask:0x3 dim:SQ_RSRC_IMG_2D unorm cases without glc.

  • Case 17: the high dword decides (texel 0x0000001200000001, data 0x0000001300000000 → 0x0000001300000000; a per-dword max would give ...0001).
  • Case 18: the low dword decides (→ 0x0000001300000005).
  • Case 19: the texel is kept (0x0000001400000003 against 0x00000013ffffffff; a per-dword max would give 0x00000014ffffffff).
  • In all three, the data pair is left alone, and the test stores and checks it.

The return form (glc) was already covered by case 8. check.py, tests/test_shader_checks.py and the regenerated fixture have the new words. test_image_atomics_64.test_game_form_umax_2d_without_glc checks high-dword, low-dword, kept and unsigned cases, plus an inactive lane.

RTX 3060, driver 32.0.16.1714, Vulkan SDK 1.4.363.0, validation on:

  PASS  cs_imgatomic64        all 64 words of every image the tool prints exact
d3d12_image_atomic64_test: OK (0 validation errors)

The python tests (test_image_atomics_64, test_image_atomics_32, tests/test_shader_checks.py) pass, and regen_fixtures.py --check is clean.

I didn't add a pixel-shader 64-bit case. ps_imgatomic runs through vk_bindless_test, which only has the r32ui bindings, so it would need new R64 images at binding 26 and the extension in that tool. As you say, the DXGI format of the view the game binds at draw or dispatch is still unmeasured.

AI-assisted (Claude).

@requiemsnkrp

Copy link
Copy Markdown
Author

Follow-up on the semantic suite: origin/main 98fa503 on its own (6245 tests) has the same test_loop_ballot_barrier failures: the 3 failing subtests of test_divergent_loop_wave64_emulate_and_native_cs (emulate_64_sg32, emulate_128_sg32, emulate_40_partial_sg32) and the 2 errors (test_nested_divergent_loops_emulate, test_bug4b_loop_carried_split_sgpr_pair_ballot). This branch adds no other failure. AI-assisted (Claude).

@Ayinaki

Ayinaki commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 73eedd6 on RTX 5070, driver 616.86, Windows 10.0.26200: pass.

Built runtime with MSVC 14.52 (Visual Studio 18 2026, x64, RelWithDebInfo) and ran every target this PR touches, with LEONIDA_VK_DEVICE="RTX 5070". All four exit 0:

  • d3d12_image_atomic64_test: "OK (0 validation errors)". The 64-bit typed image atomic cases match: format 17 (UAV 17, castable) gives 16/16 texels and returned values exact through binding 26, index 4, so R64_UINT typed atomics run on this device with shaderBufferInt64Atomics/image 64-bit atomics requested.
  • bindless_sizing_test: r64ui bindings 4096 (2D) and 256 (3D) storage indices; at a 3584 storage limit 2D holds 224 with them and 256 without.
  • vk_pipeline_check and vk_store_test: exit 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants