Skip to content

feat(libSceJxr): enumerate supported pixel format conversions - #316

Open
Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/15646
Open

Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/15646

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#15646, originally opened by santhoshkumar-dev.

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.

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

Summary by CodeRabbit

  • New Features
    • Added support for enumerating available JXR format conversions, including the target format for a selected source format and index.
  • Bug Fixes
    • Replaced a placeholder conversion-enumeration entry point with working behavior.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

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

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 8
  • Waived: $2.00 (charged $0.00)
  • View usage details

Note

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.

Files selected for processing: 9

  • core/libs/prx/libSceJxr/CMakeLists.txt
  • core/libs/prx/libSceJxr/ConversionEnumeration.cmake
  • core/libs/prx/libSceJxr/Export.cpp
  • core/libs/prx/libSceJxr/include/Api.hpp
  • core/libs/prx/libSceJxr/src/ConversionEnumeration.cpp
  • core/libs/prx/libSceJxr/src/NativeConversionEnumeration.c
  • core/libs/prx/libSceJxr/tests/ConversionEnumeration.cpp
  • core/libs/prx/libSceJxr/tests/ConversionReference.c
  • docs/dev/debt/libSceJxr.md
Files with no reviewable changes: 1

  • core/libs/prx/libSceJxr/Export.cpp

Limit details: You’ve used all 10 included reviews currently available.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants