Skip to content

fix(libScePlayGo): take the chunk set from sce_sys/playgo-chunk.dat - #3435

Merged
adriadam10 merged 3 commits into
boykopovar:mainfrom
alfalfa-star:fix/playgo-package-chunk-table
Oct 11, 2026
Merged

adriadam10 merged 3 commits into
boykopovar:mainfrom
alfalfa-star:fix/playgo-package-chunk-table

Conversation

@alfalfa-star

@alfalfa-star alfalfa-star commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Since #3238, a dump without playgo-chunkdefs.xml accepts every chunk id. Unreal Engine 4 titles find their chunks by calling scePlayGoGetLocus for ids 0, 1, 2, ... until it returns SCE_PLAYGO_ERROR_BAD_CHUNK_ID (0x80B2000C). That error never comes now, so the loop never ends.

Title: RIDE 4 (PPSA01599, UE4) on main 8ec0e13 adds a chunk entry on every pass of that loop, on the main thread during engine pre-init. It stops a few seconds in, before any window, with:

PS5 Out of Memory:
    AvailablePhysical: 4901502976
    UsedPhysical:      9279373312
LowLevelFatalError [File:Unknown] [Line: 186]
Ran out of memory allocating 5565054976 bytes with alignment 65536

Under gdb, the loop is a virtual call per chunk index at app.elf+0x254f73f. That call returns 0 (stop) only when scePlayGoGetLocus returns 0x80B2000C. Its loop counter is an int while the chunk ids are uint16_t, so it wraps and never ends.

Fix

PS5 dumps do carry the package's chunk table: sce_sys/playgo-chunk.dat, magic plgx. The 16-bit value at offset 0x0A is the chunk count. In four dumps, exactly that many 0x20-byte chunk entries follow from offset 0x100, and the field at 0x10 is the file size:

Title count at 0x0A file size
RIDE 4 (PPSA01599) 35 0xA10
Persona 5 Royal (PPSA05110) 25 0x760
LEGO Horizon Adventures (PPSA14632) 1 0x1A0
Kena: Bridge of Spirits (PPSA01802) 1 0x1A0

The chunk set is now taken from these sources, in order:

The comment block above the chunk table described only the XML source, so it is removed. The TechnicalDebt entry now says where the set comes from and what is assumed about the plgx format.

Tested

Linux (Arch), GCC, Release, on main 99c1c26.

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

🤖 Generated with Claude Code

alfalfa-star and others added 3 commits October 11, 2026 12:29
Without playgo-chunkdefs.xml every chunk id was accepted, so a title
that probes chunk ids until SCE_PLAYGO_ERROR_BAD_CHUNK_ID never stops.
RIDE 4 (PPSA01599, Unreal Engine 4) grows its chunk list until it runs
out of memory. The package's chunk table header holds the chunk count
at offset 0x0A; ids below it are valid. Every id is still accepted only
when neither file exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A child process runs from a root whose app0/sce_sys/playgo-chunk.dat
declares 3 chunks: ids 0-2 are local, id 3 is rejected with
SCE_PLAYGO_ERROR_BAD_CHUNK_ID and scePlayGoGetChunkId counts 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked build and ctest (libs/PlayGo, 19 tests) on the PR merged onto main, and that guest_playgo fails without the change and passes with it. The chunk_count offset (0x0A) matches the PlayGo header layout in shadPS4. Assumption of contiguous ids is recorded in TechnicalDebt; merging.

@adriadam10
adriadam10 merged commit f6d156a into boykopovar:main Oct 11, 2026
16 checks passed
@alfalfa-star
alfalfa-star deleted the fix/playgo-package-chunk-table branch October 11, 2026 10:41
@Tamalero

Copy link
Copy Markdown
Contributor

Checked on Guardians of the Galaxy (PPSA01748): it keeps working. Its dump has neither sce_sys/playgo-chunk.dat nor playgo-chunkdefs.xml, only sce_sys/playgo-scenario.json. So ReadPackageChunks returns false, the table stays undefined, and every chunk id is accepted as with #3238. The same holds for my Ratchet & Clank: Rift Apart (PPSA01474) and High on Life (PPSA15388) dumps, which have neither file either.

Run check: libScePlayGo.prx built from main cbd98bbd, swapped into my otherwise unchanged build. Guardians passes its chunk queries (ids 1-10) and renders to frame 1441 (one run). Without #3238 it stalls before the loading screen.

So for these three dumps the new path is never taken. I couldn't test the plgx table itself, since none of them has one.

Tested and written by Claude (AI assistant) on a contributor's machine.

@xXPBSXx

xXPBSXx commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

The change is now open as #4491 (ids below 256 accepted without a chunk table; Sifu, Demon Slayer and Returnal numbers in its description). The chunk count read from playgo-chunk.dat (#3435) and the Guardians case of #3238 (ids 1 to 10) are unchanged.

AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants