feat(libSceJxr): implement the PKFormatConverter exports #17400

Merged
MarrasFederico merged 10 commits from upstream-pr/17400 into main 2026-11-15 20:00:11 +00:00
MarrasFederico commented 2026-11-08 18:59:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-11-08T18:59:15Z.


What

Consolidates #16696, #16698, #16700, #16701, #16702, #16704, #16731, #16732 into one topic so the shared remaining-stub count, test blocks, and build registrations do not cause cascading conflicts between individual merges. Preserves their published library implementations, with identical shared helpers and declarations kept once.

Implemented exports:

  • PKFormatConverter_GetPixelFormat
  • PKFormatConverter_GetSize
  • PKFormatConverter_Release
  • PKFormatConverter_GetSourcePixelFormat
  • PKFormatConverter_GetResolution
  • PKFormatConverter_Copy
  • PKFormatConverter_InitializeConvert
  • PKFormatConverter_Initialize

The default PKFormatConverter_Convert returns WMP_errSuccess as on current main (integrated via #15626), matching firmware 13.42 disassembly and jxrlib JXRGluePFC.c:2319-2327.

A debt fragment records the converter gaps and updates the inventory from the resulting Export.cpp: 6 remaining NotImplemented_nid_no_patch(__func__) calls. Main’s debt entries are preserved; source-definition anchors affected by the merge are refreshed through the fragment.

The original converter test blocks have separate local scopes to avoid duplicate variable declarations.

Tested

Ubuntu 26.04.1 LTS, kernel 7.0.0-43-generic, GCC 15.2.0, Release, BUILD_TESTING=ON, CMake 4.4.4 with Ninja. Merged main 9659ce01e4cba30f74faf1b4211eac4e5e3b0a24 into the published head 2a49cacd2a with normal merge commit 6a692957be24f2b048e09dc0cd6a3a67cd9e86cd. History was not rewritten. This verification ran entirely on the laptop; no Windows, macOS, console or title execution was performed locally.

  • Resolved adjacent helper/include additions in GlueHelpers.cpp and NativeGlue.c, retaining both converter helpers and main’s tile/BitIO helpers. The GuestJxr.cpp allocator keeps both the converter release counter and main’s tile-free recording. Main’s implementations and tests from #17403 are retained.
  • Built core/libs/prx/libSceJxr/all using nice -n 19 cmake --build build --parallel 7 --target core/libs/prx/libSceJxr/all.
  • ctest --test-dir build -R '^guest_jxr' --output-on-failure: 23/23 pass, none skipped or Not Run, 0.79 seconds.
  • python3 tools/check_conventions.py --base upstream/main: All conventions checks passed.
  • python3 core/libs/tests/test_public_headers.py --audit-only: 413 libraries, 34,557 exports, unique declarations and umbrella coverage verified.
  • git diff --check upstream/main...HEAD: clean. The JXR debt fragment applies cleanly in isolation and leaves a single inventory entry with the source-counted 6 placeholders. No existing main debt entries are deleted.
  • Manually compared the shared-file diffs of #15645 and #15646. Metadata and conversion enumeration are separate work; PKFormatConverter_EnumConversions still throws here and is not one of this PR’s eight implemented exports.

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 under Silent stubs in their library's technical debt file
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5214165855 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17400). Originally posted by [MarrasFederico](https://github.com/MarrasFederico) on 2026-11-08T18:59:15Z. --- ### What Consolidates #16696, #16698, #16700, #16701, #16702, #16704, #16731, #16732 into one topic so the shared remaining-stub count, test blocks, and build registrations do not cause cascading conflicts between individual merges. Preserves their published library implementations, with identical shared helpers and declarations kept once. Implemented exports: - `PKFormatConverter_GetPixelFormat` - `PKFormatConverter_GetSize` - `PKFormatConverter_Release` - `PKFormatConverter_GetSourcePixelFormat` - `PKFormatConverter_GetResolution` - `PKFormatConverter_Copy` - `PKFormatConverter_InitializeConvert` - `PKFormatConverter_Initialize` The default `PKFormatConverter_Convert` returns `WMP_errSuccess` as on current `main` (integrated via #15626), matching firmware 13.42 disassembly and jxrlib `JXRGluePFC.c:2319-2327`. A debt fragment records the converter gaps and updates the inventory from the resulting `Export.cpp`: 6 remaining `NotImplemented_nid_no_patch(__func__)` calls. Main’s debt entries are preserved; source-definition anchors affected by the merge are refreshed through the fragment. The original converter test blocks have separate local scopes to avoid duplicate variable declarations. ### Tested Ubuntu 26.04.1 LTS, kernel 7.0.0-43-generic, GCC 15.2.0, Release, `BUILD_TESTING=ON`, CMake 4.4.4 with Ninja. Merged main `9659ce01e4cba30f74faf1b4211eac4e5e3b0a24` into the published head `2a49cacd2a` with normal merge commit `6a692957be24f2b048e09dc0cd6a3a67cd9e86cd`. History was not rewritten. This verification ran entirely on the laptop; no Windows, macOS, console or title execution was performed locally. - Resolved adjacent helper/include additions in `GlueHelpers.cpp` and `NativeGlue.c`, retaining both converter helpers and main’s tile/BitIO helpers. The `GuestJxr.cpp` allocator keeps both the converter release counter and main’s tile-free recording. Main’s implementations and tests from #17403 are retained. - Built `core/libs/prx/libSceJxr/all` using `nice -n 19 cmake --build build --parallel 7 --target core/libs/prx/libSceJxr/all`. - `ctest --test-dir build -R '^guest_jxr' --output-on-failure`: **23/23 pass**, none skipped or Not Run, 0.79 seconds. - `python3 tools/check_conventions.py --base upstream/main`: **All conventions checks passed.** - `python3 core/libs/tests/test_public_headers.py --audit-only`: **413 libraries, 34,557 exports**, unique declarations and umbrella coverage verified. - `git diff --check upstream/main...HEAD`: clean. The JXR debt fragment applies cleanly in isolation and leaves a single inventory entry with the source-counted 6 placeholders. No existing main debt entries are deleted. - Manually compared the shared-file diffs of #15645 and #15646. Metadata and conversion enumeration are separate work; `PKFormatConverter_EnumConversions` still throws here and is not one of this PR’s eight implemented exports. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
gabichuuuuu commented 2026-11-08 19:55:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T19:55:53Z.

Review: COMMENTED


Windows run of head 3d9a085f07, merged alone onto main 095ff72367 (clean merge). Setup: Windows 11, WinLibs GCC 15.2 (x86_64-ucrt-posix-seh), Release, BUILD_TESTING=ON.

  • All 16 guest_jxr* tests with --repeat until-fail:5: every run passes.
  • No runnable negative control: with main's libSceJxr/Export.cpp and this PR's header, the build stops with conflicting declaration of C function, because the tests call exports that only exist with this PR.

The four consolidations still conflict with each other. Merged onto main two at a time, every pair of #17400, #17401, #17402 and #17403 conflicts. For this one, that's with #17401, #17402, #17403. The conflicts are in docs/dev/debt/libSceJxr.md (the remaining-stub line) in every pair, plus GlueHelpers.cpp, NativeGlue.c, Api.hpp, CMakeLists.txt, GuestJxr.cpp or GuestJxrGlue.cpp depending on the pair. So the cascade the description wants to avoid is now four-way instead of 22-way: after the first one merges, the other three each need a rebase. Stacking them (each based on the previous) or one PR for the shared helpers and debt line would remove it.

The default Convert still throws. PKFormatConverter_Initialize installs PKFormatConverter_Convert_nid_postfix (Export.cpp:205), which still calls NotImplemented_nid_no_patch (Export.cpp:247-249). In jxrlib, PKFormatConverter_Convert (JXRGluePFC.c:2319-2327) does nothing and returns WMP_errSuccess, and PKCodecFactory_CreateFormatConverter installs it as the default (JXRGlue.c:448). So a same-format copy that reaches the converter throws where jxrlib succeeds. This is the gap I noted on #16704, #16731 and #16732, which this PR consolidates.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5819425203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17400#pullrequestreview-5819425203). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T19:55:53Z. **Review:** COMMENTED --- Windows run of head `3d9a085f07`, merged alone onto `main` `095ff72367` (clean merge). Setup: Windows 11, WinLibs GCC 15.2 (`x86_64-ucrt-posix-seh`), Release, `BUILD_TESTING=ON`. - All 16 `guest_jxr*` tests with `--repeat until-fail:5`: every run passes. - No runnable negative control: with `main`'s `libSceJxr/Export.cpp` and this PR's header, the build stops with `conflicting declaration of C function`, because the tests call exports that only exist with this PR. **The four consolidations still conflict with each other.** Merged onto `main` two at a time, every pair of #17400, #17401, #17402 and #17403 conflicts. For this one, that's with #17401, #17402, #17403. The conflicts are in `docs/dev/debt/libSceJxr.md` (the remaining-stub line) in every pair, plus `GlueHelpers.cpp`, `NativeGlue.c`, `Api.hpp`, `CMakeLists.txt`, `GuestJxr.cpp` or `GuestJxrGlue.cpp` depending on the pair. So the cascade the description wants to avoid is now four-way instead of 22-way: after the first one merges, the other three each need a rebase. Stacking them (each based on the previous) or one PR for the shared helpers and debt line would remove it. **The default `Convert` still throws.** `PKFormatConverter_Initialize` installs `PKFormatConverter_Convert_nid_postfix` (`Export.cpp:205`), which still calls `NotImplemented_nid_no_patch` (`Export.cpp:247-249`). In jxrlib, `PKFormatConverter_Convert` (`JXRGluePFC.c:2319-2327`) does nothing and returns `WMP_errSuccess`, and `PKCodecFactory_CreateFormatConverter` installs it as the default (`JXRGlue.c:448`). So a same-format copy that reaches the converter throws where jxrlib succeeds. This is the gap I noted on #16704, #16731 and #16732, which this PR consolidates.
Sign in to join this conversation.
No reviewers
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!17400
No description provided.