fix(agc): a 0xffffffff register offset names no register #16054
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16054"
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 stuart-russell on 2026-11-05T13:35:17Z.
What
A
SET_*_REG/SET_*_REG_INDIRECTpacket whose register offset is0xffffffffnames no register; the hardware accepts the packet and the remaining entries still take effect. The driver threw (indirect register sentinel semantics are not implemented), which aborted the whole submission.registerOffsetnow returns an empty optional for0xffffffff, and the four call sites (validation range check, the directSET_*_REGwrite loop, the indirect pair loop and the indirect trace) skip that entry instead of writing it.APS5_PM4_RINGdumps of such packets still list the other offsets.IndirectRegistersValidstill classifies a list holding the sentinel as invalid, so the re-read-at-execution path and the released reports that depend on it are unchanged; the sentinel entry is skipped when either copy is written, so both copies behave the same.The packets that carry a byte offset are
SET_CONTEXT_REG(0x69),SET_SH_REG(0x76),SET_UCONFIG_REG(0x79) and their indirect forms.SET_UCONFIG_REG_INDEX(0x7a) selects a bank and index rather than a byte offset and still rejects0xffffffff.Part of the split of #10420; independent of #10779 and #16053.
References
The context register space ends below
0x4000, so0xffffffffcannot name a register; the packet is accepted, not rejected.docs/dev/debt/libSceAgcDriver.mdrecords theSET_*_REG_INDIRECTread timing for the entries that are genuinely invalid (bits 16-27 set). Measurement: the title trace that motivated the series containsSET_CONTEXT_REGpackets carrying this offset, and before the change the submission threw.Tested
agc_driver_pm4(18 tests) andagc_driver_graphicspass, andtools/check_conventions.py --base origin/mainpasses, ond23df92b38. The register tests now execute such a packet and check that the neighbouring entries land while the sentinel entry writes nothing, instead of expecting a failure.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R 'agc_driver_(pm4|graphics)' -Vpasses with noVUID-lines and without the "was not found but was requested by env var VK_INSTANCE_LAYERS" message. This machine has no Vulkan device, so that run covers the decode path only.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T07:02:30Z.
Review: COMMENTED
Reviewed — no blocking findings
Head
1688b109186059ffdc464d2404e61009f5291af6shows no verified defect in the sentinel handling, but the author's test run cites another commit, so no formal approval is given. Nothing blocks this; the points below are optional.What I ran
1688b109186059ffdc464d2404e61009f5291af6, basemain.core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp(lines 578–608) and the otherIndirectRegistersValidcall sites by search.Results
agc_driver_pm4,agc_driver_graphics)d23df92b38, not on this headcheck_conventions.pyd23df92b38Findings
Blocking
None.
Non-blocking
docs/dev/debt/changes/fix-agc-register-offset-sentinel.md:1: the checklist says no.mdnotes were added and that the change is generic, not specific to one title. The new file names a title ID and a game (PPSA23566, UFC 6). If this file is the expected technical-debt record format, the checklist should say so; otherwise the title reference could be dropped.core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:71(the direct0x69/0x76/0x79path): a direct packet whose offset is0xffffffffnow writes nothing, including its value dwords. The description's "the remaining entries still take effect" reads as referring to indirect list entries. The code and the new test agree on the whole-packet skip; the description could say so to avoid doubt.Not verified
d23df92b38, not on head1688b109186059ffdc464d2404e61009f5291af6. They were not re-run here.PPSA23566behaviour) were not checked. They depend on hardware and traces that were not available here.Submission.cppwas checked only at its call toIndirectRegistersValid(line 434), not in full.Pm4.cppandtests/Pm4.cppwas not read; the review covers the changed hunks and the call sites found by search.registerOffsetfor0x7a(SET_UCONFIG_REG_INDEX) is still rejected by the bank check beforeregisterOffsetis reached; this was read from the diff context, not from an executed test.To get this to a good state
Nothing is required.
Optional, before merge:
agc_driver_pm4andagc_driver_graphicson the current head1688b109186059ffdc464d2404e61009f5291af6and record the output in the PR, since the cited run is on another commit.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T11:08:53Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and regression coverage support merging.
What I ran
14aba68c24b9a2f40af7cc06eaab0341eb6a8782against basemainusing the prepared diff andrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp,core/libs/prx/libSceAgcDriver/tests/Pm4.cpp, anddocs/dev/debt/changes/fix-agc-register-offset-sentinel.md; all are listed as reviewed in the manifest. No changed files were excluded.To get this to a good state
Nothing is required.