fix(libSceAgcDriver): return the console's workload stream registration errors #9166

Merged
orezraey merged 2 commits from upstream-pr/9166 into main 2026-10-24 01:35:52 +00:00
orezraey commented 2026-10-21 14:09:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-21T14:09:10Z.


What

sceAgcDriverRegisterWorkloadStream and sceAgcDriverUnregisterWorkloadStream return the console's error codes. Before, they returned 0 for every argument. Measured on a retail PS5 (firmware 13.60) with two homebrew probes; the sources and console logs are in this gist (workload, and workload2 for the order of the checks).

Call Console Before
Register an id outside 1 to 31 (0, 32, 0x101, 0xffffffff) 0x8a6c0033, also with a null stream 0
Register an id that is already registered 0x8a6c0033, also with a null stream 0
Register a valid, free id with a null stream 0x8a6c0035, not registered 0, not registered
Register with a stream pointer misaligned by 1 or 4 bytes 0 0
Register an id again after unregistering it 0 0
Unregister an id outside 1 to 31 0x8a6c0033 0
Unregister an id that is not registered 0x8a6c003a 0

The workload packets themselves are unchanged here. The same probe recorded them, and the results are in a comment on #8302, which documents them. The debt entry loses its sentence about the unknown registration codes. #8302 and #8318 edit the same entry, so whichever merges second needs a small rebase.

Tested

Windows 11, MinGW (winlibs), NVIDIA GeForce RTX 5070 Ti (driver 616.64).

  • guest_agc_driver_resources covers every row above, and agc_commands passes unchanged.
  • I ran both tests on main (663de1ab21) and on this branch with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Both pass. Neither log contains the missing-layer message or any VUID-. These two tests don't create a Vulkan device, so the validation layer has nothing to check in them.
  • tools/check_conventions.py passes.
  • Linux was not built.

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 GeForce RTX 5070 Ti, driver 616.64, Windows 11 (validation run of guest_agc_driver_resources and agc_commands, which create no Vulkan device)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4952968740 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9166). Originally posted by [orezraey](https://github.com/orezraey) on 2026-10-21T14:09:10Z. --- ### What `sceAgcDriverRegisterWorkloadStream` and `sceAgcDriverUnregisterWorkloadStream` return the console's error codes. Before, they returned 0 for every argument. Measured on a retail PS5 (firmware 13.60) with two homebrew probes; the sources and console logs are in [this gist](https://gist.github.com/orezraey/befe7632b827421988b47a6c04e89e1d) (`workload`, and `workload2` for the order of the checks). | Call | Console | Before | |---|---|---| | Register an id outside 1 to 31 (0, 32, 0x101, 0xffffffff) | `0x8a6c0033`, also with a null stream | 0 | | Register an id that is already registered | `0x8a6c0033`, also with a null stream | 0 | | Register a valid, free id with a null stream | `0x8a6c0035`, not registered | 0, not registered | | Register with a stream pointer misaligned by 1 or 4 bytes | 0 | 0 | | Register an id again after unregistering it | 0 | 0 | | Unregister an id outside 1 to 31 | `0x8a6c0033` | 0 | | Unregister an id that is not registered | `0x8a6c003a` | 0 | The workload packets themselves are unchanged here. The same probe recorded them, and the results are in a comment on #8302, which documents them. The debt entry loses its sentence about the unknown registration codes. #8302 and #8318 edit the same entry, so whichever merges second needs a small rebase. ### Tested Windows 11, MinGW (winlibs), NVIDIA GeForce RTX 5070 Ti (driver 616.64). - `guest_agc_driver_resources` covers every row above, and `agc_commands` passes unchanged. - I ran both tests on `main` (663de1ab21) and on this branch with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. Both pass. Neither log contains the missing-layer message or any `VUID-`. These two tests don't create a Vulkan device, so the validation layer has nothing to check in them. - `tools/check_conventions.py` passes. - Linux was not built. ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 616.64, Windows 11 (validation run of `guest_agc_driver_resources` and `agc_commands`, which create no Vulkan device) - [x] AI-assisted: yes
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!9166
No description provided.