Repository navigation
feat(libSceJxr): implement the pixel format hash, image IID lookups, aligned allocation and IDPEmpty - #14905
Conversation
…aligned allocation and IDPEmpty
Progress report (151a2cb → 642d95d)📈 System libraries: 27.08% (+0.01%, +6 implemented functions) ✅ 6 implemented
Changed libraries (implemented exports)
|
|
@AlexWhitehouse @ahmadmuj I checked this branch against #14425 and #14631. All three merge cleanly with I've recorded The current pairwise preview with #7645 is clean. The latest Windows, conventions and library-portability checks pass. This PR is ready for review; console behavior remains unverified as documented. |
|
Thanks for this. At
|
Address review: the pixel-format hash, image IID lookups, aligned allocation and IDPEmpty now call jxrlib's JXRGlue.c and strcodec.c from 3rdparty/jxrlib through a C bridge instead of adapted copies in core/. A dedicated build of JXRGlue.c routes its calloc and free to the guest heap; the C++ adapters keep only the guest ABI, argument checks and IID object mapping. Alignments below 8 are now rejected up front, since jxrlib would write the original pointer before the block.
|
@oneandonlydean thanks, done in The jxrlib logic is no longer adapted in To route jxrlib's allocator to the guest heap without copying it, a new
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi @Noxy-HNR, I merged |
What
Six named libSceJxr exports currently throw:
GetPixelFormatFromHash,GetImageEncodeIID,GetImageDecodeIID,PKAllocAligned,PKFreeAlignedandIDPEmpty. Implement them from Microsoft's jxrlib at the pinned submodule commit, JXRGlue.c and strcodec.c:GetPixelFormatFromHashcalls the pinned jxrlib through a C bridge, likePixelFormatLookup, and returns its read-only GUID for the hash (the GUID's last byte), or null.GetImageEncodeIID/GetImageDecodeIIDmatch.jxr,.wdpand.hdpas case-insensitive prefixes and store the exportedIID_PKImageWmpEncode(101) /IID_PKImageWmpDecode(201)..wdpand.hdpencoding store a privateIID_PKImageUnsupported(100), which the module does not export. Unknown extensions returnWMP_errUnsupportedFormat(-106) without writing the output.PKAllocAlignedtakessize + 8 + alignment - 1bytes from the guestcalloc, stores the original pointer just below the aligned block and returnsWMP_errOutOfMemory(-101) whencallocfails.PKFreeAlignedreleases that original pointer through the guestfree.IDPEmptyreturnsICERR_OK(0).The third-party algorithms stay in the unmodified, source-built
3rdparty/jxrlibdependency, with its license notices retained.NativeGlue.cbridges toJXRGlue.candstrcodec.c;GlueHelpers.cppsupplies the guest ABI, argument checks and IID-object mapping. A dedicatedJXRGlue.cbuild routescallocandfreethrough the guest heap. Null outputs, alignments below 8 and overflowing block sizes throw before entering jxrlib. That the console's module is jxrlib with these prototypes is inferred from the export names; nothing is checked on a console. These limits are recorded in the library's debt file. No title unblock is claimed.Merge order: this PR follows #14425 and #14631. Both merge cleanly with current main individually, but their combination with this branch conflicts in the shared JXR files. There is no runtime dependency on either implementation; the dependency line records integration order. Rebase and rerun
guest_jxrafter those PRs merge. The current pairwise preview with #7645 is clean.Tested
Latest follow-up verification at
c7a34875b0: rebuiltguest_jxr_glue_tests,guest_jxr_stream_testsandguest_jxr_testson Windows 11 x86-64, WinLibs MinGW GCC 15.2.0, Release.ctest -R '^guest_jxr(_glue|_stream)?$': 3/3 passed. This directly checks the new native glue, the guest allocator routing and existing stream helpers. Conventions and whitespace checks passed. The hosted Windows, conventions and library-portability checks also pass at this head. The earlier 10-test runs below are retained as prior verification; Linux and patched lookup tests were not rerun in this follow-up.New
guest_jxr_gluetest: all 256 hashes against the pinned jxrlib'sGetPixelFormatFromHash(null-ness and GUID bytes), the IID lookups for each extension, case, prefix and unknown extension with and without an output, aligned allocation for alignments 8, 16, 24, 64 and 4096 and sizes 0, 1 and 100 through a recording application allocator (calloc arguments, alignment, zero fill, stored original pointer, release), calloc failure, null and too-small alignments and size overflow.0580e5c951:ctest -R guest_jxr10/10 passed.ctest -R guest_jxr10/10 passed, including the_patchedlookup tests against the patchedlibSceJxr.prx.python tools/check_conventions.py --base origin/main,git diff --checkandpython core/libs/tests/test_public_headers.py --audit-only(399 libraries, 26,743 exports): passed.python tools/pr_overlap.py --branch claude/jxr-glue-helpers(1,849 open PRs): feat(libSceJxr): implement PKAlloc #14425 (PKAlloc) and feat(libSceJxr): implement WMPAlloc, WMPFree and the memory stream #14631 (WMPAlloc,WMPFree, memory stream) touch neighbouring lines ofCMakeLists.txt,Export.cpp,include/Api.hppand the debt file; neither shares an export or new file. Whichever lands second needs a small rebase. fix(tests): stage linked .prx runtime files next to test executables on Windows #7645 also editslibSceJxr/CMakeLists.txt(Windows DLL staging forguest_jxr_lookup_tests); if it lands first,guest_jxr_glue_testsmay need the same treatment.No console or retail-title test.
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)