feat(agc): let agc_shader_replay write a request's code words for other disassemblers #456

Merged
oneandonlydean merged 1 commit from upstream-pr/456 into main 2026-10-03 22:33:50 +00:00
oneandonlydean commented 2026-10-03 13:52:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-03T13:52:01Z.


What

agc_shader_replay --code writes the request's shader code as <request name>.code in the working directory: the raw little-endian code words, ready for another disassembler, for example llvm-mc -triple amdgcn -mcpu=gfx1030 --disassemble. --asm prints only the first word of each instruction, so literals and the second dword of VOP3, MUBUF or MIMG encodings were not visible without decoding them by hand.

The file is written the way --spv writes its output. If it cannot be written, the request is reported as failed ("could not write ...") instead of being skipped silently.

Tested

  • Linux (CachyOS, x86-64): built agc_shader_replay (it is EXCLUDE_FROM_ALL, so CI does not build it) and the full tree with BUILD_TESTING=ON.
  • Replayed a compute request dumped from PPSA21564 (shader_500696500.req, 4200 code words) with --code: the 16800-byte file disassembles with llvm-mc -mcpu=gfx1030, and its first instructions match the raw words --asm prints (s_inst_prefetch 0x3, s_lshl_b32 vcc_lo, s14, 2, s_buffer_load_dword, ...). In a read-only directory the request fails with "could not write shader_500696500.req.code".
  • I have used this on my integration branch since 2026-09-29 for every shader I disassembled while debugging PPSA21564.
  • #426 also edits this file; the two merge cleanly.

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:4727049077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/456). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-03T13:52:01Z. --- ### What `agc_shader_replay --code` writes the request's shader code as `<request name>.code` in the working directory: the raw little-endian code words, ready for another disassembler, for example `llvm-mc -triple amdgcn -mcpu=gfx1030 --disassemble`. `--asm` prints only the first word of each instruction, so literals and the second dword of VOP3, MUBUF or MIMG encodings were not visible without decoding them by hand. The file is written the way `--spv` writes its output. If it cannot be written, the request is reported as failed ("could not write ...") instead of being skipped silently. ### Tested - Linux (CachyOS, x86-64): built `agc_shader_replay` (it is `EXCLUDE_FROM_ALL`, so CI does not build it) and the full tree with `BUILD_TESTING=ON`. - Replayed a compute request dumped from PPSA21564 (`shader_500696500.req`, 4200 code words) with `--code`: the 16800-byte file disassembles with `llvm-mc -mcpu=gfx1030`, and its first instructions match the raw words `--asm` prints (`s_inst_prefetch 0x3`, `s_lshl_b32 vcc_lo, s14, 2`, `s_buffer_load_dword`, ...). In a read-only directory the request fails with "could not write shader_500696500.req.code". - I have used this on my integration branch since 2026-09-29 for every shader I disassembled while debugging PPSA21564. - #426 also edits this file; the two merge cleanly. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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
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!456
No description provided.