perf(agc): clear the mirror of a depth plane instead of dispatching the UAV clear over it #7449

Closed
AlxcBTW wants to merge 3 commits from upstream-pr/7449 into main
AlxcBTW commented 2026-10-18 07:01:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-18T07:01:11Z.


What

#7178 left out the two whole-plane copies around the 15-word 8x8x1 image clear kernel when it clears a depth plane, but the dispatch itself was still recorded: a compute pass that stores one colour dword to every texel of the plane's colour mirror (DepthSurface::Storage no longer fills the mirror, StoreBack clears the depth image instead). At the title that is 64 MiB of stores per clear (a 16384x2048 plane at 16 bits), and up to 128 MiB on the larger planes in gameplay, that nobody reads.

VulkanDevice::recordDispatch now records vkCmdClearColorImage on the mirror in place of the dispatch when that dispatch is one of the clears #7178 takes, that is, when all of this holds:

  • Driver::dispatch matched the kernel (MatchStorageImageClear) over a registered depth surface and installed the DepthPlaneClear scope on the recording thread, and the dispatch is direct (no indirect arguments);
  • the dispatch writes the depth plane's mirror (DepthSurface::SkipsClearDispatch), the clear covers the whole plane, the mirror has the view's address, format, tile mode, dimension and the plane's extent, and the colour dword is still the one that was matched (the checks StoreOverwrite already made, now one function OverwriteOf that both use; the only new condition is that the mirror's width and height equal the plane's, which StorageViewMatches has already ensured when the mirror is made);
  • ClearColorForTexel gives an exact clear value for the colour in the mirror's format.

Then the pre-dispatch barrier is recorded (never merged away) with the transfer stage as its destination, the clear is recorded in place of vkCmdDispatch, and the trailing barrier also covers transfer writes. Everything else around it is as before: the descriptor set and pipeline are bound, the GPU timing and the notes of written images are made, and MarkGpuWrites marks the mirror as written. Storage still leaves out the copy-in and StoreBack still replaces the copy-out by a clear of the depth image (both #7178, unchanged), and a pending fill of #7131 is applied in Storage before any of it (ApplyFastClear), so nothing about fills changes. A dispatch that does not qualify is recorded as before.

The path is on by default. APS5_NO_DEPTH_CLEAR_DISPATCH_SKIP=1 records the dispatch again (like the other APS5_NO_* switches: set at all means off). The entry "Reused depth storage" in docs/dev/debt/libSceAgcDriver.md says so, and docs/dev/ENVIRONMENT.md has a row for APS5_NO_DEPTH_CLEAR_DISPATCH_SKIP.

Why the result is the same bytes:

  1. The kernel reads nothing from the image and stores one dword c to every texel its threads cover. #7178's matcher fixed the kernel's words, the group sizes and the registers, and the whole-plane condition makes that every texel of the mirror (the T# extent is the plane's extent). So after the dispatch the mirror is the constant store(c), and a clear of the whole image to the value that stores the same bits writes the same bytes.
  2. The colour goes through ClearColorForTexel for the mirror's format, which refuses NaN and denormals. The values the depth HLE takes are 0 or 1 through a 16-bit unorm view, 0 or 0xffff through a 16-bit uint view, and 0 or a normal float in (0, 1] through a 32-bit float or integer view; for these a device clear and the image store of the kernel give identical bytes (unorm 1.0 and 0.0 are 0xffff and 0 for any rounding, integer and float 32-bit values are bit copies). -0.0 is read as raw 0 by #7178 and clears to 0.
  3. The mirror keeps the marks that make it write back to guest memory (MarkGpuWrites runs as before), so guest memory gets the same bytes. The depth image is cleared exactly as #7178 does, in StoreBack.
  4. The colour is read when the dispatch is matched, again when the dispatch is replaced, and again when the copy-out is replaced (#7178). A value that changed before the dispatch is replaced keeps the dispatch; one that changed after keeps the copy-out, as in #7178.
  5. Not taken, so unchanged: indirect dispatches, partial coverage, other values and formats, stencil planes, layered views, dispatches that queue on the draw pipeline (the limit #7178 states).

Limits: equivalence to console behaviour is not measured on console hardware. The lab verify mode that compared both paths on a device is not in this PR; the argument above and the test below are.

Tested

  • Linux (Ubuntu 24.04, Mesa lavapipe), fork CI after the merge of main (bad09497c, base 0c6a5bd59) and the ENVIRONMENT.md row, at d4d6c1048 (the PR head fa32376e3 plus the CI scaffolding commit; run 39677504672, ctest regex agc_): 876 of 876 passed with 60 of them skipped for lack of a device capability, among them agc_driver_depth_clear_hle (passed, 2.26 s, not skipped). Not run on Windows.
  • agc_driver_depth_clear_hle (tests/execution/DepthClearHle.cpp) has four new cases, each run with the switch on and off on the same sequence of clears and the same expectations: a 64x32 D32F plane (producer 0.5; clears to 1.0 and 0.25 full, 0.75 on the left half, 2.0 and 0.125 full) and a 64x32 D16 plane (an R16 unorm view cleared to 1.0, 0.0 and 0.5). After the clears the depth tests of the harness' triangle must pass as the value says, the guest memory after the flush (the mirror's write-back) and the depth image (read back texel by texel through the mirror) must hold the cleared value in every texel, and the counters must say which dispatches were left out: 3 of 5 for the 32-bit plane (not the half plane, not 2.0) and 2 of 3 for the 16-bit plane (not 0.5), with the mirror clears adding up to 3 x 8 KiB and 2 x 4 KiB, and 0 with the switch off. The 16-bit case skips itself, as the existing 16-bit case does, on a device without the format. The case with the switch off is the comparison with the dispatch path: both modes must end with the same bytes.
  • Windows 11, NVIDIA, Minecraft Dungeons II (PPSA16064). Measured on the lab version 924e2474c of this change (fork branch lab/clear-kernel, on an older base than this PR: the lab stack best10, a run of lab changes of which this is the only difference between the arms), not on this PR's head; the PR head differs from it by the switch (the lab version was behind APS5_LAB_CLEAR_KERNEL), the shared OverwriteOf check with the width and height compare, the colour re-read when the dispatch is replaced, and the lab verify mode that is not in the PR. Job 99, APS5_PROFILE_GPU=1 on all rows, arm a without the change, arm b with it, trace digest figures:
row scene arm FPS frame p50 ms frame p99 ms GPU busy per present ms
ck-t-a-1 title a 9.35 106.5 120.9 77.4
ck-t-a-2 title a 9.28 107.2 122.1 77.5
ck-t-b-1 title b 9.95 99.6 122.3 72.3
ck-t-b-2 title b 9.92 100.3 115.0 72.2
ck-g-a-1 gameplay a 4.70 213.1 277.7 88.7
ck-g-a-2 gameplay a 8.60 119.6 266.2 65.2
ck-g-a-3 gameplay a 6.40 170.6 387.8 66.6
ck-g-b-1 gameplay b 5.90 178.8 434.9 70.4
ck-g-b-2 gameplay b 7.35 144.0 294.3 54.9
ck-g-b-3 gameplay b 4.85 207.1 283.9 64.2
ck-g-verify gameplay verify 4.70 214.4 391.0 69.6

At the title the mean FPS is 9.31 without and 9.93 with the change (+0.62, +6.7 %) and the mean GPU busy per present 77.5 ms against 72.2 ms (-5.3 ms); both rows of each arm agree, which makes the title figure the one I claim. The gameplay rows are memory-noisy (this machine has 31 GiB and the spread inside arm a alone is 4.7 to 8.6 FPS): mean FPS 6.57 without and 6.03 with, mean GPU busy 73.5 ms against 63.2 ms; I claim nothing for gameplay from them. Counters at the end of the b rows (cumulative per process): the clear was taken for 1546 of 1546 and 1534 of 1534 clear dispatches over a depth plane at the title and for 1685 of 1685, 2250 of 2250 and 1580 of 1580 in gameplay, with no decline for coverage, view or format. The verify row (gameplay, kernel recorded, then a copy of its result cleared and compared with it on a sample) compared 201 of 1493 clears texel by texel (every texel of each plane, 16,777,216 to 67,108,864 per plane), with 0 differing clears and 0 differing texels; there is no verify row for the title. Pictures were not compared. Traces are on the lab machine and I can attach them on request.

  • python3 tools/check_conventions.py --base origin/main passes. Based on 0c6a5bd59 (merged into the branch). tools/pr_overlap.py lists #6146 (the "Reused depth storage" line of the debt document) and #7390 (the lines of recordDispatch around the dispatch); neither implements the same function.

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 (PPSA16064 speed; no Game bring-up discussion yet)
  • GPUs tested: Mesa 25.2.8 lavapipe, Ubuntu 24.04 (all GPU tests); NVIDIA GeForce RTX 5070 Laptop GPU, driver 617.42, Windows 11 26200 (game rows only, GPU tests not run there)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4907119152 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-18T07:01:11Z. --- ### What #7178 left out the two whole-plane copies around the 15-word 8x8x1 image clear kernel when it clears a depth plane, but the dispatch itself was still recorded: a compute pass that stores one colour dword to every texel of the plane's colour mirror (`DepthSurface::Storage` no longer fills the mirror, `StoreBack` clears the depth image instead). At the title that is 64 MiB of stores per clear (a 16384x2048 plane at 16 bits), and up to 128 MiB on the larger planes in gameplay, that nobody reads. `VulkanDevice::recordDispatch` now records `vkCmdClearColorImage` on the mirror in place of the dispatch when that dispatch is one of the clears #7178 takes, that is, when all of this holds: - `Driver::dispatch` matched the kernel (`MatchStorageImageClear`) over a registered depth surface and installed the `DepthPlaneClear` scope on the recording thread, and the dispatch is direct (no indirect arguments); - the dispatch writes the depth plane's mirror (`DepthSurface::SkipsClearDispatch`), the clear covers the whole plane, the mirror has the view's address, format, tile mode, dimension and the plane's extent, and the colour dword is still the one that was matched (the checks `StoreOverwrite` already made, now one function `OverwriteOf` that both use; the only new condition is that the mirror's width and height equal the plane's, which `StorageViewMatches` has already ensured when the mirror is made); - `ClearColorForTexel` gives an exact clear value for the colour in the mirror's format. Then the pre-dispatch barrier is recorded (never merged away) with the transfer stage as its destination, the clear is recorded in place of `vkCmdDispatch`, and the trailing barrier also covers transfer writes. Everything else around it is as before: the descriptor set and pipeline are bound, the GPU timing and the notes of written images are made, and `MarkGpuWrites` marks the mirror as written. `Storage` still leaves out the copy-in and `StoreBack` still replaces the copy-out by a clear of the depth image (both #7178, unchanged), and a pending fill of #7131 is applied in `Storage` before any of it (`ApplyFastClear`), so nothing about fills changes. A dispatch that does not qualify is recorded as before. The path is on by default. `APS5_NO_DEPTH_CLEAR_DISPATCH_SKIP=1` records the dispatch again (like the other `APS5_NO_*` switches: set at all means off). The entry "Reused depth storage" in `docs/dev/debt/libSceAgcDriver.md` says so, and `docs/dev/ENVIRONMENT.md` has a row for `APS5_NO_DEPTH_CLEAR_DISPATCH_SKIP`. Why the result is the same bytes: 1. The kernel reads nothing from the image and stores one dword `c` to every texel its threads cover. #7178's matcher fixed the kernel's words, the group sizes and the registers, and the whole-plane condition makes that every texel of the mirror (the T# extent is the plane's extent). So after the dispatch the mirror is the constant `store(c)`, and a clear of the whole image to the value that stores the same bits writes the same bytes. 2. The colour goes through `ClearColorForTexel` for the mirror's format, which refuses NaN and denormals. The values the depth HLE takes are 0 or 1 through a 16-bit unorm view, 0 or 0xffff through a 16-bit uint view, and 0 or a normal float in (0, 1] through a 32-bit float or integer view; for these a device clear and the image store of the kernel give identical bytes (unorm 1.0 and 0.0 are 0xffff and 0 for any rounding, integer and float 32-bit values are bit copies). `-0.0` is read as raw 0 by #7178 and clears to 0. 3. The mirror keeps the marks that make it write back to guest memory (`MarkGpuWrites` runs as before), so guest memory gets the same bytes. The depth image is cleared exactly as #7178 does, in `StoreBack`. 4. The colour is read when the dispatch is matched, again when the dispatch is replaced, and again when the copy-out is replaced (#7178). A value that changed before the dispatch is replaced keeps the dispatch; one that changed after keeps the copy-out, as in #7178. 5. Not taken, so unchanged: indirect dispatches, partial coverage, other values and formats, stencil planes, layered views, dispatches that queue on the draw pipeline (the limit #7178 states). Limits: equivalence to console behaviour is not measured on console hardware. The lab verify mode that compared both paths on a device is not in this PR; the argument above and the test below are. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Linux (Ubuntu 24.04, Mesa lavapipe), fork CI after the merge of `main` (bad09497c, base 0c6a5bd59) and the ENVIRONMENT.md row, at d4d6c1048 (the PR head fa32376e3 plus the CI scaffolding commit; run 39677504672, ctest regex `agc_`): 876 of 876 passed with 60 of them skipped for lack of a device capability, among them `agc_driver_depth_clear_hle` (passed, 2.26 s, not skipped). Not run on Windows. - `agc_driver_depth_clear_hle` (`tests/execution/DepthClearHle.cpp`) has four new cases, each run with the switch on and off on the same sequence of clears and the same expectations: a 64x32 D32F plane (producer 0.5; clears to 1.0 and 0.25 full, 0.75 on the left half, 2.0 and 0.125 full) and a 64x32 D16 plane (an R16 unorm view cleared to 1.0, 0.0 and 0.5). After the clears the depth tests of the harness' triangle must pass as the value says, the guest memory after the flush (the mirror's write-back) and the depth image (read back texel by texel through the mirror) must hold the cleared value in every texel, and the counters must say which dispatches were left out: 3 of 5 for the 32-bit plane (not the half plane, not 2.0) and 2 of 3 for the 16-bit plane (not 0.5), with the mirror clears adding up to 3 x 8 KiB and 2 x 4 KiB, and 0 with the switch off. The 16-bit case skips itself, as the existing 16-bit case does, on a device without the format. The case with the switch off is the comparison with the dispatch path: both modes must end with the same bytes. - Windows 11, NVIDIA, Minecraft Dungeons II (PPSA16064). Measured on the lab version 924e2474c of this change (fork branch `lab/clear-kernel`, on an older base than this PR: the lab stack best10, a run of lab changes of which this is the only difference between the arms), not on this PR's head; the PR head differs from it by the switch (the lab version was behind `APS5_LAB_CLEAR_KERNEL`), the shared `OverwriteOf` check with the width and height compare, the colour re-read when the dispatch is replaced, and the lab verify mode that is not in the PR. Job 99, `APS5_PROFILE_GPU=1` on all rows, arm a without the change, arm b with it, trace digest figures: | row | scene | arm | FPS | frame p50 ms | frame p99 ms | GPU busy per present ms | |---|---|---|---|---|---|---| | ck-t-a-1 | title | a | 9.35 | 106.5 | 120.9 | 77.4 | | ck-t-a-2 | title | a | 9.28 | 107.2 | 122.1 | 77.5 | | ck-t-b-1 | title | b | 9.95 | 99.6 | 122.3 | 72.3 | | ck-t-b-2 | title | b | 9.92 | 100.3 | 115.0 | 72.2 | | ck-g-a-1 | gameplay | a | 4.70 | 213.1 | 277.7 | 88.7 | | ck-g-a-2 | gameplay | a | 8.60 | 119.6 | 266.2 | 65.2 | | ck-g-a-3 | gameplay | a | 6.40 | 170.6 | 387.8 | 66.6 | | ck-g-b-1 | gameplay | b | 5.90 | 178.8 | 434.9 | 70.4 | | ck-g-b-2 | gameplay | b | 7.35 | 144.0 | 294.3 | 54.9 | | ck-g-b-3 | gameplay | b | 4.85 | 207.1 | 283.9 | 64.2 | | ck-g-verify | gameplay | verify | 4.70 | 214.4 | 391.0 | 69.6 | At the title the mean FPS is 9.31 without and 9.93 with the change (+0.62, +6.7 %) and the mean GPU busy per present 77.5 ms against 72.2 ms (-5.3 ms); both rows of each arm agree, which makes the title figure the one I claim. The gameplay rows are memory-noisy (this machine has 31 GiB and the spread inside arm a alone is 4.7 to 8.6 FPS): mean FPS 6.57 without and 6.03 with, mean GPU busy 73.5 ms against 63.2 ms; I claim nothing for gameplay from them. Counters at the end of the b rows (cumulative per process): the clear was taken for 1546 of 1546 and 1534 of 1534 clear dispatches over a depth plane at the title and for 1685 of 1685, 2250 of 2250 and 1580 of 1580 in gameplay, with no decline for coverage, view or format. The verify row (gameplay, kernel recorded, then a copy of its result cleared and compared with it on a sample) compared 201 of 1493 clears texel by texel (every texel of each plane, 16,777,216 to 67,108,864 per plane), with 0 differing clears and 0 differing texels; there is no verify row for the title. Pictures were not compared. Traces are on the lab machine and I can attach them on request. - `python3 tools/check_conventions.py --base origin/main` passes. Based on 0c6a5bd59 (merged into the branch). `tools/pr_overlap.py` lists #6146 (the "Reused depth storage" line of the debt document) and #7390 (the lines of `recordDispatch` around the dispatch); neither implements the same function. ### 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 (PPSA16064 speed; no Game bring-up discussion yet) - [x] GPUs tested: Mesa 25.2.8 lavapipe, Ubuntu 24.04 (all GPU tests); NVIDIA GeForce RTX 5070 Laptop GPU, driver 617.42, Windows 11 26200 (game rows only, GPU tests not run there) - [x] AI-assisted: yes
LeandroLP23 commented 2026-10-18 16:33:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T16:33:36Z.


AMD on Windows: the tests this PR names pass on an RDNA 3.5 GPU.

Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release. main 6efb7261b with this PR (17efa3696) merged, together with #7296, #7446, #7377, #7445, #6708, #6748, #6785, #6706, #6613, #7391, #7489, #7484, #7514. They were built once, so the result is for the combination; each merge was clean.

  • agc_driver_depth_clear_hle: pass, 3 runs of 3.
  • Every agc_* test on the combined build: 713 of 716 pass. The 3 that fail, agc_driver_host_import_lifetime, agc_driver_quad_pixel_mask and agc_driver_layered_volume_vertex_no_gpl, fail the same way on unchanged main here, so none comes from these PRs.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252348680 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449#issuecomment-6252348680). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T16:33:36Z. --- AMD on Windows: the tests this PR names pass on an RDNA 3.5 GPU. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release. `main` `6efb7261b` with this PR (`17efa3696`) merged, together with #7296, #7446, #7377, #7445, #6708, #6748, #6785, #6706, #6613, #7391, #7489, #7484, #7514. They were built once, so the result is for the combination; each merge was clean. - `agc_driver_depth_clear_hle`: pass, 3 runs of 3. - Every `agc_*` test on the combined build: 713 of 716 pass. The 3 that fail, `agc_driver_host_import_lifetime`, `agc_driver_quad_pixel_mask` and `agc_driver_layered_volume_vertex_no_gpl`, fail the same way on unchanged `main` here, so none comes from these PRs. AI-assisted
oneandonlydean commented 2026-10-18 19:51:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T19:51:59Z.


Thanks, the equivalence argument and the on/off cases are convincing. One robustness point in recordDispatch:

PlanDepthClearDispatchSkip and RecordDepthClearDispatchSkip each take surfacesMutex() and evaluate SkipsClearDispatch separately, and the leading barrier (with the transfer stage as its destination) is recorded between them. If the second evaluation disagrees with the first, RecordDepthClearDispatchSkip throws "the mirror of a depth clear dispatch belongs to no depth surface any more". That can happen if the colour dword in guest memory changes in between, or another thread retires the surface or replaces its mirror. That makes a guest-visible race an abort, and the PR text and the debt line say "a changed value keeps the dispatch", which isn't what happens after the plan.

Could the plan return what the record needs: the surface (or the mirror plus its VkClearColorValue) decided under one lock, so the record doesn't re-decide? Holding the lock across both, or having the record fall back to the dispatch, would also work, but the fallback would need the compute-stage barrier. Then the only re-read of the colour is the one before the plan, and the debt line can say so.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6254394310 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449#issuecomment-6254394310). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-18T19:51:59Z. --- Thanks, the equivalence argument and the on/off cases are convincing. One robustness point in `recordDispatch`: `PlanDepthClearDispatchSkip` and `RecordDepthClearDispatchSkip` each take `surfacesMutex()` and evaluate `SkipsClearDispatch` separately, and the leading barrier (with the transfer stage as its destination) is recorded between them. If the second evaluation disagrees with the first, `RecordDepthClearDispatchSkip` throws "the mirror of a depth clear dispatch belongs to no depth surface any more". That can happen if the colour dword in guest memory changes in between, or another thread retires the surface or replaces its mirror. That makes a guest-visible race an abort, and the PR text and the debt line say "a changed value keeps the dispatch", which isn't what happens after the plan. Could the plan return what the record needs: the surface (or the mirror plus its `VkClearColorValue`) decided under one lock, so the record doesn't re-decide? Holding the lock across both, or having the record fall back to the dispatch, would also work, but the fallback would need the compute-stage barrier. Then the only re-read of the colour is the one before the plan, and the debt line can say so.
savvaniss commented 2026-10-19 06:36:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T06:36:05Z.


Intel and AMD Windows data: agc_driver_depth_clear_hle passes with this PR on an Intel UHD 770 and an AMD RX 9070 XT.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head 17efa3696 merged into main 07377573f.

Tests, ×3 UHD 770 RX 9070 XT
This head: agc_driver_depth_clear_hle pass pass

The test files don't build on main without the rest of the PR, so there is no before-run.

This is a correctness check only; I measured no speed.

I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7432, #7426, #7413, #7480, #7465, #7466, #7464, #7489, #7673, #7560). Neither GPU showed a failure beyond main's own: the five image-table tests (#6647) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_driver_layered_volume_vertex_no_gpl (#4768) on the RX 9070 XT.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261246574 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449#issuecomment-6261246574). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T06:36:05Z. --- Intel and AMD Windows data: `agc_driver_depth_clear_hle` passes with this PR on an Intel UHD 770 and an AMD RX 9070 XT. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest. Intel UHD Graphics 770 (`8086:a780`), driver 32.0.101.7088. AMD Radeon RX 9070 XT (`1002:7550`), driver 32.0.31041.1004, with `VkCache` emptied first. This head `17efa3696` merged into `main` `07377573f`. | Tests, ×3 | UHD 770 | RX 9070 XT | |---|---|---| | This head: `agc_driver_depth_clear_hle` | pass | pass | The test files don't build on `main` without the rest of the PR, so there is no before-run. This is a correctness check only; I measured no speed. I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7432, #7426, #7413, #7480, #7465, #7466, #7464, #7489, #7673, #7560). Neither GPU showed a failure beyond `main`'s own: the five image-table tests (#6647) and `agc_driver_sample_multisample_target` (#6957) on the UHD 770, and `agc_driver_layered_volume_vertex_no_gpl` (#4768) on the RX 9070 XT. AI-assisted: yes (Claude Code)
blawesom commented 2026-10-19 09:15:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T09:15:32Z.


Rebase handoff — rebased onto current main (authorship unchanged). One conflict in VulkanDevice.cpp: your mirror-clear skip kept before main's newer indirect-buffer dispatch form. One ENVIRONMENT.md row added for APS5_NO_DEPTH_CLEAR_DISPATCH_SKIP.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; the depth tests pass (25/25); conventions pass; full suite green apart from the four known main regressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7449
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 9e09b06cb.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6263815904 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449#issuecomment-6263815904). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-19T09:15:32Z. --- **Rebase handoff** — rebased onto current `main` (authorship unchanged). One conflict in `VulkanDevice.cpp`: your mirror-clear skip kept before `main`'s newer indirect-buffer dispatch form. One `ENVIRONMENT.md` row added for `APS5_NO_DEPTH_CLEAR_DISPATCH_SKIP`. Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): builds; the depth tests pass (25/25); conventions pass; **full suite green apart from the four known `main` regressions** (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR. **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/7449 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `9e09b06cb`.
github-actions[bot] commented 2026-10-21 21:16:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T21:16:59Z.


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:6326748866 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449#issuecomment-6326748866). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T21:16:59Z. --- <!-- 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`.
CnRJay commented 2026-11-01 19:57:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:57:47Z.

Review: COMMENTED


Three gaps in the evidence, all of them things the AGC rules ask for.

1. The speed numbers are not from this change. The Minecraft Dungeons II rows are measured on lab/clear-kernel 924e2474c, on an older base, behind APS5_LAB_CLEAR_KERNEL, and the PR text itself lists what differs from the PR head (the OverwriteOf width/height compare, the colour re-read at dispatch replacement, the verify mode). All rows also run with APS5_PROFILE_GPU=1. The only figure claimed is the title row (+6.7 % FPS, -5.3 ms GPU busy) from two runs per arm; the gameplay rows go the other way (6.57 to 6.03 FPS) and are set aside as noise. Please give tools/trace_digest.py summaries of main and of this PR head from the same machine and scene, without the profile switch.

2. No validation-layer run on a real GPU. RecordMirrorClear adds vkCmdClearColorImage on the mirror in VK_IMAGE_LAYOUT_GENERAL, with new TRANSFER stage masks in the pre and post barriers in recordDispatch. Nothing in the diff touches the mirror's usage flags, so is VK_IMAGE_USAGE_TRANSFER_DST_BIT already set on every storage mirror that SkipsClearDispatch can accept? The 876 lavapipe tests ran without VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, and the NVIDIA runs are game rows only ("GPU tests not run there"). Please run the focused agc_driver_depth_clear_hle tests on main and on this head with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation on one GPU, and show no new VUID- lines.

3. Per-dispatch lock. DepthClearDispatchSkipActive() checks the thread-local scope first, so ordinary dispatches stay cheap, but a matching clear takes surfacesMutex() and scans every surface twice (PlanDepthClearDispatchSkip, then RecordDepthClearDispatchSkip), with SkipsClearDispatch recomputing OverwriteOf and ClearColorForTexel in both. Resolving the surface once in the plan step and handing it to the record step would avoid the second scan.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729949673 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449#pullrequestreview-5729949673). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:57:47Z. **Review:** COMMENTED --- Three gaps in the evidence, all of them things the AGC rules ask for. **1. The speed numbers are not from this change.** The Minecraft Dungeons II rows are measured on `lab/clear-kernel` 924e2474c, on an older base, behind `APS5_LAB_CLEAR_KERNEL`, and the PR text itself lists what differs from the PR head (the `OverwriteOf` width/height compare, the colour re-read at dispatch replacement, the verify mode). All rows also run with `APS5_PROFILE_GPU=1`. The only figure claimed is the title row (+6.7 % FPS, -5.3 ms GPU busy) from two runs per arm; the gameplay rows go the other way (6.57 to 6.03 FPS) and are set aside as noise. Please give `tools/trace_digest.py` summaries of `main` and of this PR head from the same machine and scene, without the profile switch. **2. No validation-layer run on a real GPU.** `RecordMirrorClear` adds `vkCmdClearColorImage` on the mirror in `VK_IMAGE_LAYOUT_GENERAL`, with new `TRANSFER` stage masks in the pre and post barriers in `recordDispatch`. Nothing in the diff touches the mirror's usage flags, so is `VK_IMAGE_USAGE_TRANSFER_DST_BIT` already set on every storage mirror that `SkipsClearDispatch` can accept? The 876 lavapipe tests ran without `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, and the NVIDIA runs are game rows only ("GPU tests not run there"). Please run the focused `agc_driver_depth_clear_hle` tests on `main` and on this head with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` on one GPU, and show no new `VUID-` lines. **3. Per-dispatch lock.** `DepthClearDispatchSkipActive()` checks the thread-local scope first, so ordinary dispatches stay cheap, but a matching clear takes `surfacesMutex()` and scans every surface twice (`PlanDepthClearDispatchSkip`, then `RecordDepthClearDispatchSkip`), with `SkipsClearDispatch` recomputing `OverwriteOf` and `ClearColorForTexel` in both. Resolving the surface once in the plan step and handing it to the record step would avoid the second scan.
MarcZX10 commented 2026-11-16 20:17:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T20:17:14Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change based on the code and test evidence reviewed; the author’s reported CI run passed, but I did not run checks locally.

What I ran

Reviewed head fa32376e3a6562ea19b32fd5f9d4b6bf43ad5f1f. Read the prepared description, commits, manifest and diff, plus targeted source and test ranges through repo_read.py. No commands or tests were run.

Results

Check Result Note
Targeted source review passed Dispatch replacement and depth mirror clear path inspected
Automated checks not run CI results are author reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

The changed files listed in manifest.json were all included in the review bundle; I read the relevant changed functions and test sections, not every line of every changed file. The reported lavapipe CI, Windows behavior, console equivalence, and performance results were not independently verified. Excluded files: none reported in the review bundle.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5926883178 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7449#pullrequestreview-5926883178). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T20:17:14Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change based on the code and test evidence reviewed; the author’s reported CI run passed, but I did not run checks locally. ## What I ran Reviewed head `fa32376e3a6562ea19b32fd5f9d4b6bf43ad5f1f`. Read the prepared description, commits, manifest and diff, plus targeted source and test ranges through `repo_read.py`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Targeted source review | passed | Dispatch replacement and depth mirror clear path inspected | | Automated checks | not run | CI results are author reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The changed files listed in `manifest.json` were all included in the review bundle; I read the relevant changed functions and test sections, not every line of every changed file. The reported lavapipe CI, Windows behavior, console equivalence, and performance results were not independently verified. Excluded files: none reported in the review bundle. ## To get this to a good state Nothing is required.

Pull request closed

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!7449
No description provided.