fix(agc): restore initialized defaults for context operation zero #22667
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22667"
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 JJenkx on 2026-11-18T01:06:19Z.
What
Operation 0 of
sceAgcDcbContextStateOpand_0100now emitsLOAD_CONTEXT_REG_INDEXfrom the selected initialized CX defaults. The old marker cleared the context instead of restoring those defaults. The load preserves unrelated context registers.The descriptor is captured before buffer growth, so a callback that initializes another SDK version cannot change the current packet’s backing. Growth honors reserved words, callback failure, replacement storage and overflow. Calling before initialization raises a host validation error before touching the buffer or invoking growth.
The packet, selector and allocation behavior are reference-derived from the user-owned PPSA06652 compatibility module (
qj7QZpgr9Uw/HabmgqPwPw0, module SHA-256124a637bb17080d4e754d07d73f3320531d3b5c6e384ae2a81c364c44d17abbd), not a fresh console measurement. Private code/data are excluded. Other operations’ synchronization and shadow-mode gaps remain in debt.Tested
Linux, RX 6650 XT/RADV Mesa 26.2.7, Khronos validation 1.4.363; SPIRV-Tools OFF. Frozen full SDK/relinker builds of main
378945815f6cplus the declared prerequisites, with and without this topic.The expected failures are the five new restore cases (uninitialized and initialized0/8/10/13) and the corrected legacy command check. New tests compare all sparse default pairs, execute the packet through the driver’s CPU PM4 state machine, preserve unrelated CX state, cover the original0..5 capacity boundaries and growth outcomes, and verify exact descriptor pointer/count retention across a callback that changes the active SDK version. The uninitialized case checks rejection before a callback can initialize the library. Existing operation1/2/3 cases and buffer guards remain. The three existing validation warnings are identical on both arms; each records one real Radeon validation insertion.
The SDKs remain frozen at control
a61d8e3abc12and change15a3d101fc8c. A test-only initialization placement fix was compiled separately into the common fixture bank; identical fixture binaries run against both SDKs. All final production files match the frozen change SDK source exactly. Final public1857ccd6c64dmerged with tested main equals the final integration tree. Its production source is identical to the frozen SDK; the sole later change was the rebuilt fixture setup. Own-header syntax5/5 and conventions pass. Newer mainf0ed3312610cmerges cleanly; AGC/driver sources are unchanged since the tested main.Verbose CTest/JUnit, matched builds, exact source/fixture/binary manifests and reference-scope notes, SHA-256
6517e4ac277307dd6ffcd91d83b0f8a89dc9f2514541b6031c1c7f5e7377b7d0. Downloaded and all44 payload hashes verified. No final-head native-title, Windows or NVIDIA qualification is claimed; no performance or title-unblock claim.Overlap: #20548 changes unversioned operation1; this topic changes operation0 in
_0100. Source merge with itsf8db0aa9ca56is clean; that combined runtime is not claimed. The inherited cache/backing changes are from the dependencies below, also shared by #22535/#22574. #17742/#22647 add independent CMake test targets, and the known.tsv differences are inherited prerequisite work rather than new edits to #19191/#20294 cases.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:05:41Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
1857ccd6c64da7d288cb6b38d6d040230ce6b17using the prepared diff andrepo_read.pysource reads. I did not run build or test commands. The author reports matched Linux builds and focused tests in the PR description; those results were not independently run here.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read the description, commits, manifest, diff, and all 14 included changed files listed in the review bundle. The deleted debt note was excluded because it has no added lines; it was not read. I did not independently verify the linked test artifacts, run the reported checks, or qualify behavior on Windows, NVIDIA, or a console.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T20:06:31Z.
Review: APPROVED
Reviewed — looks good
The source changes at head
b1e34d2a9b73f449ce4f227d367cb4bf08ef5e58support the stated operation-zero restoration, and I found no verified blocking defect.What I ran
Read the prepared diff, manifest, and changed source hunks through
repo_read.py. I did not compile or run tests.Results
Negative control
Not run; no tests were executed in this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No compilation, test execution, Windows or NVIDIA qualification, or physical-console behavior was verified. The Linux/Vulkan results in the PR description are author-reported. I read the changed hunks for all 18 non-deleted entries in
files.json; the deleted debt note was checked in the diff. No files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T20:10:18Z.
Review: COMMENTED
🏛️ Architecture findings (3)
Advisory architecture findings (3)
💬 Code review
Actionable comments posted (1)
c2a7daef-f92d-4ad4-874f-58119353fde8Reviewing files that changed from the base of the PR and between
1891347284andb1e34d2a9b.tools/library-oracle/known.tsvis excluded by!**/*.tsvcore/libs/prx/libSceAgc/Acb/include/Control.hppcore/libs/prx/libSceAgc/Acb/src/Control.cppcore/libs/prx/libSceAgc/CMakeLists.txtcore/libs/prx/libSceAgc/Command/include/RegisterDefaults.hppcore/libs/prx/libSceAgc/Command/src/RegisterDefaults.cppcore/libs/prx/libSceAgc/DcbState/src/ContextState.cppcore/libs/prx/libSceAgc/DcbState/src/Init.cppcore/libs/prx/libSceAgc/Misc/include/RegisterDefaults.hppcore/libs/prx/libSceAgc/Misc/src/RegisterDefaults.cppcore/libs/prx/libSceAgc/tests/Commands.cppcore/libs/prx/libSceAgc/tests/ContextDefaultRestore.cppcore/libs/prx/libSceAgc/tests/ContextStateSize.cppcore/libs/prx/libSceAgc/tests/DefaultCxStateRange.cppcore/libs/prx/libSceAgc/tests/QueueReset.cppdocs/dev/debt/changes/fix-agc-acb-reset-context-20261116.mddocs/dev/debt/changes/fix-agc-context-default-restore-20261118.mddocs/dev/debt/changes/fix-agc-default-context-range-reader-20261115.mddocs/dev/debt/changes/fix-agc-init-0090-ignored-argument-20261115.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T22:28:13Z.
Review: COMMENTED
🏛️ Architecture findings (4)
Advisory architecture findings (4)
💬 Code review
Actionable comments posted (2)
6e761e73-2ea5-4680-aee2-43f06469cc28Reviewing files that changed from the base of the PR and between
b1e34d2a9band5f06b828d1.tools/library-oracle/known.tsvis excluded by!**/*.tsvcore/libs/prx/libSceAgc/Acb/src/Control.cppcore/libs/prx/libSceAgc/CMakeLists.txtcore/libs/prx/libSceAgc/Command/include/Packet.hppcore/libs/prx/libSceAgc/Command/include/RegisterDefaults.hppcore/libs/prx/libSceAgc/Command/src/Packet.cppcore/libs/prx/libSceAgc/Command/src/RegisterDefaults.cppcore/libs/prx/libSceAgc/DcbState/src/ContextState.cppcore/libs/prx/libSceAgc/tests/Commands.cppcore/libs/prx/libSceAgc/tests/ContextDefaultRestore.cppcore/libs/prx/libSceAgc/tests/QueueReset.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T23:28:36Z.
Review: COMMENTED
🏛️ Architecture findings (3)
Advisory architecture findings (3)
💬 Code review
b430349d-2da6-45a8-9ff3-be07c9c55e0bReviewing files that changed from the base of the PR and between
c29b580cc7and2a7600de0a.core/libs/prx/libSceAgc/Acb/src/Control.cppcore/libs/prx/libSceAgc/Command/include/Packet.hppcore/libs/prx/libSceAgc/Command/src/Packet.cppcore/libs/prx/libSceAgc/DcbState/src/ContextState.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T23:54:26Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes at head
2a7600de0a90d3ca854dbcdaba1f80b8cdc432c2show no verified defects and support merging. Nothing blocks this; the points below are optional.What I ran
Read-only review of the prepared diff and all 15 changed paths listed as reviewed, with source context read through
repo_read.pyat the exact head above. The environment was Linux; no compiler or build tool was invoked, and no merged-preview check was run. The author-reported test and hardware results were not independently reproduced.Results
Negative control
Not run; the focused tests were not executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
No tests, builds, physical-console behavior, Windows or NVIDIA qualification were independently verified. All 15 changed paths in
manifest.jsonunderreviewedwere inspected through the prepared diff and included files;files.jsonlists no excluded paths. The author-reported results remain unverified here.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-03T10:03:29Z.
Review: COMMENTED
Actionable comments
25affcd8-36d0-4702-8e5d-ac3baf3c001eReviewing files that changed from the base of the PR and between
2a7600de0aand48f743c606.core/libs/prx/libSceAgc/Acb/src/Control.cppcore/libs/prx/libSceAgc/Command/include/Packet.hppcore/libs/prx/libSceAgc/Command/src/Packet.cppcore/libs/prx/libSceAgc/tests/Commands.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T10:30:02Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
48f743c606e22c66846cd74c8197c1d2570b652a. I inspected the prepared diff and changed-file snapshots, then usedrepo_read.pyfor pinned-head caller context. I ran no builds or tests.Results
Negative control
Not run; no test was executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
The operation-zero restore captures initialized context defaults before allocation can invoke a growth callback, and its packet write uses the shared nullable allocator: ContextState.cpp at the reviewed head, Packet.cpp at the reviewed head. Queue reset snapshots its selected state and holds the buffer allocation scope while emitting the packet sequence: Control.cpp at the reviewed head.
Not verified
I did not independently verify the author-reported test results, linked artifact hashes, or console behavior. No changed files were excluded. All 15 paths listed under
reviewedinfiles.jsonwere inspected:core/libs/prx/libSceAgc/Acb/include/Control.hpp,core/libs/prx/libSceAgc/Acb/src/Control.cpp,core/libs/prx/libSceAgc/CMakeLists.txt,core/libs/prx/libSceAgc/Command/include/Packet.hpp,core/libs/prx/libSceAgc/Command/include/RegisterDefaults.hpp,core/libs/prx/libSceAgc/Command/src/Packet.cpp,core/libs/prx/libSceAgc/Command/src/RegisterDefaults.cpp,core/libs/prx/libSceAgc/DcbState/src/ContextState.cpp,core/libs/prx/libSceAgc/tests/Commands.cpp,core/libs/prx/libSceAgc/tests/ContextDefaultRestore.cpp,core/libs/prx/libSceAgc/tests/ContextStateSize.cpp,core/libs/prx/libSceAgc/tests/QueueReset.cpp,docs/dev/debt/changes/fix-agc-acb-reset-context-20261116.md,docs/dev/debt/changes/fix-agc-context-default-restore-20261118.md, andtools/library-oracle/known.tsv.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:18:36Z.
Review: COMMENTED
The five context-default restore cases passed on Linux, including the uninitialized case and four explicit default versions. I also ran the shared Vulkan scalar-buffer test on main and the patched tree on the same llvmpipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. It passed on both trees. The loader inserted the layer and neither log reported a missing layer or
VUID-entry.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.