fix(agc): wait briefly for a dispatch's background shader work instead of dropping it silently #25226
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25226"
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 Ketz7 on 2026-11-21T19:39:49Z.
What
APS5_ASYNC_DRAW_COMPILE, a dispatch whose shader is still being prepared or specialized in the background now waits for that job up toAPS5_ASYNC_DISPATCH_WAIT_MS(1000 by default) instead of being dropped.agc_driver_async_draw_compilenow requires the dispatch to store on its first attempt when it may wait.agc_driver_async_draw_compile_no_wait(APS5_ASYNC_DISPATCH_WAIT_MS=0) keeps the old skip covered.docs/dev/ENVIRONMENT.mddocumentsAPS5_ASYNC_DISPATCH_WAIT_MS.Tested
APS5_ASYNC_DRAW_COMPILE=1:0e001115a9win-perf-pr): both reached demo3 with the same pipeline-skip lines and closed at the 180 s harness limit.agc_driver_async_draw_compile_{enabled,small_pipeline,no_wait,disabled}on Linux (llvmpipe):small_pipelinestores on the first dispatch.no_waittakes 2 and printsdropping the dispatches of compute shader ...and... prepared after 1 dropped dispatches.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T07:43:38Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the point below is optional.
What I ran
Reviewed head
0eb495f0e1dbb1ecbf6f929d05941889a81f2c62usingrepo_read.pyreader tools. No build or tests were run. The prepared diff and manifest show eight changed files, all marked included.Results
Findings
Blocking
None.
Non-blocking
Diagnostics.cpp:151–152: concurrent dispatches can each receive the same remaining wait allowance because the budget is only charged after waiting. Their combined wait can exceed the stated twice-per-10-second cap. Reserve allowance while holding the budget mutex, then reconcile it after the wait.Not verified
No build, automated tests, or hardware behavior were verified. Inspected changed-file content:
Diagnostics.hpp,Diagnostics.cpp,Dispatch.cpp,DrawCapture.cpp,ShaderRegistry.cpp,agc_driver_async_draw_compile_tests.cmake,AsyncDrawCompile.cpp, andENVIRONMENT.md. For source files, review was limited to the changed hunks and targeted context; full file contents were not read. No excluded changed files are listed in the manifest.To get this to a good state
Nothing is required. Optionally reserve the wait budget atomically so simultaneous dispatches cannot exceed the documented cap.