PPSA21567: submission stops on "unsupported PM4 packet type: header 0x00000001" where a RELEASE_MEM header is expected #1458
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T07:40:55Z.
On
main6b573862(with #285 and #943), with #759 merged locally, PPSA21567 (Astro Bot, v01.019.000) stops at submission validation about 20 s after start, the same way in every run:Before this point the buffer is a run of
RELEASE_MEMpairs betweenPUSH_MARKER/POP_MARKER. The first packet of each pair writes0x4_0367xxxx; the second has payload06000514 01010000 0 0 0 0 0000abcd. At DWORD 8730 the second packet's payload is there, but its header is0x00000001where0xc0064900is expected.What I checked:
copySegment, the submission is one segment,0x502002500, 10340 words, with noINDIRECT_BUFFERorCOND_INDIRECT_BUFFERjump. So the word is0x00000001in guest memory whencopyCommandsruns at submit.astrobot(93faece1, and 88d7bb62) runs past this point into the intro on the same machine and dump.mainwithout #759 stops earlier, oncompute shader 0x5005f6100: AGC driver: guest memory is not readable at 0x30, so I could not testmainalone at this point.Not established: who writes
1there, or whether the title fills that header after submitting the buffer (the console's CP reads it later thancopyCommandsdoes).Host: CachyOS, kernel 7.2.9, GCC 16.2.1, Ryzen 7 7800X3D, RX 9070 XT (RADV GFX1201, Mesa 26.2.4), default
udmabuf.size_limit_mb(64).AI-assisted: yes (Claude Code ran the builds and wrote this; the runs are on my machine).
Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T07:56:08Z.
Found the writer of the
1: it is the driver's deferred completion-label store, not the title.Hardware watchpoint (gdb,
watch -lon0x502002500 + 8730*4 = 0x50200ad68, armed 12 s in):memcpyto0x50200ad64(the title writing new commands there). Afterwards the word is0x00000000.libc memcpywithrdi = 0x50200ad68, value1, called fromRecorder::finish→Recorder::AfterCompletions(...)::{lambda()#2}→GuestMemory::StoreOwnBytes→memcpy(
libSceAgcDriver.prx+0x2ab561, +0x295e5f, +0x203987, +0x2038a1, +0x1fd598).The submission copy then reads
1as the header.What is queued there (a local print in
AfterCompletionsfor addresses in0x502000000–0x502100000). The title queues label stores into its own command-buffer range, in pairs per frame, and none is stored on the GPU:The same happens for other addresses in that buffer (
0x502002d68,0x502002f38,0x502003040, …): 10516 such completion stores in one 300 s run. WithstoredOnGpu 0the value only lands when the batch's completions run infinish. By then the title has already rewritten that memory as the next command buffer, so the late store overwrites a packet header. On hardware the label would be written in stream order, before the title moves on.Not established: why
astrobot(93faece1) does not stop here. Withudmabuf.size_limit_mb=64on both, so the same imports fail,astrobotran 240 s without this error. So the difference is in the driver, not the import limit.AI-assisted: yes (Claude Code ran the watchpoint and the instrumented build and wrote this; the runs are on my machine).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T09:49:41Z.
astrobottakes the same path here.WriteLabelOnGpu'simport == nullptrbranch (VulkanDevice.cpp:1255on main) andRecorder::AfterCompletionsare the same code in both.astrobothas no udmabuf import (815d2747isn't in it), so on RADV it can't import this range either and defers the same store. The difference is pacing:astrobotholdsDriver::Submitwhile a submission with a flip is queued and not yet started (throttleSubmit, 40cd74e2), so the title doesn't get far enough ahead to reuse that memory before the batch is reaped. That hides the bug but doesn't fix it. Two runs should confirm it (not run here):astrobotwithAPS5_MAX_QUEUED_FLIPS=offshould stop at the same DWORD, and main withAPS5_DRAIN_COMPLETION_LABELS=1should get past it.The fix belongs in that branch. A label the GPU can't store has to be stored at its place in the stream, not when the batch is reaped. With the current code, the exact way is the drain path: wait for the recorded work, then store on the CPU. That means the deferred
AfterCompletions(..., false)goes away.Recorder.hppalready describes this hazard for thestoredOnGpucase, and the plain store has the same problem.Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:51:23Z.
This is a complex GPU command buffer issue. Based on my review of recent PRs related to the AGC driver and shader recompiler, I can provide some context:
The fact that oneandonlydean's
astrobotbranch runs past this point suggests there may be a difference in how command buffers are being processed or validated between the two implementations. The issue correctly identifies that the word0x00000001appears where a RELEASE_MEM header (0xc0064900) is expected, and that this happens consistently at the same DWORD offset.Some observations based on similar issues I've seen:
I'd suggest comparing how oneandonlydean's implementation handles command buffer submission and validation to see if there are any differences that might explain why it works.
Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-08T12:30:14Z.
Results for the two runs you suggested, plus one correction on the repro conditions.
Repro conditions
udmabuf.size_limit_mbat the default 64, which I hadn't noticed.main(6b573862+ #759, same build as before) did not stop in 7 runs of 100 s each, headless and windowed.APS5_HOST_IMPORT_MIB=64(host import budget: 0 MiB live of 64 MiB). That stops at the same place:unsupported PM4 packet type: header 0x00000001 at DWORD 8730 of 10340.mainwith the budget at 64, 100 s per run, headless gamescopestoredOnGpu=0stores queued into 0x502000000–0x502100000APS5_DRAIN_COMPLETION_LABELS=1, 3 runsSo the drain path gets past it, and it removes every deferred store into that range. This matches your reading.
astrobotwithAPS5_MAX_QUEUED_FLIPS=off: not confirmedastrobot88d7bb62 + #943 + #1334 + #1065, with the budget at 64.astrobotrun with flips off and no budget cap ended after about 25 s in a gfx ring timeout with no page fault (vkQueueSubmit recorder: Vulkan result -4). I haven't tied that to this bug.AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T06:25:35Z.
#2044 now stores labels the GPU can't reach in stream order. Could you retest on current main?
Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-10T08:05:32Z.
Retested on
maina29bae31: fixed.Linux (CachyOS, GCC, Release), RX 9070 XT, RADV / Mesa 26.2.4, headless gamescope. I used the same repro conditions as before,
APS5_HOST_IMPORT_MIB=64, so the DCB range stays unimported. Before, every run stopped about 20 s in onunsupported PM4 packet type: header 0x00000001 at DWORD 8730 of 10340.ShaderRecompiler::Recompile: shader image heap capacity exceeded(#1789).Closing, since #2044 resolves it.
Tested and written by Claude (AI assistant) on a contributor's machine.