fix(agc): hold a pending producer batch with a timeline semaphore #7913

Merged
mazen320 merged 1 commit from upstream-pr/7913 into main 2026-10-20 04:04:16 +00:00
mazen320 commented 2026-10-19 13:41:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mazen320 on 2026-10-19T13:41:44Z.


What

The pending-producer fixture kept its earlier label batch from completing by waiting on a host event and calling vkSetEvent only after the leased producer was submitted. Vulkan rejects that: a HOST wait has to be signaled before the command buffer is submitted (VUID-vkCmdWaitEvents-srcStageMask-01158), and vkSetEvent is illegal while that wait is still pending (VUID-vkSetEvent-event-09543). The fixture now submits the label batch with a wait on a timeline semaphore and signals that semaphore from the host after the producer submission. The label stays pending, the producer stays unsubmitted until the indirect dispatch, and that dispatch still takes the pending-label CPU fallback (cpuReason 2). The five-second watchdog still releases the wait and the fixture still fails if the producer was never submitted.

Tested

Windows 11, NVIDIA GeForce RTX 5090, driver 617.42. agc_driver_indirect_arguments_pending_producer_tests with ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation (Khronos 1.4.304): 3/3 fresh runs passed, each reporting pending producer CPU fallback: cpuReason 2. VUID-vkCmdWaitEvents-srcStageMask-01158 and VUID-vkSetEvent-event-09543 did not appear. The same layer reports VUID-VkDeviceCreateInfo-pNext-pNext at device creation because it does not know a structure in this tree's Vulkan headers; that report is unchanged by this fix.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: #7868
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5090, driver 617.42, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4921883200 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7913). Originally posted by [mazen320](https://github.com/mazen320) on 2026-10-19T13:41:44Z. --- ### What The pending-producer fixture kept its earlier label batch from completing by waiting on a host event and calling `vkSetEvent` only after the leased producer was submitted. Vulkan rejects that: a `HOST` wait has to be signaled before the command buffer is submitted (`VUID-vkCmdWaitEvents-srcStageMask-01158`), and `vkSetEvent` is illegal while that wait is still pending (`VUID-vkSetEvent-event-09543`). The fixture now submits the label batch with a wait on a timeline semaphore and signals that semaphore from the host after the producer submission. The label stays pending, the producer stays unsubmitted until the indirect dispatch, and that dispatch still takes the pending-label CPU fallback (`cpuReason 2`). The five-second watchdog still releases the wait and the fixture still fails if the producer was never submitted. ### Tested Windows 11, NVIDIA GeForce RTX 5090, driver 617.42. `agc_driver_indirect_arguments_pending_producer_tests` with `ANYPS5_NO_SHADER_CACHE=1` and `VK_LAYER_KHRONOS_validation` (Khronos 1.4.304): 3/3 fresh runs passed, each reporting `pending producer CPU fallback: cpuReason 2`. `VUID-vkCmdWaitEvents-srcStageMask-01158` and `VUID-vkSetEvent-event-09543` did not appear. The same layer reports `VUID-VkDeviceCreateInfo-pNext-pNext` at device creation because it does not know a structure in this tree's Vulkan headers; that report is unchanged by this fix. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: #7868 - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 5090, driver 617.42, Windows 11 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-19 13:53:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T13:53:30Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6658 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp L806
PR 7464 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp L806

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.

Pull request Shared files not compared
PR 5431 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6185 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6682 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6268886981 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7913#issuecomment-6268886981). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T13:53:30Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6658](https://www.github.com/boykopovar/AnyPS5/pull/6658) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp` [L806](https://github.com/boykopovar/AnyPS5/blob/db9fe523101ebde1223442478e179f784f319f97/core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp#L806) | | | | [PR 7464](https://www.github.com/boykopovar/AnyPS5/pull/7464) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp` [L806](https://github.com/boykopovar/AnyPS5/blob/db9fe523101ebde1223442478e179f784f319f97/core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp#L806) | | | 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. | Pull request | Shared files not compared | |---|---| | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6682](https://www.github.com/boykopovar/AnyPS5/pull/6682) | `core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` |
MarcZX10 commented 2026-10-19 20:09:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T20:09:15Z.


I reviewed this against #7868. The label submission waits on the timeline semaphore, and the host signals it only after the producer submission is observed, so the pending-label fallback remains the condition under test while avoiding the invalid event wait/signal sequence. The reported three RTX 5090 runs retain cpuReason 2 and contain neither of the two fixture VUIDs. I found no issue in this focused change. I did not independently run Vulkan hardware validation on this host.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6276249223 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7913#issuecomment-6276249223). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T20:09:15Z. --- I reviewed this against #7868. The label submission waits on the timeline semaphore, and the host signals it only after the producer submission is observed, so the pending-label fallback remains the condition under test while avoiding the invalid event wait/signal sequence. The reported three RTX 5090 runs retain `cpuReason 2` and contain neither of the two fixture VUIDs. I found no issue in this focused change. I did not independently run Vulkan hardware validation on this host.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7913
No description provided.