AGC: Killzone: Liberation (PPSA11142) stops on WRITE_DATA register or GDS destination is not implemented for its frame fence; fix branch ready #3534

Closed
opened 2026-10-11 12:38:01 +00:00 by Mouad-Scriptz-0 · 3 comments
Mouad-Scriptz-0 commented 2026-10-11 12:38:01 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Mouad-Scriptz-0 on 2026-10-11T12:38:01Z.


Killzone: Liberation (PPSA11142 01.000.004, Sony's PSP emulator wrapper, Linux) gets past start-up with #1693 (sceRazorCpuNamedSync, its first stop on main) and #3428 (sceKernelOpen(""), its second), reaches OnGameStart, and then stops at its first frame:

what():  AGC driver: WRITE_DATA at DWORD 248: WRITE_DATA register or GDS destination is not implemented

The packet is c0030037 06100300 7dffe520 00000002 00000000: DST_SEL 3, WR_CONFIRM, cache policy 3, one dword of 0 to 0x27dffe520, which is a label the title carves out of its own command-buffer memory. Its code at 0xe8483 (and a second copy at 0x44fe7f) calls

sceAgcDcbAcquireMem(...)
sceAgcDcbWriteData(buf, dst 6, cachePolicy 3, label, &zero, 1, increment 0, writeConfirm 1)
sceAgcCbReleaseMem(...)
sceAgcDcbWaitRegMem(...)

With a fprintf in Command::WriteData the title issues this call ~50 times per second (2045 in 40 s), plus dst 4, cachePolicy 0 for two-dword data writes (1022). The graphics encoding ((dst & 1) << 30) | ((dst & 0x1e) << 7) is the one OpenAGC marks SPRX-confirmed, so the console receives the same DST_SEL 3 packet, and the title would wait on its own fence forever unless the console writes that label. AMD's GFX10 header (nvd.h) names DST_SEL 3 the GDS; a 40-bit address in the title's memory cannot be a GDS offset (the GDS is 64 KiB). For comparison, Middle Ages Ping Pong (PPSA28319, Unity) passes dst 4 in all 32 of its sceAgcDcbWriteData calls, including its fences with cache policy 3, and runs on main.

Fix branch ready: Mouad-Scriptz-0:feat/agc-write-data-dst3 (9c53b7f6, one commit on main 0f863c10). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is (#3433 carried my truncate this way). No open PR touches the WRITE_DATA destination (tools/pr_overlap.py --branch reports no overlap).

  • Validate accepts DST_SEL 3 next to 1, 2 and 5; Execute and DecodeLabelWrite already treat every accepted destination as a memory write, so nothing else changes. A register destination (0) still throws.
  • agc_driver_pm4 gains: a DST_SEL 3 write lands in guest memory, a one-dword DST_SEL 3 write resolves as a label, and DST_SEL 0 is still refused.
  • TechnicalDebt records that the console's routing (GDS or cache) is unknown and where the memory-write semantics come from.

Result. With #1693, #3428 and this branch merged locally, the title runs for the full 120 s of a sandboxed run with no exception (4899 log lines, OnGameStart, sceDisplaySetMode 480x272, continuous frames) and shows its controls screen at 49 fps; on main + #1693 + #3428 it dies at DWORD 248 of its first submission every time. The four storage image multisampling is unavailable on the target device shaders are an Intel driver limit, not this change.

Its next stop, past this branch: pressing START saves the wrapper's settings, mounts the disc (sceUmdActivate(1, disc0:)), loads UCUS98646#v1.00/vms/GAME/UCUS98646/KZL.PRX, and the first frame of the PSP game itself stops in the graphics driver:

[videoout] presentation failed: AGC graphics: null vertex buffer table address
terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC graphics: null vertex buffer table address

(ShaderInputState.cpp:197, a vertex shader with a vertex attribute table whose vertex buffer table user SGPRs hold 0.) No open PR or issue mentions it. Separately, with Noto fonts in anyps5-fonts/ the controls screen's text reaches sceFontCharacterGetSyllableStringState (the stub #2497 implemented; reported there) and then sceFontWritingLineWritesOrder: writing attribute 2147483898 is not modelled; without fonts the text is blank and the title runs.

Tested on Fedora 44 (kernel 7.2.8, GCC 16.2.1, Ninja, Release, full build with BUILD_TESTING=ON, Intel Arc Meteor Lake iGPU, Mesa 26.2.3):

  • agc_driver_pm4 passes.
  • ctest -j4 --timeout 120 without the seven agc_driver_* tests that fail the same way on a clean main build on this iGPU (f64_fma_subnormals, vop1_float_unary, vopc_compare, prepared_shaders, prepared_shaders_indirect, prepared_shaders_uncached, prepared_shaders_debug): 822/822, Vulkan tests included; agc_driver_flat_store and agc_driver_global_vcc_base need 102 s and 77 s alone here and pass.
  • tools/check_conventions.py --base origin/main and git diff --check pass.
  • eboot.bin and sce_module/libc.prx unwrapped from their SELF containers, relinker --registry, tools/import_audit.py: one absent import (sceRazorCpuNamedSync, #1693), three stubs not reached. Not tested on Windows.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5801114192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3534). Originally posted by [Mouad-Scriptz-0](https://github.com/Mouad-Scriptz-0) on 2026-10-11T12:38:01Z. --- Killzone: Liberation (PPSA11142 01.000.004, Sony's PSP emulator wrapper, Linux) gets past start-up with #1693 (`sceRazorCpuNamedSync`, its first stop on `main`) and #3428 (`sceKernelOpen("")`, its second), reaches `OnGameStart`, and then stops at its first frame: ``` what(): AGC driver: WRITE_DATA at DWORD 248: WRITE_DATA register or GDS destination is not implemented ``` The packet is `c0030037 06100300 7dffe520 00000002 00000000`: DST_SEL 3, WR_CONFIRM, cache policy 3, one dword of 0 to `0x27dffe520`, which is a label the title carves out of its own command-buffer memory. Its code at `0xe8483` (and a second copy at `0x44fe7f`) calls ``` sceAgcDcbAcquireMem(...) sceAgcDcbWriteData(buf, dst 6, cachePolicy 3, label, &zero, 1, increment 0, writeConfirm 1) sceAgcCbReleaseMem(...) sceAgcDcbWaitRegMem(...) ``` With a `fprintf` in `Command::WriteData` the title issues this call ~50 times per second (2045 in 40 s), plus `dst 4, cachePolicy 0` for two-dword data writes (1022). The graphics encoding `((dst & 1) << 30) | ((dst & 0x1e) << 7)` is the one [OpenAGC marks SPRX-confirmed](https://github.com/OpenAGC/OpenAGC/blob/main/src/cb_builders.c), so the console receives the same DST_SEL 3 packet, and the title would wait on its own fence forever unless the console writes that label. AMD's GFX10 header ([`nvd.h`](https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdgpu/nvd.h)) names DST_SEL 3 the GDS; a 40-bit address in the title's memory cannot be a GDS offset (the GDS is 64 KiB). For comparison, Middle Ages Ping Pong (PPSA28319, Unity) passes `dst 4` in all 32 of its `sceAgcDcbWriteData` calls, including its fences with cache policy 3, and runs on `main`. **Fix branch ready:** [`Mouad-Scriptz-0:feat/agc-write-data-dst3`](https://github.com/Mouad-Scriptz-0/AnyPS5/tree/feat/agc-write-data-dst3) (`9c53b7f6`, one commit on `main` 0f863c10). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is (#3433 carried my `truncate` this way). No open PR touches the WRITE_DATA destination (`tools/pr_overlap.py --branch` reports no overlap). - `Validate` accepts DST_SEL 3 next to 1, 2 and 5; `Execute` and `DecodeLabelWrite` already treat every accepted destination as a memory write, so nothing else changes. A register destination (0) still throws. - `agc_driver_pm4` gains: a DST_SEL 3 write lands in guest memory, a one-dword DST_SEL 3 write resolves as a label, and DST_SEL 0 is still refused. - TechnicalDebt records that the console's routing (GDS or cache) is unknown and where the memory-write semantics come from. **Result.** With #1693, #3428 and this branch merged locally, the title runs for the full 120 s of a sandboxed run with no exception (4899 log lines, `OnGameStart`, `sceDisplaySetMode 480x272`, continuous frames) and shows its controls screen at 49 fps; on `main` + #1693 + #3428 it dies at DWORD 248 of its first submission every time. The four `storage image multisampling is unavailable on the target device` shaders are an Intel driver limit, not this change. Its next stop, past this branch: pressing START saves the wrapper's settings, mounts the disc (`sceUmdActivate(1, disc0:)`), loads `UCUS98646#v1.00/vms/GAME/UCUS98646/KZL.PRX`, and the first frame of the PSP game itself stops in the graphics driver: ``` [videoout] presentation failed: AGC graphics: null vertex buffer table address terminate called after throwing an instance of 'std::runtime_error' what(): AGC graphics: null vertex buffer table address ``` (`ShaderInputState.cpp:197`, a vertex shader with a vertex attribute table whose vertex buffer table user SGPRs hold 0.) No open PR or issue mentions it. Separately, with Noto fonts in `anyps5-fonts/` the controls screen's text reaches `sceFontCharacterGetSyllableStringState` (the stub #2497 implemented; reported there) and then `sceFontWritingLineWritesOrder: writing attribute 2147483898 is not modelled`; without fonts the text is blank and the title runs. **Tested** on Fedora 44 (kernel 7.2.8, GCC 16.2.1, Ninja, Release, full build with `BUILD_TESTING=ON`, Intel Arc Meteor Lake iGPU, Mesa 26.2.3): - `agc_driver_pm4` passes. - `ctest -j4 --timeout 120` without the seven `agc_driver_*` tests that fail the same way on a clean `main` build on this iGPU (`f64_fma_subnormals`, `vop1_float_unary`, `vopc_compare`, `prepared_shaders`, `prepared_shaders_indirect`, `prepared_shaders_uncached`, `prepared_shaders_debug`): 822/822, Vulkan tests included; `agc_driver_flat_store` and `agc_driver_global_vcc_base` need 102 s and 77 s alone here and pass. - `tools/check_conventions.py --base origin/main` and `git diff --check` pass. - `eboot.bin` and `sce_module/libc.prx` unwrapped from their SELF containers, `relinker --registry`, `tools/import_audit.py`: one absent import (`sceRazorCpuNamedSync`, #1693), three stubs not reached. Not tested on Windows. AI-assisted: yes (Claude Code).
MarcZX10 commented 2026-10-11 12:42:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T12:42:37Z.


Carried the fix into PR #3539, preserving Mouad's commit authorship. On current main, the full Linux Release build passed and agc_driver_pm4 passed three consecutive runs. PR CI is queued; the issue reporter's Fedora/Intel Arc title run is recorded separately in the PR description.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109137294 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3534#issuecomment-6109137294). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T12:42:37Z. --- Carried the fix into [PR #3539](https://github.com/boykopovar/AnyPS5/pull/3539), preserving Mouad's commit authorship. On current `main`, the full Linux Release build passed and `agc_driver_pm4` passed three consecutive runs. PR CI is queued; the issue reporter's Fedora/Intel Arc title run is recorded separately in the PR description.
Mouad-Scriptz-0 commented 2026-10-11 13:02:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Mouad-Scriptz-0 on 2026-10-11T13:02:17Z.


Follow-up on the stop after this branch, with the registers. Second run (same Fedora 44 / Intel Arc setup, main 0f863c10 + #1693 + #3428 + this branch): the wrapper's settings were already in save data, so it skips the controls screen, starts the PSP game ((AppEmu) RUNNING, sceUmdActivate(1, disc0:), loads KZL.PRX) and stops on its first frame:

[vb-table] vertexBufferReg 4 vertexAttribReg 6 attribTable 0x31016fac00000000 userData: 0 0 0 0 0 0 0 31016fac 7efff390 100002 49 4dfac 7effe190 2 810000e8 2
  what():  AGC graphics: null vertex buffer table address

([vb-table] is a local diagnostic in ShaderInputState.cpp printing the decoded direct-resource registers and the 16 user SGPRs at the throw.) The shader header places the vertex buffer table at user SGPRs 4-5 and the attribute table at 6-7, but SGPRs 0-6 are zero and the pointer-like pairs sit from SGPR 8 (7efff390 00100002, 7effe190 00000002), the same lo, hi|0x00100000 shape the title writes with SET_SH_REG at offset 0x8c on its controls screen. So the table the driver looks for is four registers lower than where the title put its data, or this shader's ABI is one the decoder does not model. I also checked the SET_*_REG_INDIRECT snapshot theory from TechnicalDebt with a diagnostic that re-reads every indirect list at execution and compares: no list changed between submission and execution in this run, so it is not that.

I have not gone further; it needs someone who knows the shader ABI decoding. AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109300771 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3534#issuecomment-6109300771). Originally posted by [Mouad-Scriptz-0](https://github.com/Mouad-Scriptz-0) on 2026-10-11T13:02:17Z. --- Follow-up on the stop after this branch, with the registers. Second run (same Fedora 44 / Intel Arc setup, `main` 0f863c10 + #1693 + #3428 + this branch): the wrapper's settings were already in save data, so it skips the controls screen, starts the PSP game (`(AppEmu) RUNNING`, `sceUmdActivate(1, disc0:)`, loads `KZL.PRX`) and stops on its first frame: ``` [vb-table] vertexBufferReg 4 vertexAttribReg 6 attribTable 0x31016fac00000000 userData: 0 0 0 0 0 0 0 31016fac 7efff390 100002 49 4dfac 7effe190 2 810000e8 2 what(): AGC graphics: null vertex buffer table address ``` (`[vb-table]` is a local diagnostic in `ShaderInputState.cpp` printing the decoded direct-resource registers and the 16 user SGPRs at the throw.) The shader header places the vertex buffer table at user SGPRs 4-5 and the attribute table at 6-7, but SGPRs 0-6 are zero and the pointer-like pairs sit from SGPR 8 (`7efff390 00100002`, `7effe190 00000002`), the same `lo, hi|0x00100000` shape the title writes with `SET_SH_REG` at offset 0x8c on its controls screen. So the table the driver looks for is four registers lower than where the title put its data, or this shader's ABI is one the decoder does not model. I also checked the SET_*_REG_INDIRECT snapshot theory from TechnicalDebt with a diagnostic that re-reads every indirect list at execution and compares: no list changed between submission and execution in this run, so it is not that. I have not gone further; it needs someone who knows the shader ABI decoding. AI-assisted: yes (Claude Code).
blawesom commented 2026-10-11 13:08:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T13:08:55Z.


Independent verification on Linux: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON.

  • Rebased 9c53b7f6 onto current main: applies cleanly, no conflicts.
  • tools/check_conventions.py --base origin/main and git diff --check pass.
  • The agc write-data tests pass, including the new DST_SEL 3 cases.
  • Full suite: 832/832 (all tests including the Vulkan suites on AMD RX 9070 XT / RADV).

The rebased branch is available at blawesom:verify/3534 for anyone carrying — the commit is otherwise unchanged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109356667 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3534#issuecomment-6109356667). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T13:08:55Z. --- Independent verification on **Linux**: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`. - Rebased `9c53b7f6` onto current `main`: applies cleanly, no conflicts. - `tools/check_conventions.py --base origin/main` and `git diff --check` pass. - The agc write-data tests pass, including the new DST_SEL 3 cases. - Full suite: **832/832** (all tests including the Vulkan suites on AMD RX 9070 XT / RADV). The rebased branch is available at [`blawesom:verify/3534`](https://github.com/blawesom/AnyPS5/tree/verify/3534) for anyone carrying — the commit is otherwise unchanged.
Sign in to join this conversation.
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#3534
No description provided.