feat(libSceJobManager): implement CPU job sequences #3170

Merged
fma-rc merged 3 commits from upstream-pr/3170 into main 2026-10-11 07:32:50 +00:00
fma-rc commented 2026-10-10 23:57:47 +00:00 (Migrated from github.com)

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


#3186 contains these commits plus the compute path, so reviewing that one covers both.

What

Adds libSceJobManager with a working sce::Job::JobManager for CPU job sequences: the constructor and destructor, calculateRequiredMemorySize, both initialize overloads, shutdown, the two sequence factory getters and setPersistentThreadCount, plus the sequence and factory interfaces titles call through (dispatch, sync point, wait, create, destroy). Astro's Playroom (PPSA01325) imports the library and does not ship it. Fixes #2476 and replaces the throwing exports of #2924.

The behaviour is taken from the disassembly of the copies that Ratchet & Clank: Rift Apart (PPSA01474) and Hades II (PPSA36082) ship in sce_module. Compute sequences and both compute dispatches throw NotImplemented. What differs from the original is listed in TechnicalDebt.

Tested

Arch Linux, GCC 16.2.1. guest_job_manager_tests has eight cases: the size formula, every error code, a 1000-invocation dispatch, sync point ordering, a job that dispatches into its own sequence behind a sync point, the per-sequence limits and node exhaustion, priority order, and repeated initialize and shutdown. I built the same test file against a shim that forwards the exports to the relinked modules of both titles, and all eight cases pass there too, so the assertions are the original's behaviour.

Full suite on RADV (Radeon 610M): 757 of 757 pass. On an RTX 5080: 756 pass, agc_driver_dcc_keys_first_write fails, which this branch does not touch. check_conventions.py passes.

PPSA01325 now loads: the import audit shows 0 absent imports. It stops 40 s in on sceLibcInternalHeapErrorReportForGame_nid_postfix not implemented, the same place it stopped with the throwing exports, so it has not called into the library by then and no title has exercised the interfaces yet.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4815319916 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3170). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-10T23:57:47Z. --- #3186 contains these commits plus the compute path, so reviewing that one covers both. ### What Adds `libSceJobManager` with a working `sce::Job::JobManager` for CPU job sequences: the constructor and destructor, `calculateRequiredMemorySize`, both `initialize` overloads, `shutdown`, the two sequence factory getters and `setPersistentThreadCount`, plus the sequence and factory interfaces titles call through (dispatch, sync point, wait, create, destroy). Astro's Playroom (PPSA01325) imports the library and does not ship it. Fixes #2476 and replaces the throwing exports of #2924. The behaviour is taken from the disassembly of the copies that Ratchet & Clank: Rift Apart (PPSA01474) and Hades II (PPSA36082) ship in `sce_module`. Compute sequences and both compute dispatches throw `NotImplemented`. What differs from the original is listed in TechnicalDebt. ### Tested Arch Linux, GCC 16.2.1. `guest_job_manager_tests` has eight cases: the size formula, every error code, a 1000-invocation dispatch, sync point ordering, a job that dispatches into its own sequence behind a sync point, the per-sequence limits and node exhaustion, priority order, and repeated initialize and shutdown. I built the same test file against a shim that forwards the exports to the relinked modules of both titles, and all eight cases pass there too, so the assertions are the original's behaviour. Full suite on RADV (Radeon 610M): 757 of 757 pass. On an RTX 5080: 756 pass, `agc_driver_dcc_keys_first_write` fails, which this branch does not touch. `check_conventions.py` passes. PPSA01325 now loads: the import audit shows 0 absent imports. It stops 40 s in on `sceLibcInternalHeapErrorReportForGame_nid_postfix not implemented`, the same place it stopped with the throwing exports, so it has not called into the library by then and no title has exercised the interfaces yet. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
github-actions[bot] commented 2026-10-10 23:57:56 +00:00 (Migrated from github.com)

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


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:6103527966 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3170#issuecomment-6103527966). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T23:57:56Z. --- 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-11 05:42:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T05:42:51Z.


Progress report (8975b59 → 4474548)

📈 System libraries: 85.8% (+0.02%, +11 implemented, +1 declared functions)

✅ 11 implemented
Library Name
libSceJobManager WorkerEntry
libSceJobManager _ZN3sce3Job10JobManager10initializeEPvmjjPKNS1_12ConfigParamsE
libSceJobManager _ZN3sce3Job10JobManager10initializeEPvmjjjmPKNS1_12ConfigParamsE
libSceJobManager _ZN3sce3Job10JobManager24setPersistentThreadCountEj
libSceJobManager _ZN3sce3Job10JobManager27getSequenceFactoryInterfaceENS1_8PriorityE
libSceJobManager _ZN3sce3Job10JobManager34getUnifiedSequenceFactoryInterfaceENS1_8PriorityE
libSceJobManager _ZN3sce3Job10JobManager8shutdownEv
libSceJobManager _ZN3sce3Job10JobManagerC1Ev
libSceJobManager _ZN3sce3Job10JobManagerC2Ev
libSceJobManager _ZN3sce3Job10JobManagerD1Ev
libSceJobManager _ZN3sce3Job10JobManagerD2Ev
🆕 1 declared as stubs
Library Name
libSceJobManager _ZN3sce3Job10JobManager27calculateRequiredMemorySizeEPKNS1_21MemorySizeQueryParamsE
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105932150 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3170#issuecomment-6105932150). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T05:42:51Z. --- <!-- progress-report --> ### Progress report (8975b59 → 4474548) 📈 **System libraries**: 85.8% (+0.02%, +11 implemented, +1 declared functions) <details> <summary>✅ 11 implemented</summary> | Library | Name | | - | - | | libSceJobManager | `WorkerEntry` | | libSceJobManager | `_ZN3sce3Job10JobManager10initializeEPvmjjPKNS1_12ConfigParamsE` | | libSceJobManager | `_ZN3sce3Job10JobManager10initializeEPvmjjjmPKNS1_12ConfigParamsE` | | libSceJobManager | `_ZN3sce3Job10JobManager24setPersistentThreadCountEj` | | libSceJobManager | `_ZN3sce3Job10JobManager27getSequenceFactoryInterfaceENS1_8PriorityE` | | libSceJobManager | `_ZN3sce3Job10JobManager34getUnifiedSequenceFactoryInterfaceENS1_8PriorityE` | | libSceJobManager | `_ZN3sce3Job10JobManager8shutdownEv` | | libSceJobManager | `_ZN3sce3Job10JobManagerC1Ev` | | libSceJobManager | `_ZN3sce3Job10JobManagerC2Ev` | | libSceJobManager | `_ZN3sce3Job10JobManagerD1Ev` | | libSceJobManager | `_ZN3sce3Job10JobManagerD2Ev` | </details> <details> <summary>🆕 1 declared as stubs</summary> | Library | Name | | - | - | | libSceJobManager | `_ZN3sce3Job10JobManager27calculateRequiredMemorySizeEPKNS1_21MemorySizeQueryParamsE` | </details>
Mouhand-Kaddo commented 2026-10-11 07:22:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-11T07:22:57Z.


Additional platform validation of standalone PR head 9557efae6acc799982729f5acfc90416e953c900 (2026-10-11):

Windows: blocked or failed — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, BUILD_TESTING=ON.

Build/configuration did not reach executable validation; no passing test verdict.

Checks: guest_job_manager_memory, guest_job_manager_validation, guest_job_manager_dispatch, guest_job_manager_ordering, guest_job_manager_nested, guest_job_manager_limits, guest_job_manager_priority, guest_job_manager_shutdown.

The new test fixture does not compile with the supported Windows toolchain: core/libs/tests/GuestJobManager.cpp:100 uses std::aligned_alloc, which WinLibs GCC 15.2.0 does not provide (error: aligned_alloc is not a member of std). The eight job-manager cases could not run; the fixture needs a portable aligned allocation/free pair.

No title/gameplay validation. These results cover the standalone head, not a merge with current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106637701 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3170#issuecomment-6106637701). Originally posted by [Mouhand-Kaddo](https://github.com/Mouhand-Kaddo) on 2026-10-11T07:22:57Z. --- <!-- anyps5-platform-validation:9557efae6acc799982729f5acfc90416e953c900 --> Additional platform validation of standalone PR head `9557efae6acc799982729f5acfc90416e953c900` (2026-10-11): **Windows: blocked or failed** — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, `BUILD_TESTING=ON`. Build/configuration did not reach executable validation; no passing test verdict. Checks: `guest_job_manager_memory`, `guest_job_manager_validation`, `guest_job_manager_dispatch`, `guest_job_manager_ordering`, `guest_job_manager_nested`, `guest_job_manager_limits`, `guest_job_manager_priority`, `guest_job_manager_shutdown`. The new test fixture does not compile with the supported Windows toolchain: core/libs/tests/GuestJobManager.cpp:100 uses std::aligned_alloc, which WinLibs GCC 15.2.0 does not provide (error: aligned_alloc is not a member of std). The eight job-manager cases could not run; the fixture needs a portable aligned allocation/free pair. No title/gameplay validation. These results cover the standalone head, not a merge with current main.
adriadam10 commented 2026-10-11 07:25:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:25:14Z.


Checked on Linux: build, guest_job_manager 8/8, and 50 repeated runs without a failure; check_conventions.py passes. Code review found no problem in the dispatch/wait locking.

Added on your branch (two small commits, no logic changes):

  • Rebased onto current main, which drops the Merge remote-tracking branch 'origin/main' commit (no merge commits, CONTRIBUTING).
  • Moved the TechnicalDebt line out of the last position of "Functional", where it conflicts with #1619 and every other PR that appends there.

Not verified here: that the behaviour equals the original's (rests on your shim run against the shipped modules); nothing was run on Windows or NVIDIA. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106654618 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3170#issuecomment-6106654618). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:25:14Z. --- Checked on Linux: build, `guest_job_manager` 8/8, and 50 repeated runs without a failure; `check_conventions.py` passes. Code review found no problem in the dispatch/wait locking. Added on your branch (two small commits, no logic changes): - Rebased onto current `main`, which drops the `Merge remote-tracking branch 'origin/main'` commit (no merge commits, CONTRIBUTING). - Moved the TechnicalDebt line out of the last position of "Functional", where it conflicts with #1619 and every other PR that appends there. Not verified here: that the behaviour equals the original's (rests on your shim run against the shipped modules); nothing was run on Windows or NVIDIA. Merging once CI is green.
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!3170
No description provided.