fix(shader): set a BDA-written page's bit inside the slot probe loop #3472
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3472"
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 oneandonlydean on 2026-10-11T11:07:30Z.
What
Since #3175, six tests lose the device on NVIDIA 610.57.04 (Linux, RTX 4090):
agc_driver_bda_deviceandagc_driver_flat_apertures_0,_2,_3,_4,_5. Every run fails; they pass onmainwith #3175 reverted. #3175's author passed on 615.71.09, and CI (lavapipe) passes. The RTX 5080 run on Windows 610.62 in #3291 (comment of 2026-10-11T09:04Z,mainccf9ff90, which has #3175) fails the same five aperture parts the same way.The dispatch that never finishes is one that reaches
note_bda_writefromwrite_bda_bytes. Inagc_driver_bda_deviceit is the first unaligned store,write(guest + 41, 4, 16, ...), with one workgroup; the aligned stores before it pass. Its SPIR-V passesspirv-val --target-env vulkan1.2, and both loops in it are bounded (8 probes, 4 bytes), so the module is valid and the driver's compiler is at fault.#3175 made
note_bda_writekeep the found slot in a function variable and, after the probe loop, load the chunk's page mask (OpAtomicLoad) and set the page's bit (OpAtomicOr) if it was clear. Variants of that block on this driver, withagc_driver_bda_device:note_bda_writemainwrite_bda_bytesstoremain, function markedDontInlineOpAtomicOrafter the loop without the load and testOpLoadinstead ofOpAtomicLoadOpAtomicLoadand conditionalOpAtomicOrin the loop body (this PR)So this PR moves the block into the loop body, on the iteration that finds or claims the slot, and drops the variable. The atomics, their order and the record are the same as #3175's: a page already noted still costs one atomic load and no write, and the claim list, count and overflow word are unchanged.
BdaAbi.hppandBdaResources.cppare untouched.No new test: the existing tests above fail without the change on this driver, and no test can show it on lavapipe.
Tested
Linux (CachyOS, GCC 16.2.1, Release,
BUILD_TESTING=ON), RTX 4090, NVIDIA 610.57.04, i9-14900KF, onmainf0c6cf27:agc_driver_bda_deviceagc_driver_flat_apertures_0-_5ctestmain_0,_2,_3,_4,_5fail 3 of 3;_1passesmainwith #3175 revertedtools/check_conventions.pypasses.agc_driver_bda_deviceon this branch still checks that exactly the stored pages are noted and that each chunk is claimed once, also with 64 workgroups storing to one page.Not tested on 615.x, on Windows, on AMD or on lavapipe.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:51:40Z.
Checked the diff: the mask load and
OpAtomicOrnow run in the probe iteration that finds or claims the slot (doneis only set there), same atomics and order as #3175,helddropped. Built and ran the libSceAgc/libSceAgcDriver ctest scope on RADV (402/402). The NVIDIA hang itself can't be reproduced here, so that part rests on your table; merging once CI is green.