perf(agc): skip the queued-draw read check when a storage flush stores nothing #8911

Merged
Celegans12 merged 1 commit from upstream-pr/8911 into main 2026-10-25 15:19:29 +00:00
Celegans12 commented 2026-10-21 05:48:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-21T05:48:41Z.


What

Since #6914, StorageTexture::FlushPending asks DrawPipeline::HeldReads first on every call. That takes the draw pipeline's mutex and walks the read ranges of every queued draw. Most flushes come from sampled-texture lookups and storage refreshes over memory with no pending results, and those return false without storing or publishing anything, held or not. In a Yōtei profile on our tree the check cost the draw commit thread about 3.3 s per 120 s, 2.1 s of it in the winpthreads mutex.

  • FlushPending now returns false before the check when nothing would be stored: no pending image with a unit in the range, none being flushed, and no unit shadow over it when the scope publishes. That's the same answer the old path gives in that case.
  • A flush with something to store still asks HeldReads first, so #6914's ordering is unchanged.
  • DrawPipeline::HeldReadQueries returns the existing query counter, for the test.
  • The [storage] line's "held for a queued draw read" and "pretest skipped" counts no longer include flushes that had nothing to store.

Overlaps: #6615 renames refreshing to Refreshing::Get(), which the new check reads too, so whichever lands second needs that one-word change. #6682 changes FlushPending's signature right next to these lines (textual only).

Tested

  • Windows 11 Pro, MinGW-w64 GCC 15.2.0, -DBUILD_TESTING=ON, RTX 3080 Laptop, based on main 7ab4b2e561: ctest 1824/1828. The 4 failures (log_macros, log_macros_timestamps, guest_kqueue, and agc_driver_image_array_window_past_layer_limit, which doesn't compile with MinGW here) fail on main too.
  • agc_driver_queued_index_read_order now also flushes a range with no pending results while an image is pending elsewhere, and checks that HeldReads wasn't asked. With main's Texture.cpp it fails: "a flush with nothing to store asked the draw pipeline for held reads".
  • Linux (WSL, GCC 13.3, lavapipe), CI's job on the merge with main: 1760/1780; the same 20 fail on main (WSL has no userfaultfd write watching).
  • Speed, not isolated for this PR: the only number I have comes from our own Ghost of Yōtei (PPSA26344) tree, not main, with #8911, #8912 and #8913 switched on and off together in one in-run open-world A/B (9+9 phases): 6.17 vs 5.16 presents per 10 s (paired -0.95 +- 0.20 SE) for the combined set. This PR's own counter in that run: 948k flushes skipped the check in the on phases (a counter in our tree, not in this diff).
  • main vs this change, measured by @Dextroid17 (thanks), in this comment: Ghost of Yōtei title menu and loading, RTX 3080 Ti, Linux, APS5_TRACE_SECONDS=20:30, cleared shader cache, main/change interleaved three times each. Frame p50 160.1 vs 158.9 ms (mean of 3), GPU busy 75.4 vs 73.9 ms per present: within the run-to-run spread, so no speedup on that scene. The traces and trace_digest.py output are attached there. The two summary lines below are his median main run and the closest change run. I only fixed the title field, which the summary writer had double-encoded.
aps5-summary.jsonl, main 2b3baacdba and #8911 bfd4634c88da
{"commit":"2b3baacdba51","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"20:30"},"gpu":"NVIDIA GeForce RTX 3080 Ti","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-2-cachyos","cpu":"11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz","cpu_threads":16,"memory_mib":31912,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"seconds 20:30","first_present":156,"ms":141414.646},"presents":56,"frame_ms":{"p50":159.802,"p90":225.49,"p99":132069.728,"max":132069.728},"gpu_busy_ms_per_present":74.76,"worker_busy_pct":{"queue worker 0x0":6.574,"queue worker 0x52":1.44,"queue worker 0x20":1.539,"queue worker 0x53":1.496,"queue worker 0x48":0.574,"queue worker 0x30":4.501,"queue worker 0x38":5.184},"top_phases_ms_per_frame":{"Shader.PrepareArtifact":18054.9,"Driver.Packet":533.912,"Driver.Packet.dispatch":245.568,"Driver.Packet.memory_wait":217.322,"Driver.Dispatch":156.637,"Resources.Complete":60.799,"Vulkan.Dispatch":58.066,"Vulkan.Dispatch.shader_resources":56.567},"trace_dropped":false,"trace":"aps5-trace-2b3baacdba51-155960.json.gz"}
{"commit":"bfd4634c88da","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"20:30"},"gpu":"NVIDIA GeForce RTX 3080 Ti","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-2-cachyos","cpu":"11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz","cpu_threads":16,"memory_mib":31912,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"seconds 20:30","first_present":155,"ms":141141.748},"presents":55,"frame_ms":{"p50":159.861,"p90":221.298,"p99":131927.011,"max":131927.011},"gpu_busy_ms_per_present":72.394,"worker_busy_pct":{"queue worker 0x0":6.425,"queue worker 0x20":1.489,"queue worker 0x52":1.359,"queue worker 0x53":1.527,"queue worker 0x30":4.41,"queue worker 0x38":5.088,"queue worker 0x48":0.454},"top_phases_ms_per_frame":{"Shader.PrepareArtifact":18371.997,"Driver.Packet":530.589,"Driver.Packet.dispatch":245.406,"Driver.Packet.memory_wait":211.582,"Driver.Dispatch":158.985,"Resources.Complete":62.124,"Vulkan.Dispatch":57.12,"Vulkan.Dispatch.shader_resources":55.56},"trace_dropped":false,"trace":"aps5-trace-bfd4634c88da-139442.json.gz"}
- Not tested: AMD, Intel, console behaviour.

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: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080 Laptop GPU, driver 610.62, Windows 11 Pro; lavapipe (Mesa 25.2.8, WSL Ubuntu 24.04)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4947036129 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-21T05:48:41Z. --- ### What Since #6914, `StorageTexture::FlushPending` asks `DrawPipeline::HeldReads` first on every call. That takes the draw pipeline's mutex and walks the read ranges of every queued draw. Most flushes come from sampled-texture lookups and storage refreshes over memory with no pending results, and those return false without storing or publishing anything, held or not. In a Yōtei profile on our tree the check cost the draw commit thread about 3.3 s per 120 s, 2.1 s of it in the winpthreads mutex. - `FlushPending` now returns false before the check when nothing would be stored: no pending image with a unit in the range, none being flushed, and no unit shadow over it when the scope publishes. That's the same answer the old path gives in that case. - A flush with something to store still asks `HeldReads` first, so #6914's ordering is unchanged. - `DrawPipeline::HeldReadQueries` returns the existing query counter, for the test. - The `[storage]` line's "held for a queued draw read" and "pretest skipped" counts no longer include flushes that had nothing to store. Overlaps: #6615 renames `refreshing` to `Refreshing::Get()`, which the new check reads too, so whichever lands second needs that one-word change. #6682 changes `FlushPending`'s signature right next to these lines (textual only). ### Tested - Windows 11 Pro, MinGW-w64 GCC 15.2.0, `-DBUILD_TESTING=ON`, RTX 3080 Laptop, based on `main` 7ab4b2e561: ctest 1824/1828. The 4 failures (`log_macros`, `log_macros_timestamps`, `guest_kqueue`, and `agc_driver_image_array_window_past_layer_limit`, which doesn't compile with MinGW here) fail on `main` too. - `agc_driver_queued_index_read_order` now also flushes a range with no pending results while an image is pending elsewhere, and checks that `HeldReads` wasn't asked. With `main`'s `Texture.cpp` it fails: "a flush with nothing to store asked the draw pipeline for held reads". - Linux (WSL, GCC 13.3, lavapipe), CI's job on the merge with `main`: 1760/1780; the same 20 fail on `main` (WSL has no userfaultfd write watching). - Speed, not isolated for this PR: the only number I have comes from our own Ghost of Yōtei (PPSA26344) tree, not `main`, with #8911, #8912 and #8913 switched on and off together in one in-run open-world A/B (9+9 phases): 6.17 vs 5.16 presents per 10 s (paired -0.95 +- 0.20 SE) for the combined set. This PR's own counter in that run: 948k flushes skipped the check in the on phases (a counter in our tree, not in this diff). - `main` vs this change, measured by @Dextroid17 (thanks), in [this comment](https://github.com/boykopovar/AnyPS5/pull/8911#issuecomment-6376920571): Ghost of Yōtei title menu and loading, RTX 3080 Ti, Linux, `APS5_TRACE_SECONDS=20:30`, cleared shader cache, main/change interleaved three times each. Frame p50 160.1 vs 158.9 ms (mean of 3), GPU busy 75.4 vs 73.9 ms per present: within the run-to-run spread, so no speedup on that scene. The traces and `trace_digest.py` output are attached there. The two summary lines below are his median `main` run and the closest change run. I only fixed the `title` field, which the summary writer had double-encoded. <details><summary><code>aps5-summary.jsonl</code>, <code>main</code> 2b3baacdba51 and #8911 bfd4634c88da</summary> ```json {"commit":"2b3baacdba51","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"20:30"},"gpu":"NVIDIA GeForce RTX 3080 Ti","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-2-cachyos","cpu":"11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz","cpu_threads":16,"memory_mib":31912,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"seconds 20:30","first_present":156,"ms":141414.646},"presents":56,"frame_ms":{"p50":159.802,"p90":225.49,"p99":132069.728,"max":132069.728},"gpu_busy_ms_per_present":74.76,"worker_busy_pct":{"queue worker 0x0":6.574,"queue worker 0x52":1.44,"queue worker 0x20":1.539,"queue worker 0x53":1.496,"queue worker 0x48":0.574,"queue worker 0x30":4.501,"queue worker 0x38":5.184},"top_phases_ms_per_frame":{"Shader.PrepareArtifact":18054.9,"Driver.Packet":533.912,"Driver.Packet.dispatch":245.568,"Driver.Packet.memory_wait":217.322,"Driver.Dispatch":156.637,"Resources.Complete":60.799,"Vulkan.Dispatch":58.066,"Vulkan.Dispatch.shader_resources":56.567},"trace_dropped":false,"trace":"aps5-trace-2b3baacdba51-155960.json.gz"} ``` ```json {"commit":"bfd4634c88da","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"20:30"},"gpu":"NVIDIA GeForce RTX 3080 Ti","driver":"NVIDIA 615.78.08","os":"Linux 7.3.0-2-cachyos","cpu":"11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz","cpu_threads":16,"memory_mib":31912,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"seconds 20:30","first_present":155,"ms":141141.748},"presents":55,"frame_ms":{"p50":159.861,"p90":221.298,"p99":131927.011,"max":131927.011},"gpu_busy_ms_per_present":72.394,"worker_busy_pct":{"queue worker 0x0":6.425,"queue worker 0x20":1.489,"queue worker 0x52":1.359,"queue worker 0x53":1.527,"queue worker 0x30":4.41,"queue worker 0x38":5.088,"queue worker 0x48":0.454},"top_phases_ms_per_frame":{"Shader.PrepareArtifact":18371.997,"Driver.Packet":530.589,"Driver.Packet.dispatch":245.406,"Driver.Packet.memory_wait":211.582,"Driver.Dispatch":158.985,"Resources.Complete":62.124,"Vulkan.Dispatch":57.12,"Vulkan.Dispatch.shader_resources":55.56},"trace_dropped":false,"trace":"aps5-trace-bfd4634c88da-139442.json.gz"} ``` </details> - Not tested: AMD, Intel, console behaviour. ### 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: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3080 Laptop GPU, driver 610.62, Windows 11 Pro; lavapipe (Mesa 25.2.8, WSL Ubuntu 24.04) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-21 05:48:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T05:48:54Z.


This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309066349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911#issuecomment-6309066349). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T05:48:54Z. --- <!-- pr-labels-perf --> This pull request is labeled `perf`, so it needs the summary line of a capture on `main` and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both `aps5-summary.jsonl` lines, attach the two traces and add the output of `tools/trace_digest.py`.
MarcZX10 commented 2026-10-21 05:50:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:50:03Z.

Review: COMMENTED


The empty-flush fast path looks consistent with the existing pending-list and shadow-publication paths on inspection. One merge-readiness gap: the description reports a measured speedup, but CONTRIBUTING.md requires the aps5-summary.jsonl lines from main and this commit for the same title/scene/machine, plus both traces and tools/trace_digest.py output. The perf label bot has also requested those artifacts. Could you attach them (or remove the quantified speed claim if it cannot be reproduced)?

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5595466599 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911#pullrequestreview-5595466599). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T05:50:03Z. **Review:** COMMENTED --- The empty-flush fast path looks consistent with the existing pending-list and shadow-publication paths on inspection. One merge-readiness gap: the description reports a measured speedup, but CONTRIBUTING.md requires the `aps5-summary.jsonl` lines from `main` and this commit for the same title/scene/machine, plus both traces and `tools/trace_digest.py` output. The perf label bot has also requested those artifacts. Could you attach them (or remove the quantified speed claim if it cannot be reproduced)?
Celegans12 commented 2026-10-21 06:18:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-21T06:18:54Z.


@MarcZX10 thanks for checking the fast path against the pending-list and shadow-publication paths, that's the part I was most worried about.

You're right about the number. The only measurement I have is from our own Yōtei tree, not main, and in it I switched this PR and #8912/#8913 on and off together, so it says nothing about this change alone. I've rewritten the speed line to say exactly that. The one figure that is specific to this PR is the count of flushes that skipped the check. I can't make a matched main/change capture right now, so the summary lines, traces and trace_digest.py output are still owed. I'll add them here when I have them, but I can't give a date.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309477303 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911#issuecomment-6309477303). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-21T06:18:54Z. --- @MarcZX10 thanks for checking the fast path against the pending-list and shadow-publication paths, that's the part I was most worried about. You're right about the number. The only measurement I have is from our own Yōtei tree, not `main`, and in it I switched this PR and #8912/#8913 on and off together, so it says nothing about this change alone. I've rewritten the speed line to say exactly that. The one figure that is specific to this PR is the count of flushes that skipped the check. I can't make a matched `main`/change capture right now, so the summary lines, traces and `trace_digest.py` output are still owed. I'll add them here when I have them, but I can't give a date.
EdouardSence commented 2026-10-21 08:45:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-21T08:45:50Z.


AMD / Linux data point for #8911, #8912 and #8913 together, on a different title. The result is neutral: no measurable change and no regression.

Setup: ASTRO BOT (PPSA21567) 01.019.000, level underwater_aerial_garden (-lvl argument), Linux 7.2.10 (CachyOS), RX 9070 XT, Mesa 26.2.4 RADV, Ryzen 7 7800X3D, 32 GB, GCC Release. The game renders at 3840x2160. Headless gamescope, APS5_TRACE_SECONDS=90:50, 180 s per run, one untimed warm-up run per build.

  • base: main f894ba69d + #7844 (merge 3def32090). #7844 is included because without it this level runs at ~830 ms/frame on this machine.
  • change: the same + #8911 + #8912 + #8913 (merge 521a161bc, all three merged cleanly)

Runs were interleaved: base, change, change, base.

run presents p50 p90 p99 GPU busy/present
base-1 189 266.8 280.1 297.7 135.1
change-1 188 262.2 279.5 344.8 134.2
change-2 187 267.1 281.2 378.7 134.9
base-2 180 276.5 297.5 327.8 132.9

The p50 difference (~2-3 %) is smaller than the spread between the two base runs. The change-1 p99 includes the first present of the window (753.8 ms), which is a load spike.

From trace_digest.py, the draw committer is not the bottleneck on this title. It is busy 30.5 ms per frame on base and 33.9 on change. queue worker 0x0 is at 99 % in both, dominated by Driver.Draw.shader_compile_and_link (140.6 vs 143.2 ms per frame). That explains why the set has no effect here. #8913's rebind path is described as coming from #6763's NVIDIA draw-input copies, so it is probably not reached on RADV at all.

Both builds ran 3 × 180 s with no device lost, no amdgpu kernel messages and no new exceptions.

Not tested: the PRs one at a time, NVIDIA/Intel, CTest.


Tested and written by Claude (AI assistant) on a contributor's machine.
AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6311878368 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911#issuecomment-6311878368). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-21T08:45:50Z. --- AMD / Linux data point for #8911, #8912 and #8913 together, on a different title. The result is neutral: no measurable change and no regression. **Setup:** ASTRO BOT (PPSA21567) 01.019.000, level `underwater_aerial_garden` (`-lvl` argument), Linux 7.2.10 (CachyOS), RX 9070 XT, Mesa 26.2.4 RADV, Ryzen 7 7800X3D, 32 GB, GCC Release. The game renders at 3840x2160. Headless gamescope, `APS5_TRACE_SECONDS=90:50`, 180 s per run, one untimed warm-up run per build. - base: `main` `f894ba69d` + #7844 (merge `3def32090`). #7844 is included because without it this level runs at ~830 ms/frame on this machine. - change: the same + #8911 + #8912 + #8913 (merge `521a161bc`, all three merged cleanly) Runs were interleaved: base, change, change, base. | run | presents | p50 | p90 | p99 | GPU busy/present | |---|---|---|---|---|---| | base-1 | 189 | 266.8 | 280.1 | 297.7 | 135.1 | | change-1 | 188 | 262.2 | 279.5 | 344.8 | 134.2 | | change-2 | 187 | 267.1 | 281.2 | 378.7 | 134.9 | | base-2 | 180 | 276.5 | 297.5 | 327.8 | 132.9 | The p50 difference (~2-3 %) is smaller than the spread between the two base runs. The change-1 p99 includes the first present of the window (753.8 ms), which is a load spike. From `trace_digest.py`, the draw committer is not the bottleneck on this title. It is busy 30.5 ms per frame on base and 33.9 on change. `queue worker 0x0` is at 99 % in both, dominated by `Driver.Draw.shader_compile_and_link` (140.6 vs 143.2 ms per frame). That explains why the set has no effect here. #8913's rebind path is described as coming from #6763's NVIDIA draw-input copies, so it is probably not reached on RADV at all. Both builds ran 3 × 180 s with no device lost, no amdgpu kernel messages and no new exceptions. Not tested: the PRs one at a time, NVIDIA/Intel, CTest. --- *Tested and written by Claude (AI assistant) on a contributor's machine.* AI-assisted: yes
JJenkx commented 2026-10-21 23:19:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T23:19:24Z.


Windows measurement of this change, for reference. Setup: AMD Radeon RX 6700 XT, AMD driver 26.10.1, Windows 11. Spirit of the Island (PPSA13934) title screen, APS5_TRACE_SUMMARY_EVERY=10, mean p50 of the nine 10 s intervals after loading. The builds are main 0c6a5bd59 and this PR merged onto it, alternated:

arm round 1 round 2
main 108.5 ms 108.9 ms
this PR 106.4 ms 107.1 ms

On that screen, most of the remaining HeldReads time on Windows was getenv itself. #9490 reads that variable once, and it composes with this PR. Built together, they measured 107.2 and 107.0 ms on the same base. I did not run the test suite on this PR here; these are frame-time runs only.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328733041 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911#issuecomment-6328733041). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-21T23:19:24Z. --- Windows measurement of this change, for reference. Setup: AMD Radeon RX 6700 XT, AMD driver 26.10.1, Windows 11. Spirit of the Island (PPSA13934) title screen, `APS5_TRACE_SUMMARY_EVERY=10`, mean p50 of the nine 10 s intervals after loading. The builds are `main` 0c6a5bd59 and this PR merged onto it, alternated: | arm | round 1 | round 2 | |---|---|---| | `main` | 108.5 ms | 108.9 ms | | this PR | 106.4 ms | 107.1 ms | On that screen, most of the remaining `HeldReads` time on Windows was `getenv` itself. #9490 reads that variable once, and it composes with this PR. Built together, they measured 107.2 and 107.0 ms on the same base. I did not run the test suite on this PR here; these are frame-time runs only.
Celegans12 commented 2026-10-22 09:49:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-22T09:49:27Z.


I measured this one on its own now, as asked on #8912. Plain main can't take Ghost of Yōtei to the open world: its loading screen stops presenting after about 160 s and the game later aborts on a blend into a 10_11_11 unorm target that main doesn't support. So this is our tree (our local merge with main of 2026-10-21) with only this PR's switch flipped every 60 s in one run (APS5_NO_HELD_READ_SKIP), which keeps the scene and session the same for both halves.

With the skip on I got 6.16 presents per 10 s against 5.61 with it off. Paired against the neighbouring phases that's -0.35 +- 0.30 presents with the change off, so about 1 SE: a lean in its favour, not a result I'd call measured. Committer time per commit didn't move (316 vs 310 us). What it clearly does is the thing it says: per phase, about 858k storage flushes skipped the queued-draw check with it on against 44k off, and the flushes that held for a queued read dropped from about 104k to 5k.

I also tried a boot-scene pair on plain main, but those captures turned out to be pipeline-cold on this machine, so I'm not quoting them. If you'd rather see a longer A/B to tighten the error bar, I can run one.

Details

Run pb-8911, our local merge with main 557682ca44, warm caches (NVIDIA pipeline cache readable, dictionary checked before the run), web-teshio-b save, 1,300 s cap, APS5_AB=60:APS5_NO_HELD_READ_SKIP from present 760, RTX 3080 Laptop (610.62), Windows 11. B = the switch set, i.e. this PR's change off.

phases (presents: begin / settled / end; clean reports present/gputime/draw/syncwait):
  A  0     760 /    769 /    822  3/0/5/4     8.89 presents/10 s
  B  1     822 /    823 /    851  5/0/5/5     4.78 presents/10 s
  A  2     851 /    853 /    880  4/0/5/5     4.70 presents/10 s
  B  3     880 /    881 /    908  5/0/5/5     4.60 presents/10 s
  A  4     908 /    910 /    943  4/0/5/5     5.80 presents/10 s
  B  5     943 /    945 /    977  4/0/5/4     5.56 presents/10 s
  A  6     977 /    979 /   1011  4/0/5/4     5.65 presents/10 s
  B  7    1011 /   1013 /   1046  4/0/5/4     5.70 presents/10 s
  A  8    1046 /   1048 /   1084  4/0/4/4     6.19 presents/10 s
  B  9    1084 /   1086 /   1120  4/0/4/4     6.01 presents/10 s
  A 10    1120 /   1122 /   1153  4/0/4/4     5.46 presents/10 s
  B 11    1153 /   1155 /   1191  4/0/5/5     6.30 presents/10 s
  A 12    1191 /   1193 /   1229  4/0/5/5     6.31 presents/10 s
  B 13    1229 /   1231 /   1267  4/0/4/5     6.28 presents/10 s
  A 14    1267 /   1269 /   1305  4/0/4/5     6.30 presents/10 s
  B 15    1305 /   1307 /      -  0/0/0/0     unfinished

per phase mean                          A          B        B-A    B/A-1   noise: B vs neighbouring A, mean diff +- SE (SD, n)
presents/10s                         6.16       5.61      -0.56    -9.0%   -0.35 +- 0.30 (SD 0.81, n 7)
frame ms                          1670.81    1808.52    +137.71    +8.2%   +92.75 +- 76.03 (SD 201.17, n 7)
GPU busy ms/frame                  736.69     726.56     -10.13    -1.4%   -8.29 +- 15.52 (SD 41.07, n 7)
GPU idle gaps ms/frame            1288.78    1083.46    -205.31   -15.9%   -110.86 +- 132.75 (SD 351.22, n 7)
committer us/commit                316.35     310.18      -6.16    -1.9%   -4.16 +- 15.49 (SD 40.99, n 7)
committer % busy                    62.13      66.69      +4.56    +7.3%   +2.87 +- 2.04 (SD 5.41, n 7)
room wait us/draw                  111.63     111.59      -0.04    -0.0%   -2.27 +- 8.16 (SD 21.58, n 7)
drain ms/10s                      1787.84    1708.80     -79.05    -4.4%   -156.22 +- 181.07 (SD 479.06, n 7)
syncwait GPU ms/10s                868.56     900.03     +31.47    +3.6%   +1.09 +- 33.05 (SD 87.45, n 7)
A total (8 phases): alloc 3.6 us/upload, lookup 14.9 us/upload; per phase: small misses 0, small-device hits/misses 88651/209, device misses 198, exact-size hits 393980, rebound 357960, held-read checks skipped 858403, held 5019
B total (7 phases): alloc 3.5 us/upload, lookup 15.2 us/upload; per phase: small misses 0, small-device hits/misses 97582/20, device misses 15, exact-size hits 441810, rebound 404208, held-read checks skipped 44009, held 104488
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337828936 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911#issuecomment-6337828936). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-22T09:49:27Z. --- I measured this one on its own now, as asked on #8912. Plain main can't take Ghost of Yōtei to the open world: its loading screen stops presenting after about 160 s and the game later aborts on a blend into a 10_11_11 unorm target that main doesn't support. So this is our tree (our local merge with main of 2026-10-21) with only this PR's switch flipped every 60 s in one run (`APS5_NO_HELD_READ_SKIP`), which keeps the scene and session the same for both halves. With the skip on I got 6.16 presents per 10 s against 5.61 with it off. Paired against the neighbouring phases that's -0.35 +- 0.30 presents with the change off, so about 1 SE: a lean in its favour, not a result I'd call measured. Committer time per commit didn't move (316 vs 310 us). What it clearly does is the thing it says: per phase, about 858k storage flushes skipped the queued-draw check with it on against 44k off, and the flushes that held for a queued read dropped from about 104k to 5k. I also tried a boot-scene pair on plain main, but those captures turned out to be pipeline-cold on this machine, so I'm not quoting them. If you'd rather see a longer A/B to tighten the error bar, I can run one. <details><summary>Details</summary> Run `pb-8911`, our local merge with main 557682ca44, warm caches (NVIDIA pipeline cache readable, dictionary checked before the run), web-teshio-b save, 1,300 s cap, `APS5_AB=60:APS5_NO_HELD_READ_SKIP` from present 760, RTX 3080 Laptop (610.62), Windows 11. B = the switch set, i.e. this PR's change off. ``` phases (presents: begin / settled / end; clean reports present/gputime/draw/syncwait): A 0 760 / 769 / 822 3/0/5/4 8.89 presents/10 s B 1 822 / 823 / 851 5/0/5/5 4.78 presents/10 s A 2 851 / 853 / 880 4/0/5/5 4.70 presents/10 s B 3 880 / 881 / 908 5/0/5/5 4.60 presents/10 s A 4 908 / 910 / 943 4/0/5/5 5.80 presents/10 s B 5 943 / 945 / 977 4/0/5/4 5.56 presents/10 s A 6 977 / 979 / 1011 4/0/5/4 5.65 presents/10 s B 7 1011 / 1013 / 1046 4/0/5/4 5.70 presents/10 s A 8 1046 / 1048 / 1084 4/0/4/4 6.19 presents/10 s B 9 1084 / 1086 / 1120 4/0/4/4 6.01 presents/10 s A 10 1120 / 1122 / 1153 4/0/4/4 5.46 presents/10 s B 11 1153 / 1155 / 1191 4/0/5/5 6.30 presents/10 s A 12 1191 / 1193 / 1229 4/0/5/5 6.31 presents/10 s B 13 1229 / 1231 / 1267 4/0/4/5 6.28 presents/10 s A 14 1267 / 1269 / 1305 4/0/4/5 6.30 presents/10 s B 15 1305 / 1307 / - 0/0/0/0 unfinished per phase mean A B B-A B/A-1 noise: B vs neighbouring A, mean diff +- SE (SD, n) presents/10s 6.16 5.61 -0.56 -9.0% -0.35 +- 0.30 (SD 0.81, n 7) frame ms 1670.81 1808.52 +137.71 +8.2% +92.75 +- 76.03 (SD 201.17, n 7) GPU busy ms/frame 736.69 726.56 -10.13 -1.4% -8.29 +- 15.52 (SD 41.07, n 7) GPU idle gaps ms/frame 1288.78 1083.46 -205.31 -15.9% -110.86 +- 132.75 (SD 351.22, n 7) committer us/commit 316.35 310.18 -6.16 -1.9% -4.16 +- 15.49 (SD 40.99, n 7) committer % busy 62.13 66.69 +4.56 +7.3% +2.87 +- 2.04 (SD 5.41, n 7) room wait us/draw 111.63 111.59 -0.04 -0.0% -2.27 +- 8.16 (SD 21.58, n 7) drain ms/10s 1787.84 1708.80 -79.05 -4.4% -156.22 +- 181.07 (SD 479.06, n 7) syncwait GPU ms/10s 868.56 900.03 +31.47 +3.6% +1.09 +- 33.05 (SD 87.45, n 7) A total (8 phases): alloc 3.6 us/upload, lookup 14.9 us/upload; per phase: small misses 0, small-device hits/misses 88651/209, device misses 198, exact-size hits 393980, rebound 357960, held-read checks skipped 858403, held 5019 B total (7 phases): alloc 3.5 us/upload, lookup 15.2 us/upload; per phase: small misses 0, small-device hits/misses 97582/20, device misses 15, exact-size hits 441810, rebound 404208, held-read checks skipped 44009, held 104488 ``` </details>
SoRadGaming commented 2026-10-22 14:48:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SoRadGaming on 2026-10-22T14:48:28Z.


A measurement that bears on how this change and #9490 split the held-read cost, from ASTRO BOT (PPSA21564) in the Crash Site hub. Setup: Windows 11, Ryzen 7 5800X3D, RX 9070 XT, main 4777caca3 plus local experiments.

With main's HeldReads, a steady-state APS5_SAMPLE_COMMITTER window put 16.3 % of the draw committer's samples in HeldReads. Of that:

  • 14.8 % was ucrtbase under the per-call getenv that #9490 removes;
  • about 1 % was the pipeline mutex (winpthreads);
  • the rest was the range scan.

So in this game nearly all of the cost is the getenv. With #9490's change alone (same build, only libSceAgcDriver.prx swapped, 3 interleaved rounds), hub hold went from 10.50 to 11.68 FPS, and the committer from 25.5 to 21.9 µs per commit (details on #9490).

I haven't measured this PR's skip on top of that. From the split above, its saving here would be at most the remaining ~1.5 % of committer samples. That still adds up across the ~370k commits per 10 s, but it is smaller than in your Yōtei profile, where the mutex dominated.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6343663257 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8911#issuecomment-6343663257). Originally posted by [SoRadGaming](https://github.com/SoRadGaming) on 2026-10-22T14:48:28Z. --- A measurement that bears on how this change and #9490 split the held-read cost, from ASTRO BOT (PPSA21564) in the Crash Site hub. Setup: Windows 11, Ryzen 7 5800X3D, RX 9070 XT, `main` 4777caca3 plus local experiments. With `main`'s `HeldReads`, a steady-state `APS5_SAMPLE_COMMITTER` window put 16.3 % of the draw committer's samples in `HeldReads`. Of that: - 14.8 % was `ucrtbase` under the per-call `getenv` that #9490 removes; - about 1 % was the pipeline mutex (winpthreads); - the rest was the range scan. So in this game nearly all of the cost is the `getenv`. With #9490's change alone (same build, only `libSceAgcDriver.prx` swapped, 3 interleaved rounds), hub hold went from 10.50 to 11.68 FPS, and the committer from 25.5 to 21.9 µs per commit (details on #9490). I haven't measured this PR's skip on top of that. From the split above, its saving here would be at most the remaining ~1.5 % of committer samples. That still adds up across the ~370k commits per 10 s, but it is smaller than in your Yōtei profile, where the mutex dominated.
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!8911
No description provided.