feat(libSceSaveData): add provisional abort and clear progress stubs #12699

Merged
SnekPolylepis merged 5 commits from upstream-pr/12699 into main 2026-10-30 04:51:22 +00:00
SnekPolylepis commented 2026-10-29 02:56:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SnekPolylepis on 2026-10-29T02:56:54Z.


What

sceSaveDataAbort and sceSaveDataClearProgress check initialization and return success without cancelling operations or clearing progress. Their signatures, console errors and behavior remain unverified, and both are recorded as silent stubs. sceSaveDataClearProgress does not reset convert progress.

After review, sceSaveDataGetMountedSaveDataCount is left throwing: its signature and behavior are unverified. SharpEmu and RPS5E write through a second argument and return a status, while the previous implementation returned a count directly. Their console accuracy is not established.

Tested

  • macOS arm64, Apple clang: syntax-only checks pass for the modified SaveData source and guest test. Six existing C-linkage warnings are reported from General.hpp.
  • python3 tools/check_conventions.py --base HEAD^ --head HEAD and git diff --check HEAD^..HEAD pass for the review update.
  • Windows guest tests were run on an earlier head; they have not been rerun after this update. Full system-library build, title and console tests were not run for this update.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5061306388 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12699). Originally posted by [SnekPolylepis](https://github.com/SnekPolylepis) on 2026-10-29T02:56:54Z. --- ### What `sceSaveDataAbort` and `sceSaveDataClearProgress` check initialization and return success without cancelling operations or clearing progress. Their signatures, console errors and behavior remain unverified, and both are recorded as silent stubs. `sceSaveDataClearProgress` does not reset convert progress. After review, `sceSaveDataGetMountedSaveDataCount` is left throwing: its signature and behavior are unverified. [SharpEmu](https://github.com/sharpemu/sharpemu/blob/b1ec2866575bf72ffcef92cd639c580bf5bf0c61/src/SharpEmu.Libs/SaveData/SaveDataExports.cs) and [RPS5E](https://github.com/keklick1337/rps5e/blob/d540c46f5d83efac3a0df9b2edc14cf12fe9f2be/crates/ps5hle/src/savedata.rs) write through a second argument and return a status, while the previous implementation returned a count directly. Their console accuracy is not established. ### Tested - macOS arm64, Apple clang: syntax-only checks pass for the modified SaveData source and guest test. Six existing C-linkage warnings are reported from `General.hpp`. - `python3 tools/check_conventions.py --base HEAD^ --head HEAD` and `git diff --check HEAD^..HEAD` pass for the review update. - Windows guest tests were run on an earlier head; they have not been rerun after this update. Full system-library build, title and console tests were not run for this update. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
adriadam10 commented 2026-10-29 03:49:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T03:49:19Z.

Review: CHANGES_REQUESTED


Thanks for addressing the debt-file requests. One blocking point remains:

  • core/libs/prx/libSceSaveData.native/Export.cpp:1212 sceSaveDataGetMountedSaveDataCount returns the count as the result, but the two references your own PR cites (SharpEmu and RPS5E) both take the output address in the second argument and return 0, and nothing established the no-argument form (shadPS4 only has a stub). On main this threw, which is the safe behaviour for an unknown ABI; returning a plausible count through a guessed convention can silently give a caller a wrong value and leave its output buffer unwritten. No title in our import census calls it, so there is no reason to guess. Either keep it throwing through NotImplemented_nid_no_patch, or bring evidence for the convention (a call-site trace or disassembly of a module that calls it, or an SDK reference) and implement that one with a test pinning the output argument.
  • sceSaveDataAbort / sceSaveDataClearProgress (Export.cpp:1043, :1110): success with no effect and unknown signatures are the same situation. If you keep them, the Silent stubs entry already covers it; otherwise leave them throwing until there is evidence for the argument list.

Happy to re-review once the ABI question is settled.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692620256 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12699#pullrequestreview-5692620256). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-29T03:49:19Z. **Review:** CHANGES_REQUESTED --- Thanks for addressing the debt-file requests. One blocking point remains: - `core/libs/prx/libSceSaveData.native/Export.cpp:1212` `sceSaveDataGetMountedSaveDataCount` returns the count as the result, but the two references your own PR cites (SharpEmu and RPS5E) both take the output address in the second argument and return 0, and nothing established the no-argument form (shadPS4 only has a stub). On `main` this threw, which is the safe behaviour for an unknown ABI; returning a plausible count through a guessed convention can silently give a caller a wrong value and leave its output buffer unwritten. No title in our import census calls it, so there is no reason to guess. Either keep it throwing through `NotImplemented_nid_no_patch`, or bring evidence for the convention (a call-site trace or disassembly of a module that calls it, or an SDK reference) and implement that one with a test pinning the output argument. - `sceSaveDataAbort` / `sceSaveDataClearProgress` (`Export.cpp:1043`, `:1110`): success with no effect and unknown signatures are the same situation. If you keep them, the Silent stubs entry already covers it; otherwise leave them throwing until there is evidence for the argument list. Happy to re-review once the ABI question is settled.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12699
No description provided.