test(agc): run csub without glc and pin it to the RDNA2 measurement #18667
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18667"
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?
Imported from boykopovar/AnyPS5. Originally posted by angrysandhill on 2026-11-12T01:15:18Z.
What
This answers the question in the review of #15252: does the hardware still write the destination register without
glc, or treat the encoding differently? It doesn't, on RDNA2 (gfx1031; the PS5's gfx1013 is not measured). Withglcclear,buffer_atomic_csubandglobal_atomic_csubapply the clamped subtract and write no register. That is what the translation from #15252 and #15253 already does, so the recompiler does not change.agc_driver_buffer_atomic_csubandagc_driver_global_atomic_csubonly compiled the encoding withoutglc. They now run it, with all lanes active and under the partial exec mask the tests already use, and check:v0: the register its vdst field names stays the thread id.Tested
Setup: Windows 10 Home 22H2 (10.0.19045), AMD Radeon RX 6750 XT (gfx1031), AMD Software Adrenalin 26.10.1 (driver 32.0.21045.16010), WinLibs GCC 15.2.0 r7 UCRT, Release,
BUILD_TESTING=ON, onmaind5fc44ac7f.RDNA2 measurement (hardware oracle, HIP), wave32 and wave64, IEEE 0, DX10_CLAMP 1, f32 and f16 denormals kept, round to nearest even, FP16_OVFL 0.
glc. The probe assembles theglcforms and clears the bit by hand: bit 16 of word 0 forglobal_atomic_csub, bit 14 forbuffer_atomic_csub. That gives the words the tests'NoReturnCodealready holds,0xdcd08000 0x00080a03and0xe0d01000 0x80010702.0x7fffffff,0x80000000and0xffffffff, both ways) and 48 random ones. Each lane gets its own dword, and its destination register is filled with a marker first.exec_lo0x55555555.glcform returns 0.global_atomic_addworks there.glcsetglcclearv0orv13) and the data registerThrough
HW_ORACLE_RUNTIME=vulkan, the recompiler gives the same values on a first probe's 64 rows with all lanes active (vdstv11/v13). The new tests cover the vdst field 0 and the partial exec mask.Tests:
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1). Withbuffer_atomic_csub_translationandglobal_atomic_csub_translation, 4 of 4 tests pass, and there is noVUID-line. Both GPU tests log the layer insertion; the translation tests open no device.389e0e17fc: the four tests pass again under the validation layer, with noVUID-line, and the mutation check below fails both GPU tests as before.mainalready behaves as measured, so the new checks also pass there.if (inst.glc)inBufferInstructions.cppandFlatInstructions.cppreplaced by an unconditional write:agc_driver_buffer_atomic_csubfails on the new check:buffer atomic csub without glc: wave32 32 threads thread 1 lane 1 data register is 0x00000000, expected 0x00000001.agc_driver_global_atomic_csubfails earlier. Withoutglcthe decoder gives the global form no destination operand, so the forced write does not compile (writeRawU32 invalid decoded operand used as a destination). Itsv0check guards against a later change that decodes and writes the vdst field.tools/check_conventions.py: passed.git diff --check: clean.Overlap:
shader.md, so they conflict textually. None changes the csub entries, so the resolution keeps both.main389e0e17fc(8b0efa5ef8), keeping its new entry above theglobal_atomic_csubone.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code