feat(libSceJobManager): implement compute sequences and compute dispatches #3186

Merged
fma-rc merged 2 commits from upstream-pr/3186 into main 2026-10-18 01:04:34 +00:00
fma-rc commented 2026-10-11 00:40:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-11T00:40:49Z.


What

Follow-up to #3170, which left compute sequences and both compute dispatches throwing. This implements them: initialize with compute sequences and a completion mask, the unified factory's CreateCompute / DestroyCompute, DispatchCompute and DispatchComputeIndirect. Each compute sequence submits on its own AGC compute queue (0x20 plus the mask bit) and a handler thread collects completions from an equeue, so sync points and waits order compute work against CPU jobs the way the shipped module does.

The behaviour was taken from the copies of libSceJobManager.prx that Ratchet & Clank (PPSA01474) and Hades II (PPSA36082) ship: sizes from calculateRequiredMemorySize, error codes, and the command stream each dispatch submits. Differences from the original are listed in docs/dev/debt/libSceJobManager.md.

Rebased onto current main: the branch now holds only the two compute commits.

Tested

Arch Linux, GCC 16.2.1, on main a8581d333 with this branch. New test agc_driver_job_manager_compute (sizes, create and dispatch errors, direct and indirect dispatch running a real compute shader, ordering across sync points, dispatch limit, shutdown) and the existing JobManager guest tests:

test RTX 5080 RADV gfx1036 lavapipe
agc_driver_job_manager_compute pass pass pass
guest_job_manager_memory pass pass pass
guest_job_manager_validation pass pass pass
guest_job_manager_dispatch pass pass pass
guest_job_manager_ordering pass pass pass
guest_job_manager_nested pass pass pass
guest_job_manager_limits pass pass pass
guest_job_manager_priority pass pass pass
guest_job_manager_shutdown pass pass pass

The same test file built against the two shipped modules passes on both, so every assertion in it holds for the original. Windows (WinLibs GCC 15.2 UCRT): build and ctest pass, 1433 of 1433. tools/check_conventions.py --base origin/main passes.

Not tested: no title I have reaches this path through our library, since the titles that use compute sequences here ship the module themselves.

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: NVIDIA RTX 5080 (driver 615.78.08), AMD Radeon 610M (RADV), lavapipe
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4815537366 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3186). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-11T00:40:49Z. --- ### What Follow-up to #3170, which left compute sequences and both compute dispatches throwing. This implements them: `initialize` with compute sequences and a completion mask, the unified factory's `CreateCompute` / `DestroyCompute`, `DispatchCompute` and `DispatchComputeIndirect`. Each compute sequence submits on its own AGC compute queue (0x20 plus the mask bit) and a handler thread collects completions from an equeue, so sync points and waits order compute work against CPU jobs the way the shipped module does. The behaviour was taken from the copies of `libSceJobManager.prx` that Ratchet & Clank (PPSA01474) and Hades II (PPSA36082) ship: sizes from `calculateRequiredMemorySize`, error codes, and the command stream each dispatch submits. Differences from the original are listed in `docs/dev/debt/libSceJobManager.md`. Rebased onto current `main`: the branch now holds only the two compute commits. ### Tested Arch Linux, GCC 16.2.1, on `main` a8581d333 with this branch. New test `agc_driver_job_manager_compute` (sizes, create and dispatch errors, direct and indirect dispatch running a real compute shader, ordering across sync points, dispatch limit, shutdown) and the existing JobManager guest tests: | test | RTX 5080 | RADV gfx1036 | lavapipe | |---|---|---|---| | `agc_driver_job_manager_compute` | pass | pass | pass | | `guest_job_manager_memory` | pass | pass | pass | | `guest_job_manager_validation` | pass | pass | pass | | `guest_job_manager_dispatch` | pass | pass | pass | | `guest_job_manager_ordering` | pass | pass | pass | | `guest_job_manager_nested` | pass | pass | pass | | `guest_job_manager_limits` | pass | pass | pass | | `guest_job_manager_priority` | pass | pass | pass | | `guest_job_manager_shutdown` | pass | pass | pass | The same test file built against the two shipped modules passes on both, so every assertion in it holds for the original. Windows (WinLibs GCC 15.2 UCRT): build and ctest pass, 1433 of 1433. `tools/check_conventions.py --base origin/main` passes. Not tested: no title I have reaches this path through our library, since the titles that use compute sequences here ship the module themselves. ### 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: NVIDIA RTX 5080 (driver 615.78.08), AMD Radeon 610M (RADV), lavapipe - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-11 00:40:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T00:40:59Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103851605 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3186#issuecomment-6103851605). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T00:40:59Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
github-actions[bot] commented 2026-10-17 23:14:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T23:14:13Z.


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.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4339 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5958 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5998 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceJobManager/CMakeLists.txt
PR 6054 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6176 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6259 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6454 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6601 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6646 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6678 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6741 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6959 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6242922790 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3186#issuecomment-6242922790). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T23:14:13Z. --- <!-- pr-overlap --> 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. | Pull request | Shared files not compared | |---|---| | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4339](https://www.github.com/boykopovar/AnyPS5/pull/4339) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5958](https://www.github.com/boykopovar/AnyPS5/pull/5958) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5998](https://www.github.com/boykopovar/AnyPS5/pull/5998) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceJobManager/CMakeLists.txt` | | [PR 6054](https://www.github.com/boykopovar/AnyPS5/pull/6054) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6176](https://www.github.com/boykopovar/AnyPS5/pull/6176) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6259](https://www.github.com/boykopovar/AnyPS5/pull/6259) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6373](https://www.github.com/boykopovar/AnyPS5/pull/6373) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6454](https://www.github.com/boykopovar/AnyPS5/pull/6454) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6486](https://www.github.com/boykopovar/AnyPS5/pull/6486) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6503](https://www.github.com/boykopovar/AnyPS5/pull/6503) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6601](https://www.github.com/boykopovar/AnyPS5/pull/6601) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6646](https://www.github.com/boykopovar/AnyPS5/pull/6646) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6678](https://www.github.com/boykopovar/AnyPS5/pull/6678) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6741](https://www.github.com/boykopovar/AnyPS5/pull/6741) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6941](https://www.github.com/boykopovar/AnyPS5/pull/6941) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6959](https://www.github.com/boykopovar/AnyPS5/pull/6959) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
oneandonlydean commented 2026-10-17 23:57:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T23:57:47Z.


Thanks for reopening this. It no longer merges cleanly into current main. Could you rebase onto current main? The branch still carries the earlier #3170 commits, which are already on main, so after the rebase it should only hold the compute sequence and dispatch work. DispatchCompute is still a stub on main, so this is wanted. We'll review and run full CI on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243430742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3186#issuecomment-6243430742). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T23:57:47Z. --- Thanks for reopening this. It no longer merges cleanly into current main. Could you rebase onto current main? The branch still carries the earlier #3170 commits, which are already on main, so after the rebase it should only hold the compute sequence and dispatch work. DispatchCompute is still a stub on main, so this is wanted. We'll review and run full CI on the new head.
fma-rc commented 2026-10-18 00:21:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-18T00:21:17Z.


@oneandonlydean rebased onto current main. The branch now holds only the two compute commits; the #3170 ones are gone. While rebasing I also replaced std::aligned_alloc in the new test, which did not build with WinLibs. The JobManager tests pass on an RTX 5080, RADV and lavapipe, and the Windows build plus ctest pass. The Tested section has the table.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243664329 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3186#issuecomment-6243664329). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-18T00:21:17Z. --- @oneandonlydean rebased onto current `main`. The branch now holds only the two compute commits; the #3170 ones are gone. While rebasing I also replaced `std::aligned_alloc` in the new test, which did not build with WinLibs. The JobManager tests pass on an RTX 5080, RADV and lavapipe, and the Windows build plus ctest pass. The Tested section has the table.
github-actions[bot] commented 2026-10-18 00:21:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T00:21:52Z.


Progress report (a8581d3 → 394ac01)

📈 System libraries: 89.73% (+0.08%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceJobManager ComputeHandlerEntry
libSceJobManager _ZN3sce3Job10JobManager10initializeEPvmjjPKNS1_12ConfigParamsE
libSceJobManager _ZN3sce3Job10JobManager10initializeEPvmjjjmPKNS1_12ConfigParamsE
libSceJobManager _ZN3sce3Job10JobManager27calculateRequiredMemorySizeEPKNS1_21MemorySizeQueryParamsE
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243669307 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3186#issuecomment-6243669307). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T00:21:52Z. --- <!-- progress-report --> ### Progress report (a8581d3 → 394ac01) 📈 **System libraries**: 89.73% (+0.08%, +4 implemented functions) <details> <summary>✅ 4 implemented</summary> | Library | Name | | - | - | | libSceJobManager | `ComputeHandlerEntry` | | libSceJobManager | `_ZN3sce3Job10JobManager10initializeEPvmjjPKNS1_12ConfigParamsE` | | libSceJobManager | `_ZN3sce3Job10JobManager10initializeEPvmjjjmPKNS1_12ConfigParamsE` | | libSceJobManager | `_ZN3sce3Job10JobManager27calculateRequiredMemorySizeEPKNS1_21MemorySizeQueryParamsE` | </details>
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!3186
No description provided.