Repository navigation
fix(libSceAgc): write the console's context push packets for ContextStateOp 1 - #20548
oneandonlydean merged 2 commits into
Conversation
…tateOp 1 sceAgcDcbContextStateOp(1) writes CONTEXT_CONTROL with shadow control 0x80018001 and CLEAR_STATE 1, as measured by agcbuild_DcbContextStateOp_b. The driver now runs CLEAR_STATE commands 1 to 3 as push, pop and push-clear instead of always clearing, and accepts that shadow control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The reviewed change matches the stated scope, and no blocking defect was verified in the inspected code.
What I ran
No commands or tests were run. The author reports Windows 11 test and oracle results in the PR description; those results were not independently verified. Reviewed head: f8db0aa9ca56c3b630b7b8bf5cacd94a12a8caaa.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Changed behavior and relevant callers inspected |
| Tests | not run | Results supplied by author only |
| Console measurements | not run | Measurement claims supplied by author |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported test, oracle, and conventions checks were not run independently. Physical-console packet behavior and the inferred CLEAR_STATE command meanings were not verified. All eight changed files listed in review/manifest.json were read; Packet.cpp was also read to check buffer reservation behavior. No changed files were excluded in review/manifest.json.
To get this to a good state
Nothing is required.
Validation: PR #20548 (Linux/AMD, RADV) — PASSIndependent end-to-end run of head Environment: CachyOS, kernel 7.3.4-1-cachyos x86-64 · GCC 16.2.1 · CMake 4.4.5 / Ninja 1.13.2 · AMD Radeon RX 9070 XT (RADV GFX1201, Vulkan 1.4.354) · Khronos validation layer 1.4.363 via Merge baseline: merge-base with Gate 1 — build: configure + Gate 2 — focused GPU tests, head vs base, same host/GPU ( Gate 3 — repo checks: Gate 4 — reproducers: Verdict: PASS. Logs under |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows NVIDIA check of head Setup: Windows 11 Home 10.0.26300, i9-13900K, WinLibs GCC 15.2.0, Release, RTX 4080 (
The one test not run on both sides is Not checked: AMD, Linux, macOS, any commercial title. AI-assisted: yes |
|
Linux NVIDIA run with the Khronos validation layer, since the runs so far are NVIDIA on Windows and RADV on Linux. Setup: Arch Linux, kernel 7.3.4, GCC 16.2.1 Release, NVIDIA GeForce RTX 4090 (10de:2684), driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head
The tests are No new AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The changed packet encoding and PM4 handling look consistent with the stated measured operation-1 sequence, and the added tests cover the modeled push, pop, and push-clear behavior; I did not run tests.
What I ran
Reviewed head 82a8cd6b68674a9ac9d962f80451b2b2f3544c60 against base main. Read all changed lines in the nine files listed by the manifest, plus targeted context in Pm4.hpp, QueueState.hpp search results, and review/README.md. I did not run commands or tests.
Results
| Check | Result | Note |
|---|---|---|
| Changed lines read | passed | All manifest entries inspected |
| Tests | not run | Author-reported results only |
| Console behavior | not run | Operation-1 packet described as measured |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports Windows 11 / WinLibs GCC 15.2.0 Release test and oracle results; I did not reproduce them. Console behavior beyond the described operation-1 measurement was not verified. The full text of changed files was present and the changed lines were read; files excluded by rule: none.
To get this to a good state
Nothing is required.
What
prosper's
agcbuildconsole measurements (tools/library-oracle) showsceAgcDcbContextStateOp(buf, 1)writing 5 words and returning the first one:AnyPS5 wrote KytyPS5's 27-word sequence of NOP markers instead (
agcbuild_DcbContextStateOp_b).sceAgcDcbContextStateOpnow writes those two packets for operation 1. Operations 0, 2 and 3 were not measured, so they still go throughsceAgcDcbContextStateOp_0100, which is unchanged.CLEAR_STATEas a clear. It now treats commands 0 to 3 as clear, push, pop and push-clear, sharing the code of theCONTEXT_STATENOP operations. Without this, the console's operation-1 packet would clear the context instead of saving it. Commands 4 to 15 are now refused rather than run as a clear.CONTEXT_CONTROLaccepts the shadow-control word0x80018001from that packet. The driver keeps no shadow memory, and the packet requests no load._aand_c), the console writes onlyCLEAR_STATEwith the operation's low bits and returns null. The two measured values, 1 and 2, can't tell a 2-bit mask from a 4-bit one, so AnyPS5 still throws and both entries stay inknown.tsv.sceAgcDcbContextStateOpGetSize(1)still reports KytyPS5's 108 bytes, more than the 20 written. The debt entry records this.agc_context_state_size_testschecks the console packet word for word.agc_driver_graphics_testsruns push, pop and push-clear throughCLEAR_STATE.agc_driver_testsnow submits commands 0 to 3 and expects 4 and 15 to be refused.libSceAgc.mdandlibSceAgcDriver.md. ReadingCLEAR_STATE1 as a push is inferred from AnyPS5's existing meaning of operation 1. It is not measured.Tested
Windows 11, WinLibs GCC 15.2.0, Release.
ctest -R "agc_context_state_size|^agc_commands$|^agc_driver_graphics$|^agc_driver$|agc_command": 8 of 8 pass.library_oracle.py agcbuild: 146 known findings, 0 new.DcbContextStateOp_bnow matches.python tools/check_conventions.py --base origin/mainChecklist
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)