fix(agc): run the queue-idle store for results a pipeline item leaves pending #22841
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22841"
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 slopezjur on 2026-11-18T12:15:32Z.
What
Queue 0 runs the idle store (
StoreIdleResults) only when it finds storage results pending while every queue is idle. With dispatch miss items on (APS5_PIPELINE_DISPATCH=1 APS5_PIPELINE_DISPATCH_MISSES=1), the dispatch that leaves those results pending is recorded by the draw committer after queue 0 has already gone idle. Queue 0 found nothing pending, waited for the next submission, and the results were never stored: the result stayed on the GPU until something flushed it directly, or until shutdown (storage image ... destroyed with GPU results pending).The committer already takes the driver lock and notifies queue 0 when it completes a deferred submission (
completeSubmission) and in the submission-end item (wakeQueueZeroForCompletions). Both now also advance the idle epoch when storage results are pending (Driver::noteResultsForIdleStore, skipped withAPS5_NO_IDLE_STORE), so a dormant queue 0 checks again and stores them. Nothing changes with miss items off, the default.New test variants run the two existing idle-store tests with miss items on:
agc_driver_store_idle_results_dispatch_missesandagc_driver_idle_store_over_unmap_dispatch_misses. Both failed without this change ("the queue-idle store did not bring the result to guest memory without a direct flush or further submission", "the queue's idle store did not settle the results of the unmapped surface").Found while measuring dispatch items on by default for Ghost of Yōtei; that default change is held back and is not part of this PR.
Tested
Windows 11, RTX 4080 SUPER (NVIDIA 621.24), Ryzen 7 7800X3D.
GPU tests:
ctest -R "^(agc_|shader_)" -Vonmain9b262cc4eeand on this branch, same machine and GPU, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(Vulkan SDK 1.4.363 layer).main2002 tests, this branch 2004 (the two new variants, both passing); the layer was inserted 1805 and 1809 times, nowas not found but was requestedline, 0VUID-lines in either. Both fail the same 3 and do not build the same 1:agc_driver_stencil_plane_memory,agc_driver_store_over_untracked,agc_driver_msaa_dcc_unwatch;agc_driver_upload_cache_read_only_flushdoes not compile on Windows. Without the fix, the two idle-store tests failed every time with miss items on (3 of 3 repeats each) and passed withAPS5_PIPELINE_DISPATCH=0or with miss items off.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-23T01:30:50Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the author-reported GPU test run supports the described queue-idle wakeup fix, though I did not run checks myself.
What I ran
Reviewed head
8b41f50eb4ee7e2dd3fc4148833962dab3b5268f. No commands or tests were run. I readdescription.md,commits.md,manifest.json,diff.patch, and the full text of all four changed files listed in the manifest:Driver.hpp,QueueWorker.cpp,agc_driver_idle_store_over_unmap_tests.cmake, andagc_driver_store_idle_results_tests.cmake. The review folder’sfiles.jsonwas not available through the reader, so excluded files could not be confirmed.Results
files.jsonwas unavailableFindings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the tests or independently verify the author-reported Windows 11 and RTX 4080 SUPER results.
files.jsonwas not readable through the supplied reader, so I could not determine whether any changed files were excluded by rule. The inspected diff changes only the four files listed inmanifest.json.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T15:52:34Z.
Review: APPROVED
I read the diff at
8b41f50eb4. Windows 11, GCC 15.2, merged intomainatc1593e4e1ddtogether with other open PRs (so not an isolated build), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validationon an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).agc_driver_store_idle_resultsandagc_driver_idle_storetests: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.agc_driver_store_idle_results_dispatch_missesfails with "the queue-idle store did not bring the result to guest memory without a direct flush or further submission".Both
agc_driver_idle_store_over_unmaptests skip themselves on this PC.Not checked: a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:18:17Z.
Review: COMMENTED
I tested
8b41f50eb4againstmainat9d362fb088on Linux with Mesa lavapipe. The scalar execution test, idle store over unmap, and the default, wake, and disabled idle-store cases passed on both revisions. Both new dispatch-miss cases passed on the change. Every run required Vulkan and disabled the shader cache. The loader insertedVK_LAYER_KHRONOS_validation1.4.369, with no missing-layer warnings orVUID-messages. This comparison used software Vulkan.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.