feat(libSceJxr): return success from four jxrlib defaults as firmware 13.42 does #15626
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15626"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-03T22:18:04Z.
What
Four libSceJxr exports threw. In firmware 13.42 each one returns 0 at once, reading none of its arguments, and this change does the same:
PKFormatConverter_ConvertCTlB5wK20QkERR (PKFormatConverter*, const PKRect*, U8*, U32),jxrgluelib/JXRGluePFC.c:2319WMP_errSuccess(0)PKImageDecode_SelectFrame4+P+wYw54HUERR (PKImageDecode*, U32),jxrgluelib/JXRGlue.c:887PKImageEncode_CreateNewFrame8QSygiUqxzQERR (PKImageEncode*, void*, size_t),jxrgluelib/JXRGlue.c:744PKImageEncode_Terminate0H5MsNx2XC4ERR (PKImageEncode*),jxrgluelib/JXRGlue.c:512The prototypes and bodies come from the jxrlib revision the debt file already pins,
f752187986, which is the3rdparty/jxrlibsubmodule. In it each of the four ignores its arguments and returnsWMP_errSuccess.ERRis a 64-bitlong, as forPKFree. The pointer types arevoid*incore/libs/prx/libSceJxr/include/Api.hpp.In
docs/dev/debt/libSceJxr.md, the entry for the remaining additional stubs goes from 51 to 47 on currentmain8e34d2642d, counted from the mergedExport.cpp(47NotImplemented_nid_no_patchcalls, against 51 onmain). A new entry says it is unverified that the console module is built from jxrlib, and that the bodies were read from disassembly, not measured on a console.The survey also listed
IDPEmpty, with the samexor %eax,%eax; retbody at0x34d10. It is left out: #14905 (Noxy-HNR) already implements it. #15232 (simnJS, since merged) takes the address ofPKFormatConverter_Convert_nid_postfixfor aPKFormatConverterslot (core/libs/prx/libSceJxr/Export.cpp:190at865e11df14, aSlot<decltype(...)>cast that builds with the typed signature), and #15774 (alvaroelpob) takes the addresses ofPKImageEncode_Terminate_nid_postfixandPKImageEncode_CreateNewFrame_nid_postfixforPKImageEncodeslots; neither calls or implements them. Whichever lands second may need to adjust those slots' casts to the typed signatures.Source
Firmware 13.42
system/common/lib/libSceJxr.sprx(sha25673c51baf72937450751e8437e2744fcbe23a58844625f28375f7c423fbe50362), read from disassembly, not run on a console. Export addresses come from the module's dynamic symbol table. Each body, to its return:A 32-bit
xor %eax,%eaxzero-extends intorax(Intel SDM Vol. 1, 3.4.1.1), which makes the 64-bitERRexactly 0. None of the four bodies above reads an argument or stores anything. A null or invalid pointer is never dereferenced, here or in firmware.Tested
main8e34d2642dinto the branch; the head is now375b98998c. The only conflict wasdocs/dev/debt/libSceJxr.md, the count line again:mainhad lowered it to 51 while this branch read 58. The count line now reads 47, counted from the mergedExport.cpp: 47NotImplemented_nid_no_patchcalls, against 51 onmainand 62 at the merge base.Export.cppandinclude/Api.hppmerged without a conflict, andgit merge-treeagainstupstream/mainis clean.375b98998c, Windows 11 Pro 10.0.26300, WinLibs GCC, Release:ctest -R '^(guest_jxr|public_headers$)'19 of 19 pass, none Not Run (100% tests passed, 0 tests failed out of 19), with all 12guest_jxr*test executables rebuilt, andlibSceJxrbuilds.sig_users.py HEAD --build: the four changed declarations are named in 3 files, none outside this branch's own changes;guest_jxr_testsandlibSceJxrbuild (exit 0).tools/check_conventions.py --base upstream/mainon the committed head375b98998c: all checks pass.tools/pr_overlap.py --branch feat/libscejxr-glue-defaults --jobs 8at this head: no line conflict with any open pull request it could compare. It failed closed for 9 that conflict withmainthemselves (#14212, #15645, #15646, #15772, #15774, #17400, #17401, #17402, #17403). I grepped the added and removed lines of all 9 for the four export names: #15774 takes the addresses ofPKImageEncode_Terminate_nid_postfixandPKImageEncode_CreateNewFrame_nid_postfixas described above, and #17402 (MarrasFederico) calls jxrlib's own CPKImageDecode_SelectFramefrom a native helper insrc/NativeGlue.c, not this branch'sPKImageDecode_SelectFrame_nid_postfixexport. The other seven share only the debt count line.main66db234b2dinto the branch; the head is now865e11df14. The only conflict wasdocs/dev/debt/libSceJxr.md, wheremainhad added its list-stream entry (WriteWS_ListtoCreateWS_List) before the count line and lowered the count to 62. Both entries are kept, and the count line now reads 58, counted from the mergedExport.cpp: 58NotImplemented_nid_no_patchcalls, against 62 onmain. Apart from the count line, the branch's added and removed lines againstmainare the same as atba5f5dca6f.865e11df14, Windows 11 Pro 10.0.26300, WinLibs GCC, Release:ctest -R '^guest_jxr'16 of 16 pass, none Not Run, withlibSceJxrand all 10guest_jxr*test executables rebuilt;public_headerspasses.sig_users.py HEAD --build: the four changed declarations are named only in this branch's files;guest_jxr_testsandlibSceJxrbuild.tools/check_conventions.py --base upstream/mainon the committed head865e11df14: all checks pass.main502288c2cfinto the branch; the head is nowa6b2857050. The only conflict wasdocs/dev/debt/libSceJxr.md, wheremainhad added its Predict and SimpleBitIO entries next to this PR's entry and lowered the count line. All three entries are kept, and the count line indocs/dev/debt/libSceJxr.mdata6b2857050now reads 78, counted from the mergedExport.cpp: 78 of its 97APS5_VABIdefinitions throw throughNotImplemented_nid_no_patch, against 82 of 97 onmain502288c2cf.Export.cppmerged without a conflict.maind4060ca168into the branch; the head is nowba5f5dca6f.mainhad implemented eightPKImageDecodeexports insrc/GlueHelpers.cppand removed their stubs fromExport.cpp; the merge takesmain's removals and declarations and keeps this branch's four. Counted from the mergedExport.cpp, 64 stubs remain (76 at the merge base5062ba1fa4, 68 onmain, 72 at this branch's previous head, which is what each states), and the debt entry says 64.ctest -R '^guest_jxr': 15 of 15 passed;sig_users.py HEAD --build: the changed declarations are named only in this branch's files.a6b2857050, Windows 11 Pro 10.0.26300, WinLibs GCC, Release: 15 of 15 pass, none Not Run. That ispublic_headersand the 14guest_jxr*tests registered at this head, with their 8 test executables rebuilt; the build linked both the unpatched and the patchedlibSceJxr.prx.mainare the same as at25a501effeapart from the count line, so the negative control below was not repeated.tools/check_conventions.py --base upstream/mainon the committed heada6b2857050: all checks pass.25a501effe(mainc9f43dfa1dmerged in): 77 of 77 pass, none Not Run. That is the twelveguest_jxr*tests registered at this head,public_headersand the 64public_headers_compile_*batches.core/libs/tests/GuestJxr.cpp(guest_jxr) now calls the four, with buffers and with null pointers.freehappened.027db07ef4; the branch's diff againstmaindiffers between that head and25a501effeonly in the count atdocs/dev/debt/libSceJxr.md:43): I putNotImplemented_nid_no_patch(__func__)back at the top of the four bodies, which ismain's behaviour, and kept this branch's signatures and test.guest_jxrthen aborts withPKFormatConverter_Convert_nid_postfix not implemented(1 of 1 failed).tools/check_conventions.py --base upstream/mainon the committed head25a501effe: all checks pass.tools/pr_overlap.py --branch feat/libscejxr-glue-defaults --jobs 8at head865e11df14: no line conflict with any open pull request it could compare. It failed closed for 33 that conflict withmainthemselves (#14212 and 32 libSceJxr pull requests) and lists them in its "Some comparisons could not be completed" table, which it does not compare line by line. I grepped the added and removed lines of all 33 diffs for the four names: #15774 takes the addresses ofPKImageEncode_Terminate_nid_postfixandPKImageEncode_CreateNewFrame_nid_postfixas described above, and #16729 (MarrasFederico)'ssrc/NativeGlue.ccalls jxrlib's own CPKImageDecode_SelectFramefrom a native helper, not this branch'sPKImageDecode_SelectFrame_nid_postfixexport. #15148, which edited the same count line, has been merged.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T21:44:01Z.
Review: COMMENTED
Windows run of head
865e11df14, merged ontomain095ff72367in one tree with other open PRs that touch different files (each PR's test is its own file, so they don't interact). Setup: Windows 11, WinLibs GCC 15.2 r7 (x86_64-ucrt-posix-seh, the CI toolchain), Release,BUILD_TESTING=ON.guest_jxrwith--repeat until-fail:5: 5 / 5 pass.main'sExport.cppand header, the test doesn't compile (too many arguments to function 'int PKFormatConverter_Convert_nid_postfix()').The four functions match jxrlib: each ignores its arguments and returns
WMP_errSuccess. One fix in the debt entry: the line numbers are in a different order from the names. At the pinned jxrlib,JXRGlue.c:512isPKImageEncode_Terminate,:744isPKImageEncode_CreateNewFrameand:887isPKImageDecode_SelectFrame, while the entry listsSelectFrame, CreateNewFrame and Terminateagainst:512, :744 and :887.This PR conflicts with each of the consolidated libSceJxr PRs #17400, #17401, #17402 and #17403. It also fixes the gap I noted on #17400:
PKFormatConverter_InitializeinstallsPKFormatConverter_Convertas the default, and that one now succeeds as in jxrlib.