fix(libScePlayGo): list chunks 0 to 999 when only a scenario file is present #7726

Merged
milescoviello merged 2 commits from upstream-pr/7726 into main 2026-10-20 02:22:30 +00:00
milescoviello commented 2026-10-19 03:16:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T03:16:11Z.


What

Ghost of Tsushima (PPSA02225) stays on a black screen: it never reads its English audio, two of its music archives or its opening movie. Its dump has sce_sys/playgo-scenario.json and no chunk table. For such a dump scePlayGoGetLocus already answers every chunk id as installed, but scePlayGoGetChunkId listed only chunk 0.

The title reads its own chunk map, cache_ps5/playgo.pgm, at start. It then calls scePlayGoGetChunkId with room for 1000 ids, builds a hash set from the ids it gets back, and keeps only the playgo.pgm entries whose chunk is in that set (app.elf 0xb76f00 to 0xb773f5). Entries in any other chunk are never marked as installed, so the title never loads them.

  • scePlayGoGetChunkId, for a dump with only a scenario file, now lists ids 0 to 999. 1000 is the room this title passes. The console's chunk limit is not known here, and the debt entry says so.
  • Dumps with playgo-chunkdefs.xml or playgo-chunk.dat, and dumps with no PlayGo file at all, are unchanged.

Tested

Ubuntu 24.04, GCC 13.3, NVIDIA RTX 4070 Ti, on main 43797ca8a9 (it merges with ca13a56a58 cleanly).

  • guest_playgo (Linux): the scenario-only case now requires 1000 listed ids, in order (0 to 999), all LOCAL_FAST from scePlayGoGetLocus, and a 2-entry buffer filled with 0 and 1.
    • On main with the new test, guest_playgo aborts: the scenario-only case finds one listed chunk.
    • With the fix, guest_playgo passes 3 of 3.
    • Windows: @xXPBSXx ran it merged onto main 676d42396 with #7725 (MinGW-w64, WinLibs): guest_playgo passes 3 of 3, and aborts 3 of 3 with main's Export.cpp and the changed test.
  • Ghost of Tsushima (PPSA02225), NVIDIA RTX 4070 Ti, Release libraries, APS5_TRACE_APR=1:
    • On main 43797ca8a9, 301 s: it reads 13 files through APR (75 reads: shaders, English text, two bitmaps, the start-up sound banks, music archives a, d and e), and all 40 dumped frames are black.
    • With this PR on the same main: by 47 s it has also read lang_english_audio.xpps, psarc/lang_english_audio.psarc, music archives b and c, and 91 reads of its opening movie movies/cutscene/splash_america.bsf, whose H.264 stream it decodes through sceVideodec2 (185 reads in all). It then stops at the splash screen on stencil replacement 0x40 against test value 0xff, which #7725 handles. With #7725 as well, it stops 41 s in on the next check, a one-sample depth target under a 2x rasterizer with PS_ITER_SAMPLE; a PR for that follows.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: PPSA02225 (Ghost of Tsushima, together with #7725), #5166
  • GPUs tested: NVIDIA RTX 4070 Ti (Linux)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4915295062 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7726). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T03:16:11Z. --- ### What Ghost of Tsushima (PPSA02225) stays on a black screen: it never reads its English audio, two of its music archives or its opening movie. Its dump has `sce_sys/playgo-scenario.json` and no chunk table. For such a dump `scePlayGoGetLocus` already answers every chunk id as installed, but `scePlayGoGetChunkId` listed only chunk 0. The title reads its own chunk map, `cache_ps5/playgo.pgm`, at start. It then calls `scePlayGoGetChunkId` with room for 1000 ids, builds a hash set from the ids it gets back, and keeps only the `playgo.pgm` entries whose chunk is in that set (`app.elf` 0xb76f00 to 0xb773f5). Entries in any other chunk are never marked as installed, so the title never loads them. - **`scePlayGoGetChunkId`**, for a dump with only a scenario file, now lists ids 0 to 999. 1000 is the room this title passes. The console's chunk limit is not known here, and the debt entry says so. - Dumps with `playgo-chunkdefs.xml` or `playgo-chunk.dat`, and dumps with no PlayGo file at all, are unchanged. ### Tested Ubuntu 24.04, GCC 13.3, NVIDIA RTX 4070 Ti, on `main` 43797ca8a9 (it merges with ca13a56a58 cleanly). - **`guest_playgo` (Linux)**: the scenario-only case now requires 1000 listed ids, in order (0 to 999), all `LOCAL_FAST` from `scePlayGoGetLocus`, and a 2-entry buffer filled with 0 and 1. - On `main` with the new test, `guest_playgo` aborts: the scenario-only case finds one listed chunk. - With the fix, `guest_playgo` passes 3 of 3. - Windows: @xXPBSXx [ran it](https://github.com/boykopovar/AnyPS5/pull/7726#issuecomment-6260352635) merged onto `main` 676d42396 with #7725 (MinGW-w64, WinLibs): `guest_playgo` passes 3 of 3, and aborts 3 of 3 with `main`'s `Export.cpp` and the changed test. - **Ghost of Tsushima (PPSA02225)**, NVIDIA RTX 4070 Ti, Release libraries, `APS5_TRACE_APR=1`: - On `main` 43797ca8a9, 301 s: it reads 13 files through APR (75 reads: shaders, English text, two bitmaps, the start-up sound banks, music archives a, d and e), and all 40 dumped frames are black. - With this PR on the same `main`: by 47 s it has also read `lang_english_audio.xpps`, `psarc/lang_english_audio.psarc`, music archives b and c, and 91 reads of its opening movie `movies/cutscene/splash_america.bsf`, whose H.264 stream it decodes through `sceVideodec2` (185 reads in all). It then stops at the splash screen on `stencil replacement 0x40 against test value 0xff`, which #7725 handles. With #7725 as well, it stops 41 s in on the next check, a one-sample depth target under a 2x rasterizer with `PS_ITER_SAMPLE`; a PR for that follows. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA02225 (Ghost of Tsushima, together with #7725), #5166 - [x] GPUs tested: NVIDIA RTX 4070 Ti (Linux) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-19 03:28:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T03:28:48Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestPlayGo.cpp
PR 8106 core/libs/prx/libScePlayGo/Export.cpp
docs/dev/debt/libScePlayGo.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6259013816 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7726#issuecomment-6259013816). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T03:28:48Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestPlayGo.cpp` | | [PR 8106](https://www.github.com/boykopovar/AnyPS5/pull/8106) | `core/libs/prx/libScePlayGo/Export.cpp`<br>`docs/dev/debt/libScePlayGo.md` |
xXPBSXx commented 2026-10-19 05:27:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-19T05:27:15Z.


Windows data point for 42f4382bc (this PR) merged onto main 676d42396 together with #7725 (c9fe9292d) in one tree (f58459c78, both merges clean, git status empty): Windows 10 (10.0.19045), MinGW-w64 (WinLibs) toolchain, ctest -R '^guest_playgo$', one fresh process per run.

  • With the PR: passes 3 of 3.
  • Same tree with libScePlayGo/Export.cpp restored to main (git checkout upstream/main -- core/libs/prx/libScePlayGo/Export.cpp, the changed test code kept): fails 3 of 3 (exit 8; ctest reports guest_playgo (Exit code 0xc0000409), which is the test's abort path on Windows, not a title error).

Not tested: a title run on Windows, other GPUs, Linux.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6260352635 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7726#issuecomment-6260352635). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-19T05:27:15Z. --- Windows data point for `42f4382bc` (this PR) merged onto `main` `676d42396` together with #7725 (`c9fe9292d`) in one tree (`f58459c78`, both merges clean, `git status` empty): Windows 10 (10.0.19045), MinGW-w64 (WinLibs) toolchain, `ctest -R '^guest_playgo$'`, one fresh process per run. - With the PR: passes 3 of 3. - Same tree with `libScePlayGo/Export.cpp` restored to `main` (`git checkout upstream/main -- core/libs/prx/libScePlayGo/Export.cpp`, the changed test code kept): fails 3 of 3 (exit 8; ctest reports `guest_playgo (Exit code 0xc0000409)`, which is the test's abort path on Windows, not a title error). Not tested: a title run on Windows, other GPUs, Linux. AI-assisted (Claude Code).
milescoviello commented 2026-10-19 06:05:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T06:05:30Z.


@xXPBSXx thanks for the Windows run and the control with main's Export.cpp. I've added it to the description.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6260812513 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7726#issuecomment-6260812513). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T06:05:30Z. --- @xXPBSXx thanks for the Windows run and the control with `main`'s `Export.cpp`. I've added it to the description. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-19 10:21:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T10:21:58Z.


@milescoviello The change and the test look right. One thing before merge: the project doesn't name specific games or their IDs in the docs (the debt files included). Could you drop "Ghost of Tsushima PPSA02225" and the "PPSA02225 builds its set…" sentence from the libScePlayGo.md entry, and keep the mechanism? For example: "…accepts every chunk id as installed, and scePlayGoGetChunkId lists ids 0 to 999. A title that builds its set of installed chunks from that list skips any chunk it does not see. The console's chunk limit is not known here, and a package with more chunks would see ids from 1000 up as not listed." The title-specific context is welcome in the game's bring-up discussion.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6265001256 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7726#issuecomment-6265001256). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-19T10:21:58Z. --- @milescoviello The change and the test look right. One thing before merge: the project doesn't name specific games or their IDs in the docs (the debt files included). Could you drop "Ghost of Tsushima PPSA02225" and the "PPSA02225 builds its set…" sentence from the `libScePlayGo.md` entry, and keep the mechanism? For example: "…accepts every chunk id as installed, and `scePlayGoGetChunkId` lists ids 0 to 999. A title that builds its set of installed chunks from that list skips any chunk it does not see. The console's chunk limit is not known here, and a package with more chunks would see ids from 1000 up as not listed." The title-specific context is welcome in the game's bring-up discussion.
milescoviello commented 2026-10-19 11:04:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T11:04:34Z.


@oneandonlydean done in e8d68f482c, with your wording. The entry now says "A title that builds its set of installed chunks from that list skips any chunk it does not see", and names no game. The Ghost of Tsushima details are on #5166.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6265725183 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7726#issuecomment-6265725183). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T11:04:34Z. --- @oneandonlydean done in e8d68f482c, with your wording. The entry now says "A title that builds its set of installed chunks from that list skips any chunk it does not see", and names no game. The Ghost of Tsushima details are on #5166. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No reviewers
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!7726
No description provided.