Skip to content

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

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:feat/shader-replay-code-words
Oct 3, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:feat/shader-replay-code-words

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

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.
  • GTA V: the prologue plays (testing branch of the PRs it needs) #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

…er disassemblers

--code writes the shader's code as <request name>.code in the working directory, as raw
little-endian words for llvm-mc -triple amdgcn -mcpu=gfx1030 --disassemble. --asm prints only
the first word of each instruction.
@github-actions github-actions Bot added the agc libSceAgc* label Oct 3, 2026
@oneandonlydean
oneandonlydean merged commit 0990e9a into boykopovar:main Oct 3, 2026
3 checks passed
@oneandonlydean
oneandonlydean deleted the feat/shader-replay-code-words branch October 3, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant