test(shader): cover integer image atomics #381

Closed
asimplestray wants to merge 1 commit from upstream-pr/381 into main
asimplestray commented 2026-10-02 16:48:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by asimplestray on 2026-10-02T16:48:15Z.


What

Test-only follow-up: the 6 integer image atomics (IMAGE_ATOMIC_CMPSWAP/SUB/SMIN/SMAX/INC/DEC) have since landed in main via other work with full SPIR-V backend plus a Vulkan execution test, so this PR keeps only the decode-level regression test.

Adds the image_atomics test (decode opcode + family + image classification plus translation emitting the expected IR op for all 6 encodings, including the dmask=3 requirement for cmpswap).

Tested

Linux (GCC, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=OFF): full build, new test passes. Note: agc_driver_pixel_helper_lanes fails on current main independent of this PR (Vulkan pixel-helper assertion, no shader implementation touched here).

Checklist

  • Based on current main; no other open PR adds the same test (checked open shader PRs)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (decoding unknown opcodes still throws)
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4719046682 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/381). Originally posted by [asimplestray](https://github.com/asimplestray) on 2026-10-02T16:48:15Z. --- ### What Test-only follow-up: the 6 integer image atomics (`IMAGE_ATOMIC_CMPSWAP/SUB/SMIN/SMAX/INC/DEC`) have since landed in `main` via other work with full SPIR-V backend plus a Vulkan execution test, so this PR keeps only the decode-level regression test. Adds the `image_atomics` test (decode opcode + family + image classification plus translation emitting the expected IR op for all 6 encodings, including the `dmask=3` requirement for cmpswap). ### Tested Linux (GCC, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`): full build, new test passes. Note: `agc_driver_pixel_helper_lanes` fails on current `main` independent of this PR (Vulkan pixel-helper assertion, no shader implementation touched here). ### Checklist - [x] Based on current `main`; no other open PR adds the same test (checked open shader PRs) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (decoding unknown opcodes still throws) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-04 01:13:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T01:13:47Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#295 core/libs/prx/libSceAgcDriver/CMakeLists.txt L806
#375 core/libs/prx/libSceAgcDriver/CMakeLists.txt L806
#423 core/libs/prx/libSceAgcDriver/CMakeLists.txt L806
#448 core/libs/prx/libSceAgcDriver/CMakeLists.txt L806
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5975295968 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/381#issuecomment-5975295968). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T01:13:47Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #295 | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` [L806](https://github.com/boykopovar/AnyPS5/blob/7e3dcbc27e4f7bbdc4942436c418b0864cf2b53a/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L806) | | | | #375 | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` [L806](https://github.com/boykopovar/AnyPS5/blob/7e3dcbc27e4f7bbdc4942436c418b0864cf2b53a/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L806) | | | | #423 | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` [L806](https://github.com/boykopovar/AnyPS5/blob/7e3dcbc27e4f7bbdc4942436c418b0864cf2b53a/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L806) | | | | #448 | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` [L806](https://github.com/boykopovar/AnyPS5/blob/7e3dcbc27e4f7bbdc4942436c418b0864cf2b53a/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L806) | | |
oneandonlydean commented 2026-10-06 05:34:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T05:34:28Z.


Thanks for this. core/libs/prx/libSceAgcDriver/tests/execution/ImageAtomics.cpp on main already runs all six of these integer image atomics (sub, smin, smax, inc, dec, cmpswap) on the GPU and checks the results, and #667 added the bitwise and unsigned ones next to it. That covers decoding and translation too, so a separate decode-level test doesn't add coverage, and I think this can be closed. If you see a case the execution tests miss (another dmask or a 64-bit form, for example), adding it there would be welcome.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6010067306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/381#issuecomment-6010067306). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T05:34:28Z. --- Thanks for this. `core/libs/prx/libSceAgcDriver/tests/execution/ImageAtomics.cpp` on main already runs all six of these integer image atomics (sub, smin, smax, inc, dec, cmpswap) on the GPU and checks the results, and #667 added the bitwise and unsigned ones next to it. That covers decoding and translation too, so a separate decode-level test doesn't add coverage, and I think this can be closed. If you see a case the execution tests miss (another dmask or a 64-bit form, for example), adding it there would be welcome.
oneandonlydean commented 2026-10-06 21:20:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T21:20:24Z.


As I mentioned on 10-06, tests/execution/ImageAtomics.cpp on main already runs all six of these integer image atomics on the GPU and checks the results, and #667 added the bitwise and unsigned ones. So I'm closing this as superseded. Thanks for the work.

If you find a case those tests miss (another dmask or a 64-bit form, for example), a PR adding it there is welcome. If you think I've missed something here, please reopen.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6025667809 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/381#issuecomment-6025667809). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T21:20:24Z. --- As I mentioned on 10-06, `tests/execution/ImageAtomics.cpp` on main already runs all six of these integer image atomics on the GPU and checks the results, and #667 added the bitwise and unsigned ones. So I'm closing this as superseded. Thanks for the work. If you find a case those tests miss (another dmask or a 64-bit form, for example), a PR adding it there is welcome. If you think I've missed something here, please reopen.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!381
No description provided.