fix(libSceAgc): write the console's context push packets for ContextStateOp 1 #20548
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20548"
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 AdriaanBoshoff on 2026-11-15T09:45:57Z.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T11:00:27Z.
Review: COMMENTED
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
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_STATEcommand meanings were not verified. All eight changed files listed inreview/manifest.jsonwere read;Packet.cppwas also read to check buffer reservation behavior. No changed files were excluded inreview/manifest.json.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T11:23:04Z.
Review: APPROVED
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
82a8cd6b68674a9ac9d962f80451b2b2f3544c60against basemain. Read all changed lines in the nine files listed by the manifest, plus targeted context inPm4.hpp,QueueState.hppsearch results, andreview/README.md. I did not run commands or tests.Results
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.