Fix/agc hold flip behind worker #1745

Merged
AymanFE merged 2 commits from upstream-pr/1745 into main 2026-10-10 10:52:08 +00:00
AymanFE commented 2026-10-08 18:20:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AymanFE on 2026-10-08T18:20:58Z.


<html>

What

A title that paces itself on pending flips can get further ahead of the queue 0 worker than its per-frame memory allows, and the worker then records a frame from memory the title has already rewritten.

Astro Bot (PPSA21564) keeps per-frame data in a ring of three slots, polls sceVideoOutIsFlipPending, and submits the next flip as soon as fewer than three are pending. On hardware a pending flip is a frame whose commands have been read. Here submissions waited 98 to 110 ms in queue 0, so the worker was still recording frame N while the title wrote frame N+3 into the same slot. A block of per-frame constants that holds the title's frame counter read 0x17e in the frame right after one that read 0x17a: the worker recorded frame 0x17b from the slot of frame 0x17e. When the slot was half rewritten the draw bound the wrong block, and the frame came out black, without the movie quad, or with the quad at half size: 8 to 16 of 48 window captures in each of five runs. APS5_FLIP_READ_CHECK=1 counted 141,478 of 158,640 in-place reads as overwritten before execution. The same overrun produced guest snapshot differs from registered memory in compute shader 0x5005e7b00.

A submission on queue 0 that carries a flip now waits until the worker has reached the flip of every earlier one. The wait ends early when queue 0 is blocked on memory that no running, held or pending work writes, the criterion orderReleased uses, since only the title can end that wait. The presenter stays asynchronous: the title still has three flips pending when the display is the limit. APS5_NO_FLIP_HOLD=1 submits as before.

tests/Flip.cpp gains a case: a flip behind a closed rendering wait holds the next flip submission until the wait opens, and a flip behind a WAIT_REG_MEM on a label only the test stores does not hold it.

Not established: what the console returns from sceVideoOutIsFlipPending while its GPU is behind. The change does not depend on it.

Tested

  • Windows 11, RTX 5070 Ti, Astro Bot (PPSA21564, 01.007.000), built from b3fcd6d6 (an older main) with this change. 45 s runs through the intro, 48 window captures each in bursts 70 ms apart:
    Build | Odd captures | Frames presented -- | -- | -- Without the change (five runs) | 8 to 16 | 730 to 795 With the change (two runs) | 0 | 868, 999 With the change and APS5_NO_FLIP_HOLD=1 | 12 | 795

    With the change the snapshot check passes through the whole intro without APS5_NO_SNAPSHOT_CHECK. The title still needs a local workaround for an unrelated failure in the same shader at the first frame (guest memory is not readable at 0x30) and APS5_HOST_IMPORT_MIB=16384.

  • Linux, on 4ddbf049 (this branch's base): agc_driver_flip, agc_driver_pm4 and agc_driver_pm4_failure pass; agc_driver is skipped there because the machine has no Vulkan device. The new case fails with APS5_NO_FLIP_HOLD=1 and passes without it. tools/check_conventions.py --base origin/main passes. The rest of the test suite was not built or run.
  • Not tested: the title on 4ddbf049 itself (the Windows runs used the older base; rebasing needed two textual conflict resolutions next to the new timing fields), any title on Linux, any title other than Astro Bot.

Checklist

  • Based on current main; no other open PR implements the same functions (unmerged pull requests from #1380 to #1744 were checked through their refs; older ones were not)
  • 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 in TechnicalDebt
  • 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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. The investigation, the change, the test and this description were written with Claude; the Windows runs were made on my PC with my own copy of the game.
</html>What

A title that paces itself on pending flips can get further ahead of the queue 0 worker than its per-frame memory allows, and the worker then records a frame from memory the title has already rewritten.

Astro Bot (PPSA21564) keeps per-frame data in a ring of three slots, polls sceVideoOutIsFlipPending, and submits the next flip as soon as fewer than three are pending. On hardware a pending flip is a frame whose commands have been read. Here submissions waited 98 to 110 ms in queue 0, so the worker was still recording frame N while the title wrote frame N+3 into the same slot. A block of per-frame constants that holds the title's frame counter read 0x17e in the frame right after one that read 0x17a: the worker recorded frame 0x17b from the slot of frame 0x17e. When the slot was half rewritten the draw bound the wrong block, and the frame came out black, without the movie quad, or with the quad at half size: 8 to 16 of 48 window captures in each of five runs. APS5_FLIP_READ_CHECK=1 counted 141,478 of 158,640 in-place reads as overwritten before execution. The same overrun produced guest snapshot differs from registered memory in compute shader 0x5005e7b00.

A submission on queue 0 that carries a flip now waits until the worker has reached the flip of every earlier one. The wait ends early when queue 0 is blocked on memory that no running, held or pending work writes, the criterion orderReleased uses, since only the title can end that wait. The presenter stays asynchronous: the title still has three flips pending when the display is the limit. APS5_NO_FLIP_HOLD=1 submits as before.

tests/Flip.cpp gains a case: a flip behind a closed rendering wait holds the next flip submission until the wait opens, and a flip behind a WAIT_REG_MEM on a label only the test stores does not hold it.

Not established: what the console returns from sceVideoOutIsFlipPending while its GPU is behind. The change does not depend on it.

Tested
Windows 11, RTX 5070 Ti, Astro Bot (PPSA21564, 01.007.000), built from b3fcd6d6 (an older main) with this change. 45 s runs through the intro, 48 window captures each in bursts 70 ms apart:
Build Odd captures Frames presented
Without the change (five runs) 8 to 16 730 to 795
With the change (two runs) 0 868, 999
With the change and APS5_NO_FLIP_HOLD=1 12 795
With the change the snapshot check passes through the whole intro without APS5_NO_SNAPSHOT_CHECK. The title still needs a local workaround for an unrelated failure in the same shader at the first frame (guest memory is not readable at 0x30) and APS5_HOST_IMPORT_MIB=16384.
Linux, on 4ddbf049 (this branch's base): agc_driver_flip, agc_driver_pm4 and agc_driver_pm4_failure pass; agc_driver is skipped there because the machine has no Vulkan device. The new case fails with APS5_NO_FLIP_HOLD=1 and passes without it. tools/check_conventions.py --base origin/main passes. The rest of the test suite was not built or run.
Not tested: the title on 4ddbf049 itself (the Windows runs used the older base; rebasing needed two textual conflict resolutions next to the new timing fields), any title on Linux, any title other than Astro Bot.
Checklist
Based on current main; no other open PR implements the same functions (unmerged pull requests from #1380 to #1744 were checked through their refs; older ones were not)
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 in TechnicalDebt
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 (none added)
Generic behaviour, not specific to one title
Depends on: none
AI-assisted: yes. The investigation, the change, the test and this description were written with Claude; the Windows runs were made on my PC with my own copy of the game.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4791061425 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1745). Originally posted by [AymanFE](https://github.com/AymanFE) on 2026-10-08T18:20:58Z. --- <html> <body> <!--StartFragment--><h3 dir="ltr">What</h3> <p dir="ltr">A title that paces itself on pending flips can get further ahead of the queue 0 worker than its per-frame memory allows, and the worker then records a frame from memory the title has already rewritten.</p> <p dir="ltr">Astro Bot (PPSA21564) keeps per-frame data in a ring of three slots, polls <code dir="ltr">sceVideoOutIsFlipPending</code>, and submits the next flip as soon as fewer than three are pending. On hardware a pending flip is a frame whose commands have been read. Here submissions waited 98 to 110 ms in queue 0, so the worker was still recording frame N while the title wrote frame N+3 into the same slot. A block of per-frame constants that holds the title's frame counter read <code dir="ltr">0x17e</code> in the frame right after one that read <code dir="ltr">0x17a</code>: the worker recorded frame <code dir="ltr">0x17b</code> from the slot of frame <code dir="ltr">0x17e</code>. When the slot was half rewritten the draw bound the wrong block, and the frame came out black, without the movie quad, or with the quad at half size: 8 to 16 of 48 window captures in each of five runs. <code dir="ltr">APS5_FLIP_READ_CHECK=1</code> counted 141,478 of 158,640 in-place reads as overwritten before execution. The same overrun produced <code dir="ltr">guest snapshot differs from registered memory</code> in compute shader <code dir="ltr">0x5005e7b00</code>.</p> <p dir="ltr">A submission on queue 0 that carries a flip now waits until the worker has reached the flip of every earlier one. The wait ends early when queue 0 is blocked on memory that no running, held or pending work writes, the criterion <code dir="ltr">orderReleased</code> uses, since only the title can end that wait. The presenter stays asynchronous: the title still has three flips pending when the display is the limit. <code dir="ltr">APS5_NO_FLIP_HOLD=1</code> submits as before.</p> <p dir="ltr"><code dir="ltr">tests/Flip.cpp</code> gains a case: a flip behind a closed rendering wait holds the next flip submission until the wait opens, and a flip behind a <code dir="ltr">WAIT_REG_MEM</code> on a label only the test stores does not hold it.</p> <p dir="ltr">Not established: what the console returns from <code dir="ltr">sceVideoOutIsFlipPending</code> while its GPU is behind. The change does not depend on it.</p> <h3 dir="ltr">Tested</h3> <ul dir="ltr"> <li>Windows 11, RTX 5070 Ti, Astro Bot (PPSA21564, 01.007.000), built from <code dir="ltr">b3fcd6d6</code> (an older <code dir="ltr">main</code>) with this change. 45 s runs through the intro, 48 window captures each in bursts 70 ms apart: <div dir="ltr"> Build | Odd captures | Frames presented -- | -- | -- Without the change (five runs) | 8 to 16 | 730 to 795 With the change (two runs) | 0 | 868, 999 With the change and APS5_NO_FLIP_HOLD=1 | 12 | 795 </div> With the change the snapshot check passes through the whole intro without <code dir="ltr">APS5_NO_SNAPSHOT_CHECK</code>. The title still needs a local workaround for an unrelated failure in the same shader at the first frame (<code dir="ltr">guest memory is not readable at 0x30</code>) and <code dir="ltr">APS5_HOST_IMPORT_MIB=16384</code>.</li> <li>Linux, on <code dir="ltr">4ddbf049</code> (this branch's base): <code dir="ltr">agc_driver_flip</code>, <code dir="ltr">agc_driver_pm4</code> and <code dir="ltr">agc_driver_pm4_failure</code> pass; <code dir="ltr">agc_driver</code> is skipped there because the machine has no Vulkan device. The new case fails with <code dir="ltr">APS5_NO_FLIP_HOLD=1</code> and passes without it. <code dir="ltr">tools/check_conventions.py --base origin/main</code> passes. The rest of the test suite was not built or run.</li> <li>Not tested: the title on <code dir="ltr">4ddbf049</code> itself (the Windows runs used the older base; rebasing needed two textual conflict resolutions next to the new timing fields), any title on Linux, any title other than Astro Bot.</li> </ul> <h3 dir="ltr">Checklist</h3> <ul dir="ltr"> <li><input disabled="" type="checkbox" checked=""> Based on current <code dir="ltr">main</code>; no other open PR implements the same functions (unmerged pull requests from #1380 to #1744 were checked through their refs; older ones were not)</li> <li><input disabled="" type="checkbox" checked=""> One topic per PR; follow-ups go in a new PR</li> <li><input disabled="" type="checkbox" checked=""> No comments in code except <a href="https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md">technical debt</a></li> <li><input disabled="" type="checkbox" checked=""> Unimplemented paths throw (<code dir="ltr">NotImplemented_nid_no_patch</code>); silent stubs are listed in <a href="https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs">TechnicalDebt</a></li> <li><input disabled="" type="checkbox" checked=""> No notes, investigation <code dir="ltr">.md</code> files or images added to the repository (attach them to this PR)</li> <li><input disabled="" type="checkbox" checked=""> New third-party code is a submodule built from source (none added)</li> <li><input disabled="" type="checkbox" checked=""> Generic behaviour, not specific to one title</li> <li><input disabled="" type="checkbox" checked=""> Depends on: none</li> <li><input disabled="" type="checkbox" checked=""> AI-assisted: yes. The investigation, the change, the test and this description were written with Claude; the Windows runs were made on my PC with my own copy of the game.</li></ul><!--EndFragment--> </body> </html>What A title that paces itself on pending flips can get further ahead of the queue 0 worker than its per-frame memory allows, and the worker then records a frame from memory the title has already rewritten. Astro Bot (PPSA21564) keeps per-frame data in a ring of three slots, polls sceVideoOutIsFlipPending, and submits the next flip as soon as fewer than three are pending. On hardware a pending flip is a frame whose commands have been read. Here submissions waited 98 to 110 ms in queue 0, so the worker was still recording frame N while the title wrote frame N+3 into the same slot. A block of per-frame constants that holds the title's frame counter read 0x17e in the frame right after one that read 0x17a: the worker recorded frame 0x17b from the slot of frame 0x17e. When the slot was half rewritten the draw bound the wrong block, and the frame came out black, without the movie quad, or with the quad at half size: 8 to 16 of 48 window captures in each of five runs. APS5_FLIP_READ_CHECK=1 counted 141,478 of 158,640 in-place reads as overwritten before execution. The same overrun produced guest snapshot differs from registered memory in compute shader 0x5005e7b00. A submission on queue 0 that carries a flip now waits until the worker has reached the flip of every earlier one. The wait ends early when queue 0 is blocked on memory that no running, held or pending work writes, the criterion orderReleased uses, since only the title can end that wait. The presenter stays asynchronous: the title still has three flips pending when the display is the limit. APS5_NO_FLIP_HOLD=1 submits as before. tests/Flip.cpp gains a case: a flip behind a closed rendering wait holds the next flip submission until the wait opens, and a flip behind a WAIT_REG_MEM on a label only the test stores does not hold it. Not established: what the console returns from sceVideoOutIsFlipPending while its GPU is behind. The change does not depend on it. Tested Windows 11, RTX 5070 Ti, Astro Bot (PPSA21564, 01.007.000), built from b3fcd6d6 (an older main) with this change. 45 s runs through the intro, 48 window captures each in bursts 70 ms apart: Build Odd captures Frames presented Without the change (five runs) 8 to 16 730 to 795 With the change (two runs) 0 868, 999 With the change and APS5_NO_FLIP_HOLD=1 12 795 With the change the snapshot check passes through the whole intro without APS5_NO_SNAPSHOT_CHECK. The title still needs a local workaround for an unrelated failure in the same shader at the first frame (guest memory is not readable at 0x30) and APS5_HOST_IMPORT_MIB=16384. Linux, on 4ddbf049 (this branch's base): agc_driver_flip, agc_driver_pm4 and agc_driver_pm4_failure pass; agc_driver is skipped there because the machine has no Vulkan device. The new case fails with APS5_NO_FLIP_HOLD=1 and passes without it. tools/check_conventions.py --base origin/main passes. The rest of the test suite was not built or run. Not tested: the title on 4ddbf049 itself (the Windows runs used the older base; rebasing needed two textual conflict resolutions next to the new timing fields), any title on Linux, any title other than Astro Bot. Checklist Based on current main; no other open PR implements the same functions (unmerged pull requests from #1380 to #1744 were checked through their refs; older ones were not) One topic per PR; follow-ups go in a new PR No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) 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 (none added) Generic behaviour, not specific to one title Depends on: none AI-assisted: yes. The investigation, the change, the test and this description were written with Claude; the Windows runs were made on my PC with my own copy of the game.
MarcZX10 commented 2026-10-08 20:44:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T20:44:35Z.


I checked the failed conventions run (37825811506). It reports that What, Tested, and Checklist are missing, plus a non-Conventional Commit title. The submitted body starts with a pasted HTML document and then repeats the same content as plain text, so the checker is not recognizing the sections. Please replace it with the repository template in plain Markdown (one copy), use a title such as fix(agc): hold flips behind the worker, then rerun conventions. The Linux build is still running; the latest Windows build passed. CONTRIBUTING also asks for a branch based on current main, so please refresh the branch before treating the reported older-base results as final.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6068710198 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1745#issuecomment-6068710198). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T20:44:35Z. --- I checked the failed conventions run (37825811506). It reports that `What`, `Tested`, and `Checklist` are missing, plus a non-Conventional Commit title. The submitted body starts with a pasted HTML document and then repeats the same content as plain text, so the checker is not recognizing the sections. Please replace it with the repository template in plain Markdown (one copy), use a title such as `fix(agc): hold flips behind the worker`, then rerun conventions. The Linux build is still running; the latest Windows build passed. CONTRIBUTING also asks for a branch based on current `main`, so please refresh the branch before treating the reported older-base results as final.
fisherjoey commented 2026-10-09 04:52:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T04:52:35Z.


Linux results, since this was tested on Windows only. Everything passes here.

Nobara 44 (Linux 7.2), GCC 16.2.1, Release, BUILD_TESTING=ON. This PR merged onto main f1451396 cleanly.

main f1451396 main + this PR
RTX 5070 Ti, driver 595.91.07, ctest -R agc_driver -j1 207 / 207 207 / 207
RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1, same 207 / 207 207 / 207
CPU tests (-E agc_driver) 286 / 287 286 / 287

The CPU failure is guest_dynamic_loader, which fails the same way on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074516203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1745#issuecomment-6074516203). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T04:52:35Z. --- Linux results, since this was tested on Windows only. Everything passes here. Nobara 44 (Linux 7.2), GCC 16.2.1, Release, `BUILD_TESTING=ON`. This PR merged onto `main` f1451396 cleanly. | | `main` f1451396 | `main` + this PR | |---|---|---| | RTX 5070 Ti, driver 595.91.07, `ctest -R agc_driver -j1` | 207 / 207 | 207 / 207 | | RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1, same | 207 / 207 | 207 / 207 | | CPU tests (`-E agc_driver`) | 286 / 287 | 286 / 287 | The CPU failure is `guest_dynamic_loader`, which fails the same way on `main`.
oneandonlydean commented 2026-10-09 09:35:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:35:10Z.


Three things before this can go in:

  • Drop APS5_NO_FLIP_HOLD (Submission.cpp:141). Env switches that turn a fix off aren't wanted here; the hold should just be right.
  • Wake the hold on worker progress instead of polling: Submission.cpp:148 waits in 1 ms wait_for steps until flipHoldOver() is true. Notify changed wherever runningWorkers, orderHolders and the pending completions drop, and wait on the predicate. Polling costs a wake-up every millisecond while held and can release up to 1 ms late.
  • Hold writers on the other queues too: submission.queue != 0 returns early (Submission.cpp:142), so a title that writes the next frame's data through a compute or second graphics queue still races the worker. The flip being held is on queue 0, but the overwrite can come from any queue.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6078309237 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1745#issuecomment-6078309237). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T09:35:10Z. --- Three things before this can go in: - Drop `APS5_NO_FLIP_HOLD` (`Submission.cpp:141`). Env switches that turn a fix off aren't wanted here; the hold should just be right. - Wake the hold on worker progress instead of polling: `Submission.cpp:148` waits in 1 ms `wait_for` steps until `flipHoldOver()` is true. Notify `changed` wherever `runningWorkers`, `orderHolders` and the pending completions drop, and wait on the predicate. Polling costs a wake-up every millisecond while held and can release up to 1 ms late. - Hold writers on the other queues too: `submission.queue != 0` returns early (`Submission.cpp:142`), so a title that writes the next frame's data through a compute or second graphics queue still races the worker. The flip being held is on queue 0, but the overwrite can come from any queue.
popcoder565 commented 2026-10-09 15:22:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:22:51Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 878d7ca1, merged onto main d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run.

  • This PR's tests pass: agc_driver_flip, agc_driver_flip_compute. None of them reported skipping a case.
  • Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows PATH setup.

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083880200 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1745#issuecomment-6083880200). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:22:51Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `878d7ca1`, merged onto `main` d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run. - This PR's tests pass: `agc_driver_flip`, `agc_driver_flip_compute`. None of them reported skipping a case. - Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows `PATH` setup. No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
adriadam10 commented 2026-10-10 05:57:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T05:57:44Z.

Review: DISMISSED


Thanks for the investigation and the measurements. Still open before this can go in:

  • Dean's three points from the previous comment are not addressed yet: drop APS5_NO_FLIP_HOLD (Submission.cpp:141), wake the hold by notifying changed where runningWorkers, orderHolders and the pending completions drop instead of the 1 ms wait_for poll (Submission.cpp:148), and hold writers coming from queues other than 0 (Submission.cpp:142).
  • conventions is red: the PR body is a pasted HTML document followed by a plain-text copy, so the What / Tested / Checklist sections are not recognized. Please replace it with one plain-Markdown copy of the template, and retitle as fix(agc): hold flips behind the worker (Conventional Commits).
  • The new test in Flip.cpp should also cover the notify path (hold released by worker progress with no extra submission) once the polling is gone.

Rebase on current main when you push; the Linux (fisherjoey) and Windows (popcoder565) runs on this head were clean.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5477874769 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1745#pullrequestreview-5477874769). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T05:57:44Z. **Review:** DISMISSED --- Thanks for the investigation and the measurements. Still open before this can go in: - Dean's three points from the previous comment are not addressed yet: drop `APS5_NO_FLIP_HOLD` (`Submission.cpp:141`), wake the hold by notifying `changed` where `runningWorkers`, `orderHolders` and the pending completions drop instead of the 1 ms `wait_for` poll (`Submission.cpp:148`), and hold writers coming from queues other than 0 (`Submission.cpp:142`). - `conventions` is red: the PR body is a pasted HTML document followed by a plain-text copy, so the `What` / `Tested` / `Checklist` sections are not recognized. Please replace it with one plain-Markdown copy of the template, and retitle as `fix(agc): hold flips behind the worker` (Conventional Commits). - The new test in `Flip.cpp` should also cover the notify path (hold released by worker progress with no extra submission) once the polling is gone. Rebase on current `main` when you push; the Linux (fisherjoey) and Windows (popcoder565) runs on this head were clean.
oneandonlydean commented 2026-10-10 10:07:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T10:07:04Z.


I rebased this on current main and added one commit on top for the review points (5d888abd75):

  • APS5_NO_FLIP_HOLD is gone.
  • The hold waits on changed with no timeout. Two things wake it: the worker that reaches a flip, and the queue 0 worker once its memory or rewind wait can only be ended by a store from the title. That second check is the same one flipHoldOver made, now done by the worker in its wait loop.
  • New case in agc_driver_flip_tests: a flip held behind a rendering wait is released when the worker moves on to a label wait that only the title can satisfy, without another submission. Without the wake it fails.

I left the other-queue point out. The hold blocks the title's thread at its flip submission, so that thread's later submissions on any queue come after the held one anyway.

Tested: Linux, RTX 4090, Release, full ctest. Everything passes except agc_driver_dcc_keys_first_write, which fails on main too. agc_driver_flip passes 20 of 20 runs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096408693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1745#issuecomment-6096408693). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T10:07:04Z. --- I rebased this on current `main` and added one commit on top for the review points (5d888abd75): - `APS5_NO_FLIP_HOLD` is gone. - The hold waits on `changed` with no timeout. Two things wake it: the worker that reaches a flip, and the queue 0 worker once its memory or rewind wait can only be ended by a store from the title. That second check is the same one `flipHoldOver` made, now done by the worker in its wait loop. - New case in `agc_driver_flip_tests`: a flip held behind a rendering wait is released when the worker moves on to a label wait that only the title can satisfy, without another submission. Without the wake it fails. I left the other-queue point out. The hold blocks the title's thread at its flip submission, so that thread's later submissions on any queue come after the held one anyway. Tested: Linux, RTX 4090, Release, full `ctest`. Everything passes except `agc_driver_dcc_keys_first_write`, which fails on `main` too. `agc_driver_flip` passes 20 of 20 runs.
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!1745
No description provided.