fix(agc): end a pipelined submission's EndSubmission time before its REWIND tail runs #8108

Merged
milescoviello merged 1 commit from upstream-pr/8108 into main 2026-10-21 01:24:14 +00:00
milescoviello commented 2026-10-19 22:00:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T22:00:41Z.


What

On the pipelined path, Driver::execute keeps its Driver.EndSubmission timer open while it runs a released REWIND tail (PacketExecution.cpp, the executeRewindTail call inside pipelined && orderedCompletion). The tail's submission ends by opening the next Driver.EndSubmission inside the first, so a chain of n tails is counted up to n times in that scope's total. worker_busy_pct and top_phases_ms_per_frame add those totals, so they overstate the queue worker's time; #8092's GTA V capture shows queue worker 0x0 at 3,740% busy. The non-pipelined path already finishes the timer before it runs the tail. The pipelined branch now does the same.

Tested

Ubuntu 24.04, GCC 13.3, Release, NVIDIA RTX 4070 Ti (595.99.02).

  • New agc_driver_pm4_rewind_trace (agc_driver_pm4_tests rewind-trace with APS5_TRACE_FRAMES=0:1 and APS5_PIPELINED_DRAWS=8). One trace window covers a submission of 12 REWIND tails that are released before it runs; each tail waits about 3 ms on a word the test sets. The test then reads queue worker 0x0's share in the window's worker_busy_pct and requires at most 150%.
    • Without the fix (b87501d550 drops the new line): 703.9%, 676.5% and 702.8%, so it fails 3 of 3.
    • With it: 90.7%, 94.0% and 94.1%, so it passes 3 of 3.
  • ctest -R '^agc_driver_pm4': 16 of 16 pass.
  • @simonbbby audited it independently on a Ryzen 9 9950X (Ubuntu 24.04, GCC 13.3, Release), nine fresh processes each. With only the added line reverted, the fixture fails 9 of 9 at 714.1–719.1%, with Driver.EndSubmission totalling 236.8–239.5 ms in a 38 ms window: 12 slices nested 12 deep, whose union is 36.9 ms. With the PR it passes 9 of 9 at 94.9–96.0%, and Driver.EndSubmission totals 0.009–0.018 ms. ^agc_driver_pm4 passes 16 of 16.
  • Khronos validation layer (LunarG SDK 1.4.363): VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_pm4' -V on main a700809679 (15 tests) and on this PR (16 tests). All pass, neither log reports the layer missing, and neither has a VUID- error.
  • tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py finds no overlap among the pull requests it could compare. It lists PRs that conflict with main and touch PacketExecution.cpp (#7978, #7642 and others), Pm4.cpp or the driver's CMakeLists.txt.

Not run: Windows and macOS. The test is registered on every platform, with the PATH setting the other Windows PM4 tests use.

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: #8092
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4928003593 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8108). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T22:00:41Z. --- ### What On the pipelined path, `Driver::execute` keeps its `Driver.EndSubmission` timer open while it runs a released REWIND tail (`PacketExecution.cpp`, the `executeRewindTail` call inside `pipelined && orderedCompletion`). The tail's submission ends by opening the next `Driver.EndSubmission` inside the first, so a chain of n tails is counted up to n times in that scope's total. `worker_busy_pct` and `top_phases_ms_per_frame` add those totals, so they overstate the queue worker's time; #8092's GTA V capture shows queue worker 0x0 at 3,740% busy. The non-pipelined path already finishes the timer before it runs the tail. The pipelined branch now does the same. ### Tested Ubuntu 24.04, GCC 13.3, Release, NVIDIA RTX 4070 Ti (595.99.02). - New `agc_driver_pm4_rewind_trace` (`agc_driver_pm4_tests rewind-trace` with `APS5_TRACE_FRAMES=0:1` and `APS5_PIPELINED_DRAWS=8`). One trace window covers a submission of 12 REWIND tails that are released before it runs; each tail waits about 3 ms on a word the test sets. The test then reads queue worker 0x0's share in the window's `worker_busy_pct` and requires at most 150%. - Without the fix (`b87501d550` drops the new line): 703.9%, 676.5% and 702.8%, so it fails 3 of 3. - With it: 90.7%, 94.0% and 94.1%, so it passes 3 of 3. - `ctest -R '^agc_driver_pm4'`: 16 of 16 pass. - @simonbbby [audited it independently](https://github.com/boykopovar/AnyPS5/pull/8108#issuecomment-6278711095) on a Ryzen 9 9950X (Ubuntu 24.04, GCC 13.3, Release), nine fresh processes each. With only the added line reverted, the fixture fails 9 of 9 at 714.1–719.1%, with `Driver.EndSubmission` totalling 236.8–239.5 ms in a 38 ms window: 12 slices nested 12 deep, whose union is 36.9 ms. With the PR it passes 9 of 9 at 94.9–96.0%, and `Driver.EndSubmission` totals 0.009–0.018 ms. `^agc_driver_pm4` passes 16 of 16. - Khronos validation layer (LunarG SDK 1.4.363): `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_pm4' -V` on `main` a700809679 (15 tests) and on this PR (16 tests). All pass, neither log reports the layer missing, and neither has a `VUID-` error. - `tools/check_conventions.py --base upstream/main` passes. `tools/pr_overlap.py` finds no overlap among the pull requests it could compare. It lists PRs that conflict with `main` and touch `PacketExecution.cpp` (#7978, #7642 and others), `Pm4.cpp` or the driver's `CMakeLists.txt`. Not run: Windows and macOS. The test is registered on every platform, with the `PATH` setting the other Windows PM4 tests use. ### 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: #8092 - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-19 22:18:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T22:18:02Z.


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 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5115 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Pm4.cpp
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6292 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6682 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7446 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7644 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7677 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7800 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8134 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8206 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 8295 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8489 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8564 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8658 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278601349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8108#issuecomment-6278601349). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T22:18:02Z. --- <!-- pr-overlap --> 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 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5115](https://www.github.com/boykopovar/AnyPS5/pull/5115) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Pm4.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Pm4.cpp` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6682](https://www.github.com/boykopovar/AnyPS5/pull/6682) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 7048](https://www.github.com/boykopovar/AnyPS5/pull/7048) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7395](https://www.github.com/boykopovar/AnyPS5/pull/7395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7446](https://www.github.com/boykopovar/AnyPS5/pull/7446) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7514](https://www.github.com/boykopovar/AnyPS5/pull/7514) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 7644](https://www.github.com/boykopovar/AnyPS5/pull/7644) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7677](https://www.github.com/boykopovar/AnyPS5/pull/7677) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8134](https://www.github.com/boykopovar/AnyPS5/pull/8134) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8206](https://www.github.com/boykopovar/AnyPS5/pull/8206) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 8295](https://www.github.com/boykopovar/AnyPS5/pull/8295) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8484](https://www.github.com/boykopovar/AnyPS5/pull/8484) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8489](https://www.github.com/boykopovar/AnyPS5/pull/8489) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8564](https://www.github.com/boykopovar/AnyPS5/pull/8564) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8592](https://www.github.com/boykopovar/AnyPS5/pull/8592) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8658](https://www.github.com/boykopovar/AnyPS5/pull/8658) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
simonbbby commented 2026-10-19 22:25:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-19T22:25:08Z.


Independent CPU trace audit of exact head 871b2076d571387474c251192356ca0df2a89027, using the new rewind-trace fixture. Ubuntu 24.04, Ryzen 9 9950X, GCC 13.3, Release.

I reverted only the added endTiming.Finish() to reproduce the main-parent production behavior (a700809679b1fef3d49cae4c00383ee85b9930be), kept the new test, rebuilt, then restored the exact source and rebuilt again. Nine fresh processes per condition:

One-line reversion Restored PR
Fixture result 9/9 fail at busy-share assertion 9/9 pass
Queue worker 0x0 busy 714.1–719.1% 94.9–96.0%
Driver.EndSubmission summary total per window 236.8–239.5 ms 0.009–0.018 ms
Trace window 38.2–38.6 ms 38.2–38.8 ms

The saved raw X events explain the difference directly. Every reverted run has 12 Driver.EndSubmission slices on the same queue-worker trace thread, nested 12 deep. For one run they sum to 239.507 ms but their union is only 36.928 ms. Adding the other serialized top-level worker-busy scopes gives 276.365 ms of slices over that same 36.928 ms union.

After restoration, the serialized worker-busy slices sum to their union in all nine runs (about 36.6–36.8 ms), with no overlap among them in this fixture. No long Driver.EndSubmission slice remains. The summary still accounts for its short 9–18 µs total: the trace intentionally folds individual slices below 20 µs, so absence from the raw events does not mean the timer disappeared. All 18 summaries report trace_dropped: false.

This supports the full chain: the unfinished inclusive parent timer survives executeRewindTail's recursive execute(tail), and TraceThread::account adds every inclusive duration to the summary. The windows remain about 38 ms and the events use one worker thread, so neither a shrinking denominator nor multiple workers explains the overcount. The fixture reaches its done assertion before the failing busy-share check in the reverted runs and still checks it after restoration, so the correction is not explained by tails ceasing to run.

The restored ^agc_driver_pm4 CTest scope passes 16/16. The checkout is clean at the stated head, and no experimental edits remain.

Scope: this fixture does not initialize a Vulkan device (the summary GPU/driver fields are empty). The runs used three ICD environments, but they are repetitions of the same CPU test, not three-GPU validation. No title, FPS, GPU timing, validation-layer or Windows/macOS result is claimed, and the no-overlap observation is limited to this fixture's serialized busy scopes. Raw traces, summaries and the interval-audit script are retained.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278711095 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8108#issuecomment-6278711095). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-19T22:25:08Z. --- Independent CPU trace audit of exact head `871b2076d571387474c251192356ca0df2a89027`, using the new `rewind-trace` fixture. Ubuntu 24.04, Ryzen 9 9950X, GCC 13.3, Release. I reverted **only** the added `endTiming.Finish()` to reproduce the main-parent production behavior (`a700809679b1fef3d49cae4c00383ee85b9930be`), kept the new test, rebuilt, then restored the exact source and rebuilt again. Nine fresh processes per condition: | | One-line reversion | Restored PR | |---|---|---| | Fixture result | 9/9 fail at busy-share assertion | 9/9 pass | | Queue worker 0x0 busy | 714.1–719.1% | 94.9–96.0% | | `Driver.EndSubmission` summary total per window | 236.8–239.5 ms | 0.009–0.018 ms | | Trace window | 38.2–38.6 ms | 38.2–38.8 ms | The saved raw `X` events explain the difference directly. Every reverted run has **12 `Driver.EndSubmission` slices on the same queue-worker trace thread, nested 12 deep**. For one run they sum to 239.507 ms but their union is only 36.928 ms. Adding the other serialized top-level worker-busy scopes gives 276.365 ms of slices over that same 36.928 ms union. After restoration, the serialized worker-busy slices sum to their union in all nine runs (about 36.6–36.8 ms), with no overlap among them in this fixture. No long `Driver.EndSubmission` slice remains. The summary still accounts for its short 9–18 µs total: the trace intentionally folds individual slices below 20 µs, so absence from the raw events does not mean the timer disappeared. All 18 summaries report `trace_dropped: false`. This supports the full chain: the unfinished inclusive parent timer survives `executeRewindTail`'s recursive `execute(tail)`, and `TraceThread::account` adds every inclusive duration to the summary. The windows remain about 38 ms and the events use one worker thread, so neither a shrinking denominator nor multiple workers explains the overcount. The fixture reaches its `done` assertion before the failing busy-share check in the reverted runs and still checks it after restoration, so the correction is not explained by tails ceasing to run. The restored **`^agc_driver_pm4` CTest scope passes 16/16**. The checkout is clean at the stated head, and no experimental edits remain. Scope: this fixture does not initialize a Vulkan device (the summary GPU/driver fields are empty). The runs used three ICD environments, but they are repetitions of the same CPU test, not three-GPU validation. No title, FPS, GPU timing, validation-layer or Windows/macOS result is claimed, and the no-overlap observation is limited to this fixture's serialized busy scopes. Raw traces, summaries and the interval-audit script are retained.
milescoviello commented 2026-10-19 22:27:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T22:27:20Z.


Thanks @simonbbby. Nine runs each way with only the line reverted, plus the raw slices, is stronger evidence than my three, and the nesting depth of 12 for 12 tails shows the mechanism directly. Added to the description.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278748918 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8108#issuecomment-6278748918). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T22:27:20Z. --- Thanks @simonbbby. Nine runs each way with only the line reverted, plus the raw slices, is stronger evidence than my three, and the nesting depth of 12 for 12 tails shows the mechanism directly. Added to the description. AI-assisted: yes (Claude Code)
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!8108
No description provided.