Repository navigation
feat(psml): implement the MFSR shared-resource and 800 context setup - #5796
Conversation
Progress report (c842491 → 46fdfec)📈 System libraries: 88.94% (+0.11%, +7 implemented, -3 reverted functions) ✅ 7 implemented
|
| Library | Name |
|---|---|
| libScePsml_debug | scePsmlMfsrCreateContext1100 |
| libScePsml_debug | scePsmlMfsrGetContextBufferRequirement1100 |
| libScePsml_debug | scePsmlMfsrGetDispatchMfsrPacket1100 |
|
Independent check on Linux, and where each "not initialized" answer comes from. This head carries #5651's commit unchanged (same patch-id as 7315fc0), so @adriadam10's review there applies here too. Linux run (WSL Ubuntu, GCC 15.2.0, Release,
State machine (Export.cpp L97-227): before The "3 went back to stubs" line in the progress report is not a regression. The 1100 trio only throws after a successful Init, and on main Init throws, so any title that reaches the new throw had already stopped at Init on main. Before Init the trio keeps the answer @Celegans12 read from Sony's libScePsml.sprx in #644. #644 could return it unconditionally because Init threw ("this is the only state a title can reach"); after an Init that succeeded, "not initialized" would be wrong, so throwing is right. Sources for the pre-Init 0x8A810001, per call:
That leaves the 1300 pair, and 1000's pre-Init answer, as the open part of #5651's review. Now that Init succeeds, a title only gets those pre-Init answers if it calls them without Init, and no run in either PR reaches them (PPSA08330 only dispatches with Trinity mode set; #5651 ran no title). So keeping them throwing, or listing them under Silent stubs as the review asks, would cost no known title. @Celegans12, if the sprx you read for #644 has the 1000 and 1300 entries, do they start with the same flag check? If this PR answers that review, #5651 could close as superseded; that is up to @klosixgaming-arch. Landing #5651 first would make this PR conflict in all three files ( KytyPS5 has a different object layout. Its Nit: L158-163 looks up the shared-resources handle under one lock and inserts the context under another. A concurrent Debt file: besides the conflicts the bot lists, #5877's 1100 line still ends with "Only 0x8A810001 (not initialized) is returned", which stops being true with this PR. Whichever PR lands second should keep this PR's before/after-Init wording and add #5877's PPSA26344 sentence. AI-assisted: written with Claude Code; I checked the Export.cpp state machine against main, #644, #5651's review and the PSML code in KytyPS5 at 9e41d83 and PS5PCEM at 78915be (NIDs recomputed with tools/nid_names.py), and ran guest_psml on Linux in the three cases above plus git merge-tree against #5651, #5531 and #5877. |
|
Thanks @nikowolf123 for the independent Linux run and the state-machine walk-through. Agreed on the "-3 reverted" line in the progress report: those calls only throw after a successful Init, and on main Init itself throws, so no title gets less far than before. Nothing to change in the PR from my side; it still waits on #5651, and I will rebase to our commit only once that merges. |
1fa0502 to
00d0232
Compare
|
Rebased onto main d92a8da (the head is now 00d0232, one commit). Main now carries the not-initialized answers for the 1100 and 1300 calls, which is what #5651 added, so this PR no longer includes #5651's commit and no longer depends on it. The body is updated to match. |
|
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.
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.
|
|
@nikowolf123, a follow-up on two points from your review that my earlier reply skipped (new commit 9ced189):
On #5877's wording: this PR already replaces the 1100 line with the before/after-Init text. Whichever PR lands second should keep that text and add #5877's PPSA26344 sentence. Tested: AI-assisted (Claude Code). |
|
Checked the build and the scoped ctest (33 tests, |
scePsmlMfsrInit, the shared-resource calls and the 800M3_2 context calls
threw or answered "not initialized", so a title that sets PSSR up at
start-up stopped there even when it never uses PSSR on hardware without
it (PPSA08330 calls the setup unconditionally and only dispatches when
sceKernelIsTrinityMode is set, which AnyPS5 reports as 0).
The layouts come from the calls in PPSA08330 and PPSA03016: requirements
are {block bytes, alignment, block count}, handles are 8-byte values
written through the first argument, and a context parameter carries its
block list at 8/16 and the shared-resources handle at 0x38. Init sets
the initialized state, the requirements ask for four 2 MiB blocks (what
PPSA08330 allocates regardless of the returned count), and create and
release keep bookkeeping objects. Invalid arguments throw because their
error codes are unknown.
The 1100 calls, scePsmlMfsrCreateContext1300 and the 900/1000/1300
dispatch packets keep returning 0x8A810001 before Init and throw after
it; packet size, mip bias and capture still throw.
The guest test links libc and gets Windows unwinding so it can check the
refused calls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A concurrent scePsmlMfsrReleaseSharedResources could pass its "still used by a context" check between the handle lookup and the context insertion. The technical debt entry now says how KytyPS5's layout differs from the calls in PPSA08330 and PPSA03016. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Head unchanged (9ced189). It conflicted with main only in |
9ced189 to
46fdfec
Compare
What
scePsmlMfsrInit, the shared-resource calls andscePsmlMfsrGetContextBufferRequirement800M3_2/scePsmlMfsrCreateContext800M3_2/scePsmlMfsrReleaseContextthrew. God of War Ragnarök (PPSA08330 v06.006) calls this setup unconditionally at start-up and stopped atscePsmlMfsrInit not implemented. It only uses the context when its cachedsceKernelIsTrinityMode()result is set (dispatch at 0x3c643d, mip bias at 0x567f97; otherwise it stores a -0.25 mip bias itself at 0x567fe2), and AnyPS5 reports 0 there. So the setup has to succeed, and the per-frame calls are never reached on non-Trinity hardware.{block bytes, alignment, block count}.{address, bytes}block list at 8 and 16.scePsmlMfsrInitsets the initialized state and returns 0.scePsmlMfsrCreateContext1300and the 900/1000/1300 dispatch packets keep main's 0x8A810001 beforescePsmlMfsrInitand throw after it. Packet size, mip bias, capture andSelectConfigstill throw.(context, uint32_t*), then the packet(context, {cursor, size in dwords}*, params), then the caller advances its command buffer by that size (0x8A810006 when the buffer cannot grow). This is recorded in the debt entry.guest_psmllinks libc and getsconfigure_windows_unwind, so it can catch the refused calls.Tested
BUILD_TESTING=ON:guest_psmlpasses.Export.cppand this test it fails atscePsmlMfsrGetSharedResourcesInitRequirement not implemented.guest_psmlpasses,tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.scePsmlMfsrInit not implemented.compute shader ...: stores 16-bit data to an image of a SINT format, which main refuses on purpose.Checklist
main; no other open PR implements the same functions (open feat(libScePsml): answer the versioned MFSR context calls as not initialized #5651 also touches the 800M3_2 calls to answer "not initialized" and conflicts with main; this PR does not depend on it)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code