feat(libSceAjmi): implement inline and run batch aliases #16283

Merged
Noxy-HNR merged 5 commits from upstream-pr/16283 into main 2026-11-13 12:51:35 +00:00
Noxy-HNR commented 2026-11-06 03:50:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Noxy-HNR on 2026-11-06T03:50:21Z.


What

Implement the two literal-NID Ajmi batch aliases as typed forwarders to the existing same-module builders: sceAjmiBatchJobInlineBuffer (4MsUK9kAnKg) and sceAjmiBatchJobRunBufferRa (m0xisYC6U2w). The firmware 13.42 symbol-table report identifies the shared entry addresses. Console behavior and other firmware versions remain unverified; the existing builders still leave invalid pointers and insufficient batch capacity unchecked.

The main merge preserves the renamed exports from merged #15495 and replaces only the two naming-only aliases. #12613 remains the integration-order prerequisite; none of its unmerged code is included. After it lands, retain its control/split builders and rerun affected tests.

The test target now builds private NID-patched Ajmi/libc/kernel copies instead of depending on every library. Raw and patched cases share the same independent byte fixtures, with scoped search paths for Windows, Linux and macOS.

Tested

Current verification (November 9), head d505b5c952fb92bd79af5baf533da342bb8bd772, merging main 52c33518f8061a9056bd2a25225b3e4f76584b18:

Windows 11 build 26300 x86-64, WinLibs GCC 15.2.0 r7/Ninja, Release, full configuration (BUILD_TESTING=ON, ANYPS5_RELINKER_ONLY=OFF), -j 18. Built guest_ajmi_batch_aliases_tests with its private module/dependency fixture.

All four CTests passed in each of three final runs, none skipped: guest_ajmi_batch_inline_unpatched, guest_ajmi_batch_run_unpatched, guest_ajmi_batch_inline_nid, guest_ajmi_batch_run_nid. A deliberate wrong return pointer compiled and caused both inline variants to fail the intended inline returned pointer assertion. The source was restored, rebuilt and all four tests passed three times afterward; final-head tests passed again after committing. Public headers passed for 407 libraries / 33,828 exports; conventions and whitespace checks passed. Independent review of the exact diff, source and validation logs found no push blockers.

No new Linux, macOS, console or title runtime result is claimed. Fresh hosted checks for this head are pending; full manual dispatch may require maintainer access.

Historical verification; results retain their original heads and scope

Historical-head hosted verification (d3a71c7d7f): the Windows changed-test job passed; all four new inline/run tests passed through the raw and NID-patched exports. The job reports zero failures among 3,346 selected CTest entries, including skipped entries. Its log identifies this exact PR head. This is not a fresh full Linux run; earlier local and Linux results below retain their stated commits and scope.

Merge order still follows #15495 and #12613; rebase and repeat the affected tests after those dependencies land.

New raw and NID-patched guest_ajmi_batch_inline_* and guest_ajmi_batch_run_* tests compare complete 512-byte batch buffers with expected layouts, including preserved header bits, padding, returned and payload pointers, odd/aligned starts, instance and flag masks, size truncation, optional return addresses and unchanged external buffers. Seven published flag measurements are pinned as literal expected words.

Windows x86-64, WinLibs GCC 15.2.0, Ninja, Release, full configuration with source-built dependencies, at d3a71c7d7f on main 3cb1cd29ec:

  • Built the complete libs dependency and guest_ajmi_batch_aliases_tests. The four inline/run, raw/NID-patched tests passed 4/4 in each of three runs.
  • With this PR's tests and main's unchanged Export.cpp, all four tests reach the old throwing exports and fail by assertion, rather than failing symbol lookup.
  • Four further deliberate-break controls fail the relevant raw and patched variants: a wrong inline return pointer, a wrong run return pointer, omission of the optional return-address record, and dropped flags. Restored source was rebuilt and all four tests passed again.
  • C++20 -Wall -Wextra -Werror test syntax, conventions and whitespace pass. The public-header audit verifies 406 libraries / 30,649 exports.
  • tools/pr_overlap.py --repo boykopovar/AnyPS5 --base main --branch feat/ajmi-batch-aliases reports the declared #15495 naming overlap and adjacent debt changes in #12613. It cannot automatically compare #13486 because that branch conflicts with main. Its shared Ajmi source/header/debt additions reproduce the already-implemented sceAjm* run builder, not these two sceAjmi* aliases; I compared those patches directly. This is not a clean automatic overlap result. The current-main merge preview is clean; integrations after the declared predecessors must be rebased and retested.

No Linux, console or retail-title run.

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: #12613
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5182595241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16283). Originally posted by [Noxy-HNR](https://github.com/Noxy-HNR) on 2026-11-06T03:50:21Z. --- ### What Implement the two literal-NID Ajmi batch aliases as typed forwarders to the existing same-module builders: `sceAjmiBatchJobInlineBuffer` (`4MsUK9kAnKg`) and `sceAjmiBatchJobRunBufferRa` (`m0xisYC6U2w`). The [firmware 13.42 symbol-table report](https://github.com/boykopovar/AnyPS5/pull/15495) identifies the shared entry addresses. Console behavior and other firmware versions remain unverified; the existing builders still leave invalid pointers and insufficient batch capacity unchecked. The main merge preserves the renamed exports from merged #15495 and replaces only the two naming-only aliases. #12613 remains the integration-order prerequisite; none of its unmerged code is included. After it lands, retain its control/split builders and rerun affected tests. The test target now builds private NID-patched Ajmi/libc/kernel copies instead of depending on every library. Raw and patched cases share the same independent byte fixtures, with scoped search paths for Windows, Linux and macOS. ### Tested Current verification (November 9), head `d505b5c952fb92bd79af5baf533da342bb8bd772`, merging main `52c33518f8061a9056bd2a25225b3e4f76584b18`: Windows 11 build 26300 x86-64, WinLibs GCC 15.2.0 r7/Ninja, Release, full configuration (`BUILD_TESTING=ON`, `ANYPS5_RELINKER_ONLY=OFF`), `-j 18`. Built `guest_ajmi_batch_aliases_tests` with its private module/dependency fixture. All four CTests passed in each of three final runs, none skipped: `guest_ajmi_batch_inline_unpatched`, `guest_ajmi_batch_run_unpatched`, `guest_ajmi_batch_inline_nid`, `guest_ajmi_batch_run_nid`. A deliberate wrong return pointer compiled and caused both inline variants to fail the intended `inline returned pointer` assertion. The source was restored, rebuilt and all four tests passed three times afterward; final-head tests passed again after committing. Public headers passed for 407 libraries / 33,828 exports; conventions and whitespace checks passed. Independent review of the exact diff, source and validation logs found no push blockers. No new Linux, macOS, console or title runtime result is claimed. Fresh hosted checks for this head are pending; full manual dispatch may require maintainer access. <details> <summary>Historical verification; results retain their original heads and scope</summary> Historical-head hosted verification (`d3a71c7d7f`): the [Windows changed-test job](https://github.com/boykopovar/AnyPS5/actions/runs/42158931294/job/127699695330) passed; all four new inline/run tests passed through the raw and NID-patched exports. The job reports zero failures among 3,346 selected CTest entries, including skipped entries. Its log identifies this exact PR head. This is not a fresh full Linux run; earlier local and Linux results below retain their stated commits and scope. Merge order still follows #15495 and #12613; rebase and repeat the affected tests after those dependencies land. New raw and NID-patched `guest_ajmi_batch_inline_*` and `guest_ajmi_batch_run_*` tests compare complete 512-byte batch buffers with expected layouts, including preserved header bits, padding, returned and payload pointers, odd/aligned starts, instance and flag masks, size truncation, optional return addresses and unchanged external buffers. Seven published flag measurements are pinned as literal expected words. Windows x86-64, WinLibs GCC 15.2.0, Ninja, Release, full configuration with source-built dependencies, at `d3a71c7d7f` on main `3cb1cd29ec`: - Built the complete `libs` dependency and `guest_ajmi_batch_aliases_tests`. The four inline/run, raw/NID-patched tests passed 4/4 in each of three runs. - With this PR's tests and main's unchanged `Export.cpp`, all four tests reach the old throwing exports and fail by assertion, rather than failing symbol lookup. - Four further deliberate-break controls fail the relevant raw and patched variants: a wrong inline return pointer, a wrong run return pointer, omission of the optional return-address record, and dropped flags. Restored source was rebuilt and all four tests passed again. - C++20 `-Wall -Wextra -Werror` test syntax, conventions and whitespace pass. The public-header audit verifies 406 libraries / 30,649 exports. - `tools/pr_overlap.py --repo boykopovar/AnyPS5 --base main --branch feat/ajmi-batch-aliases` reports the declared #15495 naming overlap and adjacent debt changes in #12613. It cannot automatically compare #13486 because that branch conflicts with main. Its shared Ajmi source/header/debt additions reproduce the already-implemented `sceAjm*` run builder, not these two `sceAjmi*` aliases; I compared those patches directly. This is not a clean automatic overlap result. The current-main merge preview is clean; integrations after the declared predecessors must be rebased and retested. No Linux, console or retail-title run. </details> <!-- 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. --> ### 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: #12613 <!-- #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!16283
No description provided.