fix(libScePlayGo): report missing chunk metadata #5494
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5494"
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 MarcZX10 on 2026-10-13T21:06:33Z.
What
When a package has neither
playgo-chunkdefs.xml,sce_sys/playgo-chunk.dat, norsce_sys/playgo-scenario.json, the dump cannot establish whether nonzero chunk IDs exist. Keep chunk 0 available, but throw a diagnostic naming the missing metadata when a title queries another ID. Complete package tables still returnSCE_PLAYGO_ERROR_BAD_CHUNK_IDfor IDs outside the table. Update the technical-debt note and regression coverage for both paths.This is related to #5487, but it does not make the incomplete High on Life dump load successfully. It gives a clear stop instead of guessing that undocumented chunks are installed.
Tested
Export.cppandGuestPlayGo.cppwith a temporaryResolvePath_nid_no_patchharness and ranguest_playgo_testssuccessfully.python3 tools/check_conventions.py --base upstream/mainpassed.git diff --checkpassed.SDL2Config.cmake).Checklist
main; no duplicate implementation identifiedImported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T01:36:58Z.
Review: COMMENTED
The description is clear about the trade-off, but this is the kind of change upstream has turned down. An environment switch that makes PlayGo answer "installed" for chunk IDs the package doesn't describe is an approximation: with it on, the answers no longer correspond to the package, and titles that enumerate until the first rejected ID never stop. Reviewers have asked for approximations, even opt-in or logged ones, to stay on testing branches, and for upstream to either be exact or throw (see the CMASK discussion on #1237).
The underlying case is a dump with no
playgo-*files, which means the dump is incomplete rather than the title being unusual. Two exact alternatives:RejectUnreadablePlayGoFilesis already there) with a message telling the user the dump lackssce_sys/playgo-chunk.dat;app0file layout.Users who need the switch for a particular broken dump can carry it on a fork branch.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T05:05:07Z.
Thanks for the review. The associated #5487 report now has a title-side A/B: with the opt-in, High on Life asks
scePlayGoGetLocusfor IDs 0–999 and stops itself; without it, IDs ≥1 returnBAD_CHUNK_IDand block the save load. That is evidence for this opt-in workaround, not for console semantics. I agree the opt-in still lets an enumeration-until-error title run past its normal stop, which is why the default remains strict and the behavior is prominently documented. If the project policy excludes even explicit user-selected compatibility workarounds from upstream, I can rework this as a clear missing-metadata error instead; I wanted to make sure the High on Life evidence is considered before choosing between those outcomes.Imported from boykopovar/AnyPS5. Originally posted by AlexOfTheForest on 2026-10-14T06:01:09Z.
Scope matches #5487: the variable is only read when there's no playgo-chunk.dat, no package chunk table and no playgo-scenario.json, and the default stays strict.
One thing: other APS5_* switches in core/libs/prx are enabled just by being set (getenv(...) != nullptr, e.g. APS5_NO_TIMELINE, APS5_COARSE_TIMED_WAITS). This one needs exactly "1", so =true or =yes is silently ignored and the user still gets the save error. Either follow the presence convention or reject values other than 0/1 with an error, so a typo doesn't look like the setting doing nothing.
Also, with the setting on, scePlayGoGetLocus accepts every id while scePlayGoGetChunkId still returns only chunk 0. USAGE.md mentions it; a line in the debt entry would help too, since a title that cross-checks both will see them disagree.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T12:28:58Z.
Thanks for the review. I pushed
36a4e690a: the setting now accepts only0or1; another explicitly set value throws an error naming the required values at the first relevant PlayGo query. The regression covers the unset default, explicit0, permissive1, and rejects bothtrueandyes. The existing test also confirms thatscePlayGoGetChunkIdlists only chunk 0 under the opt-in; the technical-debt entry already documents that distinction.\n\nOn Linux, I compiled the realExport.cppandGuestPlayGo.cppand ran the focused test executable successfully using a temporary stub only for path resolution.check_conventions.pyandgit diff --checkpass. Full CMake configuration was unavailable because SDL2 development files are absent in this environment.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T12:34:10Z.
Thanks for spelling out the upstream constraint. I removed the approximation entirely. With no chunk table or scenario metadata, chunk 0 remains available and a query for any other ID now throws a diagnostic naming both missing metadata files and the queried ID; a complete chunk table still returns BAD_CHUNK_ID for an ID outside that table. I added regression coverage for both cases. The focused Linux GuestPlayGo test executable and convention checks pass; full CMake configure remains unavailable here because SDL2 development files are missing.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T19:59:16Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/debt/libScePlayGo.mdL5Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T20:59:24Z.
Checked the diff,
guest_playgo(passes with the change, fails without it) and the partial ctest (33 tests) on Linux; the debt note matches the code. Merging.Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-14T22:25:24Z.
@adriadam10 @MarcZX100, before this merges: the current head (
a44689c48) no longer has the opt-in. It now throws when a dump without PlayGo metadata asks about a nonzero chunk. That turns two known titles from "running" into "aborting at startup":scePlayGoGetLocusone id at a time until the first error. Onmainthat error isBAD_CHUNK_IDat id 1, which is what ends the walk. With this head, id 1 throws instead. The debt note lists Demon Slayer (PPSA03490) and Returnal (PPSA01285) in the same no-file group.mainit getsBAD_CHUNK_IDand runs, with the "damaged save" symptom from #5487. With this head, it aborts at id 1.I haven't run this head on High on Life; the above is from the diff and the call pattern logged on #5487. If a clear stop is the goal, I'd keep
BAD_CHUNK_IDas the default answer (it is what #4491 settled on for Sifu) and log the missing metadata once, rather than throw. The earlier opt-in (APS5_PLAYGO_ASSUME_UNLISTED_CHUNKS_INSTALLED) worked for High on Life, as reported on #5487.Tested and written by Claude (AI assistant) on a contributor's machine.