Skip to content

feat(libSceSaveData): answer the save point, client priority and debug thread id calls as firmware 13.42 does - #14908

Open
BunnyFl wants to merge 5 commits into
boykopovar:mainfrom
BunnyFl:feat/libscesavedata-constant-calls
Open

BunnyFl wants to merge 5 commits into
boykopovar:mainfrom
BunnyFl:feat/libscesavedata-constant-calls

Conversation

@BunnyFl

@BunnyFl BunnyFl commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

What

Implements three libSceSaveData exports that threw, following firmware 13.42's libSceSaveData.sprx:

  • sceSaveDataGetSavePoint returns 2.
  • sceSaveDataGetClientThreadPriority returns 0.
  • sceSaveDataDebugGetThreadId returns 0.

Firmware code (13.42, text-segment offsets; read to the return, disassembly; also run natively, see Tested; not measured on a console):

0x37130 sceSaveDataGetSavePoint:             mov eax,0x2 ; ret
0x3a170 sceSaveDataGetClientThreadPriority:  xor eax,eax ; ret
0x3a180 sceSaveDataDebugGetThreadId:         xor eax,eax ; ret

None of them reads an argument or memory, so the existing parameterless declarations stay: whatever a caller passes, nothing is read or written, as on 13.42. Only libSceSaveData.sprx exports these NIDs in 13.42 (libSceSaveData.native.sprx does 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

Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0, Release, Ninja, BUILD_TESTING=ON, branch head 60b08f5f14 on main 66e1f7f993.

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: none
  • GPUs tested: n/a
  • AI-assisted: yes

…g thread id calls as firmware 13.42 does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Progress report (4f41f4c → 8f80305)

📈 System libraries: 26.65% (+0.01%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceSaveData.native sceSaveDataDebugGetThreadId
libSceSaveData.native sceSaveDataGetClientThreadPriority
libSceSaveData.native sceSaveDataGetSavePoint
⚪ 3 behaviourally empty (constant return or throw)
Library Name
libSceSaveData.native sceSaveDataDebugGetThreadId
libSceSaveData.native sceSaveDataGetClientThreadPriority
libSceSaveData.native sceSaveDataGetSavePoint

Changed libraries (implemented exports)

Library Before After Change
libSceSaveData.native 52/120 (43.33%) 55/120 (45.83%) +2.50%

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

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 8630 core/libs/prx/libSceSaveData.native/CMakeLists.txt
core/libs/prx/libSceSaveData.native/Export.cpp
docs/dev/debt/libSceSaveData.native.md
PR 12625 core/libs/prx/libSceSaveData.native/CMakeLists.txt
core/libs/prx/libSceSaveData.native/Export.cpp
docs/dev/debt/libSceSaveData.native.md
PR 12650 core/libs/prx/libSceSaveData.native/Export.cpp
docs/dev/debt/libSceSaveData.native.md
PR 12748 core/libs/prx/libSceSaveData.native/Export.cpp
docs/dev/debt/libSceSaveData.native.md
PR 13551 core/libs/prx/libSceSaveData.native/CMakeLists.txt
core/libs/prx/libSceSaveData.native/Export.cpp
docs/dev/debt/libSceSaveData.native.md
PR 14150 core/libs/prx/libSceSaveData.native/CMakeLists.txt
core/libs/prx/libSceSaveData.native/Export.cpp
docs/dev/debt/libSceSaveData.native.md
PR 14212 docs/dev/debt/libSceSaveData.native.md
PR 15042 core/libs/prx/libSceSaveData.native/Export.cpp

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 2, 2026
Keeps main's separate sceSaveDataGetProgress entry and drops this
branch's three answered calls from the pending list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 2, 2026
…-constant-calls

# Conflicts:
#	docs/dev/debt/libSceSaveData.native.md
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 3, 2026
…-constant-calls

# Conflicts:
#	docs/dev/debt/libSceSaveData.native.md

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — approved

sceSaveDataGetSavePoint, sceSaveDataGetClientThreadPriority and sceSaveDataDebugGetThreadId used 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 from main. The debt list is updated to match.

What I ran

Head 8f80305e9c4b7cdbbd073421b6fa0cd42741540a merged with --no-ff into main 4f41f4c375f5abb487dbd184fbc150f31994d762 (merged tree 431e9988e4b3e2bccb41f8353efa6c2c9ef45edf). Machine: Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, BUILD_TESTING=ON.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...8f80305e9c4b7cdbbd073421b6fa0cd42741540a
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build --output-on-failure -R "guest_savedata|public_headers" -j8 --test-load 32
# negative control
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:core/libs/prx/libSceSaveData.native/Export.cpp > core/libs/prx/libSceSaveData.native/Export.cpp
ninja -C build -j32 -l32 guest_savedata_constant_calls_tests
ctest --test-dir build --output-on-failure -R "^guest_savedata_constant_calls$"
git show 431e9988e4b3e2bccb41f8353efa6c2c9ef45edf:core/libs/prx/libSceSaveData.native/Export.cpp > core/libs/prx/libSceSaveData.native/Export.cpp
ninja -C build -j32 -l32 guest_savedata_constant_calls_tests libSceSaveData.native
ctest --test-dir build -R "^guest_savedata_constant_calls$"
git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py 0 errors, 1 debt-length warning on the pending-declarations entry (4972 characters; it was already over the limit on main and this PR makes it shorter)
Configure / build / libs (script) ok
Selected tests (script) 2456 ran; no new failures, no timeouts. Known failures on main: guest_interfaces, guest_socket_options_multicast, unwrap_self_..._destination_directory_group, vector_constant_factor_tininess. The unexpected guest_net_ctl skip also happens on main.
guest_savedata_* (11 tests, including the new guest_savedata_constant_calls) + public_headers* 75/75 passed
Validation-layer comparison not applicable: no AGC, shader or VideoOut files changed
check_conventions.py
docs/dev/debt/libSceSaveData.native.md:26: warning: [debt-length] Technical debt entry over 1000 characters: ... 4972 characters
1 findings, 0 errors

Negative control

I restored only core/libs/prx/libSceSaveData.native/Export.cpp from main and rebuilt. guest_savedata_constant_calls then aborted:

output
terminate called after throwing an instance of 'std::runtime_error'
  what():  sceSaveDataGetSavePoint not implemented
0% tests passed, 1 tests failed out of 1
	3041 - guest_savedata_constant_calls (Subprocess aborted)

After I restored the merged file and rebuilt, the test passed again, and git status --porcelain came 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 own TIMEOUT 20, and it does not call configure_windows_unwind like 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

  • The firmware 13.42 disassembly and the native run in the description. I have no firmware module here, so the constants 2/0/0 and the claim that no argument or memory is read are taken from the description. The new test checks what the code does, not what the firmware does.
  • Windows behaviour. Linux GCC only.
  • No console measurement, as the description and the debt entry already state.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants