fix(agc): abandon WAIT_REG_MEM after timeout under skip-failed #6252
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6252"
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 mazen320 on 2026-10-15T07:58:42Z.
What
Under
APS5_SKIP_FAILED_SHADERS, aWAIT_REG_MEMthat hitsAPS5_GPU_WAIT_TIMEOUT_MSnow returns instead of spinning forever.Previously, once an address had been reported, a later wait on the same address hit the static
reportedset, tookcontinuewithwarnedalready true, and never left the poll loop. That freezes the queue worker after a hung batch leaves the wait address hot. Default (non-skip-failed) behaviour is unchanged: timeout remains diagnostic-only per existing debt.Debt entry for WAIT_REG_MEM updated to record the skip-failed return.
Tested
Windows 11, RTX 3080. Conventions check against current
mainpassed. No new unit test: the hang is in the queue-worker poll loop over a live GPU wait address and needs a hung batch to reproduce; exercised under bring-up withAPS5_SKIP_FAILED_SHADERSwhere duplicate-address waits no longer pin the worker.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)APS5_SKIP_FAILED_SHADERS)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T08:08:41Z.
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.
docs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Synchronization/WaitMemory.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-15T08:09:23Z.
Overlap (#4855 / #5058 / #6054)
Bot flagged only
docs/dev/debt/libSceAgcDriver.md(WAIT_REG_MEM debt line). Production change here isWaitMemory.cppalone (return after timeout underAPS5_SKIP_FAILED_SHADERS). No shared exports with those PRs. Depends on: none. Debt edit can rebase if their debt hunks land first.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-18T19:27:52Z.
Review: CHANGES_REQUESTED
Thanks for the fix. A few things before this can go in:
APS5_SKIP_FAILED_SHADERSis not read anywhere onmain(git grep SKIP_FAILED_SHADERS upstream/mainfinds nothing), so this PR would introduce that switch, not extend it. If a new bring-up switch is intended, name it for what it does (it abandons a wait, not a shader), document it where the otherAPS5_*environment variables are documented, and say in the description that it is new. If it comes from another branch, depend on that PR.waitMemoryreturns as if the wait had been satisfied (WaitMemory.cpp:379-385) while the memory still does not match the reference/mask. That is the "plausible result wheremainkeeps waiting" case; the debt line should list it under the section for deliberate deviations, and the behaviour should be limited to exactly the already-reported address you describe, not every timed-out wait.APS5_GPU_WAIT_TIMEOUT_MSsmall, submitted twice on the same address (the second wait is the one that never leaves the poll loop). Please add that test to the libSceAgcDriver tests, and show it fails without the change.WaitMemory.cpp:376-377) and the WAIT_REG_MEM debt line; one of the two will need a rebase.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-19T09:16:51Z.
The
continueon a repeated address only skips the diagnostic print.warnedis local to thatwaitMemorycall, so a second wait on the same address still enters the timeout block once, thencontinues, then keeps polling withwarnedset. Falling through to the print does the same thing: neither path returns. An unsatisfied wait stays in the poll until the memory matches, which is what the debt line already says.APS5_SKIP_FAILED_SHADERSis not onmain, so this patch would be adding it. Returning from the timeout treats the wait as finished while the value still does not match. Limiting that return to an address already inreporteddoes not free the worker: the first wait on that address is the one still inside the poll, and a second wait on the same worker does not start until the first returns.I am not going to add that switch. Abandoning a wait after the first timeout would be a different behaviour from
main, and it would need a debt line that says the wait returns unsatisfied, plus a test. #6660 touches this function for address masking, not this loop.Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-19T21:58:33Z.
Closing this. The timeout path on main only skips a repeated diagnostic. Returning while the wait is still unsatisfied would be a new behavior, and
APS5_SKIP_FAILED_SHADERSis not on main. I am not adding that switch.Pull request closed