Repository navigation
GPU fixture for out-of-range image atomics (cs_imgatomic_oob, EGEN-IMGATOMIC-OOB) - #7035
xelerb-debug wants to merge 2 commits into
Conversation
…th glc (EGEN-IMGATOMIC-OOB) RDNA2 (gfx1036, measured with tools/hw_oracle) leaves memory untouched and returns 0 with glc for an image_atomic_* at x/y past the edge, at -1, or at the row pitch. The translation built OpImageTexelPointer from the raw coordinate, which is undefined in Vulkan. Every 2D/3D image atomic is now guarded by an unsigned coordinate < OpImageQuerySize test.
…GATOMIC-OOB) cs_imgatomic_oob.asm runs image atomics outside the image through vk_store_test words: add, umax, cmpswap and swap at x = width, x = -1, y = height, y = -1, (width, height) and x = 1000 on the 8x8 image, add at x = width and z = depth on the 4x4x4 volume, one case without glc, and an in-range control on each image. Every word of the three images is checked, so a write that escapes the guard (a linear wrap of (8, 0) lands on texel 8) changes a word that must keep its fill; with glc the data register must come back 0. Passes on an RTX 4060 with ItsNotRexed#5059. On NVIDIA it passes without the guard as well (the driver drops the atomics and returns 0), which docs/design.md now says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows check of
I did not run the new |
|
Tested 7e8ac5f on RTX 3090 (Ampere, 32-wide subgroups), driver 620.70.06, Linux, native Vulkan,
So the out-of-range image atomic case behaves as the fixture expects on a 32-wide NVIDIA GPU, not only on the AMD cards in the description. |
|
Tested Setup: test programs built from the PR head with llvm-mingw (clang 23.1.6) and Vulkan-Headers 1.4.357;
Two things for the branch:
AI-assisted test run. |
|
FAIL-class: rebase, do not close — the guard is needed and main has nothing like it (image_atomic_guard absent, #3559's rewrite adds an active-lane guard only, no bounds test). Tested at 7e8ac5f merged with 1d73504, rechecked against 8575d36: the semantic test is non-vacuous (red on clean main, red under a guard-removal mutation, LEONIDA_TOOLS_DIR control errors), and the guard's OpImageQuerySize-based per-axis check is present in merged output. But two things must be fixed: (1) merged with main the test fails all glc=True subtests (64→32 failures after adapting the EXEC assertion) — main's #4473 renders EXEC-static programs' active test as %true and takes dst()'s plain-store fast path, so the "%active" and OpSelect assertions encode pre-#4473 implementation details; (2) the branch now conflicts in tools/rdna2spirv.py and docs/design.md against 8575d36 (reconfirmed here) since #3559 rewrote the same emit_image_atomic* code. Rebase onto #3559's structure and relax the two representation assertions; the fixture and bounds logic themselves are fine. Also: no CI checks reported on the branch. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested
Xbox 1.0.2.1 coverage: 1,003 of 26,503 local |
Claimed in the coordination issue: #6089 (GPU fixture for out-of-range image atomics, the GPU check #7049 doesn't have yet).
Depends on: #7049 (this branch is stacked on it; its own change is the last commit)
What and why
#5059 (EGEN-IMGATOMIC-OOB) guards every
image_atomic_*with an unsigned per-axis compare againstOpImageQuerySize, measured on RDNA2 withtools/hw_oracle, and checked on the CPU bytests/semantic/test_image_atomic_bounds.py. No GPU fixture runs the guarded path yet. This adds one.runtime/test/shaders/cs_imgatomic_oob.asm, throughvk_store_test words(the TEST-184 harnesscs_imgatomicuses), thread 0 only:Every word of the uint image, the sint image and the volume is compared with the tool's fill, so any write that escapes the guard shows. Expected words are in
check.py'sSTORE_WORDS, derived in the.asmheader.docs/design.md's row gets one sentence about the fixture.Tested
Windows 11 Pro 26200, NVIDIA GeForce RTX 4060 (driver 621.01, Vulkan 1.4.357), MSVC 19.51, Vulkan SDK 1.4.363.1, native
llvm-mc21.1.8, Python 3.15.2:run_gpu_tests.py --filter imgatomicwith Coordinating who works on what (41) (moved to #7231) #7049 : 5/5 translated +spirv-val;cs_imgatomic,cs_imgatomic3d,cs_imgatomic_oob,ps_imgatomic4/4 PASS.tests/test_shader_checks.py: 79 OK.tests/test_docs_design_rows.py,test_docs_repo_paths.py: OK.Limit, on purpose in the doc row: with the translator from
3faac557(no guard; its SPIR-V has 0OpImageQuerySize, #7049 's has 12) the fixture also passes on the RTX 4060: NVIDIA drops out-of-range image atomics and returns 0 by itself, andvk_store_testenables no robustness feature. So on NVIDIA this checks that the guarded path is correct (the 12 guarded atomics, the zero result withglc, the in-range controls), not that the guard is needed. A run on AMD (RADV or the Windows driver), Intel or llvmpipe without #7049 would show whether those drivers write out of range; results welcome.No game files. AI-assisted (Claude Code).