fix(libSceAgc): emit NOP packets for the DCB workload calls #3789
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3789"
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 xXPBSXx on 2026-10-11T16:43:36Z.
What
sceAgcDcbSetWorkloadsActiveandsceAgcDcbSetWorkloadCompletethrew. They now follow KytyPS5 (src/libs/agc.cpp): an 18-dword (active) or 12-dword (complete)IT_NOPpacket carrying the stream id, and for active the 64-bit mask of the workload ids, for complete the workload id and the 64-bit clear mask. Both return null for a null command buffer, an unregistered or out-of-range stream (1 to 31), a workload id above 63, and for active a duplicate id or a count of 0 or above 63.sceAgcDriverRegisterWorkloadStreamandsceAgcDriverUnregisterWorkloadStreamrecord the stream ids that the DCB calls check; registration still returns 0 for every argument, since the console's error codes for an invalid or repeated registration are unknown. This changes the first version of this PR (a plain two-dword NOP), after review.Tested
maina11c8f7f7plus this branch:ctest -R "agc_commands|agc_initialization|guest_agc_driver_resources"passes.testWorkloadspins the packet header, stream id, mask, clear mask and the zero tail for ids {3,4} and workload 33, and each null case above, including after unregistration.python tools/check_conventions.py --base upstream/mainpasses.sceAgcDcbSetWorkloadsActive). Not tested: Linux, macOS.agcbuild.golden.tsv) measures a null return for unregistered streams, not the packet of a registered one; this and the registration behaviour are in TechnicalDebt.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T16:44:34Z.
Progress report (
bca7a29→2a7b38a)📈 System libraries: 86.53% (+0.06%, +2 implemented functions)
✅ 2 implemented
sceAgcDcbSetWorkloadCompletesceAgcDcbSetWorkloadsActiveImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T16:52:36Z.
Review: DISMISSED
Thanks for the PR. Two problems, both about returning a plausible result where
mainthrew:Workload.cpp:13-19: the packet size and contents are invented. KytyPS5 (src/libs/agc.cpp,AgcDcbSetWorkloadsActive/AgcDcbSetWorkloadComplete) writes an 18-dword (active) / 12-dword (complete)IT_NOPpacket carrying the stream id and the workload mask (complete: stream id, workload id, clear mask). A 2-dword NOP is not what any reference emits, and the TechnicalDebt line itself says the real packet is unknown.tests/data/console_oracle/agcbuild.golden.tsv,agcbuild_DcbSetWorkloadsActive_*/agcbuild_DcbSetWorkloadComplete_*) measures a null return on a real console for unregistered streams, and KytyPS5 also returns null for stream id outside 1..31, workload id > 63, duplicate ids, and count 0 or > 63 (active). This PR returns a packet in all those cases, andtestWorkloadspins that.Suggested direction: follow KytyPS5's packet layouts and checks (the workload stream registry comes from
sceAgcDriverRegisterWorkloadStream, so that is a prerequisite, or the unregistered case has to throw), pin the values in the test from the reference, and keep unverified parts in TechnicalDebt. Otherwise keep throwing.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T17:11:43Z.
Thanks, both points are right. Pushed
a167cb231: the packets now follow KytyPS5 (18-dword active with stream id and 64-bit workload mask, 12-dword complete with stream id, workload id and 64-bit clear mask), and both calls return null for a null buffer, an unregistered or out-of-range stream, a workload id above 63, and for active a duplicate id or a count of 0 or above 63. The registry is the one you suggested:sceAgcDriverRegisterWorkloadStream/sceAgcDriverUnregisterWorkloadStreamrecord ids 1 to 31, and registration still returns 0 for every argument because I have no source for the console's error codes.testWorkloadspins the values from the reference. The description is updated; the layouts rest on KytyPS5 only (the prosper oracle covers the unregistered case, not a registered packet), which TechnicalDebt now says.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:17:05Z.
Conflicts with main in
docs/dev/TechnicalDebt.md; please rebase.No title was run. Please run PPSA29866 on the branch and quote the line where it stops on main and the one where it stops with this.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T23:46:51Z.
@adriadam10 rebased onto current
main(bca7a29d2): the branch conflicted indocs/dev/TechnicalDebt.mdonly, and I resolved it by keepingmain's three entries at the end and placing this PR's entry in front of them, away from the end of the file. The code is unchanged since the review round: the two points from your review (packet layouts and checks after KytyPS5, null for unregistered streams through the driver's workload-stream registry) are answered as in my earlier comment. Built and tested on Windows after the rebase:agc_initialization,agc_commandsandguest_agc_driver_resourcespass, andtools/check_conventions.py --base upstream/mainpasses. The branch was force-pushed (own PR branch,--force-with-lease).AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T00:34:36Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgc/tests/Commands.cppL210, L561docs/dev/TechnicalDebt.mdL709docs/dev/TechnicalDebt.mdL709Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T01:58:10Z.
Title run as requested, PPSA29866 (Tomba! 2 SE), Windows, GCC, RTX 4080 SUPER, on current main + #3819 (the title's missing imports):
what(): sceAgcDcbSetWorkloadsActive not implemented, then SIGABRT;Only the workload calls were checked this way; whether the packet contents match a console is not tested (layouts follow KytyPS5 as in the earlier comment).
AI-assisted (Claude Code).