feat(libSceJxr): implement codec allocation and bit I/O structures #17403

Merged
MarrasFederico merged 9 commits from upstream-pr/17403 into main 2026-11-14 22:34:00 +00:00
MarrasFederico commented 2026-11-08 19:00:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-11-08T19:00:02Z.


What

Consolidates #16706, #16713, #16728, #16854, #16827, #16851, #16714, #16712, #16710, #16711 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:

  • allocateTileInfo
  • freeTileInfo
  • allocateQuantizer
  • freeQuantizer
  • allocatePredInfo
  • freePredInfo
  • allocateBitIOInfo
  • setBitIOPointers
  • detachISWrite
  • detachISRead

The debt count is recalculated from the resulting Export.cpp: 14 remaining NotImplemented_nid_no_patch(__func__) calls. Internal definition anchors are refreshed.

Prediction tests share one free callback that preserves both live-block accounting and the pre-free pointer observation.

The individual Jxr PR series previously received Windows checks from JJenkx and gabichuuuuu. For the PRs in this group, the recorded checks include gabichuuuuu on #16706 and JJenkx on #17403. Those results apply to the individual revisions recorded in their comments, not this combined commit.

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 1.13 from a virtualenv. Merged upstream/main (d5663ee9a3, full d5663ee9a36d47e79c53ec0d30ce6555831f084d) into fedc9a47cd with normal merge commit 1139d1a740, followed by 930e0560b1 (930e0560b1fc0159bdfad04175e726bc0204482e, reconciling the post-merge stub count bullet in docs/dev/debt/libSceJxr.md); published history was not rebased, squashed or force-pushed. Windows and macOS were not compiled here; no game title was run.

  • Built target(s): libSceJxr and the 17 guest_jxr* test executables.
  • ctest -R '^guest_jxr' --output-on-failure --repeat until-fail:3: 100% tests passed out of 23, 3 runs each, Not Run = 0 (exit 0).
  • python3 tools/check_conventions.py --base upstream/main: "All conventions checks passed." (exit 0, 0 errors, 0 warnings).
  • python3 core/libs/tests/test_public_headers.py --audit-only: 413 libraries, 34548 exports: unique declarations and umbrella coverage verified.
  • git diff --check upstream/main...HEAD: clean.

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:5214171661 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17403). Originally posted by [MarrasFederico](https://github.com/MarrasFederico) on 2026-11-08T19:00:02Z. --- ### What Consolidates #16706, #16713, #16728, #16854, #16827, #16851, #16714, #16712, #16710, #16711 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: - `allocateTileInfo` - `freeTileInfo` - `allocateQuantizer` - `freeQuantizer` - `allocatePredInfo` - `freePredInfo` - `allocateBitIOInfo` - `setBitIOPointers` - `detachISWrite` - `detachISRead` The debt count is recalculated from the resulting `Export.cpp`: 14 remaining `NotImplemented_nid_no_patch(__func__)` calls. Internal definition anchors are refreshed. Prediction tests share one free callback that preserves both live-block accounting and the pre-free pointer observation. The individual Jxr PR series previously received Windows checks from JJenkx and gabichuuuuu. For the PRs in this group, the recorded checks include [gabichuuuuu on #16706](https://github.com/boykopovar/AnyPS5/pull/16706#pullrequestreview-5819051809) and [JJenkx on #17403](https://github.com/boykopovar/AnyPS5/pull/17403#issuecomment-6726403147). Those results apply to the individual revisions recorded in their comments, not this combined commit. ### 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 1.13 from a virtualenv. Merged `upstream/main` (`d5663ee9a3`, full `d5663ee9a36d47e79c53ec0d30ce6555831f084d`) into `fedc9a47cd` with normal merge commit `1139d1a740`, followed by `930e0560b1` (`930e0560b1fc0159bdfad04175e726bc0204482e`, reconciling the post-merge stub count bullet in `docs/dev/debt/libSceJxr.md`); published history was not rebased, squashed or force-pushed. Windows and macOS were not compiled here; no game title was run. - Built target(s): `libSceJxr` and the 17 `guest_jxr*` test executables. - `ctest -R '^guest_jxr' --output-on-failure --repeat until-fail:3`: **100% tests passed out of 23**, 3 runs each, `Not Run` = 0 (exit 0). - `python3 tools/check_conventions.py --base upstream/main`: "All conventions checks passed." (exit 0, 0 errors, 0 warnings). - `python3 core/libs/tests/test_public_headers.py --audit-only`: 413 libraries, 34548 exports: unique declarations and umbrella coverage verified. - `git diff --check upstream/main...HEAD`: clean. ### 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:59 +00:00 (Migrated from github.com)

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

Review: COMMENTED


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

  • All 17 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 #17400, #17401, #17402. 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 duplicate JxrGuestMalloc_nid_no_patch that #16706 and #16714 each added is now defined once in GlueHelpers.cpp.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5819425551 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17403#pullrequestreview-5819425551). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T19:55:59Z. **Review:** COMMENTED --- Windows run of head `f5fa58b4a4`, merged alone onto `main` `095ff72367` (clean merge). Setup: Windows 11, WinLibs GCC 15.2 (`x86_64-ucrt-posix-seh`), Release, `BUILD_TESTING=ON`. - All 17 `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 #17400, #17401, #17402. 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 duplicate `JxrGuestMalloc_nid_no_patch` that #16706 and #16714 each added is now defined once in `GlueHelpers.cpp`.
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!17403
No description provided.