fix(agc): end the idle store's quiet period for a completion the draw pipeline adds #20015
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20015"
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 imellag on 2026-11-14T11:52:28Z.
What
Planet of Lana (PPSA19450) drops from about 30 fps to 13-17 fps some 30 s into gameplay on
main, and stays there. It did not before #7978 (merged 2026-11-05): a tree of 2026-11-04 holds 28 fps in the same scene.Cause: queue worker 0 waits out the idle store's 50 ms quiet period before it delivers an end-of-pipe interrupt the draw pipeline committed meanwhile.
RELEASE_MEM, which queue 0 hands to the draw pipeline.IdleResultsQuietPeriod, 50 ms) before the idle store.changed. The quiet period's wait only ends for queued work or an idle-epoch change, so the worker sleeps on and reaps the completion (and delivers the interrupt) only when the 50 ms run out.bd2197e919fixed the same case for the dormant wait a few lines below (... || completionsPending()), withagc_driver_queue_zero_late_interrupt. This PR gives the quiet period's wait the same condition. The loop then findsidleResultsPending()false and goes to the completion poll, as it does after the dormant wait.The same one-line condition is in @nicolasabosch's tracking draft #18515 (
b900b496ae, found on UFC 6, "not for merge", to be split), together with an extrawakeQueueZeroForCompletions()after the label commit. This PR does not add that call: in the path measured here the submission's completion already notifies when a completion is pending (bd2197e919). If #18515's commit is split out first, this PR's test can go on top of it.Tested
macOS 27.2, Apple M4 Pro, x86-64 Release under Rosetta 2, MoltenVK 1.4.2,
mainf0c9b11f91(the libraries build on macOS exceptlibcurl, #17425, which the title does not load).agc_driver_queue_zero_quiet_interrupt(modelled onagc_driver_queue_zero_late_interrupt): a storage dispatch leaves a result pending, then, with the GPU mutex held so the draw pipeline cannot commit yet, an interrupting release is submitted and queue 0 goes back to its quiet period; the mutex is released and the time to the graphics event is measured. It passes when one of up to 5 measured rounds delivers within half the quiet period.mainit fails 3 of 3 runs:queue 0 waited out the idle store's quiet period before it delivered an end-of-pipe interrupt the draw pipeline committed meanwhile (fastest of 2: 50.487708 ms)(also 57.3 and 50.8 ms).^agc_driver_(queue_zero|store_idle|idle_store|eop_interrupts|flip|flip_compute|submit|fill_completion_labels|linear_target_completion_points|copied_writer_copy|two_device_pending_store|store_over_untracked|storage_file_write)|^agc_driver$|^agc_submitpass with the change, with the Khronos validation layer inserted (checked in the loader log) and noVUID-.mainandmainwith this change. Presents per 10 s interval from launch (gameplay starts near 60 s):main1main2tools/trace_digest.pyon a 10 s trace of the second pair (APS5_TRACE_SECONDS=100:10):main: 142 presents, frame p50 85.2 / p90 90.5 / p99 92.7 ms, GPU busy 15.5 ms per present; queue worker busy 21.3 ms and waiting 43.0 ms per frame, all of itDriver.WorkerWait.idle_and_completion_poll.main: a log of flips and end-of-pipe deliveries showed the event 6-7 ms after the flip in the good phase, and alternately 4 ms and about 56 ms after it in the slow phase;APS5_NO_IDLE_STORE=1on unchangedmainremoves the drop (303 presents per 10 s).mainand 52.1 with the change over 100-150 s (no change expected: its worker does not sit in the quiet period).python3 tools/check_conventions.py --base upstream/mainpasses.Not run on Windows or Linux. The changed wait is common code.
tools/pr_overlap.py: #11436, #15136, #16791, #17786, #18078 and #18515 changeQueueWorker.cpp; only #18515 touches this line (the same change, see above).Checklist
main; no other open PR implements the same functions (the tracking draft #18515 carries the same line, see above)NotImplemented_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)