fix(ajm): keep batch handles within their creating context #7789
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7789"
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 JJenkx on 2026-10-19T07:37:20Z.
What
Keep each completed AJM batch associated with the context that started it. Previously another initialized context could cancel the batch or wait on it and consume its handle. Wrong-context operations now return INVALID_BATCH without consuming the owner's batch. Start and wait also reject context IDs that initialization has not allocated, matching the existing cancel check.
Add a two-context regression covering cross-context access, invalid contexts, owner access after rejected operations and repeated waits. Document the remaining finalization and synchronous-execution limitations. Context ownership follows the shadPS4 implementation cited in the debt entry; this has not been verified on PS5 hardware. No title unblock or performance improvement is claimed.
Tested
Linux x86-64 Release, AMD Ryzen 9 7950X, rebased on main
d8d0222d02:fb0dc118f3; it passes with this change.libsbuild passed.guest_ajm,guest_ajm_teardown,atrac9_gradientandatrac9_config_data: 4/4 passed, zero skipped (0.05 seconds).python3 tools/check_conventions.py --base origin/mainandgit diff --checkpassed.tools/pr_overlap.pyrequired manual comparison with #3205 and #6044. #3205 adds an unrelated error-string test; #6044 only relocates this test file unchanged totests/media/GuestAjm.cpp(R100). Neither implements batch ownership; no functional dependency. Other comparisons reported no overlap.d8d0222d02, the fulllibsbuild and 15 allocator/AJM/ATRAC9 tests passed with zero skips (0.07 seconds).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 github-actions[bot] on 2026-10-19T07:44:19Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/tests/GuestAjm.cppcore/libs/tests/GuestAjm.cppdocs/dev/debt/libSceAjm.native.mdImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T01:50:44Z.
Checked the batch map against shadPS4 (per-context batches, INVALID_CONTEXT for unknown contexts), the cross-context, invalid-context and repeated-wait cases in the new test, and the debt entry; merged.