test(shader): cover image load and store by2 and by4 variants and count as tested #1049

Closed
Kikoarl wants to merge 1 commit from upstream-pr/1049 into main
Kikoarl commented 2026-10-07 04:35:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-07T04:35:49Z.


What

According to the AMD RDNA 2 ISA manual, image_load and image_store (along with their mip-level forms image_load_mip and image_store_mip) support 2-component (dmask = 0x3) and 4-component (dmask = 0xf) transfers, which disassemblers and rdna_isa.txt list under separate _BY2 and _BY4 mnemonics.

Following the established precedent in PR #148, PR #363, PR #380, and PR #942 ("count tested shared shader instruction variants"), this PR:

  • Adds execution and recompilation test core/libs/prx/libSceAgcDriver/tests/execution/ImageLoadStoreBy.cpp covering:
    • IMAGE_LOAD_BY2 (opcode 0x00, dmask 0x3)
    • IMAGE_LOAD_BY4 (opcode 0x00, dmask 0xf)
    • IMAGE_LOAD_MIP_BY2 (opcode 0x01, dmask 0x3)
    • IMAGE_LOAD_MIP_BY4 (opcode 0x01, dmask 0xf)
    • IMAGE_STORE_BY2 (opcode 0x08, dmask 0x3)
    • IMAGE_STORE_BY4 (opcode 0x08, dmask 0xf)
    • IMAGE_STORE_MIP_BY2 (opcode 0x09, dmask 0x3)
    • IMAGE_STORE_MIP_BY4 (opcode 0x09, dmask 0xf)
  • Maps the variants in tools/progress.py under OPCODE_VARIANTS, advancing shader progress from 1135 to 1143 / 1166 (98.03%).

Tested

Linux x86_64 (/tmp/anyps5_build):

  • ninja -C /tmp/anyps5_build agc_driver_image_load_store_by_tests passed
  • ctest --test-dir /tmp/anyps5_build -R image_load_store_by --output-on-failure passed
  • python3 tools/progress.py /tmp/progress_check verified 1143/1166 (98.03%)

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:4767991640 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1049). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-07T04:35:49Z. --- ### What According to the AMD RDNA 2 ISA manual, `image_load` and `image_store` (along with their mip-level forms `image_load_mip` and `image_store_mip`) support 2-component (`dmask = 0x3`) and 4-component (`dmask = 0xf`) transfers, which disassemblers and `rdna_isa.txt` list under separate `_BY2` and `_BY4` mnemonics. Following the established precedent in PR #148, PR #363, PR #380, and PR #942 ("count tested shared shader instruction variants"), this PR: - Adds execution and recompilation test `core/libs/prx/libSceAgcDriver/tests/execution/ImageLoadStoreBy.cpp` covering: - `IMAGE_LOAD_BY2` (opcode 0x00, dmask 0x3) - `IMAGE_LOAD_BY4` (opcode 0x00, dmask 0xf) - `IMAGE_LOAD_MIP_BY2` (opcode 0x01, dmask 0x3) - `IMAGE_LOAD_MIP_BY4` (opcode 0x01, dmask 0xf) - `IMAGE_STORE_BY2` (opcode 0x08, dmask 0x3) - `IMAGE_STORE_BY4` (opcode 0x08, dmask 0xf) - `IMAGE_STORE_MIP_BY2` (opcode 0x09, dmask 0x3) - `IMAGE_STORE_MIP_BY4` (opcode 0x09, dmask 0xf) - Maps the variants in `tools/progress.py` under `OPCODE_VARIANTS`, advancing shader progress from 1135 to 1143 / 1166 (98.03%). ### Tested Linux x86_64 (`/tmp/anyps5_build`): - `ninja -C /tmp/anyps5_build agc_driver_image_load_store_by_tests` passed - `ctest --test-dir /tmp/anyps5_build -R image_load_store_by --output-on-failure` passed - `python3 tools/progress.py /tmp/progress_check` verified 1143/1166 (98.03%) ### 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:01 +00:00 (Migrated from github.com)

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


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

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


Closing: IMAGE_LOAD_BY2, _BY4 and the other _BY* forms are opcodes of their own, but the test runs plain IMAGE_LOAD/IMAGE_STORE (opcodes 0, 1, 8, 9) with a wider dmask, which main already decodes, so the only change is +8 in the progress count (see #1214). If a title's shader uses one of the real _BY* opcodes, please comment here with the title ID and where it stops.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051157752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1049#issuecomment-6051157752). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T02:49:23Z. --- Closing: `IMAGE_LOAD_BY2`, `_BY4` and the other `_BY*` forms are opcodes of their own, but the test runs plain `IMAGE_LOAD`/`IMAGE_STORE` (opcodes 0, 1, 8, 9) with a wider dmask, which main already decodes, so the only change is +8 in the progress count (see #1214). If a title's shader uses one of the real `_BY*` opcodes, please comment here with the title ID and where it stops.

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