fix(libScePlayGo): answer chunk ids from the package layout #4491
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4491"
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 xXPBSXx on 2026-10-12T13:27:53Z.
What
Without
playgo-chunkdefs.xmlorsce_sys/playgo-chunk.datevery chunk id was accepted by the PlayGo chunk checks (scePlayGoGetLocus,GetEta,GetProgress,Prefetch,SetToDoList). A title that walks the ids one call at a time until the first error then never stops: Sifu (PPSA03001), whose dump has no PlayGo file, calledscePlayGoGetLocuswith one ever increasing id per call at least 250 million times in 100 s (temporary counter, not part of this change); its own allocator then failed to grow a 16-byte-element array to about 348 million entries (Ran out of memory allocating 5565054976 bytes with alignment 65536) and the title trapped inlibc.prx. Demon Slayer (PPSA03490) and Returnal (PPSA01285) show the same title message and trap and their dumps have no PlayGo file either (observation, not shown to be caused by PlayGo for those two).The chunk set now follows the package layout instead of a constant (review on this PR):
playgo-chunkdefs.xmlor a validplaygo-chunk.dat: unchanged.sce_sys/playgo-scenario.jsonpresent (Guardians of the Galaxy PPSA01748, #3238; no chunk list in the dump): every id is accepted and reported installed, as before.sce_syshas noplaygo-*file at all (PPSA03001, PPSA03490, PPSA01285): only chunk 0 is valid, any other id returnsSCE_PLAYGO_ERROR_BAD_CHUNK_ID. This is where Sifu's enumeration ended after two calls (id 0, then id 1) before #3238 accepted every id (measured on #3209).sce_syswith otherplaygo-*files (playgo-ficm.dat,playgo-hash-table.dat) but neitherplaygo-chunk.datnorplaygo-scenario.json, or aplaygo-chunk.datwithout aplgxheader or with a zero count: throws, naming the file (no such dump is known, so no answer is guessed).Rule 3 is recorded in
docs/dev/debt/libScePlayGo.mdas unverified on a console.scePlayGoGetChunkIdstill lists only chunk 0 in rules 2 and 3.Tested
Windows 10, WinLibs GCC 15.2, Release,
-j2, onmain4bb2c7f39plus this commit (54ba59b92, before the rebase; the code of the PlayGo files is identical in the current head51c7206fd, rebased ontomain8299b2f7e;libusb-cmakefrom a local checkout).git merge-treeof the current head51c7206fdagainstmain068ab2aba(13 October) is clean. The rebased head itself was not rebuilt.guest_playgopasses (3 of 3 runs). Each layout runs in its own empty root: noplaygo-*file, chunk table, scenario file next to a chunk table, scenario file only,playgo-ficm.datonly,playgo-hash-table.datonly and an unreadableplaygo-chunk.dat(the last three expect the throw with the file name).Export.cppas onmainthe test fails; with the previous rule 3 (a96ce03cb) the three throw cases fail.python tools/check_conventions.py --base upstream/mainpasses.BAD_CHUNK_IDline in the log; the run ended after about 109 s with a GPU message (storage image access to depth/stencil surface ... is not implemented) andabort()(details in the comment on this PR). Not tested: the chunk ids the title asks for (no PlayGo trace in the libraries); Demon Slayer (PPSA03490) and Returnal (PPSA01285) with this change; Guardians of the Galaxy (PPSA01748, layout taken from the check on #3238); Linux.Checklist
main068ab2aba(git merge-tree, 13 October); no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:20:46Z.
256 is a guess, and a constant tuned to end one title's loop can't go in: the answer has to follow from the package, or throw. Your own suggestion on #3238 does that, so please use it instead:
playgo-*file insce_sys(PPSA03001, PPSA03490): the package has no PlayGo data, so only chunk 0 is valid and any other id returnsSCE_PLAYGO_ERROR_BAD_CHUNK_ID. That is where your trace shows the enumeration ending after two calls.playgo-scenario.jsonwithout a chunk table (PPSA01748): the table is missing from the dump, and the #3238 behaviour stays as the debt entry records it.Please say which
playgo-*files the PPSA01285 dump has, giveguest_playgoa case for each layout, and record the first rule indocs/dev/debt/libScePlayGo.mdas unverified on a console.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T00:52:50Z.
Thanks, agreed: the answer should follow from the package, not from a constant. I will change the PR to your two rules.
Facts for the
playgo-*question (file names and counts only, no game data):sce_syshas noplaygo-*file:about,disc_info.dat,icon0.*,keystone,nptitle.dat,param.json,pfs-version.dat,pic*,snd0.at9,trophy2,uds. PPSA03001 (Sifu) and PPSA03490 (Demon Slayer) have none either.sce_sysfolder directly (10 of them are_elfcopies of other dumps); 4 of those containplaygo-*files (PPSA16827, PPSA21480, PPSA23827, PPSA26223), all withplaygo-chunk.dat(plusplaygo-ficm.datandplaygo-hash-table.dat; PPSA21480 also hasplaygo-scenario.json). One more folder (Palworld) has itssce_sysnested deeper, also withplaygo-chunk.dat. None hasplaygo-scenario.jsonwithoutplaygo-chunk.dat, so I cannot test the second layout on a dump; PPSA01748 is not among mine. I take the layout from Tamalero's check on #3238 (scenario file present, noplaygo-chunk.dat, noplaygo-chunkdefs.xml). High on Life (PPSA15388) has noplaygo-*file there and runs with the old rule, which fits the first layout.BAD_CHUNK_ID), measured on #3209 (Windows,maina11c8f7f7). I have not traced the ids that PPSA03490 and PPSA01285 ask for; they show the same out-of-memory message and trap, which I did not show to come from PlayGo.Planned rule (not yet implemented, will follow after your OK):
playgo-chunkdefs.xmlor a validplaygo-chunk.dat: unchanged.sce_sys/playgo-scenario.jsonpresent: any id is accepted and reported as installed (behaviour of #3238, as in the debt entry).playgo-*that gives a chunk table or scenario): only chunk 0 is valid, other ids returnSCE_PLAYGO_ERROR_BAD_CHUNK_ID. This goes intodocs/dev/debt/libScePlayGo.mdas unverified on a console.Open point: a dump with
playgo-ficm.datorplaygo-hash-table.datbut neitherplaygo-chunk.datnorplaygo-scenario.json. None of my dumps is like that, so I would treat it like rule 3 unless you want otherwise.guest_playgowill get one case per layout (rule 1 with the existing chunk table cases, rule 2 with only a scenario file, rule 3 with no file). The chunk set is read once per process, so each layout needs its own run of the test.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T02:39:40Z.
Updated as discussed: the chunk set now follows the package layout (the three rules from the comment above) instead of the 256 constant, with one test process per layout and the debt entry in
docs/dev/debt/libScePlayGo.mdmarked unverified on a console. Built and run onmaind1fd9372b(guest_playgopasses 3 of 3, fails without theExport.cppchange); the PR text has the details and what is not tested.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T05:05:17Z.
Rules 1 and 2 are as agreed. Rule 3 is wider than agreed:
Export.cpp:52and:74answer "only chunk 0" for everything without a scenario file. That includes your open point (a dump with onlyplaygo-ficm.datorplaygo-hash-table.dat) and aplaygo-chunk.datthat fails theplgx/count check at:38-41. Nobody has such a dump, so chunk 0 is a guess there; please throw, naming the file, and keep "only chunk 0" for asce_syswith noplaygo-*file at all, which is what the debt entry already says.guest_playgo: give the no-file layout its own empty root like the other three (the parent process now depends on noapp0sitting next to the working directory), and add a case for the throw.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T09:27:38Z.
Thanks, both points are done in the new head.
sce_syshas noplaygo-*file at all. Asce_syswithplaygo-ficm.datorplaygo-hash-table.datbut noplaygo-chunk.datand noplaygo-scenario.json, and aplaygo-chunk.datwithout aplgxheader or with a zero count, throw astd::runtime_errornaming the file. The debt entry says so.guest_playgoruns every layout in its own empty root now, including the no-file layout (the parent no longer depends on anapp0next to the working directory). New cases:playgo-ficm.datonly,playgo-hash-table.datonly and an unreadableplaygo-chunk.dat, each expecting the throw with the file name.-j2, onmain4bb2c7f39:guest_playgopasses (3 of 3 runs). With the previous rule 3 (a96ce03cb) the new cases make it fail; withExport.cppas onmainit fails as well.check_conventionspasses.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T13:59:34Z.
PPSA03001 run on the new head, as asked (Windows 10,
main8299b2f7eplus #4491 at51c7206fd, all libraries built from that head,run_title.ps1with a 100 s limit, started by hand):Out of Memory/Ran out of memory: 0 matches.BAD_CHUNK_IDin the log: 0 matches (the libraries have no PlayGo trace, so this only shows what the title logs itself).FATAL: 1 match.AGC graphics: storage image access to depth/stencil surface ... is not implementedin a compute shader, followed byabort(). This is the GPU path, not PlayGo. The earlier stop (the out-of-memory message and the trap, 9 of 9 runs without the change, within 100 s) did not appear. Those earlier runs were made onmainffa198407/9aa5fd290, not on this base.run_155526.err, 378 in.out. At the start the title showed its logo (seen by hand) before it went on to load.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T16:56:47Z.
@oneandonlydean the PPSA03001 run you asked for is in my comment above (libraries built from this head): the title no longer stops at the out-of-memory message and now stops later at a GPU message; it does not show which chunk ids the title asks for.
Since your last reviews I corrected two source statements in my PRs (the
..case in #5008 and the gap behaviour ofsceKernelMprotectin #5143, both now follow the FreeBSD 11.4vfs_lookup.c/vm_map_protectsource), and moved the test and debt entries of my libkernel PRs to separate places so they merge independently.Could you have a look when it suits you? No hurry.
Thank you for the careful reviews.
AI-assisted (Claude Code).