Skip to content

feat(libSceSaveData): answer sceSaveDataDirNameSearch2 - #4220

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fix/savedata-dir-name-search2
Oct 12, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:fix/savedata-dir-name-search2

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

sceSaveDataDirNameSearch2 (PPSA30601, Resonance; next stop after #4101/#4207 and #3737, see #4067) throws as a stub declared by #3814. This PR makes it run the same search as sceSaveDataDirNameSearch with the same condition and result structures: filter by name pattern, sort key and order, hit_num/set_num, unknown sort key or order returns the parameter error.

Origin: SharpEmu registers sceSaveDataDirNameSearch2 on the same implementation as sceSaveDataDirNameSearchPs4/sceSaveDataDirNameSearch (same (cond, result) arguments). That is the only source I found for the signature, so the assumption that both calls take the same structures rests on it; what distinguishes the 2 variant on a console is unknown. Throwing (the current stub) is the alternative if a reviewer prefers that until a second source exists.

Tested

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 in TechnicalDebt
  • 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: fix(exports): export the calls PPSA30601 imports #3814 (declares the stub; the diff here includes its commits until it is merged)
  • AI-assisted: yes (Claude Code)

AI-assisted (Claude Code).
🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Progress report (5ccb19b → 989504e)

📈 System libraries: 87.4% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceSaveData.native sceSaveDataDirNameSearch2

@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main, authorship unchanged (staleness only — the rebase applied cleanly).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 957/957 passed

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/4220
git checkout <your branch>
git merge --ff-only FETCH_HEAD

@xXPBSXx
xXPBSXx force-pushed the fix/savedata-dir-name-search2 branch from ab87bf1 to 3cf45a1 Compare October 12, 2026 17:46
@xXPBSXx

xXPBSXx commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the rebase and the full-suite run. I had already rebased this branch onto main 2a5eca11c before I saw your handoff (head 3cf45a101), so there is nothing to pick up. Your 957/957 on Linux is a useful second platform; on Windows the same state passes guest_savedata_search (1/1).

AI-assisted (Claude Code).

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 12, 2026
@xXPBSXx
xXPBSXx force-pushed the fix/savedata-dir-name-search2 branch from 3cf45a1 to b7c9b6a Compare October 12, 2026 19:15
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux Release: build and the 30 tests of the touched directories pass, including guest_savedata_search, which fails without the change (stub throws). The new rows pin the three-save result, descending user-parameter order and the parameter error for an unknown key; the TechnicalDebt entry records that SharpEmu is the only source for the shared structures. Merging.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@adriadam10
adriadam10 force-pushed the fix/savedata-dir-name-search2 branch from b7c9b6a to 989504e Compare October 12, 2026 21:02
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux Release: build and the 30 tests of the touched directories pass, including guest_savedata_search, which fails without the change (stub throws). The new rows pin the three-save result, descending user-parameter order and the parameter error for an unknown key; the TechnicalDebt entry records that SharpEmu is the only source for the shared structures. Merging.

Rebased onto current main (only conflict: the PPSA30601 line in docs/dev/debt/libSceJson2.md, where I dropped the sceSaveDataDirNameSearch2 mention as before); build and the touched tests pass again.

@adriadam10
adriadam10 merged commit d415ce7 into boykopovar:main Oct 12, 2026
8 checks passed
@krishalivaibhav

Copy link
Copy Markdown
Contributor

Thanks for implementing this. We independently tested a minimal local sceSaveDataDirNameSearch2 forwarder to the existing native search implementation while bringing up Don't Starve Together (PPSA02070, 02.009.002) on an M2 Mac using Rosetta and MoltenVK. This was on an older runtime checkout, so it is corroborating evidence for the forwarding approach rather than a test of your exact merged revision.

The focused guest_savedata_search test passed with comparisons of Search1/Search2 counts and output at capacities 0/1/2, count-only queries, buffer canaries, long patterns and no matches, using an isolated temporary save directory. In the actual guest, the import bound successfully and Search2 returned hit_num=1, set_num=1; subsequent save mount/unmount operations succeeded.

The user observed a logo/audio during boot; gameplay has not been verified. Boot later stops in a separate graphics path because a vertex shader requests subgroup capability 61 on the Mac target. This report does not establish console ABI equivalence, PS5-specific Search2 differences, or correctness of the additional sorting behavior in your merged PR. No game files or save data are attached.

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.

4 participants