feat(libSceJxr): implement descriptive metadata cleanup #15645

Merged
santhoshkumar-dev merged 5 commits from upstream-pr/15645 into main 2026-11-15 04:54:43 +00:00
santhoshkumar-dev commented 2026-11-03 23:01:26 +00:00 (Migrated from github.com)

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


What

FreeDescMetadata (XmDuKlVaRuo) currently throws through a parameterless placeholder. Bind its void(DPKPROPVARIANT*) contract with a 16-byte LP64 guest record. LPSTR and LPWSTR payloads are released through the existing guest PKFree and cleared; EMPTY, UI2 and UI4 retain their bytes. Null records and unsupported tags throw before the reference call. A cached tag lets a guest free callback retag the record while pointer cleanup still completes.

The implementation stays in the unmodified, source-built pinned JXRGlueJxr.c. A C bridge and per-target symbol remapping route its PKFree to the guest heap. Layout follows JXRMeta.h; scalar storage is copied as object bytes without comparing indeterminate payload bytes. Console signatures, ownership and behavior remain unverified and are recorded in debt.

The dependency line records integration order with older JXR work. The functions are independent at runtime; the branches edit neighboring declarations and the same inventory-debt paragraph. The paragraph now describes remaining parameterless exports without a fixed count.

Tested

Submitted head 075a9a4bf93688b1823807701997274e92f03f81, 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 by normal name and actual packaged NID, observing guest free callbacks, narrow/wide pointer clearing, repeat cleanup, tag/padding/canary preservation, retagging during free and unchanged unsupported records.
  • Current main separately builds and passes its 9 existing JXR tests. The new metadata fixture against that main library exits 1 with FreeDescMetadata_nid_postfix not implemented.
  • Ubuntu 24.04 under WSL2, GCC 13.3: source-level ASan/UBSan probe passes using the exact adapter, C bridge, pinned cleanup and production PKFree with a recording free shim. This does not constitute a full Linux product or packaged-NID run.
  • Local combined tree 139e867b78e181a0812feb553b2db84a7ac168e3 includes this code, the independent conversion-enumeration topic and #14425/#14631/#14905/#14916/#14933/#15148/#15232/#15479 after resolving shared-file conflicts. It builds and passes 20/20 selected checks: public-header audit and all 19 combined JXR tests, including both export modes for both new functions. #15626 was reviewed separately; its overlap with this topic is the debt paragraph and its four different default functions are not called by this cleanup.

Conventions and whitespace pass. Final tools/pr_overlap.py --branch scanned 1,810 open PRs and found no same-export collision. It reports the nine JXR file/debt conflicts recorded in Depends on, and exits 2 because #7645 already conflicts with main. The exact shared JXR CMake file was separately three-way merged for this branch with #7645: clean, exit 0. The new Windows test uses an isolated executable directory and explicitly stages only compiler runtimes, avoiding that PR's project-DLL staging. Open/closed/merged history, reviews and linked work were read; #13139 supplies only the prior 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:5145846038 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15645). Originally posted by [santhoshkumar-dev](https://github.com/santhoshkumar-dev) on 2026-11-03T23:01:26Z. --- ### What `FreeDescMetadata` (`XmDuKlVaRuo`) currently throws through a parameterless placeholder. Bind its `void(DPKPROPVARIANT*)` contract with a 16-byte LP64 guest record. LPSTR and LPWSTR payloads are released through the existing guest `PKFree` and cleared; EMPTY, UI2 and UI4 retain their bytes. Null records and unsupported tags throw before the reference call. A cached tag lets a guest free callback retag the record while pointer cleanup still completes. The implementation stays in the unmodified, source-built [pinned JXRGlueJxr.c](https://github.com/4creators/jxrlib/blob/f7521879862b9085318e814c6157490dd9dbbdb4/jxrgluelib/JXRGlueJxr.c#L181-L202). A C bridge and per-target symbol remapping route its `PKFree` to the guest heap. Layout follows [JXRMeta.h](https://github.com/4creators/jxrlib/blob/f7521879862b9085318e814c6157490dd9dbbdb4/jxrgluelib/JXRMeta.h#L117-L140); scalar storage is copied as object bytes without comparing indeterminate payload bytes. Console signatures, ownership and behavior remain unverified and are recorded in debt. The dependency line records integration order with older JXR work. The functions are independent at runtime; the branches edit neighboring declarations and the same inventory-debt paragraph. The paragraph now describes remaining parameterless exports without a fixed count. ### Tested Submitted head `075a9a4bf93688b1823807701997274e92f03f81`, 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 by normal name and actual packaged NID, observing guest free callbacks, narrow/wide pointer clearing, repeat cleanup, tag/padding/canary preservation, retagging during free and unchanged unsupported records. - Current main separately builds and passes its 9 existing JXR tests. The new metadata fixture against that main library exits 1 with `FreeDescMetadata_nid_postfix not implemented`. - Ubuntu 24.04 under WSL2, GCC 13.3: source-level ASan/UBSan probe passes using the exact adapter, C bridge, pinned cleanup and production `PKFree` with a recording free shim. This does not constitute a full Linux product or packaged-NID run. - Local combined tree `139e867b78e181a0812feb553b2db84a7ac168e3` includes this code, [the independent conversion-enumeration topic](https://github.com/boykopovar/AnyPS5/pull/15646) and #14425/#14631/#14905/#14916/#14933/#15148/#15232/#15479 after resolving shared-file conflicts. It builds and passes **20/20** selected checks: public-header audit and all 19 combined JXR tests, including both export modes for both new functions. #15626 was reviewed separately; its overlap with this topic is the debt paragraph and its four different default functions are not called by this cleanup. Conventions and whitespace pass. Final `tools/pr_overlap.py --branch` scanned 1,810 open PRs and found no same-export collision. It reports the nine JXR file/debt conflicts recorded in Depends on, and exits 2 because #7645 already conflicts with main. The exact shared JXR CMake file was separately three-way merged for this branch with #7645: clean, exit 0. The new Windows test uses an isolated executable directory and explicitly stages only compiler runtimes, avoiding that PR's project-DLL staging. Open/closed/merged history, reviews and linked work were read; #13139 supplies only the prior 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 -->
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!15645
No description provided.