perf(agc): wake a held compute submission when queue 0 blocks on its label #22188
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22188"
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 muhmuhkuh on 2026-11-17T08:14:07Z.
What
A submission that must run after queue 0's earlier work (a wait-free submission of another queue, the order rule of
04f12028dc) is held until the rule releases it. One release case is a queue 0 that blocks in a wait on a label the held queue writes: the held queue has to run for queue 0 to continue.The held worker polled for that release with
poll. On Windowspollunlocks the driver mutex and sleeps 0.2 ms (PollSleep), so the release came 0.2 to 0.3 ms after queue 0 began to wait.Driver::noteWaitBlockedalready notifies the driver's condition variable (changed) when a queue blocks while a hold is waiting. The hold now waits on that condition variable with a 200 microsecond timeout, so it is released when the notification arrives and the stall watch still runs at the same period. The release rule (orderReleased) is unchanged.No switch: the behaviour is the same except when the submission is released. On other platforms
pollalready waits on the same condition variable (1 ms timeout), so the change is for Windows' sleep-based poll; I did not run Linux.The hold of queue 0 behind other queues (
waitFreeBefore) is not changed.Overlap with open pull requests: none found. The diffs of the 8 open PRs that touch
Queues/QueueWorker.cppwere searched fororder behind queue 0,orderHolders,OrderHold,poll(released)andnoteWaitBlockedin changed lines.Tested
Windows 11 Pro (10.0.26200), NVIDIA GeForce RTX 3080 Ti, driver 610.88, MinGW GCC 15.2 (UCRT, POSIX threads, SEH), Release, validation layer on (
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation). Built on the same machine onmainaf1208e6a4and on this change at the same base. The three files this change touches are the same on the posting base88fe9fbc50, so the tests were not repeated there.agc_driver_pm4_order_signal: 32 rounds. Queue 0 writes a marker and blocks in a WAIT_REG_MEM on a label; a compute submission queued right after it writes a word and then the label. The test takes the time from the marker to the word, and requires the median to be under 0.1 ms. On this change the median was 0.000 to 0.030 ms in 6 runs (largest single round 0.25 to 2.3 ms). Onmainthe test is not registered.pollagain, the test fails 5 of 5 runs with a median of 0.22 to 0.39 ms ("a held submission started ... ms (median) after queue 0 began to wait on its label; it must start at once").ctestentry that runsagc_driver_pm4_tests(25 onmain, 26 with the new one): all pass on both. Every entry that runsagc_driver_recorder_tests(151): all pass onmainand on this change. The Pm4 tests use no Vulkan device; the recorder run does.VUID-lines in all logs. The loader log shows the validation layer inserted in the 138 recorder runs of both trees (the Pm4 runs create no instance); the phrasewas not found but was requested by env var VK_INSTANCE_LAYERS: 0 occurrences.Checklist
main(88fe9fbc50at posting time); 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