test(agc): share the pipelined fill blocker with its lambda and end each case on an empty pipeline #9697
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9697"
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-22T08:55:38Z.
What
This applies #9647's blocker fix (adriadam10, for
agc_driver_pipelined_indirect_draw) to the pipelined fill test, and fixes the race that actually makes that test fail.Under CPU load,
agc_driver_pipelined_fillfails with "a satisfied WAIT_REG_MEM skipped an overlapping queued write". Its blocker has the same[this]lambda #9647 replaced, but the failure comes from somewhere else:WaitIdle. With ordered completion, a submission with nothing left open queues a completion item instead of draining (Driver::deferCompletion,QueueWorker.cpp:73-75). That item's commit wakesWaitIdle. The committer pops it and decrementsOutstanding()only after the commit returns (DrawPipeline.cpp:179-184). SoFinish()can return whileOutstanding()still counts it, for about 0.2 ms.SatisfiedWaitDrainsOverlappingQueuedWorkstarts right after the previous case, and its wait ends as soon asOutstanding() >= 2. With the previous case's completion item still counted, its own blocker makes 2 at once. So it checks before the WAIT_REG_MEM has asked for a drain.The change (test only,
PipelinedFill.cpp):Finish()waits untilDrawPipeline::Queue0().Outstanding()is 0 afterWaitIdlereturns, so each case starts on an empty pipeline.SubmitBehindstays. It lets the queue worker reach the fill while the pipeline is still empty, and nothing the test can read marks that point. Without it, every loaded run fails with "the queue worker never reached the fill".The other two
[this]blockers are fine as they are:PipelinedPrefetch.cppqueues its blocker before the submission.ImageTableCacheBounds.cpp's queued-draw case waits for all three items.So neither can return before its lambdas have run, and both passed 72 of 72 under the same load.
#9508's
agc_driver_pipelined_fill_gpu_heapvariant runs the same binary, and we saw this failure there under load too.Tested
maind6eafa54d0: 15 of 144 runs fail with "a satisfied WAIT_REG_MEM skipped an overlapping queued write". None hangs.ctest -R 'pipelined|image_table_cache_bounds'passes 9 of 9.ec95b59c08,main8b3a6ba88dmerged in (clean; the PR's own diff is unchanged):main8b3a6ba88dfails 18 of 144 with "AGC graphics: a satisfied WAIT_REG_MEM skipped an overlapping queued write". Neither hangs.ctest -R 'pipelined|image_table_cache_bounds'passes 9 of 9.agc_driver_pipelined_fill,agc_driver_pipelined_prefetch,agc_driver_pipelined_indirect_drawandagc_driver_image_table_vouch_queued_drawspass 10 of 10 on both. The libc and libkernel suites pass on both.agc_driver_pipelined_fill,agc_driver_pipelined_prefetch,agc_driver_pipelined_indirect_drawandagc_driver_image_table_vouch_queued_drawspass 20 times each on Linux, and don't fail on Windows, where the Vulkan tests skip.mainagainst this PR (CONTRIBUTING's AGC rule), on one GitHub Linux runner (run). Both runs usedVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V, withVK_LOADER_DEBUG=layerto show the layer loading. The device was llvmpipe (LLVM 20.1.2) on Mesa 25.2.8, Ubuntu 24.04.5, Khronos validation layers 1.3.275.main's once and this PR's three times.VK_LAYER_KHRONOS_validation5 times onmainand 15 with this PR, and neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS.VUID-VkDeviceCreateInfo-pNext-pNext, for a device-creation structure newer than that layer version. This PR adds noVUID-message.agc_driver_pipelined_fillrun pinned to cores 0 and 1, one at a time.main'sPipelinedFill.cpp: 13 of 23 runs fail on the RTX 3070 (driver 595.99.02) and 8 of 20 on lavapipe (Mesa 26.0.3), all with "a satisfied WAIT_REG_MEM skipped an overlapping queued write".9587c4467): 0 of 30 fail on each.ctest -R "pipelined|image_table_cache_bounds"(9 tests) passes 3 of 3 on both.check_test_registration.pyandcheck_conventions.pypass, with no comment lines added.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 clairtonmichel on 2026-10-22T09:01:59Z.
Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T09:26:13Z.
@clairtonmichel thanks for running it on the RX 7900 XTX. It's in Tested and on the GPUs tested line now. This change only shows up under load: on
mainthe test fails 15 of 144 runs with 12 copies running at once on 2 cores each, and with this PR it passes 144 of 144. A plain suite run passes on both.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T09:53:45Z.
Review: COMMENTED
Reproduced on NVIDIA, where the failure is more frequent than in the PR's runs, and this change fixes it there too.
Ubuntu 26.04, i7-8700 (12 threads), GCC 15.2, Release,
ANYPS5_REQUIRE_VULKAN=1. GPUs: NVIDIA GeForce RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), picked withANYPS5_GPU. The load is one busy loop pinned to each of the 12 threads, with everyctest -R "^agc_driver_pipelined_fill$"run pinned to cores 0 and 1 (taskset -c 0,1), one run at a time.agc_driver_pipelined_fillunder loadmain(PipelinedFill.cppas ond6eafa54dand7e2ba73e4)9587c4467Every failure on
mainisa satisfied WAIT_REG_MEM skipped an overlapping queued write, the failure the PR describes, on both devices. Without load,ctest -R "pipelined|image_table_cache_bounds"(9 tests) passes 3 of 3 with this PR on both.GPUs tested: NVIDIA GeForce RTX 3070, driver 595.99.02, Ubuntu 26.04; lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-22T09:55:36Z.
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.
core/libs/prx/libSceAgcDriver/tests/execution/PipelinedFill.cppImported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T09:58:10Z.
@jotitadev thanks for reproducing it on the RTX 3070, under a load that makes it fail more often than in our runs, with lavapipe alongside. 13 of 23 on
mainagainst 0 of 30 with this PR is the hardware red/green this PR didn't have. It's in Tested and on the GPUs tested line now.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:22:10Z.
Review: CHANGES_REQUESTED
I reviewed the shared blocker lifetime, the post-
WaitIdleOutstanding()drain, and the overlapping-write test sequence. Capturing shared state removes the queued lambda’s dependence on the stackBlocker, and joining after completion makes the target lifetime explicit. The independent RTX 3070/lavapipe loaded red/green report is strong; I found no code defect in the reviewed diff.Please update the branch to current
main(8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768); this head is based on7e2ba73e4c, 15 commits behind. Re-runagc_driver_pipelined_fillwith the reported loaded setup after the update. The test file has no reported conflict in the merge-tree, but the repository requires PR branches to stay based on current main. I could not independently build or execute the C++ test in this checkout.Local checks on the exact PR head: conventions passed with the actual PR body and
git diff --checkpassed. Hosted conventions, eligibility, intake, labels and report pass; full Linux/Windows builds are skipped by the repository gates.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T12:57:33Z.
Thanks, @MarcZX10. The branch now has
mainat8b3a6ba88dmerged in (ec95b59c08), with the PR's own diff unchanged. Rerun on that head with the reported load, 12 copies at once on 2 cores each, 144 runs:agc_driver_pipelined_fillpasses 144 of 144, whilemain8b3a6ba88dfails 18 of 144 under the same load with "a satisfied WAIT_REG_MEM skipped an overlapping queued write". Unloaded it passes 20 of 20, and the four pipelined tests pass 10 of 10 on GitHub's Linux and Windows runners (run). It's in Tested.