libSceContentSearch: the search calls are stubs (Cult of the Lamb imports four); empty-library implementation ready #3370

Closed
opened 2026-10-11 09:15:50 +00:00 by screamm · 3 comments
screamm commented 2026-10-11 09:15:50 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T09:15:50Z.


The nine libSceContentSearch exports (Export.cpp) beyond Init/Term are NotImplemented_nid_no_patch stubs. Cult of the Lamb (PPSA06465) lists sceContentSearchGetContentLastUpdateId, OpenMetadataByContentId, GetTotalContentSize and GetNumOfContent as absent imports in its import audit (#2686).

Fix branch ready: screamm:feat/content-search-empty-library (b0bd9e0e, one commit on main 1c75f4d2). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. The intake-closed #1564 took the same empty-library approach; this is a rewrite on current main.

  • Sources: Orbital db_types.json (cc408367, lines 555 to 569) for the nine signatures; SharpProspero Interop/Content/ContentSearch.cs (5dfdb4b0) for the enums, the four filter and sort layouts (added to SceTypes.hpp with size checks), the limit of 92 rows and the error codes; Platform/ContentLibrary.cs for how a caller uses the search.
  • The host media library is empty: GetNumOfContent 0, GetTotalContentSize 0, SearchContent 0 rows and never writes a row (a limit above 92 returns 0x809D100A), the last update id is 0, every call before Init returns 0x809D1001; filters and sort conditions are validated against the enums and unknown values, null outputs and malformed arrays throw. OpenMetadata/OpenMetadataByContentId throw because neither source gives the not-found code, so CloseMetadata, GetMetadataFieldInfo and GetMetadataValue throw for any id. TechnicalDebt records the update id choice, the unverified check order and the assumed content-search permission. The four ContentSearch entries leave guest_content_unimplemented.
  • New guest_content_search (the library gets its own CMakeLists test block) covers the counts, searches with and without filters and sorts, the limit, the pre-init code, and every throw.

Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs: guest_content_search, guest_content_unimplemented, guest_content_export 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" 520/521, the one failure being the unrelated guest_ampr_markers arena-overlap flake reported separately; with main's Export.cpp the new test fails; tools/check_conventions.py --base main and git diff --check pass. Not run on Linux.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5799725802 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3370). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T09:15:50Z. --- The nine libSceContentSearch exports ([Export.cpp](https://github.com/boykopovar/AnyPS5/blob/main/core/libs/prx/libSceContentSearch/Export.cpp)) beyond `Init`/`Term` are `NotImplemented_nid_no_patch` stubs. Cult of the Lamb (PPSA06465) lists `sceContentSearchGetContentLastUpdateId`, `OpenMetadataByContentId`, `GetTotalContentSize` and `GetNumOfContent` as absent imports in its import audit (#2686). **Fix branch ready:** [`screamm:feat/content-search-empty-library`](https://github.com/screamm/AnyPS5/tree/feat/content-search-empty-library) (`b0bd9e0e`, one commit on `main` `1c75f4d2`). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. The intake-closed #1564 took the same empty-library approach; this is a rewrite on current `main`. - Sources: Orbital `db_types.json` (`cc408367`, lines 555 to 569) for the nine signatures; SharpProspero `Interop/Content/ContentSearch.cs` (`5dfdb4b0`) for the enums, the four filter and sort layouts (added to `SceTypes.hpp` with size checks), the limit of 92 rows and the error codes; `Platform/ContentLibrary.cs` for how a caller uses the search. - The host media library is empty: `GetNumOfContent` 0, `GetTotalContentSize` 0, `SearchContent` 0 rows and never writes a row (a limit above 92 returns `0x809D100A`), the last update id is 0, every call before `Init` returns `0x809D1001`; filters and sort conditions are validated against the enums and unknown values, null outputs and malformed arrays throw. `OpenMetadata`/`OpenMetadataByContentId` throw because neither source gives the not-found code, so `CloseMetadata`, `GetMetadataFieldInfo` and `GetMetadataValue` throw for any id. TechnicalDebt records the update id choice, the unverified check order and the assumed content-search permission. The four ContentSearch entries leave `guest_content_unimplemented`. - New `guest_content_search` (the library gets its own CMakeLists test block) covers the counts, searches with and without filters and sorts, the limit, the pre-init code, and every throw. **Tested** on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`: `guest_content_search`, `guest_content_unimplemented`, `guest_content_export` 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` 520/521, the one failure being the unrelated `guest_ampr_markers` arena-overlap flake reported separately; with `main`'s `Export.cpp` the new test fails; `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
blawesom commented 2026-10-11 10:27:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T10:27:44Z.


Independent verification on Linux (the gap noted in the report): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON.

  • Rebased b0bd9e0e onto current main: applies cleanly, no conflicts.
  • tools/check_conventions.py and git diff --check pass.
  • guest_content_search, guest_content_unimplemented and guest_content_export pass.
  • Full suite mirroring the Windows run (ctest -j8 -E "^agc_driver_|^video_out_flip"): 523/523 passed — including the guest_ampr_markers run that flaked on the Windows pass.

The rebased branch is available at blawesom:verify/3370 for anyone carrying — the commit is otherwise unchanged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108071868 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3370#issuecomment-6108071868). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-11T10:27:44Z. --- Independent verification on **Linux** (the gap noted in the report): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`. - Rebased `b0bd9e0e` onto current `main`: applies cleanly, no conflicts. - `tools/check_conventions.py` and `git diff --check` pass. - `guest_content_search`, `guest_content_unimplemented` and `guest_content_export` pass. - Full suite mirroring the Windows run (`ctest -j8 -E "^agc_driver_|^video_out_flip"`): **523/523 passed** — including the `guest_ampr_markers` run that flaked on the Windows pass. The rebased branch is available at [`blawesom:verify/3370`](https://github.com/blawesom/AnyPS5/tree/verify/3370) for anyone carrying — the commit is otherwise unchanged.
MarcZX10 commented 2026-10-11 16:00:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T16:00:32Z.


I carried my existing local implementation forward onto current main as #3724, preserving David’s author metadata. It matches the independently verified branch; the PR notes the shared ContentExport CMake hunk with #3721 and that a rebase may be needed depending on merge order.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110889574 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3370#issuecomment-6110889574). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T16:00:32Z. --- I carried my existing local implementation forward onto current main as #3724, preserving David’s author metadata. It matches the independently verified branch; the PR notes the shared ContentExport CMake hunk with #3721 and that a rebase may be needed depending on merge order.
oneandonlydean commented 2026-10-12 06:17:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T06:17:57Z.


Closing: no title run reaches the ContentSearch calls on main. Reopen with the log line when a title stops in one of them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118868568 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3370#issuecomment-6118868568). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T06:17:57Z. --- Closing: no title run reaches the ContentSearch calls on main. Reopen with the log line when a title stops in one of them.
Sign in to join this conversation.
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#3370
No description provided.