test(shader): add regression test for ImageGather4h and map packed gather variants #1053

Closed
Kikoarl wants to merge 1 commit from upstream-pr/1053 into main
Kikoarl commented 2026-10-07 05:16:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-07T05:16:08Z.


What

  • Adds test coverage in core/libs/tests/ImageSampleGather.cpp for ImageGather4h (MIMG opcode 0x61u).
  • Maps ImageGather4h to its packed variants IMAGE_GATHER4H_PCK and IMAGE_GATHER8H_PCK in tools/progress.py under OPCODE_VARIANTS.
  • Provenance: AMD RDNA 2 ISA manual specifies IMAGE_GATHER4H (horizontal gather with RdnaImageSampleFlagGatherHorizontal) and its packed variants. The instruction was already implemented in the decoder and SPIR-V emitter (HorizontalOffsets), and this PR adds the regression test and progress tracking.

Tested

  • Linux x86_64: ninja -C /tmp/anyps5_build image_sample_gather_tests and ctest --test-dir /tmp/anyps5_build -R image_sample_gather --output-on-failure pass 100%.
  • Verified python3 tools/progress.py advances shaders by +2 to 1137 / 1166 (97.51%).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • 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
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4768279033 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1053). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-07T05:16:08Z. --- ### What - Adds test coverage in `core/libs/tests/ImageSampleGather.cpp` for `ImageGather4h` (MIMG opcode `0x61u`). - Maps `ImageGather4h` to its packed variants `IMAGE_GATHER4H_PCK` and `IMAGE_GATHER8H_PCK` in `tools/progress.py` under `OPCODE_VARIANTS`. - Provenance: AMD RDNA 2 ISA manual specifies `IMAGE_GATHER4H` (horizontal gather with `RdnaImageSampleFlagGatherHorizontal`) and its packed variants. The instruction was already implemented in the decoder and SPIR-V emitter (`HorizontalOffsets`), and this PR adds the regression test and progress tracking. ### Tested - Linux x86_64: `ninja -C /tmp/anyps5_build image_sample_gather_tests` and `ctest --test-dir /tmp/anyps5_build -R image_sample_gather --output-on-failure` pass 100%. - Verified `python3 tools/progress.py` advances shaders by +2 to 1137 / 1166 (97.51%). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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 - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-07 19:36:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T19:36:05Z.


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
#1214 tools/progress.py L56-59
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6045384374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1053#issuecomment-6045384374). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T19:36:05Z. --- <!-- 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 | |---|---|---|---| | #1214 | `tools/progress.py` [L56-59](https://github.com/boykopovar/AnyPS5/blob/df16c4c256be3c44e03eb9149a6ce5f8e8a038b2/tools/progress.py#L56-L59) | | |
oneandonlydean commented 2026-10-08 02:49:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:49:26Z.


Same problem as #1049: IMAGE_GATHER4H_PCK and IMAGE_GATHER8H_PCK are separate opcodes the decoder doesn't handle, so counting them under ImageGather4h adds +2 without implementing anything, and the new test line already passes on main. If a title's shader hits one of them, comment here with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051158191 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1053#issuecomment-6051158191). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T02:49:26Z. --- Same problem as #1049: `IMAGE_GATHER4H_PCK` and `IMAGE_GATHER8H_PCK` are separate opcodes the decoder doesn't handle, so counting them under `ImageGather4h` adds +2 without implementing anything, and the new test line already passes on main. If a title's shader hits one of them, comment here with the title ID and the log line.

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!1053
No description provided.