fix(savedata): return no saves for a search with another title's ID #5133

Merged
SandstromPL merged 1 commit from upstream-pr/5133 into main 2026-10-14 02:41:59 +00:00
SandstromPL commented 2026-10-13 12:24:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-13T12:24:12Z.


What

sceSaveDataDirNameSearch and sceSaveDataDirNameSearch2 ignore cond->title_id and always list the running title's own saves. Minecraft Preview (PPSA19639) searches for another title's saves (PPSA17221). #1277 lists this as stop 3: such a search must return 0 hits, and here it returns Preview's own saves instead.

Only the running title's saves are kept, so a search with another title's ID now reports zero hits. A null ID or the running title's ID searches as before. shadPS4 and KytyPS5 also search the given title's own save directory and report zero hits when it does not exist. #713 already noted that the PS5 search did not filter by title ID. The running title's ID is the titleId in param.json (GetAppTitleId_nid_postfix), as for the other param.json lookups. What a console returns for another title's saves is not verified, and the debt entry records it.

Tested

Ubuntu 24.04, GCC 13.3, full build (Release):

  • guest_savedata_search gains OtherTitle. With param.json titleId PPSA00000 and one save, both search functions must find:

    • 1 hit with no title ID and 1 with PPSA00000;
    • 0 hits with PPSA17221, with the name buffer left untouched.

    On main it fails with "a search for another title must find none of the running title's saves". It passes here, 5 runs out of 5. All 13 save data tests pass.

  • Built at 99e4dfefe. The save data, AppMetadata and libkernel sources are identical on current main; libc differs only in Syslog.cpp (#5048).

  • Minecraft Preview was not run. #1277's stop 3 comes from its reporter's build. Of the earlier stops, #1092 fixed stop 1, but stop 2 (the NetCtl and NpManager callbacks) is still open on main.

  • #5094 changes other lines of dirNameSearch, the same test file and the same debt file; the two merge cleanly.

  • tools/check_conventions.py from main passes with this title and body.

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
  • Unblocks: PPSA19639 #1277 (stop 3, from the reporter's build; not rerun here)
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code); I reviewed and tested every line

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4843167852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5133). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-13T12:24:12Z. --- ### What `sceSaveDataDirNameSearch` and `sceSaveDataDirNameSearch2` ignore `cond->title_id` and always list the running title's own saves. Minecraft Preview (PPSA19639) searches for another title's saves (PPSA17221). #1277 lists this as stop 3: such a search must return 0 hits, and here it returns Preview's own saves instead. Only the running title's saves are kept, so a search with another title's ID now reports zero hits. A null ID or the running title's ID searches as before. [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/ec334904604ba41f5d4753f4a2498ec82540e5d6/src/core/libraries/save_data/savedata.cpp#L791-L802) and [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/569ec04d1a77127c601eed522ad5bba187173f9d/src/libs/libSaveData.cpp#L592-L596) also search the given title's own save directory and report zero hits when it does not exist. #713 already noted that the PS5 search did not filter by title ID. The running title's ID is the `titleId` in `param.json` (`GetAppTitleId_nid_postfix`), as for the other `param.json` lookups. What a console returns for another title's saves is not verified, and the debt entry records it. ### Tested Ubuntu 24.04, GCC 13.3, full build (Release): - `guest_savedata_search` gains `OtherTitle`. With `param.json` titleId PPSA00000 and one save, both search functions must find: - 1 hit with no title ID and 1 with PPSA00000; - 0 hits with PPSA17221, with the name buffer left untouched. On main it fails with "a search for another title must find none of the running title's saves". It passes here, 5 runs out of 5. All 13 save data tests pass. - Built at `99e4dfefe`. The save data, AppMetadata and libkernel sources are identical on current `main`; libc differs only in `Syslog.cpp` (#5048). - Minecraft Preview was not run. #1277's stop 3 comes from its reporter's build. Of the earlier stops, #1092 fixed stop 1, but stop 2 (the NetCtl and NpManager callbacks) is still open on main. - #5094 changes other lines of `dirNameSearch`, the same test file and the same debt file; the two merge cleanly. - `tools/check_conventions.py` from main passes with this title and body. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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] Unblocks: PPSA19639 #1277 (stop 3, from the reporter's build; not rerun here) - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code); I reviewed and tested every line 🤖 Generated with [Claude Code](https://claude.com/claude-code)
xXPBSXx commented 2026-10-13 15:35:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T15:35:42Z.


Windows test: head d34b78890 merged onto current main 60fb61870, together with 9 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest for the tests this change adds or touches: guest_savedata_search passed; python tools/check_conventions.py --base upstream/main passed for the combined tree. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149219955 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5133#issuecomment-6149219955). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-13T15:35:42Z. --- Windows test: head `d34b78890` merged onto current `main` `60fb61870`, together with 9 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j2`: full build 0 errors; ctest for the tests this change adds or touches: guest_savedata_search passed; `python tools/check_conventions.py --base upstream/main` passed for the combined tree. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
SandstromPL commented 2026-10-13 15:42:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-13T15:42:25Z.


Thanks for the Windows run! For completeness: on Linux the new check fails on main ("a search for another title must find none of the running title's saves") and passes with this change, as listed under Tested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149348537 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5133#issuecomment-6149348537). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-13T15:42:25Z. --- Thanks for the Windows run! For completeness: on Linux the new check fails on `main` ("a search for another title must find none of the running title's saves") and passes with this change, as listed under Tested.
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!5133
No description provided.