fix(agc): patch a relocated hit's decode when the finisher restarts it #19267
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19267"
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 chitters2004 on 2026-11-13T01:03:18Z.
What
Follow-up to #15455, which merged before these review commits reached it.
The bug (on
mainsince #15455, withAPS5_DRAW_PIPELINE=1). A draw served from another draw's cache entry through an alias keeps the donor's unpatched decode, becausedraw()patches it only on a miss. When the finisher restarts such a draw after its captured memory changed, the restart clearsdrawHitand caches that decode under the draw's own key. A later draw relocated from that entry then shifts the captured runs by the distance from the donor's user word instead of its own, so it misses the cache. The output is still correct, but each of those draws pays for a full miss. Now the user patches live in the draw's tail, and the restart applies them to a copy of the decode when the worker hit. WithAPS5_VERIFY_DRAW_RECIPEon,resolveDrawDecodealready rebuilds the decode from the guest registers, so the restart copy is skipped there and counted (restartPatchSkipped).Commits
19c30f8ac9test: registers #15455's finisher-restart tests under the pipeline environment, so the restart path runs in CI.24944c04bafix, plus a check inDrawCacheRelocation.cpp: it restarts a relocated stage-data hit on the finisher, then requires a draw through a second moved table to be a relocated hit.032adc92c4test: requires the finisher recapture only when draws are pipelined, so the inline run of the same test stays valid.3891c1e048review:<atomic>include order;_skip_refused_draw_pipelinemoved into the WIN32libcPATH block.ff4096498breview: skip the restart copy underAPS5_VERIFY_DRAW_RECIPE; newagc_driver_draw_cache_relocation_recipe_verify_draw_pipelineasserts exactly one skip.Tested
Fork CI, lavapipe, validation layer on:
maina445e0f0f7+ this PR (032adc92c4)VUID-VUID-main+ the tests without the fix (ab1cacbdd8)draw_cache_relocation_draw_pipelineanddraw_cache_relocation_plan_verifyfailff4096498b(run 43349134560)draw_pipelineandplan_verifyfail;recipe_verify_draw_pipelinefails (skip count 0, expected 1)Independent runs: @tablefrogpillow on three AMD generations under Linux (Vega, RDNA2, RDNA3), and @JJenkx on Windows 11 with an RX 6700 XT (10 covered tests, 3 of 3 runs, 30/30 on
032adc92c4).python -I tools/check_conventions.pypasses.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-13T01:22:31Z.
Review: COMMENTED
Reviewed the relocated-hit restart fix — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
032adc92c4f8f696196b592e5d168ba0070cf753. Base:main. No merged-preview check.repo_read.py, plus the review folder. No build, no test run.Commands
Results
check_conventions.pyFindings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp:1436: whenverifyDrawRecipe()already passed, the decode was patched at line 512, so this restart copy patches it again. Harmless, one extra copy on the restart path only. Skipping the copy when the patch is already in place would avoid it.core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheRelocation.cpp:24:<atomic>sits between<cstdint>and<cstdio>, out of alphabetical order with the rest of the include block.core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_unsupported_buffer_type_tests.cmake:12: the new_skip_refused_draw_pipelinetest is outside theWIN32block (lines 8–11) that sets thelibcPATH for the other two skip-refused tests. The author reports 9/9 on Windows, so it may not be needed. Worth confirming.The restart patch condition at line 1436 (
drawHit) and the miss-path patch at line 688 (!drawHit) are complementary, so a relocated hit's decode is patched on one path or the other.Sources
Not verified
032adc92c4f8: not fetched. Approval would need it, so none is given.check_conventions.py: author-reported, not run.DrawRecaptureOnChange.cppwas read only at its changed hunk.To get this to a good state
Nothing is required. The non-blocking points above are optional.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T05:09:28Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the review was limited to the changed code and targeted restart path.
What I ran
Reviewed head
ff4096498b709e8d271b7bff238fdf3e673f7ed4. No commands or tests were run; no precheck output was supplied as a run performed by me.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all six changed files marked
reviewedin the manifest and the prepared description, commits, manifest, and diff.files.jsonwas not available through the reader. I inspected the new restart patch logic inDraw.cpp; I did not read the remaining full contents of the changed files or execute tests. CI and hardware results in the description are author-reported, not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T02:52:38Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code and reported checks support merging.
What I ran
Reviewed head
7c28798169000cf69f898627aec894591ce68ef6. I read all six changed files listed inmanifest.json, plusdescription.md,commits.md, anddiff.patch. I did not run commands or tests. The author reports Fork CI, hardware runs, andpython -I tools/check_conventions.pypassing.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the test suite, convention check, or physical-console tests. The reported Fork CI, hardware results, and convention check were not independently verified.
To get this to a good state
Nothing is required.