feat(libSceJxr): enumerate supported pixel format conversions #15646

Closed
santhoshkumar-dev wants to merge 1 commit from upstream-pr/15646 into main
santhoshkumar-dev commented 2026-11-03 23:08:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-11-03T23:08:26Z.


What

PKFormatConverter_EnumConversions (g5p4acBy56A) currently throws through a parameterless placeholder. Bind the source-defined query: a 16-byte source GUID and 32-bit index produce a signed 64-bit ERR and a borrowed target GUID. The reference returns targets in table order; an unknown source or exhausted index returns -108 and stores DontCare. Null arguments and overlapping input/output storage throw before the native call.

The adapter calls the existing, source-built pinned JXRGluePFC.c through a C bridge. Its local GUID copy keeps native code from writing guest output storage, and the native ERR is widened with its sign on Windows. Returned GUIDs use the existing bridge's read-only native storage while the module is loaded. Console signature/table equivalence and pointer identity with the separate guest GUID data exports remain unverified and are recorded in debt.

The dependency line records integration order with older JXR branches that edit the same inventory-debt paragraph. There is no runtime dependency on their functions. The independent metadata cleanup and this topic merge cleanly.

Tested

Submitted head 3ba4f11fc72d277aadbf359fba3d6394af03e4cf, based on upstream main 1c8c0efc8c41314402e6966da5bef6ea3d639d10.

  • Windows 11 Pro x64 (26200), WinLibs GCC 15.2.0 r7, Ninja Release, bundled dependencies, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=OFF: complete libs target including all 406 packaged .prx files, the packaged loader and selected JXR executables build. 77/77 CTests pass, zero skips: public-header audit, all 64 compilation batches, the packaged-library loader and all 11 JXR tests.
  • The new fixture runs through normal symbols and the actual packaged NID. An independent native reference exercises all 84 GUIDs corresponding to the public data-export set and all 76 conversions reachable from them, comparing status and target bytes through each list terminator and UINT32_MAX. It additionally checks RGB24→BGR24 ordering, unknown/DontCare sources, replacement of an existing output on a miss, source/output canaries, retained and repeated pointer lifetime, and unchanged rejected null/overlap arguments.
  • Current main separately passes its 9 JXR tests. The new enumeration fixture against that exact main library exits 1 with PKFormatConverter_EnumConversions_nid_postfix not implemented.
  • Ubuntu 24.04 under WSL2, GCC 13.3: source-level ASan/UBSan probe passes the exact adapter, C bridge, pinned backend and in-tree 84-GUID corpus using a throwing unsupported-input shim. This is a source probe; full Linux product and packaged-NID execution were not performed.
  • Local combined tree 139e867b78e181a0812feb553b2db84a7ac168e3, containing this code, #15645's code and #14425/#14631/#14905/#14916/#14933/#15148/#15232/#15479 after shared-file resolution, builds and passes 20/20 selected checks (header audit and all 19 combined JXR runtime tests). #15626 was reviewed separately: its four different default functions have no same-export collision here; the overlap is the debt paragraph.

Conventions and whitespace pass. Final tools/pr_overlap.py --branch scanned 1,811 open PRs and found no same-export collision. It reports the nine older JXR debt conflicts recorded in Depends on and exits 2 because #7645 already conflicts with main. The exact shared JXR CMake file was manually three-way merged for this topic with #7645: clean, exit 0. The new test executable is isolated on Windows and stages only compiler runtimes, preventing project-DLL staging from shadowing the requested raw/patched dependencies. Open/closed/merged history, reviews and linked work were checked; #13139 adds the previous throwing declaration.

The full default executable/test build and entire CTest suite were not completed. macOS, physical-console, title and GPU execution were not run. GPU testing is outside this library change.

Additional Linux validation on the submitted head. Ubuntu 24.04 x86-64 under WSL2, GCC 13.3, Ninja Release with bundled dependencies and tests enabled. The complete libs target and selected test executables build. All 11 JXR runtime tests pass, including both normal and packaged export modes, along with the packaged-library loader (12/12). The public-header audit and all 64 compile batches also pass when run directly from an ext4 copy of the exact submitted source. The initial mounted-drive audit timed out at 90 seconds, which skipped its 64 dependent CTest entries. The full CTest suite remains unrun.

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: #14425, #14631, #14905, #14916, #14933, #15148, #15232, #15479, #15626
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5145920506 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15646). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-11-03T23:08:26Z. --- ### What `PKFormatConverter_EnumConversions` (`g5p4acBy56A`) currently throws through a parameterless placeholder. Bind the source-defined query: a 16-byte source GUID and 32-bit index produce a signed 64-bit `ERR` and a borrowed target GUID. The reference returns targets in table order; an unknown source or exhausted index returns -108 and stores DontCare. Null arguments and overlapping input/output storage throw before the native call. The adapter calls the existing, source-built [pinned JXRGluePFC.c](https://github.com/4creators/jxrlib/blob/f7521879862b9085318e814c6157490dd9dbbdb4/jxrgluelib/JXRGluePFC.c#L2259-L2284) through a C bridge. Its local GUID copy keeps native code from writing guest output storage, and the native `ERR` is widened with its sign on Windows. Returned GUIDs use the existing bridge's read-only native storage while the module is loaded. Console signature/table equivalence and pointer identity with the separate guest GUID data exports remain unverified and are recorded in debt. The dependency line records integration order with older JXR branches that edit the same inventory-debt paragraph. There is no runtime dependency on their functions. The [independent metadata cleanup](https://github.com/boykopovar/AnyPS5/pull/15645) and this topic merge cleanly. ### Tested Submitted head `3ba4f11fc72d277aadbf359fba3d6394af03e4cf`, based on upstream main `1c8c0efc8c41314402e6966da5bef6ea3d639d10`. - Windows 11 Pro x64 (26200), WinLibs GCC 15.2.0 r7, Ninja Release, bundled dependencies, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`: complete `libs` target including all 406 packaged `.prx` files, the packaged loader and selected JXR executables build. **77/77 CTests pass, zero skips**: public-header audit, all 64 compilation batches, the packaged-library loader and all 11 JXR tests. - The new fixture runs through normal symbols and the actual packaged NID. An independent native reference exercises all 84 GUIDs corresponding to the public data-export set and all 76 conversions reachable from them, comparing status and target bytes through each list terminator and `UINT32_MAX`. It additionally checks RGB24→BGR24 ordering, unknown/DontCare sources, replacement of an existing output on a miss, source/output canaries, retained and repeated pointer lifetime, and unchanged rejected null/overlap arguments. - Current main separately passes its 9 JXR tests. The new enumeration fixture against that exact main library exits 1 with `PKFormatConverter_EnumConversions_nid_postfix not implemented`. - Ubuntu 24.04 under WSL2, GCC 13.3: source-level ASan/UBSan probe passes the exact adapter, C bridge, pinned backend and in-tree 84-GUID corpus using a throwing unsupported-input shim. This is a source probe; full Linux product and packaged-NID execution were not performed. - Local combined tree `139e867b78e181a0812feb553b2db84a7ac168e3`, containing this code, #15645's code and #14425/#14631/#14905/#14916/#14933/#15148/#15232/#15479 after shared-file resolution, builds and passes **20/20** selected checks (header audit and all 19 combined JXR runtime tests). #15626 was reviewed separately: its four different default functions have no same-export collision here; the overlap is the debt paragraph. Conventions and whitespace pass. Final `tools/pr_overlap.py --branch` scanned 1,811 open PRs and found no same-export collision. It reports the nine older JXR debt conflicts recorded in Depends on and exits 2 because #7645 already conflicts with main. The exact shared JXR CMake file was manually three-way merged for this topic with #7645: clean, exit 0. The new test executable is isolated on Windows and stages only compiler runtimes, preventing project-DLL staging from shadowing the requested raw/patched dependencies. Open/closed/merged history, reviews and linked work were checked; #13139 adds the previous throwing declaration. The full default executable/test build and entire CTest suite were not completed. macOS, physical-console, title and GPU execution were not run. GPU testing is outside this library change. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> **Additional Linux validation on the submitted head.** Ubuntu 24.04 x86-64 under WSL2, GCC 13.3, Ninja Release with bundled dependencies and tests enabled. The complete `libs` target and selected test executables build. All 11 JXR runtime tests pass, including both normal and packaged export modes, along with the packaged-library loader (12/12). The public-header audit and all 64 compile batches also pass when run directly from an ext4 copy of the exact submitted source. The initial mounted-drive audit timed out at 90 seconds, which skipped its 64 dependent CTest entries. The full CTest suite remains unrun. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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: #14425, #14631, #14905, #14916, #14933, #15148, #15232, #15479, #15626 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-11-23 04:47:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T04:47:01Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the review found no verified defect in the inspected code.

What I ran

Reviewed head 3ba4f11fc72d277aadbf359fba3d6394af03e4cf. No commands or tests were run; the build and test results below are author-reported. Read description.md, commits.md, manifest.json, diff.patch, and all nine changed repository files listed in the manifest. No changed files were excluded.

Results

Check Result Note
Source review passed Adapter, bridge, tests, and build wiring read
Build and tests not run Reported results are from the author
Console verification not run Signature and table equivalence remain unverified

Findings

Blocking

None.

Non-blocking

None.

Not verified

No build, test, or negative control was run during this review. Physical-console behavior, console ABI signature and conversion table equivalence, and identity with the separate guest GUID exports remain unverified as recorded in the change description.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6016694192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15646#pullrequestreview-6016694192). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T04:47:01Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the review found no verified defect in the inspected code. ## What I ran Reviewed head `3ba4f11fc72d277aadbf359fba3d6394af03e4cf`. No commands or tests were run; the build and test results below are author-reported. Read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, and all nine changed repository files listed in the manifest. No changed files were excluded. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Adapter, bridge, tests, and build wiring read | | Build and tests | not run | Reported results are from the author | | Console verification | not run | Signature and table equivalence remain unverified | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No build, test, or negative control was run during this review. Physical-console behavior, console ABI signature and conversion table equivalence, and identity with the separate guest GUID exports remain unverified as recorded in the change description. ## To get this to a good state Nothing is required.

Pull request closed

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!15646
No description provided.