test(agc): keep queued_index_read_order's image results pending past the idle store #10750
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10750"
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 EagleBearerYS on 2026-10-24T20:54:09Z.
What
agc_driver_queued_index_read_order(from #6914) fails onmainon most runs on GitHub's Linux runner (lavapipe), at its setup check: "the image write left no pending result to order against". That check guards the order the test is for, so on those runs the order check never runs.Why. Queue 0's worker stores every pending storage-image result once the queues have been idle for 50 ms (
StoreIdleResults, fromQueueWorker.cpp). The test submits an image write, callsAgcDriverWaitIdle, and expects the result to be still pending. Since #7233,Driver::WaitIdlealso syncs the recorder and waits for the device under the GPU mutex. On lavapipe that outlasts the 50 ms, and the idle store flushes the result as soon asWaitIdlereturns.WaitIdleand its check.^agcrun, the store can instead land after the setup check but before the draw holds its read. The test then fails at "the queued draw's commit stored the image's results over its index buffer", although the commit never stored them. The idle store goes throughFlushPending, which stores nothing while a queued draw holds a read (DrawPipeline::HeldReads).What it does.
APS5_NO_IDLE_STORE=1turns the idle store off (f9b5cc27e1). The default is unchanged. It is documented indocs/dev/ENVIRONMENT.md.d57418e1b2), asCopiedWriterLabelOrdersetsAPS5_NO_OPPORTUNISTIC_REAP, so only the queued draw's held read decides when the image's results are stored. The idle store keeps its own tests (agc_idle_publish_wait,agc_driver_store_idle_results_wake).433e43e8d1, after oneandonlydean's review). With the idle store off, the retry after the idle check saw pending results on every pass, so an idle queue 0 with results pending went round its loop instead of waiting, unlocking and relocking the driver mutex until another submission came. That retry now applies only when the idle store is on. The retry on an idle epoch change and the wait's wakes, on a submission, an epoch change or a completion, are unchanged.docs/dev/ENVIRONMENT.mdsays queue 0 still waits.5f0c5f0bab):agc_driver_store_idle_results_disabledruns the idle store fixture withAPS5_NO_IDLE_STORE=1. With a result pending and every queue idle, queue 0 must wait within 2 s, and 200 ms later the result must still be pending and not in guest memory. A second dispatch, to another texture, must then run, so its result is pending within 10 s, and queue 0 must wait again within 2 s.A switch, rather than a change to the idle store: the idle store is run-time behaviour with its own tests, and its 50 ms timer is the one thing in this test it can't control. Lengthening or gating the timer to fit one test would change when every title's pending results are stored.
Tested
Where it broke (GitHub's Linux runner, lavapipe): passes 5 runs in a row at #6914's merge
3efab5ed86(run) and at #7233's parent8b3a6ba88d(run); fails its first run at #7233's merge3ca07d086d, with the setup message (run).mainwithout this PR, Linux: the test failed on its first run, at the setup check, in 4 of 5 runs:main137a8fab89(run) andc9b2660d56(run);main, the test alone (run);3ca07d086d(above).main2fade7ef4epassed its first run (run, the "before" arm), so the failure depends on timing and isn't certain.This head (the same trees as
d57418e1b2, onmain2fade7ef4e; run):agc_driver_queued_index_read_order,agc_idle_publish_waitandagc_driver_store_idle_results_wake, 20 runs in a row.Validation comparison (CONTRIBUTING's AGC rule,
d57418e1b2,VK_LAYER_KHRONOS_validationon both arms,ANYPS5_NO_SHADER_CACHE=1; run): the same 3 tests on Linux (llvmpipe, Mesa 25.2.8, Ubuntu 24.04.5), all pass on both arms. The layer loaded 5 times in each. The only VUID isVUID-VkDeviceCreateInfo-pNext-pNext, on both arms; this PR adds none.A parallel
^agcrun with this head (run):agc_driver_pipelined_metadata_pass,agc_driver_pipelined_metadata_pass_draw_pipeline,agc_submit_progressandagc_submit_progress_no_timeline. The same 4 fail in an^agcrun on that runner without this change (run).5f0c5f0bab, red/green againstd57418e1b2(the switch without the wait fix) on GitHub's runners (run): the three tests above,agc_driver_store_idle_results_disabledand^agc_driver_queue_zero(agc_driver_queue_zero_idle_wait,agc_driver_queue_zero_late_interrupt).agc_driver_store_idle_results_disabledfails with "with APS5_NO_IDLE_STORE queue 0 kept polling over pending storage results with every queue idle instead of waiting". With this head all 6 pass 20 runs in a row, none skipped or failed.APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.Validation comparison at
5f0c5f0bab(run),main2fade7ef4eagainst this head, the same 6 tests once on Linux (llvmpipe), withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1.main's tree ran the 5 it has, andagc_driver_queued_index_read_orderfailed there at its setup check, the failure this PR is for; this head ran all 6, and they pass. The layer was inserted 8 times onmainand 10 with this PR, neither log haswas not found but was requested, and both report onlyVUID-VkDeviceCreateInfo-pNext-pNext, so this PR adds noVUID-message.Real AMD hardware, by @tablefrogpillow (comment): Linux, RADV (Mesa 25.2.8), kernel 6.8,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, the merge-base2fade7ef4againstd57418e1b, 25 standalone runs each.agc_driver_queued_index_read_orderpasses 25 of 25 on both trees on an RX 7900 GRE (RDNA3), a Ryzen 7 7800X3D's integrated GPU (RDNA2) and an RX Vega 56 (GCN5). So on that hardwaremain's setup check holds, and the failure is lavapipe's timing, as they say. These are standalone runs; the parallel^agccase wasn't run there.519e411d96, a merge ofmain63a863d3b0(run).main's #9965 made queue-0DMA_DATApipelining the default and removedAPS5_PIPELINE_DMA, including from this test's setup; the merge keeps that and this PR'sAPS5_NO_IDLE_STOREthere, so the test no longer sets the removed variable. The PR's own lines are unchanged.agc_driver_queued_index_read_order,agc_driver_store_idle_results_disabled,agc_driver_store_idle_results_wake,agc_idle_publish_waitand theagc_driver_queue_zerotests pass 10 runs in a row. Linux: 6 run, 6 pass, 0 skip, 0 fail; the before arm failsagc_driver_store_idle_results_disabledandagc_driver_queued_index_read_order. Windows: 6 run, 0 pass, 6 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.NVIDIA GeForce RTX 5070 Ti (610.88), Windows 11 Pro, by @SeaSunPT (comment): Intel Core i5-14600K, WinLibs GCC 15.2.0 r7, Release, this PR's head
519e411d9merged ontomain5a2744c55and compared with thatmain, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validation(SDK 1.4.363.0). With this PR,agc_driver_queue_zero_idle_wait,agc_driver_queue_zero_late_interrupt,agc_driver_queued_index_read_order,agc_driver_store_idle_results,agc_driver_store_idle_results_disabled,agc_driver_store_idle_results_wakeandagc_idle_publish_waitpass 5 runs of 5, none skipped; onmainthe six that exist there pass 3 runs of 3, andagc_driver_queued_index_read_orderdid not hit its setup failure on this GPU. NoVUID-line in any log. A fullctest -j 8passes 2380 of 2382; the two failures,agc_host_import_cut_lifetime(#10746) andagc_driver_depth_plane_partial_store(#10664), fail onmainon that machine too.314eff1117, a merge ofmain0836dfdf4f(run). #12862 movedlibSceAgcDriver's test registrations intotests/cmake/; the conflict inCMakeLists.txtis resolved withtools/agc_test_split.py resolve, which moves this PR's registration intotests/cmake/agc_driver_store_idle_results_tests.cmake(+5 lines). Nothing else conflicted. Apart from the move, this PR's diff is unchanged. With-DBUILD_TESTING=ON,ctest -Ngives 3076 tests:main's 3075 plusagc_driver_store_idle_results_disabled, each listed once. The 6 tests of this PR's verify set pass 10 runs in a row. Linux: 6 run, 6 pass, 0 skip, 0 fail. Windows: 6 run, 0 pass, 6 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.Checklist
main; no other open PR implements the same functions (#10676 changes casts in the same test file, on other lines)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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:44:54Z.
Review: CHANGES_REQUESTED
I independently verified the shutdown path described in the existing inline comment at this exact head. With
APS5_NO_IDLE_STOREpresent,idleResultsPending()is false; when queue 0 is idle and storage-image results remain pending, the retry condition after the device-lock section stays true and continues before the worker reacheschanged.wait(). This can busy-spin until another consumer happens to clear those results. Please address the existing request to gate the retry on idle-store eligibility while retaining epoch/completion wake handling, and add an idle-pending regression that verifies the worker parks and wakes. I did not run the Vulkan runtime test locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T00:09:13Z.
Review: APPROVED
The PR explains the timing-dependent failure with a concrete cause in
StoreIdleResultsand keeps the production default unchanged. The opt-out is used only in the order test, while the idle-store behavior remains covered independently; the follow-up also preserves queue 0 waiting when disabled. The reported repeated lavapipe runs, validation-layer comparison, and AMD hardware runs provide useful coverage across the regression and affected queue behavior. I reviewed the head and hosted checks; native jobs are path-skipped on this PR head, so I rely on the described CI/test evidence rather than claiming a local Vulkan run.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T23:08:35Z.
Review: APPROVED
Re-checked — new head, looks good
The updated tests keep the queued image results pending through the idle-store interval, and the author reports same-machine main/change comparisons on head
519e411d965397a509c507b4134f17ea3a0adc0d.What I ran
Reviewed head
519e411d965397a509c507b4134f17ea3a0adc0dagainst PR base63a863d3b07f2457ee1210f1abba1c11409cdff5; the merge preview against currentmaindc38224141e0b6096007b876b4c42fc9144d11b8is clean. I inspected the four changed code/test files and the environment documentation. Local checks ran in Linux; no build or compiler was invoked.Results
main8b7f242358c9bccaad60c83e3db0ea0915638d4cmainpass 3/3 on the same machine; not independently run hereUnedited local check output
Findings
Blocking
None found in this re-check. The added setup and pending-result assertions address the prior timing sensitivity without pinning the implementation to refusing otherwise valid guest operations.
Non-blocking
The GPU runs are author-provided. I did not run a local build or tests; the hosted Linux/Windows product jobs skipped because no Vulkan device is available to those runners.
Sources
Not verified
No local tests, console behavior, or validation-layer run was performed. The GPU validation and same-machine baseline results above are from the author and tester's report.