feat(libSceAjm): implement sceAjmBatchJobInlineBuffer #11238
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11238"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by zaryabzip on 2026-10-25T22:26:39Z.
What
Implements
sceAjmBatchJobInlineBufferin libSceAjm and in libSceAjmi. In libSceAjm it was the one PS4 batch builder still a stub after #9637 implementedsceAjmBatchJobControlBufferRa,sceAjmBatchJobRunBufferRaandsceAjmBatchJobRunSplitBufferRa. It goes inAjm.cppbeside them, so libSceAjm and libSceAjm.native both export it.sceAjmBatchStartBufferalready skips inline chunks (kind 7), so a batch that carries a job's input inline now runs.The behaviour is firmware 13.42's routine. BunnyFl ran it in an x86-64 emulator for both
libSceAjm.sprxandlibSceAjmi.sprx, which share the same 73-byte routine. It has not been measured on a console. The signature isvoid* (void* position, const void* data, size_t size, const void** batch_address), and the routine:(word & ~0x1f) | 7, so bits 5-31 of what was already atpositionstay, as in fpPS4. shadPS4 and prosper write the word fresh. The reader takes the kind from the low bits, so the kept bits don't change parsing;*batch_addressto the copy;In libSceAjmi the export stays
sceAjmBatchJobInlineBuffer_nid_disambig1, the way #9637 keptsceAjmBatchJobRunBufferRathere, so the patchedlibSceAjmi.prxexportsstlghnic3Jcunder its own name. It is now the same routine instead of a throwing stub.sceAjmBatchJobRunBufferRain libSceAjmi still throws: the same comment says its code matches libSceAjm's, but it was not run.The test in
GuestAjm.cppresolves both exports at runtime, so it also builds onmain. The libSceAjmi one comes from thelibSceAjmi.prxthatadd_testpasses as an argument. It checks:*batch_address, the copied bytes and the untouched padding, for 13 bytes and for 0 bytes;sceAjmBatchStartBuffer: inline ATRAC9 initialize parameters, a control job built withsceAjmBatchJobControlBufferRathat reads them through the returned address, and a run job. The results matchTestConsoleHandWrittenJobs.guest_ajm_testsnow also links${CMAKE_DL_LIBS}, asguest_audio_propagation_testsdoes fordlsym.Both debt entries cite the firmware run.
Tested
Windows 11 Home 25H2 (i7-11800H, WinLibs MinGW-w64 GCC 15.2.0 UCRT r7, CMake 4.3.1, Ninja 1.13.2, Release,
BUILD_TESTING=ON) at 249fdf9246, and Ubuntu 24.04.5 on WSL2 (GCC 13.3.0, CMake 3.28.3) with it merged intomainf1efa4ddc2:ctest -R "guest_ajm|atrac9":100% tests passed, 0 tests failed out of 6on Windows, andout of 7on Linux (Linux addsguest_ajm_teardown). The others areguest_ajm,guest_ajm_vibration,guest_ajm_wvorbis,atrac9_gradient,atrac9_config_dataandngs2_atrac9.guest_ajmwith--repeat until-fail:3: 3 of 3 on both hosts.mainwith only thisGuestAjm.cppand theguest_ajmCMake changes,guest_ajmbuilds and then aborts withsceAjmBatchJobInlineBuffer is not exported by libSceAjm.native.prxon both hosts (Windows exit 0xc0000409).libSceAjmi.prx,libSceAjm.prxandlibSceAjm.native.prxeach exportstlghnic3Jconce (objdump -pon Windows,nm -Don Linux).53608ab573, changes only the failure message's library name on Linux, which printed(null). Rechecked on WSL2 merged intomain84ffc1ae2d:guest_ajmpasses with no warnings, and the baseline message nameslibSceAjm.native.prx.tools/check_conventions.pypasses.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T22:30:13Z.
Review: APPROVED
Reviewed exact head
3052f69ccbb937883e657669c1fdb93429d4d4d5. The builder writes a kind-7 inline chunk, rounds the payload region to eight bytes, sets the returned address after the header, and leaves the padding untouched; the added end-to-end test feeds that address into a control job and runs a batch. The three cited emulator implementations agree on the basic layout, while the PR records the remaining differences and lack of a retail-console measurement in technical debt. Current-main conventions and diff-check pass. Hosted product/relinker jobs were skipped by path policy; the author reports focused Windows and WSL tests, which I did not rerun locally.