Repository navigation
feat(libSceEsvmDecoderModeEx): scaffold the module from its catalog export - #18080
ColonelRyzen wants to merge 3 commits into
Conversation
…xport The PS5 13.60 stub-library catalog names libSceEsvmDecoderModeEx - the spelling its library field uses, and the module the file libsceesvmdecodermodeex-a785deee5d.jsonl describes - with one record, sceEsvmUseCustomMusicCoreForDecoderMode, and the repository carries no module under that name, so a title importing it fails at relink time. This adds the module as a no-parameter throw stub bound to its catalog NID through APS5_EXPORT. The record says signature_status: unknown, so no prototype is implied. The stub symbol carries the _nid_no_patch spelling used across the tree: MinGW also exports the defined function symbol itself, whose patched export name is derived from its own spelling, so binding the catalog NID to a plainly spelled function places two exports under one patched name and the PE patcher rejects the library. The guest test is registered in the module's own CMakeLists.txt, so no shared CMakeLists.txt changes.
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
Progress report (b819419 → e1a6c12)📉 System libraries: 36.38% (-0.0009%, +1 declared functions) 🆕 1 declared as stubs
Changed libraries (implemented exports)
|
… the catalog test The test tallied failures and returned 1; 1030 of the 1288 files in core/libs/tests abort instead, and prx/libSceNKWebKit/tests/Forwarding.cpp additionally requires that a reached stub advance libc's NotImplementedCalls counter. Asserting the counter and the error text turns "it threw something" into "it threw libc's shared not-implemented error, once, naming the export that was called".
A plain `sce*` export is renamed to its computed NID by the patcher, so a stub whose name already hashes to the NID the catalog records needs no APS5_EXPORT alias: the alias resolves to the same export string and `nid_patcher` fails the build with "duplicate patched export name", which is what the Windows job reported. A symbol spelled `_nid_no_patch` is also left in the library's export table under that spelling, so the alias form added a junk export next to the NID. This is the shape the merged skeleton libraries use (for example core/libs/prx/libSceTtsEngine/Export.cpp, where the nine exports whose names are known carry no APS5_EXPORT and only the NID-named aliases remain), and it follows NidPatcherUtils.hpp: IsNidNoPatch keeps a suffixed name verbatim, everything else is stripped and hashed.
|
Two follow-ups prompted by the review on #17847, pushed as ordinary commits (no history rewritten):
Verified on Linux at head @JJenkx the Windows run covered |
|
@ColonelRyzen, the scaffold itself is fine: the names and NIDs are derivable and every body throws. What is missing is a reason to carry it now. Library scaffolds that only declare throwing exports are kept only when a title is shown to import the library, and this PR lists Unblocks: none and cites no title. Could you add to the PR body a title ID that imports this module, with the evidence (for example the import list from the relinker output for that title, or the unresolved import error it hits today)? With that in place I will review it again. The same applies to your other scaffold PRs of this shape, so please check each one against the same bar. |
|
Closing this myself. The blocker is evidence I cannot produce. A stub-only module needs a title that imports it to be worth landing - the standard @oneandonlydean set on my other scaffolds. This PR stands on one declaration, It is also an Esvm-family name, and that family is where the duplicate-export trouble has been reported, so which module a title binds a name to has to come from real imports rather than from a name list. Why I cannot get that evidence from here. These declarations come from version-labelled catalog extracts - metadata about a dump I do not have - rather than from firmware or a game I own, and enumerating the imports of firmware or titles would need exactly the dumps I do not have: I have no title dumps and no modded console on this side. I am also not going to work from someone else's dump: CONTRIBUTING.md is explicit that you work only from dumps of titles and firmware that you own, that a title dump is a game you own, and that you never use someone else's dump because you cannot know what was done to it or where it came from. So there is no route from where I sit to what this needs in order to stay open, and an unverifiable stub-only module is not worth review time. Closing rather than leaving it parked. The branch stays ( Sorry for the time this took, and for the review time it spent. |
What
The PS5 13.60 function stub library catalog names a module
libSceEsvmDecoderModeEx- one record, one export,sceEsvmUseCustomMusicCoreForDecoderMode- and this repository carries no module under that name, so a title importing it fails at relink time. This PR adds the module:Export.cpp,include/Api.hppand thelibSceEsvmDecoderModeEx.hppumbrella header declare the export spelled plainly, and the NID the patcher derives from the name is that catalog NIDM8-ylcEPnGo, so noAPS5_EXPORTis needed, and the body throwsNotImplemented_nid_no_patch(__func__). Nothing is implemented; it is a declaration-only scaffold whose purpose is that an import oflibSceEsvmDecoderModeExresolves. The module name is the catalog's ownlibraryfield value, which is also what its file name (libsceesvmdecodermodeex-a785deee5d.jsonl) is built from.The evidence is the pinned catalog file, which contains exactly this one record,
kind: defined_function_exportwithsource_evidence: [firmware_export_table, verified_nid_name_map]andsignature_status: unknown- the catalog publishes no prototype, so no-parameter-and-throwing is the strongest thing that evidence supports. The NID equals the value this repository's own NID algorithm derives from the name (recomputed withcompute_nidfromtools/nid_names.py), and no library onmaindeclares the name, so there is nothing to conflict with. The debt file copies the name/NID pair, states the source evidence and marks console behaviour unmeasured.The stubs are spelled plainly and carry no
APS5_EXPORT:Nid::Internal::IsNidNoPatch(core/libs/nid/include/nid/NidPatcherUtils.hpp) leaves a_nid_no_patchname verbatim in the export table, while every other exported name is stripped and hashed, so a plainly spelled stub already becomes its own NID export. Binding that same NID again withAPS5_EXPORTwould put two exports under one patched name, and spelling the function_nid_no_patchwould leave the suffixed name in the guest library's export table next to the NID. This is the shape the merged skeleton libraries use: incore/libs/prx/libSceTtsEngine/Export.cppthe nine exports whose names are known carry noAPS5_EXPORTand only the genuinely unknown ones keep an alias. the_nid_no_patchspelling used across the tree: MinGW also exports the defined function symbol itself, whose patched export name is derived from its own spelling, so binding the catalog NID to a plainly spelled function would place two exports under one patched name and the PE patcher rejects the library.Tested
Linux x86-64 (glibc 2.39, gcc 13.3.0). New test
guest_esvm_decodermodeex_catalog_exports(core/libs/tests/GuestEsvmDecoderModeExCatalogExports.cpp) includesprx/libSceEsvmDecoderModeEx/libSceEsvmDecoderModeEx.hppand calls the export by name, so a declaration that disappears is a compile error rather than a passing test, and the call has to reach libc's shared not-implemented path: the test pinsNotImplementedCallsadvancing by exactly one and the error text naming the export. The registration is in the new module's owncore/libs/prx/libSceEsvmDecoderModeEx/CMakeLists.txtwith the WindowsPATH=path_list_prepend:$<TARGET_FILE_DIR:libSceEsvmDecoderModeEx>block of its neighbours, so this branch touches no sharedCMakeLists.txt-core/libs/CMakeLists.txtpicks the directory up from itsprx/*/CMakeLists.txtglob. The base branch's own copy oftools/check_conventions.py, the ctest registration audit and the PE export-name collision audit (a plain-spelled stub bound to the NID that equals its own spelling) all report nothing for this branch.ctest --test-dir build-ci -R esvm_decodermodeex_catalog: 1/1 passed. No Windows run here.python3 tools/pr_overlap.py --branch feat/libSceEsvmDecoderModeEx-catalog-declarationsprobed all 1984 open pull requests: none shares a file, a line or an export with this branch, and none had to be excluded.After this head,
readelf --dyn-syms -W build/core/libs/libs/libSceEsvmDecoderModeEx.prxlists exactly the 1 catalog NIDs and none of the function spellings, so no export is lost and none is duplicated by an alias.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)