feat(libSceSaveData): answer the save point, client priority and debug thread id calls as firmware 13.42 does #14908
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14908"
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 BunnyFl on 2026-11-02T00:16:52Z.
What
Implements three libSceSaveData exports that threw, following firmware 13.42's
libSceSaveData.sprx:sceSaveDataGetSavePointreturns 2.sceSaveDataGetClientThreadPriorityreturns 0.sceSaveDataDebugGetThreadIdreturns 0.Firmware code (13.42, text-segment offsets; read to the return, disassembly; also run natively, see Tested; not measured on a console):
None of them reads an argument or memory (the three bodies at
0x37130,0x3a170and0x3a180above), so the existing parameterless declarations stay: whatever a caller passes, nothing is read or written, as on 13.42. OnlylibSceSaveData.sprxexports these NIDs in 13.42 (libSceSaveData.native.sprxdoes not). The debt entry takes them out of the pending-declarations list and records what is still open: what the values mean and which arguments callers pass.Tested
Merged
mainad5a003138into the branch; the head is now593b690c87. The only conflict was indocs/dev/debt/libSceSaveData.native.md, wheremainhad rewritten thesceSaveDataGetProgressentry (#15097) directly above the pending-declarations list this branch shortens;main's entry is kept, then this branch's shortened list and its new entry. The branch's added and removed lines againstmainare the same as before the merge, so the negative control below was not repeated.593b690c87, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 81 of 81 pass, none Not Run, with the 11 executables behind the listed tests rebuilt: the 16guest_savedata_*tests registered at this head (guest_savedata_constant_callsincluded),public_headersand the 64public_headers_compile_*batches.tools/check_conventions.py --base upstream/mainon the committed head593b690c87: no errors; onedebt-lengthwarning on the pending-declarations entry, which this branch shortens from 5,245 characters onmainto 4,972.Earlier runs:
Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0, Release, Ninja,
BUILD_TESTING=ON, branch head60b08f5f14onmain66e1f7f993.guest_savedata_constant_callscalls each export three times against the patchedlibSceSaveData.native: passes 3 of 3.main'slibSceSaveData.native/Export.cpp, it aborts with0xc0000409.guest_savedata_search,delete,convert,mount_status,ps4,cancel,host_space) andpublic_headers: pass.0x5a-filled buffer: each returns its constant and the buffer is untouched, 0 mismatches.python tools/check_conventions.py --base upstream/main: no errors; onedebt-lengthwarning on the pending-declarations entry, which is already over the limit onmain(the figure then was 5604 characters; see the current one above).python tools/pr_overlap.py --branch feat/libscesavedata-constant-calls: no open PR implements these exports (the tool's same-exports column is empty). #10674, #12625, #12748 and #13551 also edit the one-line pending-declarations list indocs/dev/debt/libSceSaveData.native.md(line 24), which every change to these stubs has to edit, so whichever merges later resolves that line by hand. #14212 (blank lines between debt entries) could not be compared automatically.Checklist
main; no other open PR implements the same functionsNotImplemented_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)Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T14:46:11Z.
Review: APPROVED
Reviewed — approved
sceSaveDataGetSavePoint,sceSaveDataGetClientThreadPriorityandsceSaveDataDebugGetThreadIdused to throw and now return 2, 0 and 0, as in the firmware 13.42 disassembly quoted in the description. The new test passes on the merged tree and fails when the production file is restored frommain. The debt list is updated to match.What I ran
Head
8f80305e9c4b7cdbbd073421b6fa0cd42741540amerged with--no-ffintomain4f41f4c375f5abb487dbd184fbc150f31994d762(merged tree431e9988e4b3e2bccb41f8353efa6c2c9ef45edf). Machine: Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja,BUILD_TESTING=ON.Results
git diff --checkcheck_conventions.pydebt-lengthwarning on the pending-declarations entry (4972 characters; it was already over the limit onmainand this PR makes it shorter)libs(script)main:guest_interfaces,guest_socket_options_multicast,unwrap_self_..._destination_directory_group,vector_constant_factor_tininess. The unexpectedguest_net_ctlskip also happens onmain.guest_savedata_*(11 tests, including the newguest_savedata_constant_calls) +public_headers*check_conventions.py
Negative control
I restored only
core/libs/prx/libSceSaveData.native/Export.cppfrommainand rebuilt.guest_savedata_constant_callsthen aborted:output
After I restored the merged file and rebuilt, the test passed again, and
git status --porcelaincame back empty.Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceSaveData.native/CMakeLists.txt:39: the new test is the only SaveData test that sets its ownTIMEOUT 20, and it does not callconfigure_windows_unwindlike the tests next to it. Neither is needed for a test that runs in 0.01 s and catches no exceptions. Dropping the timeout would keep the registration consistent with the others.docs/dev/debt/libSceSaveData.native.md:27: the new entry leaves out the(libSceSaveData.native)tag that the entries around it carry. It is cosmetic.Not verified