Files
AnyPS5/docs/dev/debt/libSceGnmDriver.md
T
ntamas94andClaude Opus 5.5 003df54167 fix(libSceGnmDriver): drop the title-specific hint from the packet type error
A header dword of 1 is a valid type-0 write in general, so the error
keeps the type, header and position only; the debt entries keep the
explanation and note that the submission wait holds the submit lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 10:38:11 +01:00

3.7 KiB

libSceGnmDriver technical debt

Silent stubs

  • sceGnmAreSubmitsAllowed (libSceGnmDriver, PS4) - returns 1: submissions are never suspended here, because nothing on the host takes the GPU away from the title. shadPS4 returns 0 only while its submission lock is held.
  • sceGnmIsUserPaEnabled, sceGnmDriverCaptureInProgress, sceRazorIsLoaded (libSceGnmDriver, PS4) - return false: the user performance analysis mode, GPU captures and the Razor GPU profiler belong to development tools and are not present, as shadPS4 also answers for retail firmware. A title only skips its tool hooks on these answers.

Unknown function info

  • Command buffer writers (libSceGnmDriver, PS4) - the packets, register offsets and reserved sizes the sceGnm writers emit follow shadPS4; they are not checked on a console. Submitted buffers run on the AGC executor: PS4 EOP, EOS and SURFACE_SYNC packets are lowered to RELEASE_MEM and ACQUIRE_MEM, constant engine buffers are merged into the draw buffer, type-2 filler packets are dropped, the CP_DMA prefetch of the PS4 SDK is a NOP, and a flip reservation for an interrupt flip throws.
  • sceGnmLogicalCuMaskToPhysicalCuMask, sceGnmLogicalCuIndexToPhysicalCuIndex (libSceGnmDriver, PS4) - throw: they translate a logical compute unit mask or index of the title into the physical compute units of the console GPU. That mapping depends on which units are disabled on each chip and is not documented; shadPS4 returns the logical mask unchanged, which is not evidence of the console result.

Functional

  • Packet types (libSceGnmDriver, PS4) - on the PS4 Gnm path a type-0 packet (a register write by base index and count) or a type-1 packet in a draw or constant command buffer throws with its type, header and dword position; neither is applied, because no title has shown what a type-0 payload carries here, and the AGC driver (PM4 type-0 packets in libSceAgcDriver.md) rejects them too. Seen in CUSA04865, which produces a header dword of 1 itself: its compute dispatch, through a 16-byte V# over an 8-byte allocateFromCommandBuffer block, stores 1 over the next packet's header after the title has rebuilt the buffer for the next frame, while the queue trails the title by several milliseconds; the message gives the header and position only, since a dword of 1 is also a valid type-0 write in general, and APS5_GNM_SUBMIT_WAIT_IDLE=1 (Submission pacing, below) keeps the queue ahead of it.
  • Submission pacing (libSceGnmDriver, PS4) - a submission is queued without waiting for earlier ones, so the GPU can trail the title by several milliseconds, far more than the console's command processor. A title that reuses command buffer memory or descriptor tables a frame later then races with work that has not run yet: CUSA04865 loses packet headers and binds descriptors from rebuilt tables. APS5_GNM_SUBMIT_WAIT_IDLE=1 waits for all queued work before each sceGnmSubmitCommandBuffers and sceGnmSubmitAndFlipCommandBuffers that follows an earlier one, across sceGnmSubmitDone as well, so the GPU trails the title by at most one submission, which removes these races there; it is off by default because a submission whose packets wait on a label the title writes only after a later submission would never finish. The wait holds the submission lock, so a label written by another thread after it takes that lock hangs the same way.