You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(libSceJxr): enumerate supported pixel format conversions - #316
Source commit: 3ba4f11fc72d277aadbf359fba3d6394af03e4cf. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.
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.
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 boykopovar#7645 already conflicts with main. The exact shared JXR CMake file was manually three-way merged for this topic with boykopovar#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; boykopovar#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
No actionable comments were generated in the recent review.
Walkthrough
Changes: JXR conversion enumeration
Layer / File(s)
Summary
Enumeration API and native bridge core/libs/prx/libSceJxr/include/Api.hpp, core/libs/prx/libSceJxr/src/NativeConversionEnumeration.c, core/libs/prx/libSceJxr/src/ConversionEnumeration.cpp, core/libs/prx/libSceJxr/Export.cpp, docs/dev/debt/libSceJxr.md
The export now accepts a source GUID, index, and target-GUID output pointer. It calls a native helper that invokes PKFormatConverter_EnumConversions. The unimplemented stub is removed. The debt documentation describes the remaining parameterless exports and their stated limitations.
Build integration and enumeration tests core/libs/prx/libSceJxr/CMakeLists.txt, core/libs/prx/libSceJxr/ConversionEnumeration.cmake, core/libs/prx/libSceJxr/tests/*
CMake builds and links the native helper and configures platform-specific test targets. The reference library and guest test check conversion results, termination values, bounds, pointer behavior, and invalid arguments.
Suggested reviewers:codex, marrasfederico
Change: Feature
Merge Risk: Minimal · up to 3ba4f
This change turns the JXR pixel-format conversion enumeration export from an unimplemented placeholder into a working call, with tests that cover the new behavior. No concrete merge-blocking risk was found. Remaining questions about console equivalence are already recorded as known debt.
Security architecture risk: Minimal · up to 3ba4f
The new export looks up conversion formats without performing a conversion. It reuses libSceJxr’s existing native library and borrowed-GUID convention. The reviewed change does not establish a new privilege or a material expansion of memory access; console ABI compatibility remains unverified.
Security review details
Security Blast Radius
inferred — The evidenced change in reachability is to the native GUID query in the process loading libSceJxr. PixelFormatLookup already exposes the same class of direct caller-buffer access and borrowed native GUID; the new path does not establish a broader authority boundary.
Trust Boundaries and Controls
observed — The adapter rejects null and overlapping arguments before the native call, but does not translate addresses or check that the source is readable and the output slot writable. The local copy prevents jxrlib from receiving the caller’s output slot directly; it does not validate either caller address.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 16d71952-f282-4ba4-9683-ffd5514e2c2a
Commits
Reviewing files that changed from the base of the PR and between 5cf487d and 3ba4f11.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-bitERRand 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
ERRis 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 main1c8c0efc8c41314402e6966da5bef6ea3d639d10.BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF: completelibstarget including all 406 packaged.prxfiles, 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.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.PKFormatConverter_EnumConversions_nid_postfix not implemented.139e867b78e181a0812feb553b2db84a7ac168e3, containing this code, feat(libSceJxr): implement descriptive metadata cleanup boykopovar/AnyPS5#15645's code and feat(libSceJxr): implement PKAlloc boykopovar/AnyPS5#14425/feat(libSceJxr): implement WMPAlloc, WMPFree and the memory stream boykopovar/AnyPS5#14631/feat(libSceJxr): implement the pixel format hash, image IID lookups, aligned allocation and IDPEmpty boykopovar/AnyPS5#14905/feat(libSceJxr): implement bit I/O through the pinned jxrlib boykopovar/AnyPS5#14916/feat(libSceJxr): implement quantizer remapping, AC prediction mode and zigzag scan setup boykopovar/AnyPS5#14933/feat(libSceJxr): implement the jxrlib SimpleBitIO reader boykopovar/AnyPS5#15148/feat(libSceJxr): implement the PKFactory and PKCodecFactory constructors boykopovar/AnyPS5#15232/feat(libSceJxr): implement quantizer sharing and DC/AC prediction state helpers boykopovar/AnyPS5#15479 after shared-file resolution, builds and passes 20/20 selected checks (header audit and all 19 combined JXR runtime tests). feat(libSceJxr): return success from four jxrlib defaults as firmware 13.42 does boykopovar/AnyPS5#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 --branchscanned 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 boykopovar#7645 already conflicts with main. The exact shared JXR CMake file was manually three-way merged for this topic with boykopovar#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; boykopovar#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
libstarget 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
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)Summary by CodeRabbit