Repository navigation
docs(libSceAgc): record how sceAgcGetGsPrimPayload searches the IDX_FORMAT registers on firmware 11.60 - #26753
Conversation
…ORMAT registers on firmware 11.60 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Probe source (built with ps5-payload-sdk; Probe: probe.c (build d1c10b830039)Probe: stdoutAI-assisted (Claude Code). |
What
The debt entry of
sceAgcGetGsPrimPayload(docs/dev/debt/libSceAgc.md, line 17 onmain) says that AnyPS5's search over the context registers does not stop at anSPI_SHADER_IDX_FORMAT(0x1C2) entry whose format is notSPI_SHADER_2COMP, as an analysis of the library describes, while OpenAGC stops there, and that this is "not verified on PS5 hardware". No fragment onmainnames this entry. This pull request adds one fragment,docs/dev/debt/changes/docs-libsceagc-gsprimpayload-search.md(the entry with the sentence "not verified on PS5 hardware" replaced by "on a PS5 only the search below was measured", and one sentence added), and no code.A PS5 payload process on firmware 11.60 loaded
libSceAgc.sprxand tooksceAgcGetGsPrimPayloadwithdlsym(found; a control name inlibkernel.sprxand a control name of the same module,sceAgcCbCondWriteGetSize, were found, and a name that does not exist was not). It called the function eight times, once per case, at 17:06 UTC on 2026-11-24 (one run), on a synthetic shader record in a static buffer: the layout ofShaderis taken fromcore/libs/SceShaders.hppand only the context register list is filled, so the prototype(payload*, shader*)and the layout are assumptions, and the payload word was pre-filled with 0xAA. The results (lines 9 to 16 of the output) were 8 or 0 in the first word, and the other words stayed untouched:SPI_SHADER_IDX_FORMATregister with format 2 (SPI_SHADER_2COMP): 8; with value 0x12 (low nibble 2, upper bits set): 8; with format 1: 0 (cases a.1, a.3, a.2);SPI_SHADER_IDX_FORMAT: 0 (a.7);I read the function in
core/libs/prx/libSceAgc/Shader/src/GsPrimPayload.cpponmain89aad36: it loops over the registers up tonum_cx_registers(line 33), takes the first with offset 0x1C2 and a low nibble of 2 (line 38), writes 8 and stops, and otherwise writes 0, so a non-2COMP entry does not stop the search. I applied that rule to the eight register lists of the probe with a script on the host: it gives the value the console returned in all 8 cases (the null array with count 0 never reaches a read). The library's own code was not run against these calls. Its tests (core/libs/prx/libSceAgc/tests/GsPrimPayload.cpp) already check the same rules with their own values: no registers (testNoRegisters, line 46), format 2 (line 51), the low nibble and formats other than 2 (line 56), other registers (line 65) and a search that goes on past a non-matching entry (line 70); no test or code is changed here.Not measured: a register count greater than 0 with a null register array, a null payload and a null shader (the entry says these throw; the probe made none of these calls), unmapped pointers, a title process, other firmware, and whether the prototype and the layout of the record are the console's. The probe also called
sceAgcGetGsOversubscriptionafter these cases; its results are not part of this pull request and nothing about that function is changed. The entry keeps its other text, including the sentence about the analysis it cites and OpenAGC.Tested
Measured on a PS5 with firmware 11.60 (
kernel_get_fw_version0x11600005), from a homebrew payload process (ps5-payload-sdk, elfldr) that loadslibSceAgc.sprxand takes the function withdlsym, on 2026-11-24 at 17:06 UTC (one run). A title process may differ. The probe source and the complete output are in the first comment.GsPrimPayload.cpponmain(not run)The change is 1 new file, 4 lines, no code and no test. The entry grows from 632 to 998 characters, counted with the leading
-astools/check_conventions.pydoes, so it stays under the limit of 1000. I rantools/check_conventions.py --base(with this title and this body) andtools/debt_fold.py --checkon the merge of this head intomainat 5f04682 (a merge commit made withgit merge-tree, in a separate checkout): both pass, and the merge has no conflict. This is a documentation change, so no GPU test applies. Title use of the function is not established: no run log of a title that I know of calls it. Not tested: the emulator against these calls, the cases listed above as not measured, a title process and other firmware.Overlap: counted on 2026-11-24 from 19:11 to 19:25 UTC, starting from the list of the 2466 open pull requests (file lists from the GitHub API; the 17 with 100 or more files were read in full through the files API) against
mainat 5f04682; the 8 open pull requests that have aGsPrimPayloadfile or changedocs/dev/debt/libSceAgc.md(#6743, #12315, #17742, #19051, #19486, #20294, #20548 and #21376) were each merged with this branch and withmain(git merge-tree), and the patches of the debt files and of thelibSceAgcfiles of the 1779 open pull requests that change a file underdocs/dev/debt/, alibSceAgcfile or 100 or more files (read between 08:09 on 23 November and 19:25 UTC; the ones new or changed since 16:46 UTC today were read again) were searched forsceAgcGetGsPrimPayloadandGsPrimPayload. This change adds one new file,docs/dev/debt/changes/docs-libsceagc-gsprimpayload-search.md, on the entry atlibSceAgc.mdline 17, and no code. No open pull request has a file of that name or changes the entry at line 17 (the others changelibSceAgc.mdat other places, old lines 24 to 68), and none changesGsPrimPayload.cppor its tests againstmain. Of the 8, #6743, #19051 and #21376 merge cleanly with this branch and withmain, and #12315, #17742, #19486, #20294 and #20548 conflict withmainalready. #6743 and #19486 show lines oftests/GsPrimPayload.cppin their patches against an older base (checks of an unwritable payload pointer and an unreadable shader), butgit diffof their heads againstmainchanges none of its files, because the change is inmainalready (#22192, merged on 17 November, in the base of this branch). #22416 (a change ofGsOversubscription.cpp,PrimState.cppandInterpolantMapping.cpp) namessceAgcGetGsPrimPayloadin its description, changes none of the files of this change, and merges cleanly with this branch and withmain. A search of open and recently merged pull requests (since 15 November) for the function name and forIDX_FORMATfinds only #22416 (open) and #22192 (merged), and no pull request on the search of the registers. This pull request does not depend on any of them (Depends on: none).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)