Repository navigation
Conversation
The unorm bit forces texel-unit coordinates, but image_op ignored it on the samples and image_gather4_lz(_o): the same SPIR-V was emitted with and without it, so texel coordinates were sampled as normalized ones. Each spatial coordinate (and each _d gradient) is now divided by the image's level-0 size; array layers, an explicit LOD, bias, depth reference and texel offsets are left as they are. A cube with unorm is Unsupported. The explicit-LOD gathers keep their own handling (ItsNotRexed#8154). GPU fixture ps_sample_unorm: RTX 5070 Ti (610.74), 4096/4096 pixels match after, 4096/4096 read the clamped last texel before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), AMD Windows driver 32.0.32029.2010, Windows 11, at 1510544. I used vk_texture_test built from dde82f2 with llvm-mingw, and llvm-mc 23. On AMD the fixture fails without the fix and passes with it, the same as on your RTX 5070 Ti. AI-assisted (Claude Code). |
|
Tested 1510544 on Arch Linux + RTX 4070 (NVIDIA 620.70, llvm-mc 23.1.5): pass. Semantic test_image_tfe_status 15/15 OK (needs discover runner for the sys.path import); base translator fails 13. GPU fixture ps_sample_unorm runs natively: 4096/4096 pixels exact, spirv-val clean. No game files. AI-assisted. |
|
Code read + run of the PR head (Windows 11, Python 3.11; semantic suite 5971 tests, only test_image_atomics_guard and test_image_store_d16 fail, as on main; test_sample_unorm 15 OK + 1 skip): the approach looks right. Normalizing the coordinates avoids the unnormalizedCoordinates sampler and its VUIDs; array layers aren't divided (unnormalized_sizes, tools/rdna2spirv.py:11951); _d gradients are divided while bias, depth reference and texel offsets are left alone; gathers need no +0.5; refusing cube with unorm is reasonable. One gap: image_gather4_l / image_gather4_l_o are excluded from unorm (:12610-12611), but their own path never checks the bit and still computes AI-assisted (Claude Code). |
Grimkeh
left a comment
There was a problem hiding this comment.
Independent Linux CPU review (15105444)
What changed: image_sample* / image_gather4_lz honour the MIMG unorm bit (normalized coords) in the translator; new semantic coverage + a GPU fixture listing.
Checked:
python3 -I -m unittest discover -s tests/semantic -p test_sample_unorm.py→ 15 OK (1 skipped).
Looks correct; no game files.
TEST validation — Needs changesValidated on CPU (no GPU, no game files). Semantic test passes cleanly. What changed: Tests added:
Verification:
Reviewer-identified gap (blocking): Other non-blocking notes:
Recommendation: Needs changes — close the |
xundru
left a comment
There was a problem hiding this comment.
This covers the validation-layer run listed as missing in the description. vk_texture_test doesn't read LEONIDA_VK_VALIDATION, so I forced the layer through the loader instead (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation) and sent its messages to a file (VK_KHRONOS_VALIDATION_LOG_FILENAME, VK_KHRONOS_VALIDATION_DEBUG_ACTION=VK_DBG_LAYER_ACTION_LOG_MSG). Setup: 1510544 applied on main e68c5c9, Windows 11 26200, RTX 3060 (Ampere), NVIDIA 610.88, Vulkan SDK 1.4.363.1, llvm-mc 23.1.6.
run_gpu_tests.py --filter ps_sample_unorm |
Result | Layer log |
|---|---|---|
core + VALIDATE_SYNC=1 |
PASS, 4096/4096 exact | empty |
core + sync + GPUAV_ENABLE=1 |
PASS, 4096/4096 exact | 0 errors, 0 SYNC-HAZARD; only the layer's own VALIDATION-SETTINGS / Setting-Limit-Adjusted warnings, which show it was loaded |
GPU-AV also checks image reads against the bound view's numeric type and buffer bounds at run time, and it reports nothing for the fixture's four sample/gather forms.
Also on this GPU: native and LEONIDA_W64_EMULATE=1 both PASS. With main's rdna2spirv.py and the PR's fixture, all 4096 pixels differ, matching the controls above. The whole GPU suite (emulated) goes from 223/241 to 224/242, and the only failure is the known ms_wave_info_s3.
No game files. AI-assisted run.
The supported image_sample forms and image_gather4_lz(_o) ignore the instruction's unorm bit, so texel-unit coordinates are read as normalized coordinates. In the new synthetic fixture all 4,096 pixels sample the clamped edge on main. With this change all 4,096 match the independently derived expected texels.
The translator divides spatial coordinates and explicit gradients by the image's level-0 size, preserving array layers, offsets, bias, depth references and explicit LOD operands. It adds focused semantic coverage, a hand-written GPU fixture registered through TEXTURE_CONSTANTS, and the contract row in docs/design.md.
Claim: #8344 (comment)
Tracking: Kalmarv#1
Related: #8154. Its explicit-LOD gather path and the owned run-time descriptor LOD work are unchanged.
Validation at 1510544, Windows 11, RTX 5070 Ti, NVIDIA 610.74:
Limits: the expectation uses LLVM's UNRM definition and the Vulkan coordinate rule, not a native RDNA2 measurement. Nonzero explicit LOD behavior remains unmeasured. Cube+unorm is refused; image_sample_c_l+unorm remains refused. image_get_lod+unorm is outside this change. No game-corpus counts, retail run, AMD/Intel validation or Vulkan validation-layer run. Setting LEONIDA_VK_VALIDATION=1 in a repeat did not establish that a layer was loaded.
AI-assisted implementation and testing with Claude Code, reviewed by the coordinating Codex agent. Synthetic inputs only.
ISA reference: AMD's machine-readable ISA, amdgpu_isa_rdna2.xml version 1.1.1, MIMG UNORM bit 12, specifies forcing unnormalized addresses independently of the sampler setting. This establishes the bit's purpose; it does not supply the missing nonzero-LOD hardware measurement.