fix(agc): separate possible writes from complete coverage #7233

Merged
MarcZX10 merged 30 commits from upstream-pr/7233 into main 2026-10-22 12:53:33 +00:00
MarcZX10 commented 2026-10-17 18:27:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T18:27:46Z.


What

StoredAllSince_nid_no_patch is used as byte-complete evidence for native depth clears. BDA shader reports are page-granular, and descriptor-bound direct/copy-back ranges describe writable ranges rather than exact byte stores. They were recorded through MarkWritten, allowing those possible writes to prove complete coverage.

This adds MarkPossiblyWritten and keeps possible-write intervals separate from exact writes. Both kinds still invalidate overlapping readers; only exact writes contribute to complete-coverage queries. BDA page reports and direct/copy-back shader ranges use the possible-write path. The tests cover sparse ranges, repeated reports, and retaining an exact store when a possible whole-block report arrives.

The recognized full HTILE-clear kernel is an explicit producer exception: its exact kernel match and full dispatch extent prove the complete range. DepthSurface accepts that proof while still checking CPU-write races and every HTILE value. A new native-depth regression verifies this path when the tracker has only possible-write evidence, preserving the positive BDA control from #7228.

Related: #6868 independently identified the repeated-interval retention bug for exact writes. This PR now applies containment reuse and oldest-generation eviction to both exact and possible-write histories, while keeping their slots independent. The two PRs need coordination against the updated branch before merge.

Fixes #7220.

Tested

  • Exact current head eb55d58728f367f527253b3ae5b30ed45030fdf3 was built with GCC 13.3 and GCC 16.2.1. Miles Coviello reports agc_driver_native_multisample_depth_tests --clears passed 3/3 with and without Khronos validation on an NVIDIA RTX 4070 Ti; the four selected native-depth CTests passed 4/4 in both modes, with no validation VUIDs.
  • SleglJan reports the exact-head --clears test passed three times on each of an RTX 3080 (NVIDIA 615.78.08), a Ryzen 9 7950X3D iGPU (RADV, Mesa 26.2.4), and lavapipe (Mesa 26.2.4); the lavapipe runs cover both with and without /dev/udmabuf. NVIDIA follows the tracked-store assertion (checked=27 unavailable=0). RADV and lavapipe report the write-coverage skip and then verify the current fail-safe refusal for uncovered HTILE (native multisample depth clear requires tracked HTILE generations); they do not claim successful output checks for that path. Counts: RADV checked=27 unavailable=0; lavapipe checked=19 unavailable=8. The exact-head BDA-clear test passes 3/3 on RTX 3080 and self-skips on lavapipe. Khronos validation on NVIDIA reports no VUID.
  • This host cannot run the target because its CPU lacks required emulator features and it lacks write-watch support. No local runtime pass is claimed. Current-head git diff --check and the conventions check pass. Hosted eligibility, conventions, labels and report pass; build/runtime workflows are skipped by path policy.
  • Device scope: NVIDIA validates the tracked HTILE-clear path. RADV and lavapipe currently verify safe refusal when HTILE writes are uncovered; full write-watch coverage on those drivers depends on #8759.

Checklist

  • Based on current main; no other open PR fixes the possible-write coverage issue (#6868 is related interval-retention work)
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw or are documented as silent stubs; n/a
  • No notes, investigation .md files or images added to the repository
  • No new third-party code
  • Generic behavior
  • Depends on: none
  • Fixes: #7220
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 4070 Ti and RTX 3080; AMD Ryzen 9 7950X3D iGPU (RADV); lavapipe
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4902776888 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T18:27:46Z. --- ### What `StoredAllSince_nid_no_patch` is used as byte-complete evidence for native depth clears. BDA shader reports are page-granular, and descriptor-bound direct/copy-back ranges describe writable ranges rather than exact byte stores. They were recorded through `MarkWritten`, allowing those possible writes to prove complete coverage. This adds `MarkPossiblyWritten` and keeps possible-write intervals separate from exact writes. Both kinds still invalidate overlapping readers; only exact writes contribute to complete-coverage queries. BDA page reports and direct/copy-back shader ranges use the possible-write path. The tests cover sparse ranges, repeated reports, and retaining an exact store when a possible whole-block report arrives. The recognized full HTILE-clear kernel is an explicit producer exception: its exact kernel match and full dispatch extent prove the complete range. `DepthSurface` accepts that proof while still checking CPU-write races and every HTILE value. A new native-depth regression verifies this path when the tracker has only possible-write evidence, preserving the positive BDA control from #7228. Related: #6868 independently identified the repeated-interval retention bug for exact writes. This PR now applies containment reuse and oldest-generation eviction to both exact and possible-write histories, while keeping their slots independent. The two PRs need coordination against the updated branch before merge. Fixes #7220. ### Tested - Exact current head `eb55d58728f367f527253b3ae5b30ed45030fdf3` was built with GCC 13.3 and GCC 16.2.1. Miles Coviello reports `agc_driver_native_multisample_depth_tests --clears` passed 3/3 with and without Khronos validation on an NVIDIA RTX 4070 Ti; the four selected native-depth CTests passed 4/4 in both modes, with no validation VUIDs. - SleglJan reports the exact-head `--clears` test passed three times on each of an RTX 3080 (NVIDIA 615.78.08), a Ryzen 9 7950X3D iGPU (RADV, Mesa 26.2.4), and lavapipe (Mesa 26.2.4); the lavapipe runs cover both with and without `/dev/udmabuf`. NVIDIA follows the tracked-store assertion (`checked=27 unavailable=0`). RADV and lavapipe report the write-coverage skip and then verify the current fail-safe refusal for uncovered HTILE (`native multisample depth clear requires tracked HTILE generations`); they do not claim successful output checks for that path. Counts: RADV `checked=27 unavailable=0`; lavapipe `checked=19 unavailable=8`. The exact-head BDA-clear test passes 3/3 on RTX 3080 and self-skips on lavapipe. Khronos validation on NVIDIA reports no VUID. - This host cannot run the target because its CPU lacks required emulator features and it lacks write-watch support. No local runtime pass is claimed. Current-head `git diff --check` and the conventions check pass. Hosted eligibility, conventions, labels and report pass; build/runtime workflows are skipped by path policy. - Device scope: NVIDIA validates the tracked HTILE-clear path. RADV and lavapipe currently verify safe refusal when HTILE writes are uncovered; full write-watch coverage on those drivers depends on #8759. ### Checklist - [x] Based on current `main`; no other open PR fixes the possible-write coverage issue (#6868 is related interval-retention work) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw or are documented as silent stubs; n/a - [x] No notes, investigation `.md` files or images added to the repository - [x] No new third-party code - [x] Generic behavior - [x] Depends on: none - [x] Fixes: #7220 - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 4070 Ti and RTX 3080; AMD Ryzen 9 7950X3D iGPU (RADV); lavapipe - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-17 18:35:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T18:35:42Z.


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

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6169 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1732-1733
PR 6804 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp L276, L360
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp L598
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L4669-4670, L5076
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1712
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1712
PR 8105 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp L121, L142, L465, L494-495
core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp L57
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L2186-2187
PR 8126 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L5176, L5264, L5294
PR 9508 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1712

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 1191 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 2434 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6187 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6300 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6501 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6539 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6788 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6868 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 6879 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 6960 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7457 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7604 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7705 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 8014 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8278 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8527 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 8672 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 9335 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9672 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 9673 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 9674 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 9675 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 9676 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6238680525 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6238680525). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T18:35:42Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6169](https://www.github.com/boykopovar/AnyPS5/pull/6169) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1732-1733](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1732-L1733) | | | | [PR 6804](https://www.github.com/boykopovar/AnyPS5/pull/6804) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp` [L276](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp#L276), [L360](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp#L360)<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp` [L598](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp#L598)<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` [L4669-4670](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L4669-L4670), [L5076](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L5076) | | | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1712](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1712) | | | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1712](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1712) | | | | [PR 8105](https://www.github.com/boykopovar/AnyPS5/pull/8105) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp` [L121](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp#L121), [L142](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp#L142), [L465](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp#L465), [L494-495](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp#L494-L495)<br>`core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp` [L57](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp#L57)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L2186-2187](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L2186-L2187) | | | | [PR 8126](https://www.github.com/boykopovar/AnyPS5/pull/8126) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` [L5176](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L5176), [L5264](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L5264), [L5294](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L5294) | | | | [PR 9508](https://www.github.com/boykopovar/AnyPS5/pull/9508) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1712](https://github.com/boykopovar/AnyPS5/blob/8b3a6ba88d8fc74e768f1a7e8e9e36fb69842768/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1712) | | | 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 1191](https://www.github.com/boykopovar/AnyPS5/pull/1191) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 4449](https://www.github.com/boykopovar/AnyPS5/pull/4449) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 4472](https://www.github.com/boykopovar/AnyPS5/pull/4472) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 6960](https://www.github.com/boykopovar/AnyPS5/pull/6960) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 7275](https://www.github.com/boykopovar/AnyPS5/pull/7275) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 7457](https://www.github.com/boykopovar/AnyPS5/pull/7457) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7705](https://www.github.com/boykopovar/AnyPS5/pull/7705) | `core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 8278](https://www.github.com/boykopovar/AnyPS5/pull/8278) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 8527](https://www.github.com/boykopovar/AnyPS5/pull/8527) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 8672](https://www.github.com/boykopovar/AnyPS5/pull/8672) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 9335](https://www.github.com/boykopovar/AnyPS5/pull/9335) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 9356](https://www.github.com/boykopovar/AnyPS5/pull/9356) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 9387](https://www.github.com/boykopovar/AnyPS5/pull/9387) | `core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 9672](https://www.github.com/boykopovar/AnyPS5/pull/9672) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 9673](https://www.github.com/boykopovar/AnyPS5/pull/9673) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 9674](https://www.github.com/boykopovar/AnyPS5/pull/9674) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 9675](https://www.github.com/boykopovar/AnyPS5/pull/9675) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` | | [PR 9676](https://www.github.com/boykopovar/AnyPS5/pull/9676) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` |
EagleBearerYS commented 2026-10-17 18:45:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-17T18:45:29Z.


Heads-up from #6455, which conflicts with this PR in Execution/src/GuestMemory.cpp. #6455 adds WriteTracker::stampWatchedPart, which stamps the watched blocks of a store into partly watched memory. It calls noteDriverStore from the partly watched paths of storeOwn and MarkWritten. With this PR's complete flag, the merge passes true from storeOwn and markWritten's own flag from there, so a possible write into partly watched memory stays a possible write rather than becoming complete evidence. Whichever of the two lands second can take that resolution. If this PR lands first, #6455's merge of main will carry it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6238845509 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6238845509). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-17T18:45:29Z. --- Heads-up from #6455, which conflicts with this PR in `Execution/src/GuestMemory.cpp`. #6455 adds `WriteTracker::stampWatchedPart`, which stamps the watched blocks of a store into partly watched memory. It calls `noteDriverStore` from the partly watched paths of `storeOwn` and `MarkWritten`. With this PR's `complete` flag, the merge passes `true` from `storeOwn` and `markWritten`'s own flag from there, so a possible write into partly watched memory stays a possible write rather than becoming complete evidence. Whichever of the two lands second can take that resolution. If this PR lands first, #6455's merge of `main` will carry it.
oneandonlydean commented 2026-10-17 18:46:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T18:46:49Z.


Thanks for this. Review found a blocking problem.

This takes the same approach as the earlier #7220 proposal (5a9b4c22f): a BDA page report becomes a possible write that doesn't count for StoredAllSince, and the direct and copy-back producers are converted the same way. The only consumer of that distinction is Require(StoredAllSince) in CheckCurrent (core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:215). So a legitimate full native HTILE clear through BDA would now throw "no complete tracked HTILE store". That is exactly the case #7228 tests, and 5a9b4c22f failed #7228's test 3/3 on NVIDIA and AMD with that message.

The PR has no GPU run, and its one unit test is skipped in CI, so nothing here exercises that path.

A fix would need a recognized full-range clear to record an exact store, so that StoredAllSince still holds for it. Since #7228 is the regression test for this, it should land first; running it against this branch is the quickest check.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6238867509 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6238867509). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T18:46:49Z. --- Thanks for this. Review found a blocking problem. This takes the same approach as the earlier #7220 proposal (5a9b4c22f): a BDA page report becomes a possible write that doesn't count for `StoredAllSince`, and the direct and copy-back producers are converted the same way. The only consumer of that distinction is `Require(StoredAllSince)` in `CheckCurrent` (core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:215). So a legitimate full native HTILE clear through BDA would now throw "no complete tracked HTILE store". That is exactly the case #7228 tests, and 5a9b4c22f failed #7228's test 3/3 on NVIDIA and AMD with that message. The PR has no GPU run, and its one unit test is skipped in CI, so nothing here exercises that path. A fix would need a recognized full-range clear to record an exact store, so that `StoredAllSince` still holds for it. Since #7228 is the regression test for this, it should land first; running it against this branch is the quickest check.
Amoenus commented 2026-10-17 19:08:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T19:08:23Z.


Native HTILE consumer follow-up: #7371

Merge order: #7233 first, then #7371. The refreshed handoff is 191060e6fb, based on main 0393728fd3 and this PR's 2e048f56ff (adapted parent 2ebf5005c0). Own two-commit scope: five files, +70/-5, production handoff 34 added lines; unchanged added/removed lines. Marc's prerequisite history and Jan Šlégl's tracker-test attribution are preserved.

The follow-up registers a recognized queued clear's pending range and settles it before cached-owner, sampled-texture or attachment consumption. Settlement releases the surface mutex, and only an explicitly queued recognized producer enables it. Unknown writers, CPU races, missing complete coverage and unsupported metadata remain refused.

Windows: full default build, 54 focused passes on literal main and 54 on the change (36 GPU / 18 CPU each). Removing only the production handoff makes the BDA consumer test fail 3/3 per RTX 5080/Radeon Graphics; restored matching runtime passes 3/3 each. Actual devices and Khronos insertion verified, no selected skips/timeouts/VUIDs/errors/warnings. Detailed commands, drivers and analysis limitations are in #7371.

The prerequisite's DriverDispatch case still fails promptly on both GPUs with or without the handoff; it is excluded from passing counts. Maintained separate report. No new focused title replay or Driver/PM4 completion pass is claimed.

AI-assisted code/validation/report: Codex; author responsible.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6239238188 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6239238188). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-17T19:08:23Z. --- ### Native HTILE consumer follow-up: #7371 **Merge order: #7233 first, then #7371.** The refreshed handoff is [191060e6fb](https://github.com/Amoenus/AnyPS5/commit/191060e6fbca37a713f25eb15312505ec585fa28), based on main `0393728fd3` and this PR's `2e048f56ff` (adapted parent `2ebf5005c0`). [Own two-commit scope](https://github.com/Amoenus/AnyPS5/compare/2ebf5005c03809739ce6df4573457acee0f3825a...191060e6fbca37a713f25eb15312505ec585fa28): five files, +70/-5, production handoff 34 added lines; unchanged added/removed lines. Marc's prerequisite history and Jan Šlégl's tracker-test attribution are preserved. The follow-up registers a recognized queued clear's pending range and settles it before cached-owner, sampled-texture or attachment consumption. Settlement releases the surface mutex, and only an explicitly queued recognized producer enables it. Unknown writers, CPU races, missing complete coverage and unsupported metadata remain refused. Windows: full default build, 54 focused passes on literal main and 54 on the change (36 GPU / 18 CPU each). Removing only the production handoff makes the BDA consumer test fail 3/3 per RTX 5080/Radeon Graphics; restored matching runtime passes 3/3 each. Actual devices and Khronos insertion verified, no selected skips/timeouts/VUIDs/errors/warnings. Detailed commands, drivers and analysis limitations are in #7371. The prerequisite's DriverDispatch case **still fails promptly on both GPUs with or without the handoff**; it is excluded from passing counts. [Maintained separate report](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244828184). No new focused title replay or Driver/PM4 completion pass is claimed. AI-assisted code/validation/report: Codex; author responsible. <!-- codex-htile-queued-consumer-10a1-proposal-v1 -->
oneandonlydean commented 2026-10-17 19:46:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T19:46:52Z.


Thanks for the follow-up. The #7228 BDA clear now goes through, but I don't think f0303b3 is mergeable yet, and the agc_driver_native_depth_clear_refusals failure Amoenus reported is the symptom:

  1. clearKernelProvesCoverage is always true. It's only assigned in NoteHtileDepthClear (DepthSurface.cpp:1292), as nativeBytes == bytes && nativeBytes >= metadata.bytes, inside the else of the check that already rejected nativeBytes != bytes || nativeBytes < metadata.bytes. So the StoredAllSince_nid_no_patch branch in CheckCurrent (:216) can never run, and every clear is validated by StoredOver alone.
  2. StoredOver counts possible pieces (possiblePieces, possibleWhole, possibleDropped) and returns true for unwatched or uncovered ranges. So after this change, a possible write to any byte of HTILE counts as coverage, which is the thing the PR sets out to separate. The new PossibleStore case in --clears asserts exactly this: a MarkPossiblyWritten-only HTILE completes the clear.
  3. In --clear-refusals, PartialStore (4 bytes stored) now passes the coverage check and is only refused by the HTILE value check, because the rest of the fixture's HTILE doesn't hold the clear pattern. If it did (e.g. a repeated clear to the same value), the partial store would be accepted. Because TargetRefuses throws on the first mismatch, the remaining six refusal cases (CpuWrite through Overlap) don't run at all.

A possible direction: derive the "kernel proves coverage" bit from the recognized clear dispatch's actual write extent, or record the recognized clear's write as a complete store once it has executed, and keep StoredAllSince_nid_no_patch as the guard. --clear-refusals should then pass unchanged. I'd also add a refusal case where the unstored HTILE words already hold the clear pattern, and make PossibleStore a refusal rather than a success. The #7228 BDA positive and the #7220 sparse-store control should both still pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6239883507 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6239883507). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T19:46:52Z. --- Thanks for the follow-up. The #7228 BDA clear now goes through, but I don't think f0303b3 is mergeable yet, and the `agc_driver_native_depth_clear_refusals` failure Amoenus reported is the symptom: 1. `clearKernelProvesCoverage` is always true. It's only assigned in `NoteHtileDepthClear` (DepthSurface.cpp:1292), as `nativeBytes == bytes && nativeBytes >= metadata.bytes`, inside the `else` of the check that already rejected `nativeBytes != bytes || nativeBytes < metadata.bytes`. So the `StoredAllSince_nid_no_patch` branch in `CheckCurrent` (:216) can never run, and every clear is validated by `StoredOver` alone. 2. `StoredOver` counts possible pieces (`possiblePieces`, `possibleWhole`, `possibleDropped`) and returns true for unwatched or uncovered ranges. So after this change, a possible write to any byte of HTILE counts as coverage, which is the thing the PR sets out to separate. The new `PossibleStore` case in `--clears` asserts exactly this: a `MarkPossiblyWritten`-only HTILE completes the clear. 3. In `--clear-refusals`, `PartialStore` (4 bytes stored) now passes the coverage check and is only refused by the HTILE value check, because the rest of the fixture's HTILE doesn't hold the clear pattern. If it did (e.g. a repeated clear to the same value), the partial store would be accepted. Because `TargetRefuses` throws on the first mismatch, the remaining six refusal cases (CpuWrite through Overlap) don't run at all. A possible direction: derive the "kernel proves coverage" bit from the recognized clear dispatch's actual write extent, or record the recognized clear's write as a complete store once it has executed, and keep `StoredAllSince_nid_no_patch` as the guard. `--clear-refusals` should then pass unchanged. I'd also add a refusal case where the unstored HTILE words already hold the clear pattern, and make `PossibleStore` a refusal rather than a success. The #7228 BDA positive and the #7220 sparse-store control should both still pass.
MarcZX10 commented 2026-10-17 20:41:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T20:41:27Z.


Thanks for reproducing the same-value partial-store case. I removed the eager coverage shortcut. A recognized direct HTILE clear now carries its range with that specific recorded dispatch, bypasses recipe reuse, and schedules completion handling even when the resource path would not otherwise request it. Only after the dispatch completion callback finishes CheckFaults() (or WriteBackBuffers()) does it mark the exact metadata range as a complete driver write. CheckCurrent now always requires StoredAllSince.

The regression coverage now rejects a same-value partial store and a possible BDA write without completion; it also checks that a completed recognized clear can provide complete coverage. The agc_driver_native_multisample_depth_tests target builds on Linux. I could not run agc_driver_native_depth_clear_refusals: the host CPU guard aborts first because this Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. git diff --check and tools/check_conventions.py --base upstream/main pass.

The overlap audit flags shared DepthSurface code in #6300 and #6808 for their separate whole-HTILE fill and D32S8 paths; this change handles completion of the recognized HTILE mask dispatch. Those branches may need manual conflict resolution if both land.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6240683502 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6240683502). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T20:41:27Z. --- Thanks for reproducing the same-value partial-store case. I removed the eager coverage shortcut. A recognized direct HTILE clear now carries its range with that specific recorded dispatch, bypasses recipe reuse, and schedules completion handling even when the resource path would not otherwise request it. Only after the dispatch completion callback finishes `CheckFaults()` (or `WriteBackBuffers()`) does it mark the exact metadata range as a complete driver write. `CheckCurrent` now always requires `StoredAllSince`. The regression coverage now rejects a same-value partial store and a possible BDA write without completion; it also checks that a completed recognized clear can provide complete coverage. The `agc_driver_native_multisample_depth_tests` target builds on Linux. I could not run `agc_driver_native_depth_clear_refusals`: the host CPU guard aborts first because this Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. `git diff --check` and `tools/check_conventions.py --base upstream/main` pass. The overlap audit flags shared `DepthSurface` code in #6300 and #6808 for their separate whole-HTILE fill and D32S8 paths; this change handles completion of the recognized HTILE mask dispatch. Those branches may need manual conflict resolution if both land.
MarcZX10 commented 2026-10-17 21:22:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T21:22:52Z.


The newest follow-up correctly removes the boolean coverage bypass and moves exact-store evidence to CompleteHtileDepthClear after dispatch. Thanks for addressing the accepted same-value partial-store case. Before I can treat this as resolved, please run the updated head through the full agc_driver_native_depth_clear_refusals matrix (including the new same-value partial-store case) and retain the #7228 BDA-positive and #7220 sparse-store controls. The prior head failed before later refusal cases ran; current CI skips the GPU path, so a successful build alone will not settle the regression.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241302589 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6241302589). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T21:22:52Z. --- The newest follow-up correctly removes the boolean coverage bypass and moves exact-store evidence to `CompleteHtileDepthClear` after dispatch. Thanks for addressing the accepted same-value partial-store case. Before I can treat this as resolved, please run the updated head through the full `agc_driver_native_depth_clear_refusals` matrix (including the new same-value partial-store case) and retain the #7228 BDA-positive and #7220 sparse-store controls. The prior head failed before later refusal cases ran; current CI skips the GPU path, so a successful build alone will not settle the regression.
SleglJan commented 2026-10-17 23:59:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-17T23:59:56Z.


@MarcZX100 I ran 007 First Light (PPSA11386) with #7233 on top of #6868, as offered on #6868, one run per arm. The possible-write ring needs #6868's rule as well:

  • With #7233's round-robin eviction in that ring, the fog history again reads texels it did not write in 13 of 58 frame pairs, in the same slices and rows as without #6868. The magenta wash comes back weaker, up to 0.27 of the screen.
  • With #6868's containment and lowest-generation eviction applied to the possible ring too, 0 of 58 pairs differ and the share stays 0.00.

Setup:

  • The tree is the one from #6868's Tested: main 4186f06a9 with 007's bring-up stack (open PRs, among them #6346 at b8251dcbb and #6465, and local fixes) and local diagnostics. On top: #6868 (the change of its head aa8f73490), then #7233 at ef80e4aa0.
  • #7233 went in by hand. #6346 moves StoredOver's slot check into a WriteTracker helper. Where Windows restores a private mapping, it also sets dropped instead of erasing the block's pieces. So the possible ring's fields went into that helper and that step too.
  • GuestMemory.cpp/.hpp are the same in your current head e7b6e4381. Its later commits (the HTILE clear completion) were not in these runs.
  • The title's two feedback-wait limits are widened in its executable as described in #6172 (local only), and the input is scripted from a save at the start of gameplay. For each image uploaded again, the runs log why each of its blocks reads as stored over.
  • Each run dumps every fog volume after each frame's fog pass in the 59 frames after gameplay starts (58 frame pairs). It dumps the screen in every frame until the stop, after 64 frames of gameplay.
  • Linux 7.2.10, RTX 3080, NVIDIA 615.78.08, GCC 16.2.1, Release.
(b) #7233 as is: round-robin possible ring (a) + containment and lowest-generation eviction in the possible ring
fog history read that differs from the previous frame's write 13 of 58 pairs: 91,383 texels, all in slices 56-63 and rows 48-59, Inf or NaN read in all 13; largest finite component read 65,024 0 of 58; largest component read 0.06
share of screen pixels with min(R, B) − G > 60 up to 0.27: 0.08 or more in 6 of 64 frames, at most 0.02 in the rest 0.00 in all 64 frames
uploads over the whole run where only a ring's dropped generation made a block read as stored over (at least) 3,188: 2 exact ring, 3,186 possible ring, 16 of them on the fog history 234: 2 exact ring, 232 possible ring (all in blocks with four distinct possible pieces), none on the fog history

For comparison, #6868's Tested on the same harness:

  • Without #6868, four runs: 14, 21, 12 and 16 of 58 pairs, all in the same slices and all but 384 texels in the same rows. The largest component read was up to 65,024, and the screen share was at least 0.30 in 21, 34, 42 and 42 of 59 frames.
  • With it, one run: 0 of 58 pairs, and a share of at most 0.04.

The case is the one in #6868's body. The fog history's last block collects one MarkDirectWrites range again and again. #7233 routes that range as a possible write, so it fills the possible ring instead of the exact one. Under round-robin, possibleDropped then passes the image's upload generation, and StoredOver answers true for the image's part of the block.

Test: CheckRepeatedPossibleStores follows #6868's CheckRepeatedNeighbourStores, with MarkPossiblyWritten. It checks three things:

  • six identical possible writes of a range that starts inside a block leave the rest of the block not stored over, and prove no complete coverage;
  • a full possible ring forgets its lowest generation;
  • an overlapping possible write that contains no piece replaces none.

In place of #6868's store over three earlier pieces, it checks that an exact store's coverage survives possible writes that overflow the possible ring. On this machine, (b) fails it at "repeated possible writes of the neighbour's bytes count for the first surface's part of the shared block". (a) passes agc_write_tracking as a whole, #7233's own checks included. agc_write_tracking needs write watching (userfaultfd on Linux), so it skips on hosts without it.

So in either merge order, I think the possible ring should get the same replacement and eviction as the exact one. If #7233 lands first, I'll do that in #6868's rebase. If you'd rather have it in #7233, I can put the test and the possible-ring change on a branch on top of your head. Without #6868 underneath, that change brings #6868's containment and eviction for the possible ring only.

One small thing: in markWritten, the const bool complete from the write-watch collection shadows the new complete parameter. The noteDriverStore call after that block reads the parameter, so only the name would change.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243450834 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6243450834). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-17T23:59:56Z. --- @MarcZX100 I ran 007 First Light (PPSA11386) with #7233 on top of #6868, as offered on #6868, one run per arm. The possible-write ring needs #6868's rule as well: - With #7233's round-robin eviction in that ring, the fog history again reads texels it did not write in 13 of 58 frame pairs, in the same slices and rows as without #6868. The magenta wash comes back weaker, up to 0.27 of the screen. - With #6868's containment and lowest-generation eviction applied to the possible ring too, 0 of 58 pairs differ and the share stays 0.00. Setup: - The tree is the one from #6868's Tested: `main` 4186f06a9 with 007's bring-up stack (open PRs, among them #6346 at b8251dcbb and #6465, and local fixes) and local diagnostics. On top: #6868 (the change of its head aa8f73490), then #7233 at ef80e4aa0. - #7233 went in by hand. #6346 moves `StoredOver`'s slot check into a `WriteTracker` helper. Where Windows restores a private mapping, it also sets `dropped` instead of erasing the block's pieces. So the possible ring's fields went into that helper and that step too. - `GuestMemory.cpp`/`.hpp` are the same in your current head e7b6e4381. Its later commits (the HTILE clear completion) were not in these runs. - The title's two feedback-wait limits are widened in its executable as described in #6172 (local only), and the input is scripted from a save at the start of gameplay. For each image uploaded again, the runs log why each of its blocks reads as stored over. - Each run dumps every fog volume after each frame's fog pass in the 59 frames after gameplay starts (58 frame pairs). It dumps the screen in every frame until the stop, after 64 frames of gameplay. - Linux 7.2.10, RTX 3080, NVIDIA 615.78.08, GCC 16.2.1, Release. | | (b) #7233 as is: round-robin possible ring | (a) + containment and lowest-generation eviction in the possible ring | |---|---|---| | fog history read that differs from the previous frame's write | 13 of 58 pairs: 91,383 texels, all in slices 56-63 and rows 48-59, Inf or NaN read in all 13; largest finite component read 65,024 | 0 of 58; largest component read 0.06 | | share of screen pixels with min(R, B) − G > 60 | up to 0.27: 0.08 or more in 6 of 64 frames, at most 0.02 in the rest | 0.00 in all 64 frames | | uploads over the whole run where only a ring's dropped generation made a block read as stored over (at least) | 3,188: 2 exact ring, 3,186 possible ring, 16 of them on the fog history | 234: 2 exact ring, 232 possible ring (all in blocks with four distinct possible pieces), none on the fog history | For comparison, #6868's Tested on the same harness: - Without #6868, four runs: 14, 21, 12 and 16 of 58 pairs, all in the same slices and all but 384 texels in the same rows. The largest component read was up to 65,024, and the screen share was at least 0.30 in 21, 34, 42 and 42 of 59 frames. - With it, one run: 0 of 58 pairs, and a share of at most 0.04. The case is the one in #6868's body. The fog history's last block collects one `MarkDirectWrites` range again and again. #7233 routes that range as a possible write, so it fills the possible ring instead of the exact one. Under round-robin, `possibleDropped` then passes the image's upload generation, and `StoredOver` answers true for the image's part of the block. Test: `CheckRepeatedPossibleStores` follows #6868's `CheckRepeatedNeighbourStores`, with `MarkPossiblyWritten`. It checks three things: - six identical possible writes of a range that starts inside a block leave the rest of the block not stored over, and prove no complete coverage; - a full possible ring forgets its lowest generation; - an overlapping possible write that contains no piece replaces none. In place of #6868's store over three earlier pieces, it checks that an exact store's coverage survives possible writes that overflow the possible ring. On this machine, (b) fails it at "repeated possible writes of the neighbour's bytes count for the first surface's part of the shared block". (a) passes `agc_write_tracking` as a whole, #7233's own checks included. `agc_write_tracking` needs write watching (userfaultfd on Linux), so it skips on hosts without it. So in either merge order, I think the possible ring should get the same replacement and eviction as the exact one. If #7233 lands first, I'll do that in #6868's rebase. If you'd rather have it in #7233, I can put the test and the possible-ring change on a branch on top of your head. Without #6868 underneath, that change brings #6868's containment and eviction for the possible ring only. One small thing: in `markWritten`, the `const bool complete` from the write-watch collection shadows the new `complete` parameter. The `noteDriverStore` call after that block reads the parameter, so only the name would change. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 00:11:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T00:11:48Z.


Thanks for the detailed 007 First Light report and the follow-up suggestion. I applied the contained-interval reuse and lowest-generation eviction rule to both the exact-write and possible-write rings in d88fbaa45, and added an assertion that six repeated possible writes do not make the adjacent range read as stored over. I also renamed the local write-watch collection result to avoid shadowing the complete/possible parameter. check_conventions.py --base upstream/main and git diff --check pass. Linux GCC 12.2/Ninja Release builds agc_write_tracking_tests; this host returns the suite’s skip code 77 because write watching is unavailable, so I cannot claim the runtime assertion passed locally. The existing CTest registration reports it skipped for that reason. The focused regression is now in the PR for a write-watch-capable run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243581931 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6243581931). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T00:11:48Z. --- Thanks for the detailed 007 First Light report and the follow-up suggestion. I applied the contained-interval reuse and lowest-generation eviction rule to both the exact-write and possible-write rings in d88fbaa45, and added an assertion that six repeated possible writes do not make the adjacent range read as stored over. I also renamed the local write-watch collection result to avoid shadowing the complete/possible parameter. `check_conventions.py --base upstream/main` and `git diff --check` pass. Linux GCC 12.2/Ninja Release builds `agc_write_tracking_tests`; this host returns the suite’s skip code 77 because write watching is unavailable, so I cannot claim the runtime assertion passed locally. The existing CTest registration reports it skipped for that reason. The focused regression is now in the PR for a write-watch-capable run.
oneandonlydean commented 2026-10-18 00:57:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T00:57:15Z.


Thanks for d88fbaa: the completion-time marking and the possible ring now using the same containment and lowest-generation eviction fix both issues from the last round. I ran it on a device: RTX 4090, Linux, main a8581d3331 + this PR at d88fbaa45, with the tests added to ANYPS5_AGC_EXECUTION_TESTS. agc_write_tracking ran (it did not skip), and all five tests passed: write_tracking, native_multisample_depth, native_depth_retirement, native_depth_clears and native_depth_clear_refusals. With CompleteHtileDepthClear changed to mark nothing, native_depth_clears fails with "no complete tracked HTILE store", so the new positive case does depend on the completion mark.

Three things before this can merge:

  1. No test drives a recognized clear through the real path. Every test calls NoteHtileDepthClear and CompleteHtileDepthClear directly, so nothing covers Driver::dispatch → recordDispatch → the OnComplete callback → CompleteHtileDepthClear. If that wiring broke, it would fail closed (native MSAA clears refused), so nothing would be corrupted, but CI wouldn't see it either. Could you add an execution case that submits the recognized HTILE clear dispatch as PM4 and then samples the depth? If that's too much, a title run that hits a recognized clear would do instead. @SleglJan's PPSA11386 harness run is one option.

  2. The ring-full eviction rule has no test. Containment now dedupes identical writes, so the existing six-repeat check passes with either lowest-generation or round-robin eviction once the ring is full. @SleglJan's CheckRepeatedPossibleStores covers this: a full possible ring forgets its lowest generation, and an overlapping write that contains no piece replaces nothing. Could you fold it in, or an equivalent?

  3. Order with #6868. Both PRs now change noteDriverStore, so whichever lands second needs a rebase. @SleglJan offered to rebase #6868. Please agree between you which goes first.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243965935 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6243965935). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-18T00:57:15Z. --- Thanks for d88fbaa: the completion-time marking and the possible ring now using the same containment and lowest-generation eviction fix both issues from the last round. I ran it on a device: RTX 4090, Linux, main a8581d3331a + this PR at d88fbaa45, with the tests added to `ANYPS5_AGC_EXECUTION_TESTS`. `agc_write_tracking` ran (it did not skip), and all five tests passed: write_tracking, native_multisample_depth, native_depth_retirement, native_depth_clears and native_depth_clear_refusals. With `CompleteHtileDepthClear` changed to mark nothing, native_depth_clears fails with "no complete tracked HTILE store", so the new positive case does depend on the completion mark. Three things before this can merge: 1. **No test drives a recognized clear through the real path.** Every test calls `NoteHtileDepthClear` and `CompleteHtileDepthClear` directly, so nothing covers `Driver::dispatch` → `recordDispatch` → the `OnComplete` callback → `CompleteHtileDepthClear`. If that wiring broke, it would fail closed (native MSAA clears refused), so nothing would be corrupted, but CI wouldn't see it either. Could you add an execution case that submits the recognized HTILE clear dispatch as PM4 and then samples the depth? If that's too much, a title run that hits a recognized clear would do instead. @SleglJan's PPSA11386 harness run is one option. 2. **The ring-full eviction rule has no test.** Containment now dedupes identical writes, so the existing six-repeat check passes with either lowest-generation or round-robin eviction once the ring is full. @SleglJan's `CheckRepeatedPossibleStores` covers this: a full possible ring forgets its lowest generation, and an overlapping write that contains no piece replaces nothing. Could you fold it in, or an equivalent? 3. **Order with #6868.** Both PRs now change `noteDriverStore`, so whichever lands second needs a rebase. @SleglJan offered to rebase #6868. Please agree between you which goes first.
SleglJan commented 2026-10-18 01:13:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T01:13:00Z.


@MarcZX100 here are both checks for d88fbaa45.

Tests on your head as is (base main 922dc8999, no other changes). Setup: RTX 3080, NVIDIA 615.78.08, Linux 7.2.10, GCC 16.2.1, Release.

  • ctest -R '^agc': 653 of 654 pass. agc_driver_stencil_ref_export skips itself on this machine.
  • agc_write_tracking ran with write watching available: the binary prints "write tracking tests passed", with no skip.
  • These also pass: agc_driver_native_depth_clear_refusals, agc_driver_native_depth_clears, agc_driver_native_depth_retirement, agc_driver_native_multisample_depth, agc_driver_depth_htile_write, agc_driver_bda_device and agc_driver_bda_span_reads.
  • #7228's agc_driver_native_depth_bda_clear was merged into main after 922dc8999, so it isn't in this tree and didn't run.

007 First Light, arm (c): the harness from my last comment without #6868, plus your tracker commits 929e6cf2f and d88fbaa45, plus our CheckRepeatedPossibleStores.

  • As before, the possible ring's fields went into #6346's helper and into the Windows mapping step.
  • The HTILE commits (2b372b2a3, 9326ed2d1, e7b6e4381) are not in it: e7b6e4381 doesn't apply to that base's Dispatch.cpp and VulkanDevice.cpp.
  • One run, with the same title patch (#6172), scripted input, dumps and logging as (a) and (b). It stopped after 63 frames of gameplay ((a) and (b): 64).
  • @oneandonlydean: the HTILE commits aren't in this run, so it doesn't answer your point 1. I'm checking whether 007 reaches a recognized HTILE clear with all of #7233 on current main, and will report here.
(b) #6868 + #7233 ef80e4aa0: round-robin possible ring (a) (b) + containment and lowest-generation eviction in the possible ring (c) no #6868: your 929e6cf2f + d88fbaa45
fog history read that differs from the previous frame's write 13 of 58 pairs 0 of 58 0 of 58
largest finite component read 65,024 0.06 0.04
largest share of screen pixels with min(R, B) − G > 60 0.27 0.00 0.00
uploads over the whole run where only a ring's dropped generation made a block read as stored over (at least) 3,188 (2 exact, 3,186 possible), 16 on the fog history 234 (2 exact, 232 possible, all in blocks with four distinct possible pieces), none on the fog history 246 (0 exact, 246 possible, all in blocks with four distinct possible pieces), none on the fog history
  • Apart from names, (c)'s tracker code is the same as (a)'s, so this run shows your code reproducing (a), not a new behaviour.
  • All three arms carry #6346 (b8251dcbb). Under it, the store slots decide whether the fog history is uploaded again; on main they decide whether its write-back stores its last block. The arms compare with each other, not with #7233 on main alone.
  • agc_write_tracking on (c)'s build passes, with your repeated-possible-write assertions and CheckRepeatedPossibleStores in the same binary.

Your new assertions cover repeated identical possible writes. #6868's tests are not in #7233:

  • CheckRepeatedNeighbourStores in agc_write_tracking covers four cases for the exact ring: six identical stores keeping their complete coverage, a store over three earlier pieces, lowest-generation eviction after a slot was replaced, and an overlap that contains no piece.
  • agc_repeated_neighbour_stores writes back a storage image whose last block takes five driver stores after its end, over watched memory and over a host import.

For oneandonlydean's point 2, I'll put CheckRepeatedPossibleStores on a branch on top of d88fbaa45 and link it here.

Since #7233 now carries #6868's exact-ring change, the two PRs overlap fully there. I'll come back on the order with #6868.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244097771 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244097771). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T01:13:00Z. --- @MarcZX100 here are both checks for d88fbaa45. Tests on your head as is (base `main` 922dc8999, no other changes). Setup: RTX 3080, NVIDIA 615.78.08, Linux 7.2.10, GCC 16.2.1, Release. - `ctest -R '^agc'`: 653 of 654 pass. `agc_driver_stencil_ref_export` skips itself on this machine. - `agc_write_tracking` ran with write watching available: the binary prints "write tracking tests passed", with no skip. - These also pass: `agc_driver_native_depth_clear_refusals`, `agc_driver_native_depth_clears`, `agc_driver_native_depth_retirement`, `agc_driver_native_multisample_depth`, `agc_driver_depth_htile_write`, `agc_driver_bda_device` and `agc_driver_bda_span_reads`. - #7228's `agc_driver_native_depth_bda_clear` was merged into `main` after 922dc8999, so it isn't in this tree and didn't run. 007 First Light, arm (c): the harness from my last comment without #6868, plus your tracker commits 929e6cf2f and d88fbaa45, plus our `CheckRepeatedPossibleStores`. - As before, the possible ring's fields went into #6346's helper and into the Windows mapping step. - The HTILE commits (2b372b2a3, 9326ed2d1, e7b6e4381) are not in it: e7b6e4381 doesn't apply to that base's `Dispatch.cpp` and `VulkanDevice.cpp`. - One run, with the same title patch (#6172), scripted input, dumps and logging as (a) and (b). It stopped after 63 frames of gameplay ((a) and (b): 64). - @oneandonlydean: the HTILE commits aren't in this run, so it doesn't answer your point 1. I'm checking whether 007 reaches a recognized HTILE clear with all of #7233 on current `main`, and will report here. | | (b) #6868 + #7233 ef80e4aa0: round-robin possible ring | (a) (b) + containment and lowest-generation eviction in the possible ring | (c) no #6868: your 929e6cf2f + d88fbaa45 | |---|---|---|---| | fog history read that differs from the previous frame's write | 13 of 58 pairs | 0 of 58 | 0 of 58 | | largest finite component read | 65,024 | 0.06 | 0.04 | | largest share of screen pixels with min(R, B) − G > 60 | 0.27 | 0.00 | 0.00 | | uploads over the whole run where only a ring's dropped generation made a block read as stored over (at least) | 3,188 (2 exact, 3,186 possible), 16 on the fog history | 234 (2 exact, 232 possible, all in blocks with four distinct possible pieces), none on the fog history | 246 (0 exact, 246 possible, all in blocks with four distinct possible pieces), none on the fog history | - Apart from names, (c)'s tracker code is the same as (a)'s, so this run shows your code reproducing (a), not a new behaviour. - All three arms carry #6346 (b8251dcbb). Under it, the store slots decide whether the fog history is uploaded again; on `main` they decide whether its write-back stores its last block. The arms compare with each other, not with #7233 on `main` alone. - `agc_write_tracking` on (c)'s build passes, with your repeated-possible-write assertions and `CheckRepeatedPossibleStores` in the same binary. Your new assertions cover repeated identical possible writes. #6868's tests are not in #7233: - `CheckRepeatedNeighbourStores` in `agc_write_tracking` covers four cases for the exact ring: six identical stores keeping their complete coverage, a store over three earlier pieces, lowest-generation eviction after a slot was replaced, and an overlap that contains no piece. - `agc_repeated_neighbour_stores` writes back a storage image whose last block takes five driver stores after its end, over watched memory and over a host import. For oneandonlydean's point 2, I'll put `CheckRepeatedPossibleStores` on a branch on top of d88fbaa45 and link it here. Since #7233 now carries #6868's exact-ring change, the two PRs overlap fully there. I'll come back on the order with #6868. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 01:37:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T01:37:55Z.


Thanks for running the current d88fbaa45 head on the RTX 3080 and for the controlled 007 comparison. The native depth refusal/clear/retirement and write-tracking groups pass on your device, and the updated possible-ring rule matches the no-magenta arm in the comparison.

The remaining validation gap from @oneandonlydean is still real: the 007 arm you describe excludes the HTILE completion commits, so it does not exercise the production Driver::dispatch → recordDispatch → completion callback → CompleteHtileDepthClear path. I will work on an execution regression for that wiring; I do not count the existing direct helper test as covering it.

For ordering with #6868, I propose merging #7233 first because this head now contains the exact-ring fix and the possible-ring extension; #6868 can then rebase and keep its title-level write-back regression. Please link your possible-ring helper test branch when ready so I can review it against the current CheckRepeatedPossibleStores assertions.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244313675 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244313675). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T01:37:55Z. --- Thanks for running the current `d88fbaa45` head on the RTX 3080 and for the controlled 007 comparison. The native depth refusal/clear/retirement and write-tracking groups pass on your device, and the updated possible-ring rule matches the no-magenta arm in the comparison. The remaining validation gap from @oneandonlydean is still real: the 007 arm you describe excludes the HTILE completion commits, so it does not exercise the production `Driver::dispatch` → `recordDispatch` → completion callback → `CompleteHtileDepthClear` path. I will work on an execution regression for that wiring; I do not count the existing direct helper test as covering it. For ordering with #6868, I propose merging #7233 first because this head now contains the exact-ring fix and the possible-ring extension; #6868 can then rebase and keep its title-level write-back regression. Please link your possible-ring helper test branch when ready so I can review it against the current `CheckRepeatedPossibleStores` assertions.
MarcZX10 commented 2026-10-18 01:41:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T01:41:54Z.


Added a bounded-history regression to agc_write_tracking_tests: eight disjoint possible-write intervals in one block evict the oldest of the four retained slots, retain the newest, and re-recording the old interval makes it visible again. The target compiles on Linux GCC 12.2/Ninja Release. Runtime execution skips on this Linux 6.1 host because guest write-watch support is unavailable, so the new assertions still need a supported host run. I have not yet added the full Driver::dispatch -> recordDispatch -> OnComplete integration test; the existing NativeDepthBdaClear harness enters through VulkanDevice::Dispatch and cannot prove Driver-side kernel recognition by itself.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244352611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244352611). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T01:41:54Z. --- Added a bounded-history regression to `agc_write_tracking_tests`: eight disjoint possible-write intervals in one block evict the oldest of the four retained slots, retain the newest, and re-recording the old interval makes it visible again. The target compiles on Linux GCC 12.2/Ninja Release. Runtime execution skips on this Linux 6.1 host because guest write-watch support is unavailable, so the new assertions still need a supported host run. I have not yet added the full `Driver::dispatch` -> `recordDispatch` -> `OnComplete` integration test; the existing `NativeDepthBdaClear` harness enters through `VulkanDevice::Dispatch` and cannot prove Driver-side kernel recognition by itself.
oneandonlydean commented 2026-10-18 02:20:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T02:20:41Z.


Thanks for the bounded-history test. We ran 330610e2c on current main on an RTX 4090 with write watch available, so the test actually ran instead of skipping. The production change is the same as d88fbaa45, and the four native depth tests pass (agc_driver_native_multisample_depth, _depth_retirement, _depth_clears, _depth_clear_refusals). The new assertion fails:

agc_write_tracking: write tracking test failed: an evicted possible-write interval remained in the bounded history

(WriteTracking.cpp:162.) The test and the code disagree about what eviction means. On eviction, possibleDropped = max(possibleDropped, oldest.generation) folds the evicted interval's generation into the block, and StoredOver then returns true for any range of that block once possibleDropped > generation. So after eight distinct inserts into a four-slot ring, interval 0 still reads as stored over, and so does the rest of the block. The test expects eviction to forget it.

Please pick one:

  • (a) Keep the conservative fold (the code as it is) and fix the test: after eviction, the evicted interval and the rest of the block read as stored over, the newest interval is retained, and StoredAllSince stays false. Or drop the commit.
  • (b) Make eviction forget the interval, and explain why that is safe. A forgotten possible write could leave a cached image in use after the guest bytes changed. If you go this way, name the StoredOver consumer that needs it and add a test of that consumer.

Either way, a test that tells lowest-generation eviction apart from round-robin is still missing: refresh an old slot through containment, then overflow the ring, and check which slot was dropped.

Linux CI may skip agc_write_tracking on a runner without userfaultfd, and Windows has no write watch, so please check that the test shows Passed (not Skipped) in the log, or run it on a host with write watch.

The Driver::dispatch → recordDispatch → completion → CompleteHtileDepthClear integration test can be a follow-up. A break in that wiring is refused rather than reported as a clear.

On ordering with #6868: agreed, #7233 first.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244666131 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244666131). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-18T02:20:41Z. --- Thanks for the bounded-history test. We ran 330610e2c on current `main` on an RTX 4090 with write watch available, so the test actually ran instead of skipping. The production change is the same as d88fbaa45, and the four native depth tests pass (`agc_driver_native_multisample_depth`, `_depth_retirement`, `_depth_clears`, `_depth_clear_refusals`). The new assertion fails: ``` agc_write_tracking: write tracking test failed: an evicted possible-write interval remained in the bounded history ``` (WriteTracking.cpp:162.) The test and the code disagree about what eviction means. On eviction, `possibleDropped = max(possibleDropped, oldest.generation)` folds the evicted interval's generation into the block, and `StoredOver` then returns true for any range of that block once `possibleDropped > generation`. So after eight distinct inserts into a four-slot ring, interval 0 still reads as stored over, and so does the rest of the block. The test expects eviction to forget it. Please pick one: - (a) Keep the conservative fold (the code as it is) and fix the test: after eviction, the evicted interval and the rest of the block read as stored over, the newest interval is retained, and `StoredAllSince` stays false. Or drop the commit. - (b) Make eviction forget the interval, and explain why that is safe. A forgotten possible write could leave a cached image in use after the guest bytes changed. If you go this way, name the `StoredOver` consumer that needs it and add a test of that consumer. Either way, a test that tells lowest-generation eviction apart from round-robin is still missing: refresh an old slot through containment, then overflow the ring, and check which slot was dropped. Linux CI may skip `agc_write_tracking` on a runner without userfaultfd, and Windows has no write watch, so please check that the test shows Passed (not Skipped) in the log, or run it on a host with write watch. The `Driver::dispatch` → `recordDispatch` → completion → `CompleteHtileDepthClear` integration test can be a follow-up. A break in that wiring is refused rather than reported as a clear. On ordering with #6868: agreed, #7233 first.
SleglJan commented 2026-10-18 02:23:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T02:23:45Z.


@MarcZX100 @oneandonlydean I get the same failure on my RTX 3080 machine (Linux, write watching available), from 330610e2c as is: "an evicted possible-write interval remained in the bounded history" (tests/WriteTracking.cpp:162). The reason is the one oneandonlydean gives: the evictions raise possibleDropped past before, and StoredOver then answers true for the whole block (Execution/src/GuestMemory.cpp:1580).

With the possible ring's eviction switched to round-robin locally, it fails the same way at the same line. Eight disjoint writes in generation order pick the same slots under both rules, so this check doesn't tell them apart.

offer/7233-possible-ring-test has two commits on 330610e2c: oneandonlydean's option (a) for that block, then the ring test he asks for. The fix comes first, so it can be taken without the ring test, but I ran only the branch tip.

  • 988f51125 corrects that block. It checks four things:
    • the evicted interval and the untouched gap beside it read as stored over since before;
    • the newest interval reads as stored over since a baseline taken just before its write, so it was retained;
    • the re-recorded interval reads as stored over since a baseline taken just before it is written again;
    • no complete coverage.
  • 41d08edd7 adds CheckRepeatedPossibleStores. It checks three things:
    • an exact store keeps its complete coverage through possible writes that overflow the ring;
    • in a full ring whose first piece was refreshed in place, a fifth range evicts the second piece: the rest of the block doesn't read as stored over since that piece's own generation, but does since the collect;
    • a possible write that overlaps a piece without containing it keeps that piece, and the ring again evicts the oldest.

Compared with the version in (c)'s build, its repeated-writes section is gone: your six-repeat check tests the same three properties within one block.

On the RTX 3080, agc_write_tracking passes on the branch tip. Two local variants of the possible ring (not in the branch) make it fail at "a full possible ring evicted a newer piece instead of its oldest": round-robin eviction, and an eviction of the second-oldest piece.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244690428 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244690428). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T02:23:45Z. --- @MarcZX100 @oneandonlydean I get the same failure on my RTX 3080 machine (Linux, write watching available), from 330610e2c as is: "an evicted possible-write interval remained in the bounded history" (`tests/WriteTracking.cpp:162`). The reason is the one oneandonlydean gives: the evictions raise `possibleDropped` past `before`, and `StoredOver` then answers true for the whole block (`Execution/src/GuestMemory.cpp:1580`). With the possible ring's eviction switched to round-robin locally, it fails the same way at the same line. Eight disjoint writes in generation order pick the same slots under both rules, so this check doesn't tell them apart. [`offer/7233-possible-ring-test`](https://github.com/SleglJan/AnyPS5/tree/offer/7233-possible-ring-test) has two commits on 330610e2c: oneandonlydean's option (a) for that block, then the ring test he asks for. The fix comes first, so it can be taken without the ring test, but I ran only the branch tip. - 988f51125 corrects that block. It checks four things: - the evicted interval and the untouched gap beside it read as stored over since `before`; - the newest interval reads as stored over since a baseline taken just before its write, so it was retained; - the re-recorded interval reads as stored over since a baseline taken just before it is written again; - no complete coverage. - 41d08edd7 adds `CheckRepeatedPossibleStores`. It checks three things: - an exact store keeps its complete coverage through possible writes that overflow the ring; - in a full ring whose first piece was refreshed in place, a fifth range evicts the second piece: the rest of the block doesn't read as stored over since that piece's own generation, but does since the collect; - a possible write that overlaps a piece without containing it keeps that piece, and the ring again evicts the oldest. Compared with the version in (c)'s build, its repeated-writes section is gone: your six-repeat check tests the same three properties within one block. On the RTX 3080, `agc_write_tracking` passes on the branch tip. Two local variants of the possible ring (not in the branch) make it fail at "a full possible ring evicted a newer piece instead of its oldest": round-robin eviction, and an eviction of the second-oldest piece. AI-assisted: yes (Claude Code)
Amoenus commented 2026-10-18 02:41:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T02:41:14Z.


Windows retest, 2026-10-21: the revised clear group passes on both GPUs, with 26 completed outputs and one expected uncovered-HTILE refusal per run.

Tested #7233 eb55d58728f367f527253b3ae5b30ed45030fdf3 adapted onto main cd700fe9ec0ec49a0394845605c3d42f2789c556 as base 01248f46b6e3e16b5fc5b5ce5bf503a7593848ff, using test-only control 20de25385f. NativeMultisampleDepth.cpp is byte-identical to exact eb55. The control differs from the adapted base only by #7371's identical BDA regression; none of #7371's production handoff is present. This is an adapted-main composition, not an unchanged whole-PR checkout.

Three fresh serial CTest processes per GPU RTX 5080 Radeon Graphics
agc_driver_native_depth_clears 3/3 pass 3/3 pass
Completed depth-output cases per process 26 26
Expected uncovered-HTILE refusal cases per process 1 1
Separate #7371 BDA regression, without its handoff 3/3 expected failures 3/3 expected failures

Each clear run reports checked=27 unavailable=0, but the uncovered DriverDispatch case returns after asserting the exact production refusal native multisample depth clear requires tracked HTILE generations. That case does not validate completed-clear output. Both the fixture and live-driver contexts select the requested physical GPU; the scratch private-import probes say write watch is kept. Those probes do not prove coverage for the actual metadata span. The reason that span is uncovered on this Windows host remains unisolated; #8759's Linux host-import diagnosis must not be assumed to be its cause.

Control total: 60 assertion passes plus six expected missing-pending-range failures (the recognized HTILE clear is missing its pending write range), separately from literal main's 66 passes on its older fixture. All runs: no whole-test skips, timeouts, VUIDs, validation errors or warnings. Main's clear group has 23 completed-output cases, so passing names alone are not identical coverage. This supersedes the older dc960 completed-clear failure as the current fixture result, without claiming a production tracking fix or a game result.

Windows 11 Enterprise 26200; WinLibs GCC15.2r7/UCRT Release. NVIDIA RTX 5080 10de:2c02, 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics 1002:13c0, 32.0.21036.18. Actual devices and Khronos 1.4.363 insertion verified; required Vulkan, app shader cache and journal disabled; driver cache uncontrolled. #7371's separate qualified refresh now passes all66 selected processes, including the BDA consumer regression3/3 per GPU; it retains the same26 completed outputs plus1 expected refusal in the clear group. Those candidate results are not included in this control's counts.

AI-assisted: yes (Codex); author responsible.

Historical Windows evidence at its original pins

Current Windows retest, 2026-10-20: the CPU-only gate exposes a completed-HTILE failure on both physical GPUs, including NVIDIA.

Tested #7233 dc960cf76594cf96ac07b804ddd3f310ecc47c9d / main 339217ebc9 using control 28336d0554. Its production and NativeMultisampleDepth.cpp are byte-identical to that prerequisite. The sole file difference is #7371's independent BDA regression; none of #7371's production handoff is present. This is not an unchanged whole-PR checkout.

agc_driver_native_depth_clears, three fresh serial CTest processes Result
NVIDIA GeForce RTX 5080, driver 610.62 / 32.0.16.1062 3/3 assertion failures, no skip
AMD Radeon(TM) Graphics 1002:13c0, driver 32.0.21036.18 3/3 assertion failures, no skip

All six reach driver idle returned before recording the completed HTILE dispatch (CTest exit 8), within 1.3 s. The CPU-device condition no longer hides these failures. Actual adapters and loaded Khronos 1.4.363 verified; zero VUIDs, validation errors/warnings or timeouts. Windows 11 Enterprise 26200, WinLibs GCC 15.2 r7/UCRT Release, required Vulkan, app shader cache/journal disabled; driver cache uncontrolled.

This differs from the passing Linux NVIDIA results, so the observed failure is not confined to RADV. A common Windows/RADV cause is not established. The earlier actual-range watched-coverage measurement below was not repeated, and no assertion or production guard was weakened. #7371's qualified handoff refresh now passes its BDA regression 3/3 per GPU, while the prerequisite completed-clear assertion still fails 3/3 per GPU with that handoff present. It remains dependent on this PR.

AI-assisted: yes (Codex); author responsible.

Earlier Windows results, skip-gate checks and watched-range measurements at their original pins

@MarcZX10 @oneandonlydean @SleglJan Exact-head Windows retest, 2026-10-20: 8073c2e532 still skips DriverDispatch on both physical GPUs; this is not a hardware completion pass.

  • agc_driver_native_depth_clears: 3/3 skipped per GPU, after each process completed its 26 other clear subcases. The new result-based gate prevents the StoredAllSince assertion from running on this hardware too. Dean's hardware-gating concern remains unresolved.
  • Write tracking (CPU, 3/3), BDA clear, clear refusals, plain multisample depth and retirement (each 3/3 per GPU): 27 passes, separately from those six skips.
  • The Linux skip-policy parser rejects all six Windows-produced JUnit files because skipped native HTILE driver dispatch: this device's ... does not match its device-limitation convention. This is a parser check, not a Linux/lavapipe runtime result.

I pushed a one-line message-only proposal, based directly on Marc's head. Three fresh processes per GPU still skip, and all six outputs now pass both Linux and Windows skip-policy parsers. It changes neither the skip condition nor production validation, and does not resolve the hardware-gating review. Selected target builds and conventions pass; Cppcheck/clang-tidy complete with three advisories in unchanged code. No new full build or Linux runtime claim for the message edit.

Controls: literal main 434e965d46 passes all 33 selected attempts. The older prerequisite adapted to that same main (fa23b5820a) gives 27 passes and six DriverDispatch failures. Its entire tree differs from exact 8073c2e532 only in the nine-line fixture update. Required Vulkan, actual adapters and loaded Khronos verified; no VUIDs, validation errors/warnings or timeouts in these focused runs. App shader cache/journal requested disabled; driver cache uncontrolled.

RTX 5080 / 610.62 and Radeon Graphics / 32.0.21036.18, Windows 11 Enterprise 26200, WinLibs GCC15.2r7, Khronos1.4.363. Could the device-dependent DriverDispatch case also become a separate CTest entry, so its skip does not mark the 26 completed clear subcases as skipped?

AI-assisted: yes (Codex); author responsible.

Earlier Windows watched-range measurements and validation at their original pins

@MarcZX10 @oneandonlydean @SleglJan Windows follow-up, 2026-10-20: the actual HTILE range loses its watched coverage during DriverDispatch on both GPUs.

Current #7233 1c210cd21d composed with main 77e31219c8 as parent 9d089a66d5, using its original fixture and none of #7371's production or fixture changes, fails agc_driver_native_depth_clears 3/3 per GPU at driver idle returned before recording the completed HTILE dispatch.

Following Jan's actual-range investigation, I added only five net fixture lines querying the same metadata range before/after SubmitDriverHtileClear, and printing the unchanged completion predicate. No production change or weakened assertion. All three fresh runs per GPU report:

RTX 5080: before=1 after=0 generationBefore=4584 generationAfter=4591 complete=0 bytes=32768
Radeon:   before=1 after=0 generationBefore=4602 generationAfter=4627 complete=0 bytes=32768

The scratch host-import probe reports keep the write watch: yes in these processes; that probe does not guarantee coverage for this actual range. The Windows measurement confirms loss of the fixture's watched-range precondition, consistent with Jan's proposed post-dispatch capability check. It does not identify which Windows call removes coverage or directly measure clearGeneration. A capability-check adjustment remains to be validated; all six measurements still fail the original assertion.

Later integration retest: after merging main b85d972f42 (including #6759's write-watch restoration), integration ca0c22e410 still fails this DriverDispatch assertion 3/3 on each Windows GPU. The separate BDA-consumer fixture passes 3/3 on each. Required Vulkan, actual devices and Khronos insertion verified; no VUIDs, validation errors/warnings, skips or timeouts in these twelve runs. This composition includes #7371 and other bring-up work: it is not an isolated #7233/main comparison, and it does not repeat the watched-range measurements above or establish a new cause.

Windows 11 Enterprise 26200, WinLibs GCC15.2r7; RTX5080 610.62 and Radeon Graphics 32.0.21036.18. Actual devices and loaded Khronos1.4.363 verified, Vulkan required, app shader cache/journal disabled; no skips, timeouts, VUIDs or validation errors/warnings. The earlier CPU-race message is absent. #7371 has the same six completion failures; literal main passes its older fixture without this DriverDispatch coverage. No new Linux/title claim. AI-assisted: yes (Codex); author responsible.

Earlier Windows observations at older prerequisite pins

Windows follow-up, 2026-10-20: the unlocked Driver wait no longer times out, but the current prerequisite still fails its DriverDispatch completion case on both GPUs. This matches @SleglJan's Linux NVIDIA report on 2e048f56ff.

Scope: #7233 head 2e048f56ff adapted onto main 0393728fd3 as 2ebf5005c0, plus #7371's regression files at 53be445b97, without #7371's production handoff. This is an adapted-parent check, not an unchanged published-head run. Prerequisite history and Jan's tracker-test attribution are retained.

agc_driver_native_depth_clears, one fresh process per device, fails in 1.293 s on RTX 5080 and 1.834 s on Radeon Graphics:

[gpu] deferred write-back failed: AGC graphics: CPU writes raced native multisample depth clear
AGC graphics: driver idle returned before recording the completed HTILE dispatch

The same messages occur with #7371 production present (191060e6fb), 1.277 / 1.629 s. No 30-second timeout, skip, VUID, validation error or warning. I have not identified the newer CPU stamp's source and have not relaxed the race guard. These results do not confirm an import-caused stamp.

Literal main passes its original clear fixture once per GPU; it lacks the new DriverDispatch assertions. The separate six native-depth/draw groups pass 3x per GPU on main and the candidate (36 GPU passes per pin), with another 18 CPU passes per pin. The BDA consumer regression fails 3/3 per GPU without the handoff and passes 3/3 after restoration. None of those counts includes the failing DriverDispatch case. Full candidate build and all matching control/restoration target builds pass. Current scoped evidence.

Hardware: NVIDIA RTX 5080 10de:2c02, 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics 1002:13c0, 32.0.21036.18; Windows 11 Enterprise 26200, supported WinLibs GCC 15.2r7/UCRT. Khronos 1.4.363 device insertion and actual GPU verified, Vulkan required, shader cache and pipeline journal disabled; driver caches/system implicit layers uncontrolled. No new title/performance claim.

Earlier timeout and packet/unlock observations remain historical results at their original pins; they are superseded as a description of this current Driver case. Order remains #7233, then #7371.

AI-assisted validation/report: Codex; author responsible.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244828184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244828184). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-18T02:41:14Z. --- <!-- codex-7233-eb55-windows-control-v1 --> **Windows retest, 2026-10-21: the revised clear group passes on both GPUs, with 26 completed outputs and one expected uncovered-HTILE refusal per run.** Tested #7233 `eb55d58728f367f527253b3ae5b30ed45030fdf3` adapted onto main `cd700fe9ec0ec49a0394845605c3d42f2789c556` as base `01248f46b6e3e16b5fc5b5ce5bf503a7593848ff`, using [test-only control `20de25385f`](https://github.com/Amoenus/AnyPS5/commit/20de25385fcc3489e123263f769f7daee6eb4cac). `NativeMultisampleDepth.cpp` is byte-identical to exact eb55. The control differs from the adapted base only by #7371's identical BDA regression; **none of #7371's production handoff is present**. This is an adapted-main composition, not an unchanged whole-PR checkout. | Three fresh serial CTest processes per GPU | RTX 5080 | Radeon Graphics | | --- | --- | --- | | `agc_driver_native_depth_clears` | 3/3 pass | 3/3 pass | | Completed depth-output cases per process | 26 | 26 | | Expected uncovered-HTILE refusal cases per process | 1 | 1 | | Separate #7371 BDA regression, without its handoff | 3/3 expected failures | 3/3 expected failures | Each clear run reports `checked=27 unavailable=0`, but the uncovered DriverDispatch case returns after asserting the exact production refusal `native multisample depth clear requires tracked HTILE generations`. **That case does not validate completed-clear output.** Both the fixture and live-driver contexts select the requested physical GPU; the scratch private-import probes say write watch is kept. Those probes do not prove coverage for the actual metadata span. The reason that span is uncovered on this Windows host remains unisolated; #8759's Linux host-import diagnosis must not be assumed to be its cause. Control total: **60 assertion passes plus six expected missing-pending-range failures** (`the recognized HTILE clear is missing its pending write range`), separately from literal main's 66 passes on its older fixture. All runs: no whole-test skips, timeouts, VUIDs, validation errors or warnings. Main's clear group has 23 completed-output cases, so passing names alone are not identical coverage. This supersedes the older dc960 completed-clear failure as the current fixture result, without claiming a production tracking fix or a game result. Windows 11 Enterprise 26200; WinLibs GCC15.2r7/UCRT Release. NVIDIA RTX 5080 `10de:2c02`, 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics `1002:13c0`, 32.0.21036.18. Actual devices and Khronos 1.4.363 insertion verified; required Vulkan, app shader cache and journal disabled; driver cache uncontrolled. [#7371's separate qualified refresh](https://github.com/boykopovar/AnyPS5/pull/7371#issuecomment-6303353936) now passes all66 selected processes, including the BDA consumer regression3/3 per GPU; it retains the same26 completed outputs plus1 expected refusal in the clear group. Those candidate results are not included in this control's counts. AI-assisted: yes (Codex); author responsible. <!-- /codex-7233-eb55-windows-control-v1 --> <details> <summary>Historical Windows evidence at its original pins</summary> <!-- codex-7233-dc960-windows-control-v1 --> **Current Windows retest, 2026-10-20: the CPU-only gate exposes a completed-HTILE failure on both physical GPUs, including NVIDIA.** Tested #7233 `dc960cf76594cf96ac07b804ddd3f310ecc47c9d` / main `339217ebc9` using [control `28336d0554`](https://github.com/Amoenus/AnyPS5/commit/28336d055410775cca0cbdb4bd8cd45d8c1e0f6c). Its production and `NativeMultisampleDepth.cpp` are byte-identical to that prerequisite. The sole file difference is #7371's independent BDA regression; none of #7371's production handoff is present. This is not an unchanged whole-PR checkout. | `agc_driver_native_depth_clears`, three fresh serial CTest processes | Result | |---|---| | NVIDIA GeForce RTX 5080, driver 610.62 / 32.0.16.1062 | **3/3 assertion failures**, no skip | | AMD Radeon(TM) Graphics `1002:13c0`, driver 32.0.21036.18 | **3/3 assertion failures**, no skip | All six reach `driver idle returned before recording the completed HTILE dispatch` (CTest exit 8), within 1.3 s. The CPU-device condition no longer hides these failures. Actual adapters and loaded Khronos 1.4.363 verified; zero VUIDs, validation errors/warnings or timeouts. Windows 11 Enterprise 26200, WinLibs GCC 15.2 r7/UCRT Release, required Vulkan, app shader cache/journal disabled; driver cache uncontrolled. This differs from the [passing Linux NVIDIA results](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303114436), so the observed failure is not confined to RADV. A common Windows/RADV cause is **not established**. The earlier actual-range watched-coverage measurement below was not repeated, and no assertion or production guard was weakened. [#7371's qualified handoff refresh](https://github.com/boykopovar/AnyPS5/pull/7371#issuecomment-6303353936) now passes its BDA regression 3/3 per GPU, while the prerequisite completed-clear assertion still fails 3/3 per GPU with that handoff present. It remains dependent on this PR. AI-assisted: yes (Codex); author responsible. <!-- /codex-7233-dc960-windows-control-v1 --> <details> <summary>Earlier Windows results, skip-gate checks and watched-range measurements at their original pins</summary> <!-- codex-7233-8073-hardware-retest-v1 --> @MarcZX10 @oneandonlydean @SleglJan **Exact-head Windows retest, 2026-10-20: `8073c2e532` still skips DriverDispatch on both physical GPUs; this is not a hardware completion pass.** - `agc_driver_native_depth_clears`: **3/3 skipped per GPU**, after each process completed its 26 other clear subcases. The new result-based gate prevents the `StoredAllSince` assertion from running on this hardware too. Dean's hardware-gating concern remains unresolved. - Write tracking (CPU, 3/3), BDA clear, clear refusals, plain multisample depth and retirement (each 3/3 per GPU): **27 passes**, separately from those six skips. - The **Linux skip-policy parser rejects all six Windows-produced JUnit files** because `skipped native HTILE driver dispatch: this device's ...` does not match its device-limitation convention. This is a parser check, **not a Linux/lavapipe runtime result**. I pushed a [one-line message-only proposal](https://github.com/Amoenus/AnyPS5/compare/8073c2e532bca758fdd37c54c2626f6c9227f30a...af4b961d1034af2a713504e0071ebf4bf9aad4f3), based directly on Marc's head. Three fresh processes per GPU still skip, and all six outputs now pass both Linux and Windows skip-policy parsers. **It changes neither the skip condition nor production validation**, and does not resolve the hardware-gating review. Selected target builds and conventions pass; Cppcheck/clang-tidy complete with three advisories in unchanged code. No new full build or Linux runtime claim for the message edit. Controls: literal main `434e965d46` passes all 33 selected attempts. The older prerequisite adapted to that same main (`fa23b5820a`) gives 27 passes and six DriverDispatch failures. Its entire tree differs from exact `8073c2e532` only in the nine-line fixture update. Required Vulkan, actual adapters and loaded Khronos verified; no VUIDs, validation errors/warnings or timeouts in these focused runs. App shader cache/journal requested disabled; driver cache uncontrolled. RTX 5080 / 610.62 and Radeon Graphics / 32.0.21036.18, Windows 11 Enterprise 26200, WinLibs GCC15.2r7, Khronos1.4.363. Could the device-dependent DriverDispatch case also become a separate CTest entry, so its skip does not mark the 26 completed clear subcases as skipped? AI-assisted: yes (Codex); author responsible. <!-- /codex-7233-8073-hardware-retest-v1 --> <details> <summary>Earlier Windows watched-range measurements and validation at their original pins</summary> <!-- codex-7233-current-windows-validation-v1 --> @MarcZX10 @oneandonlydean @SleglJan **Windows follow-up, 2026-10-20: the actual HTILE range loses its watched coverage during DriverDispatch on both GPUs.** Current #7233 `1c210cd21d` composed with main `77e31219c8` as [parent `9d089a66d5`](https://github.com/Amoenus/AnyPS5/commit/9d089a66d5560e0ef8021515f38a655a86823ff6), using its original fixture and none of #7371's production or fixture changes, fails `agc_driver_native_depth_clears` 3/3 per GPU at `driver idle returned before recording the completed HTILE dispatch`. Following [Jan's actual-range investigation](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6292873486), I added only [five net fixture lines](https://github.com/Amoenus/AnyPS5/compare/9d089a66d5560e0ef8021515f38a655a86823ff6...03887a1c3f72af2dd19fc471ce296830375b0c85) querying the same metadata range before/after `SubmitDriverHtileClear`, and printing the unchanged completion predicate. No production change or weakened assertion. All three fresh runs per GPU report: ```text RTX 5080: before=1 after=0 generationBefore=4584 generationAfter=4591 complete=0 bytes=32768 Radeon: before=1 after=0 generationBefore=4602 generationAfter=4627 complete=0 bytes=32768 ``` The scratch host-import probe reports `keep the write watch: yes` in these processes; that probe does not guarantee coverage for this actual range. The Windows measurement confirms loss of the fixture's watched-range precondition, consistent with Jan's proposed post-dispatch capability check. It does not identify which Windows call removes coverage or directly measure `clearGeneration`. A capability-check adjustment remains to be validated; all six measurements still fail the original assertion. **Later integration retest:** after merging main `b85d972f42` (including #6759's write-watch restoration), [integration `ca0c22e410`](https://github.com/Amoenus/AnyPS5/commit/ca0c22e4100513794304a6149b5a6606a814603f) still fails this DriverDispatch assertion 3/3 on each Windows GPU. The separate BDA-consumer fixture passes 3/3 on each. Required Vulkan, actual devices and Khronos insertion verified; no VUIDs, validation errors/warnings, skips or timeouts in these twelve runs. This composition includes #7371 and other bring-up work: it is not an isolated #7233/main comparison, and it does not repeat the watched-range measurements above or establish a new cause. <!-- codex-7233-mainb85d-integration-retest-v1 --> Windows 11 Enterprise 26200, WinLibs GCC15.2r7; RTX5080 610.62 and Radeon Graphics 32.0.21036.18. Actual devices and loaded Khronos1.4.363 verified, Vulkan required, app shader cache/journal disabled; no skips, timeouts, VUIDs or validation errors/warnings. The earlier CPU-race message is absent. #7371 has the same six completion failures; literal main passes its older fixture without this DriverDispatch coverage. No new Linux/title claim. AI-assisted: yes (Codex); author responsible. <!-- /codex-7233-current-windows-validation-v1 --> <details> <summary>Earlier Windows observations at older prerequisite pins</summary> **Windows follow-up, 2026-10-20: the unlocked Driver wait no longer times out, but the current prerequisite still fails its DriverDispatch completion case on both GPUs.** This matches @SleglJan's Linux NVIDIA report on `2e048f56ff`. Scope: #7233 head `2e048f56ff` adapted onto main `0393728fd3` as `2ebf5005c0`, plus #7371's regression files at `53be445b97`, **without #7371's production handoff**. This is an adapted-parent check, not an unchanged published-head run. Prerequisite history and Jan's tracker-test attribution are retained. `agc_driver_native_depth_clears`, one fresh process per device, fails in 1.293 s on RTX 5080 and 1.834 s on Radeon Graphics: ```text [gpu] deferred write-back failed: AGC graphics: CPU writes raced native multisample depth clear AGC graphics: driver idle returned before recording the completed HTILE dispatch ``` The same messages occur with #7371 production present (`191060e6fb`), 1.277 / 1.629 s. No 30-second timeout, skip, VUID, validation error or warning. I have **not identified the newer CPU stamp's source** and have not relaxed the race guard. These results do not confirm an import-caused stamp. Literal main passes its original clear fixture once per GPU; it lacks the new DriverDispatch assertions. The separate six native-depth/draw groups pass 3x per GPU on main and the candidate (36 GPU passes per pin), with another 18 CPU passes per pin. The BDA consumer regression fails 3/3 per GPU without the handoff and passes 3/3 after restoration. None of those counts includes the failing DriverDispatch case. Full candidate build and all matching control/restoration target builds pass. [Current scoped evidence](https://github.com/boykopovar/AnyPS5/pull/7371). Hardware: NVIDIA RTX 5080 `10de:2c02`, 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics `1002:13c0`, 32.0.21036.18; Windows 11 Enterprise 26200, supported WinLibs GCC 15.2r7/UCRT. Khronos 1.4.363 device insertion and actual GPU verified, Vulkan required, shader cache and pipeline journal disabled; driver caches/system implicit layers uncontrolled. No new title/performance claim. Earlier timeout and packet/unlock observations remain historical results at their original pins; they are superseded as a description of this current Driver case. **Order remains #7233, then #7371.** AI-assisted validation/report: Codex; author responsible. <!-- codex-pr7233-peer41d-windows-validation-v1 --> </details> </details> </details> </details>
MarcZX10 commented 2026-10-18 02:41:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T02:41:51Z.


Added a DriverDispatch clear case under --clears. It submits the recognized HTILE mask kernel through the public DCB/PM4 path, then uses the existing native depth readback to check that the production completion callback made the clear visible.

Verification:

  • agc_driver_native_multisample_depth_tests compiled successfully.
  • git diff --check passed.
  • I launched the binary with --clears; execution stopped before GPU assertions because this host's Xeon E5-1620 v2 lacks the required LZCNT, BMI1, BMI2, MOVBE, AVX2, and FMA instructions.
  • check_conventions.py --base origin/main reports six existing non-conventional Revert commit subjects in the PR history; no finding pointed to this change.

Could someone with a supported CPU/GPU run agc_driver_native_multisample_depth_tests --clears on this head and confirm the new production-path case passes?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244832979 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244832979). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T02:41:51Z. --- Added a `DriverDispatch` clear case under `--clears`. It submits the recognized HTILE mask kernel through the public DCB/PM4 path, then uses the existing native depth readback to check that the production completion callback made the clear visible. Verification: - `agc_driver_native_multisample_depth_tests` compiled successfully. - `git diff --check` passed. - I launched the binary with `--clears`; execution stopped before GPU assertions because this host's Xeon E5-1620 v2 lacks the required LZCNT, BMI1, BMI2, MOVBE, AVX2, and FMA instructions. - `check_conventions.py --base origin/main` reports six existing non-conventional `Revert` commit subjects in the PR history; no finding pointed to this change. Could someone with a supported CPU/GPU run `agc_driver_native_multisample_depth_tests --clears` on this head and confirm the new production-path case passes?
MarcZX10 commented 2026-10-18 02:44:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T02:44:25Z.


I reviewed and carried Jan Šlégl’s two test-only commits from offer/7233-possible-ring-test onto this PR, preserving Jan as author. They correct the assertion to match the conservative possibleDropped behavior, then add controls that exercise exact-store coverage, refreshing an older slot before overflow, and overlapping without containment. No production tracking behavior changed.

Validation on this branch:

  • Linux GCC 12.2 built agc_write_tracking_tests; local execution returned 77 with no write watching: skipped on this host.
  • The native depth test target also compiles; its --clears execution is stopped by this host’s CPU feature guard before GPU assertions.
  • Amoenus reports an independent Windows GCC 15.2 Release run of agc_write_tracking passing 3/3 with write watching active on the offered commits.

The production-path HTILE dispatch case is also on this head. It still needs a supported CPU/GPU run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244852789 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244852789). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T02:44:25Z. --- I reviewed and carried Jan Šlégl’s two test-only commits from `offer/7233-possible-ring-test` onto this PR, preserving Jan as author. They correct the assertion to match the conservative `possibleDropped` behavior, then add controls that exercise exact-store coverage, refreshing an older slot before overflow, and overlapping without containment. No production tracking behavior changed. Validation on this branch: - Linux GCC 12.2 built `agc_write_tracking_tests`; local execution returned 77 with `no write watching: skipped` on this host. - The native depth test target also compiles; its `--clears` execution is stopped by this host’s CPU feature guard before GPU assertions. - Amoenus reports an independent Windows GCC 15.2 Release run of `agc_write_tracking` passing 3/3 with write watching active on the offered commits. The production-path HTILE dispatch case is also on this head. It still needs a supported CPU/GPU run.
MarcZX10 commented 2026-10-18 03:07:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T03:07:51Z.


Thanks for the updated exact-head results. The timeout and the later incomplete-transition failure are in the new Driver clear regression added by this PR, so I agree that case is not passing and should be resolved before treating the PR as fully validated. I see you are extracting the current-main follow-up with #7233 first; please link the branch/commit or PR when it is ready so I can review and carry the fix without duplicating your consumer-handoff work. I will keep the validation claim scoped to the tracker tests and won’t describe the Driver clear case as passing.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245031472 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245031472). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T03:07:51Z. --- Thanks for the updated exact-head results. The timeout and the later incomplete-transition failure are in the new Driver clear regression added by this PR, so I agree that case is not passing and should be resolved before treating the PR as fully validated. I see you are extracting the current-main follow-up with #7233 first; please link the branch/commit or PR when it is ready so I can review and carry the fix without duplicating your consumer-handoff work. I will keep the validation claim scoped to the tracker tests and won’t describe the Driver clear case as passing.
Amoenus commented 2026-10-18 03:19:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T03:19:09Z.


@MarcZX100 The focused consumer-handoff follow-up is ready for review as #7371, head8cc74c3298. Our own two-commit diff is5files,+70/-5; full Windows/Linux builds and the focused physical-GPU regressions pass. It preserves your662 prerequisite and Jan's authorship.

Proposed order remains #7233 first, then #7371 as its separate dependent follow-up, so please coordinate here before carrying the handoff into the parent. The Driver-fixture correction is still under investigation: the latest attempts reach guest-write guards, and I have no passing fixture fix ready to cherry-pick. Its exact-head failures and source-verified setup mismatches remain in the maintained validation comment.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245120477 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245120477). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-18T03:19:09Z. --- @MarcZX100 The focused consumer-handoff follow-up is ready for review as **#7371**, [head8cc74c3298](https://github.com/Amoenus/AnyPS5/commit/8cc74c3298f832a6f842609f0edc78aae7f986b2). [Our own two-commit diff](https://github.com/Amoenus/AnyPS5/compare/51a088b3b33c4ecba909c042919d8e0c6c555070...8cc74c3298f832a6f842609f0edc78aae7f986b2) is5files,+70/-5; full Windows/Linux builds and the focused physical-GPU regressions pass. It preserves your662 prerequisite and Jan's authorship. Proposed order remains **#7233 first, then #7371** as its separate dependent follow-up, so please coordinate here before carrying the handoff into the parent. The Driver-fixture correction is still under investigation: the latest attempts reach guest-write guards, and I have no passing fixture fix ready to cherry-pick. Its exact-head failures and source-verified setup mismatches remain in [the maintained validation comment](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244828184).
SleglJan commented 2026-10-18 04:09:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T04:09:21Z.


@MarcZX100 @Amoenus @oneandonlydean here are Linux results for 662e427f3 and #7371. Setup: RTX 3080, NVIDIA 615.78.08, Linux 7.2.10, GCC 16.2.1, Release.

  • Each head is built as is, with the same script for every tree.
  • #7371's head contains 662e427f3 merged with main 2626e5ee7, so its column is on a newer main than the other two.
main 0bb238b4a (#7233's base) #7233 662e427f3 #7371 8cc74c329
agc_driver_native_multisample_depth_tests --clears, run directly with a 120 s limit exits 0: "cases checked=24 unavailable=0" killed at 120 s: the 24 regular cases and CompletedPossibleStore finish, then no output in DriverDispatch killed at 120 s at the same point
agc_driver_native_depth_clears (ctest) passes timeout (30 s) timeout (30 s)
agc_driver_native_depth_bda_clear (#7228) passes: "complete=1", accepted fails: "complete=0", then "native multisample depth clear has no complete tracked HTILE store" passes (a changed test, see below): "complete=1", accepted
agc_write_tracking, agc_driver_native_multisample_depth, agc_driver_native_depth_retirement, agc_driver_native_depth_clear_refusals pass pass pass
  • The DriverDispatch timeout that Amoenus reports reproduces here, and #7371's head still has it.
  • agc_driver_native_depth_bda_clear fails on 662e427f3. There the full BDA clear's HTILE write counts only as a possible write, and the test dispatches through VulkanDevice::Dispatch without the clear's completion, so nothing records the write as complete.
  • #7371 changes this test (006d1b82f): its dispatch carries the completion, and it checks three consumers. So the #7371 column runs a different version of it.
  • ctest -R '^agc' -E '^agc_driver_native_depth_clears$' on 662e427f3: 679 of 681 pass. agc_driver_native_depth_bda_clear fails, and agc_driver_stencil_ref_export skips itself.

007 First Light, as I said I'd check: in three runs, no dispatch is recognized as the HTILE clear.

  • Each run carried a local trace of depth surface creation, kernel recognition and NoteHtileDepthClear.
  • The two runs on d88fbaa45 also traced CompleteHtileDepthClear, which the arm (c) tree doesn't have.
run tree depth surfaces created recognized HTILE clears
title screen to the menu's loading screen (1,800 s limit) #7233 at d88fbaa45 (the same non-test change as 662e427f3, on main 922dc8999) + #5799, #6317, #6332 and #6881 189, all single-sample 0
title screen (2,700 s limit) the same 204, all single-sample 0
64 frames of gameplay the arm (c) tree from my earlier comment, with your tracker commits but not the HTILE ones 1,930, all single-sample 0

Counts cover each whole run from boot.

  • In these runs the title creates no multisample depth surface, and no dispatch is recognized as the HTILE clear kernel. So these runs don't exercise the completion path, and they can't stand in for an end-to-end test. Your DriverDispatch case is that test once it passes.
  • The title-screen and gameplay runs had the title's #6172 patch; the menu run had the unpatched title. All three had scripted input.
  • Only the menu run had pipelined dispatch on (APS5_PIPELINE_DISPATCH=1).
  • The title-screen run never left the title screen, because of a harness limit on that tree.

One more point, from reading the code; I haven't measured it. At Execution/src/Driver/Dispatch/Dispatch.cpp:403-405, dispatch() runs again for the same packet. By then the outer call has already passed NoteHtileDepthClear, and the completion it holds (:122) is not attached. The same holds for the resolve-ahead rethrow at :434-438 when it comes from PrepareDispatch (:522); the call from :570 already carries the completion. The second call would then hit the overlap refusal in NoteHtileDepthClear (Graphics/src/DepthSurface.cpp:1313), and only a new surface clears that refusal.

  • Under default settings I don't see how the first path is reached. A capture read that overlaps a queued label records that label group first (Graphics/src/Recorder.cpp:1013-1019), so at :403 recordQueuedLabelsAfterCapture finds no overlap and returns false.
  • With APS5_NO_QUEUED_LABELS=1 or APS5_NO_LABEL_BATCHING=1, the queued labels are not noted for that hook (Execution/src/Driver/Packets/PacketFlush.cpp:17-18), and the path looks reachable.
  • In the title-screen and gameplay runs, [labels] reported 0 packets redone for a queued label over the capture (the :403 path), and [groupcap] reported 0 rejected by the device (the :434-438 path).

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245507550 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245507550). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T04:09:21Z. --- @MarcZX100 @Amoenus @oneandonlydean here are Linux results for 662e427f3 and #7371. Setup: RTX 3080, NVIDIA 615.78.08, Linux 7.2.10, GCC 16.2.1, Release. - Each head is built as is, with the same script for every tree. - #7371's head contains 662e427f3 merged with `main` 2626e5ee7, so its column is on a newer `main` than the other two. | | `main` 0bb238b4a (#7233's base) | #7233 662e427f3 | #7371 8cc74c329 | |---|---|---|---| | `agc_driver_native_multisample_depth_tests --clears`, run directly with a 120 s limit | exits 0: "cases checked=24 unavailable=0" | killed at 120 s: the 24 regular cases and `CompletedPossibleStore` finish, then no output in `DriverDispatch` | killed at 120 s at the same point | | `agc_driver_native_depth_clears` (ctest) | passes | timeout (30 s) | timeout (30 s) | | `agc_driver_native_depth_bda_clear` (#7228) | passes: "complete=1", accepted | fails: "complete=0", then "native multisample depth clear has no complete tracked HTILE store" | passes (a changed test, see below): "complete=1", accepted | | `agc_write_tracking`, `agc_driver_native_multisample_depth`, `agc_driver_native_depth_retirement`, `agc_driver_native_depth_clear_refusals` | pass | pass | pass | - The `DriverDispatch` timeout that Amoenus reports reproduces here, and #7371's head still has it. - `agc_driver_native_depth_bda_clear` fails on 662e427f3. There the full BDA clear's HTILE write counts only as a possible write, and the test dispatches through `VulkanDevice::Dispatch` without the clear's completion, so nothing records the write as complete. - #7371 changes this test (006d1b82f): its dispatch carries the completion, and it checks three consumers. So the #7371 column runs a different version of it. - `ctest -R '^agc' -E '^agc_driver_native_depth_clears$'` on 662e427f3: 679 of 681 pass. `agc_driver_native_depth_bda_clear` fails, and `agc_driver_stencil_ref_export` skips itself. 007 First Light, as I said I'd check: in three runs, no dispatch is recognized as the HTILE clear. - Each run carried a local trace of depth surface creation, kernel recognition and `NoteHtileDepthClear`. - The two runs on d88fbaa45 also traced `CompleteHtileDepthClear`, which the arm (c) tree doesn't have. | run | tree | depth surfaces created | recognized HTILE clears | |---|---|---|---| | title screen to the menu's loading screen (1,800 s limit) | #7233 at d88fbaa45 (the same non-test change as 662e427f3, on `main` 922dc8999) + #5799, #6317, #6332 and #6881 | 189, all single-sample | 0 | | title screen (2,700 s limit) | the same | 204, all single-sample | 0 | | 64 frames of gameplay | the arm (c) tree from my earlier comment, with your tracker commits but not the HTILE ones | 1,930, all single-sample | 0 | Counts cover each whole run from boot. - In these runs the title creates no multisample depth surface, and no dispatch is recognized as the HTILE clear kernel. So these runs don't exercise the completion path, and they can't stand in for an end-to-end test. Your `DriverDispatch` case is that test once it passes. - The title-screen and gameplay runs had the title's #6172 patch; the menu run had the unpatched title. All three had scripted input. - Only the menu run had pipelined dispatch on (`APS5_PIPELINE_DISPATCH=1`). - The title-screen run never left the title screen, because of a harness limit on that tree. One more point, from reading the code; I haven't measured it. At `Execution/src/Driver/Dispatch/Dispatch.cpp:403-405`, `dispatch()` runs again for the same packet. By then the outer call has already passed `NoteHtileDepthClear`, and the completion it holds (:122) is not attached. The same holds for the resolve-ahead rethrow at :434-438 when it comes from `PrepareDispatch` (:522); the call from :570 already carries the completion. The second call would then hit the overlap refusal in `NoteHtileDepthClear` (`Graphics/src/DepthSurface.cpp:1313`), and only a new surface clears that refusal. - Under default settings I don't see how the first path is reached. A capture read that overlaps a queued label records that label group first (`Graphics/src/Recorder.cpp:1013-1019`), so at :403 `recordQueuedLabelsAfterCapture` finds no overlap and returns false. - With `APS5_NO_QUEUED_LABELS=1` or `APS5_NO_LABEL_BATCHING=1`, the queued labels are not noted for that hook (`Execution/src/Driver/Packets/PacketFlush.cpp:17-18`), and the path looks reachable. - In the title-screen and gameplay runs, `[labels]` reported 0 packets redone for a queued label over the capture (the :403 path), and `[groupcap]` reported 0 rejected by the device (the :434-438 path). AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 04:23:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:23:31Z.


Thanks for running the exact heads and for separating the title runs that never exercise HTILE recognition from the completion-path regression. The RTX 3080 results confirm that DriverDispatch still hangs on both #7233 and #7371, while main completes; the title runs therefore do not validate this path. I will keep the completion change unvalidated until that case finishes and the completion-aware BDA regression passes on the intended head. The detailed timeout location or a stack trace, if available, would help isolate where the dispatch stalls.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245615251 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245615251). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T04:23:31Z. --- Thanks for running the exact heads and for separating the title runs that never exercise HTILE recognition from the completion-path regression. The RTX 3080 results confirm that `DriverDispatch` still hangs on both #7233 and #7371, while main completes; the title runs therefore do not validate this path. I will keep the completion change unvalidated until that case finishes and the completion-aware BDA regression passes on the intended head. The detailed timeout location or a stack trace, if available, would help isolate where the dispatch stalls.
Amoenus commented 2026-10-18 04:29:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T04:29:24Z.


@MarcZX100 @SleglJan I have no captured stack trace, but our fixture-only control localizes the first wait: main holds GpuMutex across the Driver case, which waits for the dispatch worker. Releasing that outer fixture lock around the case removes the timeout on RTX5080 and reaches the incomplete/unproven-clear refusal. Subsequent packet/extent corrections reach further guest-write guards; there is no passing Driver fix yet. Exact-head controls and the correction sequence are maintained in place; production guards remain intact.

Agreed that #7371's completion-aware BDA case is a changed fixture, not an unchanged-head pass for #7233, and the 007 runs do not validate unexercised HTILE completion. I also checked the cited dispatch re-entry ordering: recognition precedes both recursive calls. That is source evidence only; I have not reproduced its overlap refusal and will keep it separate from the confirmed fixture timeout.

AI-assisted: Codex; author responsible.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245658704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245658704). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-18T04:29:24Z. --- @MarcZX100 @SleglJan I have no captured stack trace, but our fixture-only control localizes the first wait: [main holds GpuMutex](https://github.com/boykopovar/AnyPS5/blob/662e427f398e8a9f834c63cd93cd30df44d8b3d9/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp#L1153) across the Driver case, which [waits for the dispatch worker](https://github.com/boykopovar/AnyPS5/blob/662e427f398e8a9f834c63cd93cd30df44d8b3d9/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp#L209). Releasing that outer fixture lock around the case removes the timeout on RTX5080 and reaches the incomplete/unproven-clear refusal. Subsequent packet/extent corrections reach further guest-write guards; there is no passing Driver fix yet. [Exact-head controls and the correction sequence](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244828184) are maintained in place; production guards remain intact. Agreed that #7371's completion-aware BDA case is a changed fixture, not an unchanged-head pass for #7233, and the 007 runs do not validate unexercised HTILE completion. I also checked the cited dispatch re-entry ordering: recognition precedes both recursive calls. That is source evidence only; I have not reproduced its overlap refusal and will keep it separate from the confirmed fixture timeout. AI-assisted: Codex; author responsible.
MarcZX10 commented 2026-10-18 04:30:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:30:19Z.


Thanks, that localizes the first wait to the fixture lock and separates it from the still-unproven HTILE clear. I agree that releasing the lock only removes the fixture timeout; it does not validate the production completion path, and the later refusal still needs to be resolved on the intended head. I also agree that #7371’s changed completion-aware fixture is separate evidence rather than a pass for #7233 as published.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245665419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245665419). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T04:30:19Z. --- Thanks, that localizes the first wait to the fixture lock and separates it from the still-unproven HTILE clear. I agree that releasing the lock only removes the fixture timeout; it does not validate the production completion path, and the later refusal still needs to be resolved on the intended head. I also agree that #7371’s changed completion-aware fixture is separate evidence rather than a pass for #7233 as published.
SleglJan commented 2026-10-18 04:45:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T04:45:55Z.


@MarcZX100 here are stacks of the DriverDispatch stall on 662e427f3. It is the deadlock Amoenus describes. Line numbers are from 662e427f3.

Setup: Linux, RTX 3080, a Release build (-O3 -g) of the test target only, --clears under gdb, interrupted after 30 s, thread apply all bt.

Test thread:

std::condition_variable::wait
AgcDriver::DriverDetail::Driver::WaitIdle           Execution/src/Driver/Lifecycle.cpp:181
AgcDriver::WaitIdle                                 Execution/src/Driver/EntryPoints.cpp:14
AgcDriverWaitIdle_nid_postfix                       Execution/src/Driver/EntryPoints.cpp:64
SubmitDriverHtileClear                              tests/execution/NativeMultisampleDepth.cpp:209
CheckDepthTarget                                    tests/execution/NativeMultisampleDepth.cpp:786
main                                                tests/execution/NativeMultisampleDepth.cpp:1183

It holds GuestMemory::GpuMutex() from the lock_guard at NativeMultisampleDepth.cpp:1153.

Queue worker running the submitted DISPATCH_DIRECT:

std::recursive_mutex::lock
AgcDriver::LockSpinning<std::recursive_mutex>       Execution/include/HandoffSpin.hpp:56
AgcDriver::GuestMemory::GpuMutexType::lock          Execution/src/GuestMemory.cpp:1969
AgcDriver::DriverDetail::Driver::dispatch           Execution/src/Driver/Dispatch/Dispatch.cpp:85
(packet lambda, PM4 0x15)                           Execution/src/Driver/Packets/PacketExecution.cpp:322
AgcDriver::DriverDetail::Driver::timed              Execution/src/Driver/Packets/PacketExecution.cpp:49
AgcDriver::DriverDetail::Driver::execute            Execution/src/Driver/Packets/PacketExecution.cpp:322
AgcDriver::DriverDetail::Driver::run                Execution/src/Driver/Queues/QueueWorker.cpp:263

The worker blocks on GpuMutex at Dispatch.cpp:85, where Driver::dispatch creates the driver's VulkanDevice because none is loaded yet (:82-88). That comes before the recognition at Dispatch.cpp:135-140, which is why no refusal text appears while the fixture holds the lock.

The other threads are idle condition-variable waits: two Mesa RADV disk-cache threads (from the iGPU's Vulkan driver), five NVIDIA driver threads and the AsyncLog thread.

#7371 at 8cc74c329 has the same two stacks, with the lines shifted: Lifecycle.cpp:180, GuestMemory.cpp:1968, main at NativeMultisampleDepth.cpp:1191 and the lock_guard at :1161. The rest are unchanged.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245782022 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245782022). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T04:45:55Z. --- @MarcZX100 here are stacks of the `DriverDispatch` stall on 662e427f3. It is the deadlock Amoenus describes. Line numbers are from 662e427f3. Setup: Linux, RTX 3080, a Release build (`-O3 -g`) of the test target only, `--clears` under gdb, interrupted after 30 s, `thread apply all bt`. Test thread: ``` std::condition_variable::wait AgcDriver::DriverDetail::Driver::WaitIdle Execution/src/Driver/Lifecycle.cpp:181 AgcDriver::WaitIdle Execution/src/Driver/EntryPoints.cpp:14 AgcDriverWaitIdle_nid_postfix Execution/src/Driver/EntryPoints.cpp:64 SubmitDriverHtileClear tests/execution/NativeMultisampleDepth.cpp:209 CheckDepthTarget tests/execution/NativeMultisampleDepth.cpp:786 main tests/execution/NativeMultisampleDepth.cpp:1183 ``` It holds `GuestMemory::GpuMutex()` from the `lock_guard` at `NativeMultisampleDepth.cpp:1153`. Queue worker running the submitted `DISPATCH_DIRECT`: ``` std::recursive_mutex::lock AgcDriver::LockSpinning<std::recursive_mutex> Execution/include/HandoffSpin.hpp:56 AgcDriver::GuestMemory::GpuMutexType::lock Execution/src/GuestMemory.cpp:1969 AgcDriver::DriverDetail::Driver::dispatch Execution/src/Driver/Dispatch/Dispatch.cpp:85 (packet lambda, PM4 0x15) Execution/src/Driver/Packets/PacketExecution.cpp:322 AgcDriver::DriverDetail::Driver::timed Execution/src/Driver/Packets/PacketExecution.cpp:49 AgcDriver::DriverDetail::Driver::execute Execution/src/Driver/Packets/PacketExecution.cpp:322 AgcDriver::DriverDetail::Driver::run Execution/src/Driver/Queues/QueueWorker.cpp:263 ``` The worker blocks on `GpuMutex` at `Dispatch.cpp:85`, where `Driver::dispatch` creates the driver's `VulkanDevice` because none is loaded yet (`:82-88`). That comes before the recognition at `Dispatch.cpp:135-140`, which is why no refusal text appears while the fixture holds the lock. The other threads are idle condition-variable waits: two Mesa RADV disk-cache threads (from the iGPU's Vulkan driver), five NVIDIA driver threads and the `AsyncLog` thread. #7371 at 8cc74c329 has the same two stacks, with the lines shifted: `Lifecycle.cpp:180`, `GuestMemory.cpp:1968`, `main` at `NativeMultisampleDepth.cpp:1191` and the `lock_guard` at `:1161`. The rest are unchanged. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 04:49:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:49:44Z.


Thanks for collecting the stacks. This identifies the timeout as a test-fixture deadlock: the test holds GuestMemory::GpuMutex() across WaitIdle, while the queue worker needs that mutex in Driver::dispatch before clear recognition runs. This separates the fixture timeout from the production HTILE completion path; the guard/refusal behavior still needs separate validation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245810111 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245810111). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T04:49:44Z. --- Thanks for collecting the stacks. This identifies the timeout as a test-fixture deadlock: the test holds `GuestMemory::GpuMutex()` across `WaitIdle`, while the queue worker needs that mutex in `Driver::dispatch` before clear recognition runs. This separates the fixture timeout from the production HTILE completion path; the guard/refusal behavior still needs separate validation.
MarcZX10 commented 2026-10-18 05:07:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:07:17Z.


Thanks for the stacks; they confirm the fixture holds GuestMemory::GpuMutex() while waiting for the queue worker that needs the same lock before it can reach the intended assertion.

I prototyped releasing the fixture's unique_lock around WaitIdle and reacquiring it on both success and exception. The focused target builds after a temporary, restored workaround for the unrelated GCC 12 Flags<MemoryFlags>() parse error. CTest on this Xeon aborts at the host CPU feature guard before assertions, so I cannot claim a local runtime pass. The PR branch is behind current main; my local rebase hit an earlier conflict in GuestMemory.cpp, so I have not pushed this test change. The existing #7233 head remains unchanged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245943828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245943828). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T05:07:17Z. --- Thanks for the stacks; they confirm the fixture holds `GuestMemory::GpuMutex()` while waiting for the queue worker that needs the same lock before it can reach the intended assertion. I prototyped releasing the fixture's `unique_lock` around `WaitIdle` and reacquiring it on both success and exception. The focused target builds after a temporary, restored workaround for the unrelated GCC 12 `Flags<MemoryFlags>()` parse error. CTest on this Xeon aborts at the host CPU feature guard before assertions, so I cannot claim a local runtime pass. The PR branch is behind current `main`; my local rebase hit an earlier conflict in `GuestMemory.cpp`, so I have not pushed this test change. The existing #7233 head remains unchanged.
SleglJan commented 2026-10-18 05:12:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T05:12:32Z.


@MarcZX100 if you push the prototype to a branch, I can run agc_driver_native_multisample_depth_tests --clears and the native depth ctests against it on the RTX 3080 (Linux; this CPU passes the feature guard). It can stay on 662e427f3's base; no rebase is needed for the run.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245984150 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6245984150). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T05:12:32Z. --- @MarcZX100 if you push the prototype to a branch, I can run `agc_driver_native_multisample_depth_tests --clears` and the native depth ctests against it on the RTX 3080 (Linux; this CPU passes the feature guard). It can stay on 662e427f3's base; no rebase is needed for the run. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 05:22:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:22:05Z.


I pushed the fixture-only prototype on codex/7233-unlock-fixture-wait, commit b7bc7865600391a8b423fc33929470517a7c5e0a, based directly on the current #7233 head 662e427f3; I have not rebased or changed the PR head. The change passes git diff --check and python3 tools/check_conventions.py --base upstream/pr-7233-current --head HEAD, and agc_driver_native_multisample_depth_tests builds on Linux/GCC 12. CTest aborts at the Xeon E5-1620 v2 CPU-feature guard before reaching assertions, so I do not have a local runtime result. The one-line template workaround for the unrelated GCC 12 parse error in SrtDescriptorEvaluation.cpp was restored and is not in this branch. Could you run agc_driver_native_multisample_depth_tests --clears and the native-depth CTests against this branch on the RTX 3080 when convenient?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246055383 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246055383). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T05:22:05Z. --- I pushed the fixture-only prototype on [codex/7233-unlock-fixture-wait](https://github.com/MarcZX100/AnyPS5/tree/codex/7233-unlock-fixture-wait), commit `b7bc7865600391a8b423fc33929470517a7c5e0a`, based directly on the current #7233 head `662e427f3`; I have not rebased or changed the PR head. The change passes `git diff --check` and `python3 tools/check_conventions.py --base upstream/pr-7233-current --head HEAD`, and `agc_driver_native_multisample_depth_tests` builds on Linux/GCC 12. CTest aborts at the Xeon E5-1620 v2 CPU-feature guard before reaching assertions, so I do not have a local runtime result. The one-line `template` workaround for the unrelated GCC 12 parse error in `SrtDescriptorEvaluation.cpp` was restored and is not in this branch. Could you run `agc_driver_native_multisample_depth_tests --clears` and the native-depth CTests against this branch on the RTX 3080 when convenient?
Amoenus commented 2026-10-18 05:53:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T05:53:09Z.


Current consumer-handoff validation (2026-10-18): #7371 now follows your rebased 348a5345d3 directly. Its two handoff commits are unchanged; full Windows/Linux builds and the focused matrix pass (57 invocations, plus the documented Linux BDA write-watch skip). Our own scope remains five files, +70/-5. The prerequisite Driver/PM4 clear fixture is excluded from that passing matrix and remains separately disclosed; this does not establish that Driver case as passing.

Earlier exact-b7 results and the CPU-validated rebase offer

@MarcZX100 I tested your exact b7bc786560 prototype on RTX 5080, Radeon Graphics, and Linux lavapipe. The timeout is gone on all three; the Driver clear test still fails at the incomplete/unproven transition guard (Linux aborts after printing it). The other native depth, retirement, and refusal groups each passed three fresh runs per device. Production guards were unchanged. I updated the existing validation report with the exact scope and results; this supports the wait correction, but does not yet validate the clear-completion path.

Separate rebase offer: db4c0d39fe on our fork merges exact 662e427f3 with main 66e71b63d1, retaining your original commits and Jan's credit. The GuestMemory.cpp resolution retains main's partial-watch stamping and carries your complete flag through stampWatchedPart; completed own stores pass true. It adds a partly watched MarkPossiblyWritten regression. The CPU write-tracking group passes 3/3 on Windows and 3/3 on Linux; disabling partial-watch stamping for possible writes fails the new assertion 3/3 on Windows, then restoring it passes 3/3. Conventions pass. This is a CPU-validated source rebase offer, not a full/GPU-validated integration or upstream submission, and does not include your separate b7 prototype.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246286348 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246286348). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-18T05:53:09Z. --- **Current consumer-handoff validation (2026-10-18):** [#7371](https://github.com/boykopovar/AnyPS5/pull/7371) now follows your rebased `348a5345d3` directly. Its two handoff commits are unchanged; full Windows/Linux builds and the focused matrix pass (57 invocations, plus the documented Linux BDA write-watch skip). Our own scope remains five files, +70/-5. The prerequisite Driver/PM4 clear fixture is excluded from that passing matrix and remains separately disclosed; this does not establish that Driver case as passing. <details> <summary>Earlier exact-b7 results and the CPU-validated rebase offer</summary> @MarcZX100 I tested your exact `b7bc786560` prototype on RTX 5080, Radeon Graphics, and Linux lavapipe. The timeout is gone on all three; the Driver clear test still fails at the incomplete/unproven transition guard (Linux aborts after printing it). The other native depth, retirement, and refusal groups each passed three fresh runs per device. Production guards were unchanged. I updated the [existing validation report](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244828184) with the exact scope and results; this supports the wait correction, but does not yet validate the clear-completion path. Separate rebase offer: [`db4c0d39fe` on our fork](https://github.com/Amoenus/AnyPS5/commit/db4c0d39fe4302254b0402d7e1e32a62bc29dcb0) merges exact `662e427f3` with main `66e71b63d1`, retaining your original commits and Jan's credit. The `GuestMemory.cpp` resolution retains main's partial-watch stamping and carries your `complete` flag through `stampWatchedPart`; completed own stores pass `true`. It adds a partly watched `MarkPossiblyWritten` regression. The CPU write-tracking group passes 3/3 on Windows and 3/3 on Linux; disabling partial-watch stamping for possible writes fails the new assertion 3/3 on Windows, then restoring it passes 3/3. Conventions pass. This is a CPU-validated source rebase offer, not a full/GPU-validated integration or upstream submission, and does not include your separate `b7` prototype. </details>
MarcZX10 commented 2026-10-18 05:57:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:57:28Z.


Thanks for testing the exact fixture prototype on the RTX 5080, Radeon iGPU, and lavapipe. That confirms the fixture lock was the source of the timeout across those backends, while the incomplete-transition guard remains a separate failing production-path assertion; I will keep the PR’s validation scoped accordingly. I am reviewing your attribution-preserving rebase composition against current main now, then I will continue on the clear-path test without relaxing its production guards.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246320371 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246320371). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T05:57:28Z. --- Thanks for testing the exact fixture prototype on the RTX 5080, Radeon iGPU, and lavapipe. That confirms the fixture lock was the source of the timeout across those backends, while the incomplete-transition guard remains a separate failing production-path assertion; I will keep the PR’s validation scoped accordingly. I am reviewing your attribution-preserving rebase composition against current `main` now, then I will continue on the clear-path test without relaxing its production guards.
SleglJan commented 2026-10-18 06:04:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T06:04:48Z.


@MarcZX100 here are results for b7bc78656 on the RTX 3080 (Linux, NVIDIA 615.78.08, GCC 16.2.1, Release). Its diff against 662e427f3 touches only tests/execution/NativeMultisampleDepth.cpp.

On b7bc78656 as is:

  • --clears no longer hangs. The 24 regular cases and CompletedPossibleStore pass, then DriverDispatch fails with "native multisample depth incomplete or unproven fast-clear transition is not implemented", as Amoenus reports.
  • ctest: agc_driver_native_depth_clears fails in 0.47 s (no timeout). agc_driver_native_depth_bda_clear still fails as on 662e427f3.
  • agc_write_tracking, agc_driver_native_multisample_depth, agc_driver_native_depth_retirement and agc_driver_native_depth_clear_refusals pass.
  • ^agc overall: 679 of 682 pass. Those 2 fail, and agc_driver_stencil_ref_export skips itself.

Where the refusal comes from, per a local [htile] trace in the driver:

  • The worker recognizes the dispatch and its HTILE address.
  • NoteHtileDepthClear(htile, bytes = 1024, nativeBytes = 0) then takes the refusal branch (Graphics/src/DepthSurface.cpp:1312) and records no completion.
  • The refusal is thrown later in CheckCurrent (:204), called from DepthSurfaceHolds (:1431) and CheckDepthTarget (NativeMultisampleDepth.cpp:812).

Two things in the test's packet (SubmitDriverHtileClear) cause it. Both are already in Amoenus's validation comment:

  • COMPUTE_PGM_RSRC2 = 8 << 1 means eight user SGPRs and no X group id. HtileDepthClearBytes_nid_no_patch needs six user words and groupIdEnable[0] (bit 7), so it returns 0.
  • DISPATCH_DIRECT x = 1 covers 1,024 bytes (64 threads × 16), while this target's HTILE is 32,768 bytes. His diagnostic shows native = 1,024 against the 32,768 required once the SGPR flags are corrected.

I changed both locally (not pushed). The hardcoded 0xf0 words he also flags are unchanged:

-    append(DriverPm4Packet(0x76u, {0x213u, 8u << 1u}));
+    append(DriverPm4Packet(0x76u, {0x213u, (6u << 1u) | (1u << 7u)}));
-    append(DriverPm4Packet(0x15u, {static_cast<std::uint32_t>(1u), 1u, 1u, 0x41u}));
+    append(DriverPm4Packet(0x15u, {static_cast<std::uint32_t>(metadataBytes / 1024u), 1u, 1u, 0x41u}));

Here metadataBytes = HtileMetadataBytes(extent) is passed in from CheckDepthTarget. With that change, the case gets further along the production path:

  • the recognized clear is accepted: 32,768 bytes, and NoteHtileDepthClear returns true;
  • the completion is attached to the recorded dispatch;
  • CheckCurrent runs with the clear pending and no refusal;
  • CompleteHtileDepthClear is entered after CheckCurrent (both take surfacesMutex; its trace line comes second).

Then it fails with "CPU writes raced native multisample depth clear". That comes from CheckCurrent's UnchangedSinceCollected(metadata.address, metadata.bytes, clearGeneration) check (DepthSurface.cpp:214), the CPU-race guard Amoenus reached after his corrections. CompleteHtileDepthClear printed no trace line after its MarkWritten. It has the same check (:1336).

A possible cause I haven't verified: on this host, the run prints that importing a range dirties its watched pages, while a GPU write doesn't ("0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import"). If the HTILE range is imported for the kernel after the clear is accepted, that import would read as a CPU write since clearGeneration.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246376328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246376328). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T06:04:48Z. --- @MarcZX100 here are results for b7bc78656 on the RTX 3080 (Linux, NVIDIA 615.78.08, GCC 16.2.1, Release). Its diff against 662e427f3 touches only `tests/execution/NativeMultisampleDepth.cpp`. On b7bc78656 as is: - `--clears` no longer hangs. The 24 regular cases and `CompletedPossibleStore` pass, then `DriverDispatch` fails with "native multisample depth incomplete or unproven fast-clear transition is not implemented", as Amoenus reports. - ctest: `agc_driver_native_depth_clears` fails in 0.47 s (no timeout). `agc_driver_native_depth_bda_clear` still fails as on 662e427f3. - `agc_write_tracking`, `agc_driver_native_multisample_depth`, `agc_driver_native_depth_retirement` and `agc_driver_native_depth_clear_refusals` pass. - `^agc` overall: 679 of 682 pass. Those 2 fail, and `agc_driver_stencil_ref_export` skips itself. Where the refusal comes from, per a local `[htile]` trace in the driver: - The worker recognizes the dispatch and its HTILE address. - `NoteHtileDepthClear(htile, bytes = 1024, nativeBytes = 0)` then takes the refusal branch (`Graphics/src/DepthSurface.cpp:1312`) and records no completion. - The refusal is thrown later in `CheckCurrent` (`:204`), called from `DepthSurfaceHolds` (`:1431`) and `CheckDepthTarget` (`NativeMultisampleDepth.cpp:812`). Two things in the test's packet (`SubmitDriverHtileClear`) cause it. Both are already in Amoenus's validation comment: - `COMPUTE_PGM_RSRC2 = 8 << 1` means eight user SGPRs and no X group id. `HtileDepthClearBytes_nid_no_patch` needs six user words and `groupIdEnable[0]` (bit 7), so it returns 0. - `DISPATCH_DIRECT` x = 1 covers 1,024 bytes (64 threads × 16), while this target's HTILE is 32,768 bytes. His diagnostic shows native = 1,024 against the 32,768 required once the SGPR flags are corrected. I changed both locally (not pushed). The hardcoded `0xf0` words he also flags are unchanged: ``` - append(DriverPm4Packet(0x76u, {0x213u, 8u << 1u})); + append(DriverPm4Packet(0x76u, {0x213u, (6u << 1u) | (1u << 7u)})); - append(DriverPm4Packet(0x15u, {static_cast<std::uint32_t>(1u), 1u, 1u, 0x41u})); + append(DriverPm4Packet(0x15u, {static_cast<std::uint32_t>(metadataBytes / 1024u), 1u, 1u, 0x41u})); ``` Here `metadataBytes = HtileMetadataBytes(extent)` is passed in from `CheckDepthTarget`. With that change, the case gets further along the production path: - the recognized clear is accepted: 32,768 bytes, and `NoteHtileDepthClear` returns true; - the completion is attached to the recorded dispatch; - `CheckCurrent` runs with the clear pending and no refusal; - `CompleteHtileDepthClear` is entered after `CheckCurrent` (both take `surfacesMutex`; its trace line comes second). Then it fails with "CPU writes raced native multisample depth clear". That comes from `CheckCurrent`'s `UnchangedSinceCollected(metadata.address, metadata.bytes, clearGeneration)` check (`DepthSurface.cpp:214`), the CPU-race guard Amoenus reached after his corrections. `CompleteHtileDepthClear` printed no trace line after its `MarkWritten`. It has the same check (`:1336`). A possible cause I haven't verified: on this host, the run prints that importing a range dirties its watched pages, while a GPU write doesn't ("0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import"). If the HTILE range is imported for the kernel after the clear is accepted, that import would read as a CPU write since `clearGeneration`. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 06:16:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T06:16:08Z.


I traced the remaining DriverDispatch refusal to three fixture inputs, without changing production guards: COMPUTE_PGM_RSRC2 must encode six user SGPRs and GROUP_ID_X_EN ((6u << 1u) | 0x80u); the 5x3 HTILE extent is 32,768 bytes, so the dispatch needs 32 groups at 1,024 bytes/group; and the masked store computes (original & userData[5]) | userData[4], so the combined clear needs userData[4] = 0xfffc00f0 and userData[5] = 0.

I applied those fixture-only edits in the rebased worktree and built agc_driver_native_multisample_depth_tests successfully. The runtime exits before the test starts because this Linux host (Xeon E5-1620 v2) lacks the AVX2/BMI/FMA features required by the test runner. The build also needed a temporary local template disambiguator at SrtDescriptorEvaluation.cpp:186 for GCC 12; both temporary source edits have been reverted and the worktree is clean. I have not pushed or claimed a passing runtime result. Could someone with a supported CPU run the corrected --clears fixture on the current PR head?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246465658 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246465658). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T06:16:08Z. --- I traced the remaining `DriverDispatch` refusal to three fixture inputs, without changing production guards: `COMPUTE_PGM_RSRC2` must encode six user SGPRs and `GROUP_ID_X_EN` (`(6u << 1u) | 0x80u`); the 5x3 HTILE extent is 32,768 bytes, so the dispatch needs 32 groups at 1,024 bytes/group; and the masked store computes `(original & userData[5]) | userData[4]`, so the combined clear needs `userData[4] = 0xfffc00f0` and `userData[5] = 0`. I applied those fixture-only edits in the rebased worktree and built `agc_driver_native_multisample_depth_tests` successfully. The runtime exits before the test starts because this Linux host (Xeon E5-1620 v2) lacks the AVX2/BMI/FMA features required by the test runner. The build also needed a temporary local `template` disambiguator at `SrtDescriptorEvaluation.cpp:186` for GCC 12; both temporary source edits have been reverted and the worktree is clean. I have not pushed or claimed a passing runtime result. Could someone with a supported CPU run the corrected `--clears` fixture on the current PR head?
MarcZX10 commented 2026-10-18 06:16:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T06:16:12Z.


Clarification on the build setup: the isolated CMake build used -DCMAKE_CXX_FLAGS=-fpermissive in addition to the temporary template disambiguator, to get past GCC 12’s baseline parse failure. This is a compile-only result under that local workaround, not a clean standard-flags build.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246466187 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246466187). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T06:16:12Z. --- Clarification on the build setup: the isolated CMake build used `-DCMAKE_CXX_FLAGS=-fpermissive` in addition to the temporary `template` disambiguator, to get past GCC 12’s baseline parse failure. This is a compile-only result under that local workaround, not a clean standard-flags build.
SleglJan commented 2026-10-18 06:38:54 +00:00 (Migrated from github.com)

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


@MarcZX100 I ran all three fixture corrections together on the RTX 3080 (Linux, NVIDIA 615.78.08). They are local, on top of b7bc78656:

  • COMPUTE_PGM_RSRC2 set to (6u << 1u) | (1u << 7u);
  • DISPATCH_DIRECT x set to metadataBytes / 1024 (32 here);
  • userData[4] = 0xfffc00f0 and userData[5] = 0 (registers 0x244/0x245).

I haven't run the current head 348a5345d. Its NativeMultisampleDepth.cpp is the same as on 662e427f3, so it has neither your lock release nor these corrections. Line numbers below are from b7bc78656.

DriverDispatch still fails, at the same place as with the first two corrections: "CPU writes raced native multisample depth clear", from CheckCurrent's UnchangedSinceCollected check (Graphics/src/DepthSurface.cpp:214). It fails the same way with and without my local trace. The run gets this far:

  • the clear is recognized and accepted, at 32,768 bytes;
  • the completion is attached;
  • CheckCurrent runs with the clear pending;
  • CompleteHtileDepthClear is entered, but its trace line after MarkWritten doesn't appear before the test exits.

So the user-data change doesn't move the stop. Going by the code, CheckCurrent checks the HTILE words (htileProvesClear, :221) only after this guard.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246647000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246647000). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T06:38:54Z. --- @MarcZX100 I ran all three fixture corrections together on the RTX 3080 (Linux, NVIDIA 615.78.08). They are local, on top of b7bc78656: - `COMPUTE_PGM_RSRC2` set to `(6u << 1u) | (1u << 7u)`; - `DISPATCH_DIRECT` x set to `metadataBytes / 1024` (32 here); - `userData[4] = 0xfffc00f0` and `userData[5] = 0` (registers 0x244/0x245). I haven't run the current head 348a5345d. Its `NativeMultisampleDepth.cpp` is the same as on 662e427f3, so it has neither your lock release nor these corrections. Line numbers below are from b7bc78656. `DriverDispatch` still fails, at the same place as with the first two corrections: "CPU writes raced native multisample depth clear", from `CheckCurrent`'s `UnchangedSinceCollected` check (`Graphics/src/DepthSurface.cpp:214`). It fails the same way with and without my local trace. The run gets this far: - the clear is recognized and accepted, at 32,768 bytes; - the completion is attached; - `CheckCurrent` runs with the clear pending; - `CompleteHtileDepthClear` is entered, but its trace line after `MarkWritten` doesn't appear before the test exits. So the user-data change doesn't move the stop. Going by the code, `CheckCurrent` checks the HTILE words (`htileProvesClear`, `:221`) only after this guard. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-18 06:40:54 +00:00 (Migrated from github.com)

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


@MarcZX10 thanks for tracing the DriverDispatch refusal. The new head 348a5345d3 looks like a rebase of the same commits onto current main: the test files are byte-identical to 662e427f3, and b7bc786560 isn't on the PR branch. Could you push the fixture corrections from your 06:16Z comment (the COMPUTE_PGM_RSRC2 SGPR/GROUP_ID_X_EN encoding, 32 groups for the 32 KiB HTILE extent, and the rest) as a commit on this branch? We'll run full CI and the depth-clear tests on it straight away. The production side still reads correct after the rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246663798 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6246663798). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-18T06:40:54Z. --- @MarcZX10 thanks for tracing the `DriverDispatch` refusal. The new head 348a5345d3 looks like a rebase of the same commits onto current main: the test files are byte-identical to 662e427f3, and b7bc786560 isn't on the PR branch. Could you push the fixture corrections from your 06:16Z comment (the `COMPUTE_PGM_RSRC2` SGPR/`GROUP_ID_X_EN` encoding, 32 groups for the 32 KiB HTILE extent, and the rest) as a commit on this branch? We'll run full CI and the depth-clear tests on it straight away. The production side still reads correct after the rebase.
MarcZX10 commented 2026-10-18 12:02:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T12:02:12Z.


Pushed the requested fixture corrections in 42cbe0c33:

  • advertise six user SGPRs and enable X group ID in COMPUTE_PGM_RSRC2;
  • dispatch 32 groups to cover the full 32 KiB HTILE extent;
  • use clear mask 0xfffc00f0 and zero the second mask word.

Validation on Linux: both focused targets compiled. agc_write_tracking_tests ran and skipped because write-watch is unavailable on this Linux host. agc_driver_native_multisample_depth_tests stops at the existing host CPU guard (Xeon E5-1620 v2 lacks LZCNT, BMI1/2, AVX2, and FMA), before exercising the Vulkan test. git diff --check and tools/check_conventions.py --base upstream/main passed. Hosted build jobs are skipped by the current path filters; conventions, eligibility, and report jobs passed on the preceding head. Please run the GPU-backed test on supported hardware for the final result.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6249673511 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6249673511). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T12:02:12Z. --- Pushed the requested fixture corrections in `42cbe0c33`: - advertise six user SGPRs and enable X group ID in `COMPUTE_PGM_RSRC2`; - dispatch 32 groups to cover the full 32 KiB HTILE extent; - use clear mask `0xfffc00f0` and zero the second mask word. Validation on Linux: both focused targets compiled. `agc_write_tracking_tests` ran and skipped because write-watch is unavailable on this Linux host. `agc_driver_native_multisample_depth_tests` stops at the existing host CPU guard (Xeon E5-1620 v2 lacks LZCNT, BMI1/2, AVX2, and FMA), before exercising the Vulkan test. `git diff --check` and `tools/check_conventions.py --base upstream/main` passed. Hosted build jobs are skipped by the current path filters; conventions, eligibility, and report jobs passed on the preceding head. Please run the GPU-backed test on supported hardware for the final result.
MarcZX10 commented 2026-10-18 12:30:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T12:30:56Z.


Full main workflow-dispatch run 39126421629 at 0d078f75d gives a useful baseline: Linux CTest timed out agc_driver_native_depth_clears at its configured 30 s limit (***Timeout 30.02 sec; 1 of 1,446 tests failed). This is consistent with the queue-wait issue this PR addresses, but it is an unmodified-main run, not validation of this branch. The Windows run had a separate timeout in shader_cache_native_paths.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6249939591 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6249939591). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T12:30:56Z. --- Full `main` workflow-dispatch run `39126421629` at `0d078f75d` gives a useful baseline: Linux CTest timed out `agc_driver_native_depth_clears` at its configured 30 s limit (`***Timeout 30.02 sec`; 1 of 1,446 tests failed). This is consistent with the queue-wait issue this PR addresses, but it is an unmodified-main run, not validation of this branch. The Windows run had a separate timeout in `shader_cache_native_paths`.
oneandonlydean commented 2026-10-18 12:51:55 +00:00 (Migrated from github.com)

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


Thanks for the register fix. The pushed commit has the RSRC2/group/mask corrections but not b7bc786560 ("release GPU lock while waiting for driver queue"), which was what removed the timeout in Amoenus's runs. On 42cbe0c3 SubmitDriverHtileClear still calls AgcDriverWaitIdle_nid_postfix() while the test's outer lock_guard holds the GPU mutex, and full CI on 42cbe0c3 confirms it: agc_driver_native_depth_clears timed out at 30 s on Linux. (Run 39126421629 is a PR build, not plain main: it's dispatched from main with pr=7233, and its "Merge the pull request into main" step merges refs/pull/7233/head 42cbe0c33 into 0d078f75d (11 files, including NativeMultisampleDepth.cpp) before building. So the timeout is on this branch.) Could you push b7bc786560 (or the equivalent unlock around the wait) on top?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250135873 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250135873). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-18T12:51:55Z. --- Thanks for the register fix. The pushed commit has the RSRC2/group/mask corrections but not b7bc786560 ("release GPU lock while waiting for driver queue"), which was what removed the timeout in Amoenus's runs. On 42cbe0c3 `SubmitDriverHtileClear` still calls `AgcDriverWaitIdle_nid_postfix()` while the test's outer `lock_guard` holds the GPU mutex, and full CI on 42cbe0c3 confirms it: `agc_driver_native_depth_clears` timed out at 30 s on Linux. (Run 39126421629 is a PR build, not plain main: it's dispatched from main with `pr=7233`, and its "Merge the pull request into main" step merges `refs/pull/7233/head` 42cbe0c33 into 0d078f75d (11 files, including NativeMultisampleDepth.cpp) before building. So the timeout is on this branch.) Could you push b7bc786560 (or the equivalent unlock around the wait) on top?
SleglJan commented 2026-10-18 13:32:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T13:32:10Z.


@MarcZX10 @oneandonlydean results for 42cbe0c33 on the RTX 3080 (Linux, NVIDIA 615.78.08, Release).

As pushed, matching oneandonlydean's CI run:

  • --clears prints nothing after the 25 earlier cases (the 24 regular ones and CompletedPossibleStore) and was killed at 120 s. That's the same stop as on 662e427f3.
  • ctest: agc_driver_native_depth_clears times out (30 s), and agc_driver_native_depth_bda_clear fails as before ("complete=0", "no complete tracked HTILE store").
  • agc_write_tracking, agc_driver_native_multisample_depth, _depth_retirement and _depth_clear_refusals pass.
  • ^agc: 696 of 699 pass. Those 2 fail, and agc_driver_stencil_ref_export skips itself.

With b7bc78656's lock release cherry-picked on top (local), your corrected packets get the clear recognized:

  • The clear is accepted at 32,768 bytes, and the completion is attached to the recorded dispatch.
  • CheckCurrent runs with the clear pending. CompleteHtileDepthClear is entered only after it: both hold surfacesMutex, and its trace line comes second. Its trace line after MarkWritten doesn't appear before the test exits.

The case then fails with "CPU writes raced native multisample depth clear". The throw is CheckCurrent's first check with that text (gdb on that local tree, line numbers mapped to 42cbe0c33):

Require                    Graphics/include/Context.hpp:74
DepthSurface::CheckCurrent Graphics/src/DepthSurface.cpp:313
DepthSurfaceHolds          Graphics/src/DepthSurface.cpp:1647
CheckDepthTarget           tests/execution/NativeMultisampleDepth.cpp:808
main                       tests/execution/NativeMultisampleDepth.cpp:1183   (ClearFault::DriverDispatch)

The same frames and the same stop showed up on 662e427f3 with b7bc78656 and the same corrections (local), so the rebase onto 1b0c7cfa0 didn't change it.

The completion's MarkWritten isn't what fails :313:

  • In this run, the completion runs only after the failed check (above).
  • In CompletedPossibleStore, which passes, the test calls CompleteHtileDepthClear before CheckCurrent. Its MarkWritten returns generation 3329, newer than that case's clearGeneration 3326, and :313 holds.
  • From reading the code: UnchangedSinceCollected (Execution/src/GuestMemory.cpp:1742) compares only CPU stamps, i.e. the per-page stamps from noteCpuStore or the block's CPU stamp. MarkWritten stamps its blocks as driver stores (:1592), which set neither. Its collect beforehand (:1576) stamps only pages that were already dirty, which the check's own collect would find anyway.

From reading the code, not measured, :313 does count a host import inside the clear window:

  • After an import, ImportWatched collects the range's dirty pages as CPU writes (:1449).
  • stampWrittenRun gives those pages CPU stamps even where the bytes didn't change (:1174). The import-window kind only keeps those blocks out of the stored stamp (:1058).
  • On this host, an import dirties its pages ("4 after the import").
  • The driver's VulkanDevice is created in this dispatch (Execution/src/Driver/Dispatch/Dispatch.cpp:86, before the note at :139). So any import it makes for the dispatch comes after clearGeneration was collected.

I haven't confirmed that the HTILE allocation is imported in this run. One more point from the code, also unverified: Driver::WaitIdle (Execution/src/Driver/Lifecycle.cpp:175-184) waits until the worker has processed what was submitted, not for the completion. The completion runs when the batch is reaped, which is why CheckCurrent comes first here. With this fixture order, :314 ("no complete tracked HTILE store") would likely be the next stop even if :313 held.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250518395 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250518395). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T13:32:10Z. --- @MarcZX10 @oneandonlydean results for 42cbe0c33 on the RTX 3080 (Linux, NVIDIA 615.78.08, Release). As pushed, matching oneandonlydean's CI run: - `--clears` prints nothing after the 25 earlier cases (the 24 regular ones and `CompletedPossibleStore`) and was killed at 120 s. That's the same stop as on 662e427f3. - ctest: `agc_driver_native_depth_clears` times out (30 s), and `agc_driver_native_depth_bda_clear` fails as before ("complete=0", "no complete tracked HTILE store"). - `agc_write_tracking`, `agc_driver_native_multisample_depth`, `_depth_retirement` and `_depth_clear_refusals` pass. - `^agc`: 696 of 699 pass. Those 2 fail, and `agc_driver_stencil_ref_export` skips itself. With b7bc78656's lock release cherry-picked on top (local), your corrected packets get the clear recognized: - The clear is accepted at 32,768 bytes, and the completion is attached to the recorded dispatch. - `CheckCurrent` runs with the clear pending. `CompleteHtileDepthClear` is entered only after it: both hold `surfacesMutex`, and its trace line comes second. Its trace line after `MarkWritten` doesn't appear before the test exits. The case then fails with "CPU writes raced native multisample depth clear". The throw is `CheckCurrent`'s first check with that text (gdb on that local tree, line numbers mapped to 42cbe0c33): ``` Require Graphics/include/Context.hpp:74 DepthSurface::CheckCurrent Graphics/src/DepthSurface.cpp:313 DepthSurfaceHolds Graphics/src/DepthSurface.cpp:1647 CheckDepthTarget tests/execution/NativeMultisampleDepth.cpp:808 main tests/execution/NativeMultisampleDepth.cpp:1183 (ClearFault::DriverDispatch) ``` The same frames and the same stop showed up on 662e427f3 with b7bc78656 and the same corrections (local), so the rebase onto 1b0c7cfa0 didn't change it. The completion's `MarkWritten` isn't what fails `:313`: - In this run, the completion runs only after the failed check (above). - In `CompletedPossibleStore`, which passes, the test calls `CompleteHtileDepthClear` before `CheckCurrent`. Its `MarkWritten` returns generation 3329, newer than that case's `clearGeneration` 3326, and `:313` holds. - From reading the code: `UnchangedSinceCollected` (`Execution/src/GuestMemory.cpp:1742`) compares only CPU stamps, i.e. the per-page stamps from `noteCpuStore` or the block's CPU stamp. `MarkWritten` stamps its blocks as driver stores (`:1592`), which set neither. Its collect beforehand (`:1576`) stamps only pages that were already dirty, which the check's own collect would find anyway. From reading the code, not measured, `:313` does count a host import inside the clear window: - After an import, `ImportWatched` collects the range's dirty pages as CPU writes (`:1449`). - `stampWrittenRun` gives those pages CPU stamps even where the bytes didn't change (`:1174`). The import-window kind only keeps those blocks out of the stored stamp (`:1058`). - On this host, an import dirties its pages ("4 after the import"). - The driver's `VulkanDevice` is created in this dispatch (`Execution/src/Driver/Dispatch/Dispatch.cpp:86`, before the note at `:139`). So any import it makes for the dispatch comes after `clearGeneration` was collected. I haven't confirmed that the HTILE allocation is imported in this run. One more point from the code, also unverified: `Driver::WaitIdle` (`Execution/src/Driver/Lifecycle.cpp:175-184`) waits until the worker has processed what was submitted, not for the completion. The completion runs when the batch is reaped, which is why `CheckCurrent` comes first here. With this fixture order, `:314` ("no complete tracked HTILE store") would likely be the next stop even if `:313` held. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 13:52:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T13:52:45Z.


Thanks for the independent rerun and stack trace. The CheckCurrent failure at :313 appears to precede completion, while the proposed lock release addresses the earlier wait timeout; the import-window CPU stamps you describe could be a separate cause. Before changing the patch, could you isolate whether the HTILE range is imported during this dispatch and whether CheckCurrent still fails with that import suppressed? That would distinguish the import-window hypothesis from a fixture/order issue. I would keep the lock-release change and this new failure separately validated.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250721334 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250721334). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T13:52:45Z. --- Thanks for the independent rerun and stack trace. The `CheckCurrent` failure at `:313` appears to precede completion, while the proposed lock release addresses the earlier wait timeout; the import-window CPU stamps you describe could be a separate cause. Before changing the patch, could you isolate whether the HTILE range is imported during this dispatch and whether `CheckCurrent` still fails with that import suppressed? That would distinguish the import-window hypothesis from a fixture/order issue. I would keep the lock-release change and this new failure separately validated.
oneandonlydean commented 2026-10-18 13:54:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T13:54:42Z.


Thanks @SleglJan, that narrows it a lot. @MarcZX10, with b7bc786560 the hang is gone and the clear is recognized, so the remaining DriverDispatch failure looks like two things:

  1. The new guard can count the driver's own import as a CPU write. The "CPU writes raced native multisample depth clear" check (DepthSurface.cpp:313, added by this PR) uses UnchangedSinceCollected, which reads the per-page CPU stamps. On main, an import's collect gives its dirty pages CPU stamps even in the import window (stampWrittenRun calls noteCpuStore for every kind except Driver, GuestMemory.cpp:1174; the window kind only changes the block stamp). On hosts where an import dirties its pages (SleglJan's 3080: "4 after the import"), importing the HTILE range after clearGeneration is taken makes the guard refuse a clear nobody raced. In this test the VulkanDevice is created inside the dispatch, so its import of the HTILE range lands inside the window. Could you confirm with APS5_TRACE_HOST_IMPORT=1? If it does, I'd fix it in the product rather than the test: collect or import the metadata range before recording clearGeneration when the clear is accepted, or have the check ignore pages stamped by an import-window collect. A title can hit the same thing whenever the HTILE range's first import comes after the clear.
  2. The test checks before the completion. Driver::WaitIdle returns once the worker has processed the submission, not after the batch is reaped, so CheckCurrent runs with the clear still pending, and :314 ("no complete tracked HTILE store") would fail next. If the guard is meant to refuse a pending clear (the safe direction in a title), the test should wait for the completion before CheckCurrent, as CompletedPossibleStore does. If a pending clear should be accepted, :314 needs to account for it.

Could you push b7bc786560, plus whichever of these you choose, so CI can show agc_driver_native_depth_clears and agc_driver_native_depth_bda_clear passing?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250740452 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250740452). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-18T13:54:42Z. --- Thanks @SleglJan, that narrows it a lot. @MarcZX10, with b7bc786560 the hang is gone and the clear is recognized, so the remaining `DriverDispatch` failure looks like two things: 1. **The new guard can count the driver's own import as a CPU write.** The "CPU writes raced native multisample depth clear" check (`DepthSurface.cpp:313`, added by this PR) uses `UnchangedSinceCollected`, which reads the per-page CPU stamps. On `main`, an import's collect gives its dirty pages CPU stamps even in the import window (`stampWrittenRun` calls `noteCpuStore` for every kind except `Driver`, `GuestMemory.cpp:1174`; the window kind only changes the block stamp). On hosts where an import dirties its pages (SleglJan's 3080: "4 after the import"), importing the HTILE range after `clearGeneration` is taken makes the guard refuse a clear nobody raced. In this test the `VulkanDevice` is created inside the dispatch, so its import of the HTILE range lands inside the window. Could you confirm with `APS5_TRACE_HOST_IMPORT=1`? If it does, I'd fix it in the product rather than the test: collect or import the metadata range before recording `clearGeneration` when the clear is accepted, or have the check ignore pages stamped by an import-window collect. A title can hit the same thing whenever the HTILE range's first import comes after the clear. 2. **The test checks before the completion.** `Driver::WaitIdle` returns once the worker has processed the submission, not after the batch is reaped, so `CheckCurrent` runs with the clear still pending, and `:314` ("no complete tracked HTILE store") would fail next. If the guard is meant to refuse a pending clear (the safe direction in a title), the test should wait for the completion before `CheckCurrent`, as `CompletedPossibleStore` does. If a pending clear should be accepted, `:314` needs to account for it. Could you push b7bc786560, plus whichever of these you choose, so CI can show `agc_driver_native_depth_clears` and `agc_driver_native_depth_bda_clear` passing?
MarcZX10 commented 2026-10-18 14:00:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:00:04Z.


I traced the current code: the false-positive path is real at the tracker level. ImportWatched calls the post-import walk with StampKind::Cpu plus WindowCopy; stampWrittenRun calls noteCpuStore for every non-Driver run before it checks WindowCopy::Holds, while the window only changes the general block stamp to ImportWindow. So an unchanged page dirtied by the first host import can advance the CPU page stamp past clearGeneration. I have not run APS5_TRACE_HOST_IMPORT=1 on the reported Windows/GPU setup, so I cannot confirm that specific runtime trace. Separately, the fixture should wait for/reap the completion before asserting the completed-clear proof; WaitIdle alone does not establish completion callback execution. I agree these should be tested independently so the guard does not accept pending work.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250793491 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250793491). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T14:00:04Z. --- I traced the current code: the false-positive path is real at the tracker level. `ImportWatched` calls the post-import walk with `StampKind::Cpu` plus `WindowCopy`; `stampWrittenRun` calls `noteCpuStore` for every non-Driver run before it checks `WindowCopy::Holds`, while the window only changes the general block stamp to `ImportWindow`. So an unchanged page dirtied by the first host import can advance the CPU page stamp past `clearGeneration`. I have not run `APS5_TRACE_HOST_IMPORT=1` on the reported Windows/GPU setup, so I cannot confirm that specific runtime trace. Separately, the fixture should wait for/reap the completion before asserting the completed-clear proof; `WaitIdle` alone does not establish completion callback execution. I agree these should be tested independently so the guard does not accept pending work.
MarcZX10 commented 2026-10-18 14:07:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:07:36Z.


I checked the completion path further. Recorder::Sync() runs the completion actions, so the dispatch fixture should call it after AgcDriverWaitIdle_nid_postfix() and before asserting the completed-clear proof. The GPU-lock release commit b7bc78656 addresses the independent wait hang.

I also tried a fresh Linux build from the published head plus that fixture change. Configuration succeeded, but compilation stops in unchanged core/shader/recompiler/Optimization/src/SrtWalker/SrtDescriptorEvaluation.cpp:186 at read.read->Flags<MemoryFlags>() (GCC 12 reports a missing dependent-template keyword). I did not push the fixture-only change without a successful focused build/runtime check.

For the import-stamp race, globally excluding ImportWindow pages from CPU-write stamps would also hide a genuine same-value CPU store on those watched pages. A safe fix needs the metadata import to complete before the clear baseline (or equivalent evidence that distinguishes the importer from a CPU writer); the specific HTILE import trace on the reported machine remains unconfirmed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250870035 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250870035). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T14:07:36Z. --- I checked the completion path further. `Recorder::Sync()` runs the completion actions, so the dispatch fixture should call it after `AgcDriverWaitIdle_nid_postfix()` and before asserting the completed-clear proof. The GPU-lock release commit `b7bc78656` addresses the independent wait hang. I also tried a fresh Linux build from the published head plus that fixture change. Configuration succeeded, but compilation stops in unchanged `core/shader/recompiler/Optimization/src/SrtWalker/SrtDescriptorEvaluation.cpp:186` at `read.read->Flags<MemoryFlags>()` (GCC 12 reports a missing dependent-template keyword). I did not push the fixture-only change without a successful focused build/runtime check. For the import-stamp race, globally excluding `ImportWindow` pages from CPU-write stamps would also hide a genuine same-value CPU store on those watched pages. A safe fix needs the metadata import to complete before the clear baseline (or equivalent evidence that distinguishes the importer from a CPU writer); the specific HTILE import trace on the reported machine remains unconfirmed.
MarcZX10 commented 2026-10-18 14:13:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:13:30Z.


Update to my previous build note: the failing template expression is exactly the current upstream occurrence already fixed by the open #6306/#6738 qualifier PRs. With that one-line qualifier applied temporarily in the isolated worktree, the full agc_driver_native_multisample_depth_tests target built successfully, including the GPU-lock release commit and a local recorder.Sync() before the completed-clear assertion. The runtime binary then stopped at AnyPS5's host CPU guard because this Xeon lacks AVX2/BMI features; Vulkan execution was not reached. I restored the temporary qualifier and test edits and left #7233's published head unchanged. The HTILE import-stamp hypothesis still lacks the reported Windows/GPU trace, so this is not ready to push as a complete fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6250930328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250930328). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T14:13:30Z. --- Update to my previous build note: the failing template expression is exactly the current upstream occurrence already fixed by the open #6306/#6738 qualifier PRs. With that one-line qualifier applied temporarily in the isolated worktree, the full `agc_driver_native_multisample_depth_tests` target built successfully, including the GPU-lock release commit and a local `recorder.Sync()` before the completed-clear assertion. The runtime binary then stopped at AnyPS5's host CPU guard because this Xeon lacks AVX2/BMI features; Vulkan execution was not reached. I restored the temporary qualifier and test edits and left #7233's published head unchanged. The HTILE import-stamp hypothesis still lacks the reported Windows/GPU trace, so this is not ready to push as a complete fix.
SleglJan commented 2026-10-18 14:51:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T14:51:54Z.


@oneandonlydean @MarcZX10 APS5_TRACE_HOST_IMPORT=1 confirms the import. Same local tree as in my last comment: 42cbe0c33 + b7bc78656, plus local [htile] trace lines; RTX 3080, Linux.

The DriverDispatch case's dispatched clear is its second iteration; the first is a regular note and passes. In order:

  1. The worker recognizes the dispatch as the HTILE clear, the clear is accepted, and clearGeneration is collected.
  2. [gpu] host import of 0x…+0x10000 ok (1 live, 0.1 MiB live, 0.1 MiB ever). This imports the 64 KiB block that starts at the HTILE address, so it covers the whole 32 KiB metadata range.
  3. The completion is attached.
  4. CheckCurrent starts and fails at :313 with "CPU writes raced native multisample depth clear".

It is the only guest-memory host import (the only [gpu] host import line) in the whole --clears run. None of the 25 earlier cases imports anything: they run on the fixture's own context, where hostImportAlignment is 0.

The driver's device is created inside this dispatch, just before step 1. Its write-watch probe prints "host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import)".

I also added recorder.Sync() right after SubmitDriverHtileClear returns (local). The order and the result are the same, and gdb again puts the throw at CheckCurrent :313 (line mapped to 42cbe0c33), with the completion still after the check. The dispatch's completion is registered on the driver device's own recorder (Execution/src/VulkanDevice.cpp:4671, recorder.OnComplete, with recorder = *state->recorder from :4522). The fixture's Recorder::Sync() finishes only the fixture's recorder. :314 is not reached, so this doesn't show whether it would pass.

Importing the block before the clear isn't something the fixture can do on its own. Graphics::HostImportFor returns nullptr there, because the fixture's own Vulkan context leaves hostImportAlignment at 0. And the fixture's context isn't the driver's device anyway, which makes its own import inside the dispatch. A cheap control without a build is APS5_NO_HOST_IMPORT=1, which stops the driver device from importing (the dispatch then copies and writes back instead). I'll run that next and add the result here.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251315588 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251315588). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T14:51:54Z. --- @oneandonlydean @MarcZX10 `APS5_TRACE_HOST_IMPORT=1` confirms the import. Same local tree as in my last comment: 42cbe0c33 + b7bc78656, plus local `[htile]` trace lines; RTX 3080, Linux. The `DriverDispatch` case's dispatched clear is its second iteration; the first is a regular note and passes. In order: 1. The worker recognizes the dispatch as the HTILE clear, the clear is accepted, and `clearGeneration` is collected. 2. `[gpu] host import of 0x…+0x10000 ok (1 live, 0.1 MiB live, 0.1 MiB ever)`. This imports the 64 KiB block that starts at the HTILE address, so it covers the whole 32 KiB metadata range. 3. The completion is attached. 4. `CheckCurrent` starts and fails at `:313` with "CPU writes raced native multisample depth clear". It is the only guest-memory host import (the only `[gpu] host import` line) in the whole `--clears` run. None of the 25 earlier cases imports anything: they run on the fixture's own context, where `hostImportAlignment` is 0. The driver's device is created inside this dispatch, just before step 1. Its write-watch probe prints "host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import)". I also added `recorder.Sync()` right after `SubmitDriverHtileClear` returns (local). The order and the result are the same, and gdb again puts the throw at `CheckCurrent` `:313` (line mapped to 42cbe0c33), with the completion still after the check. The dispatch's completion is registered on the driver device's own recorder (`Execution/src/VulkanDevice.cpp:4671`, `recorder.OnComplete`, with `recorder` = `*state->recorder` from `:4522`). The fixture's `Recorder::Sync()` finishes only the fixture's recorder. `:314` is not reached, so this doesn't show whether it would pass. Importing the block before the clear isn't something the fixture can do on its own. `Graphics::HostImportFor` returns nullptr there, because the fixture's own Vulkan context leaves `hostImportAlignment` at 0. And the fixture's context isn't the driver's device anyway, which makes its own import inside the dispatch. A cheap control without a build is `APS5_NO_HOST_IMPORT=1`, which stops the driver device from importing (the dispatch then copies and writes back instead). I'll run that next and add the result here. AI-assisted: yes (Claude Code)
SleglJan commented 2026-10-18 15:20:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T15:20:36Z.


The APS5_NO_HOST_IMPORT=1 control from my last comment doesn't separate the two. It runs on the same local tree (42cbe0c33 + b7bc78656 + trace).

  • No host import happens.
  • The DriverDispatch case never gets to the check. The clear is recognized and accepted, then the worker fails the dispatch with "AGC graphics: sample-preserving guest publication of native multisample depth is not implemented".
  • That message's only source is RequireNoResidentDepthRead_nid_no_patch (Graphics/src/DepthSurface.cpp:1286). Without an import, the dispatch has to copy the HTILE block in through a guest read, and the resident native depth surface refuses that read.
  • So the completion is never attached, CheckCurrent never runs for this clear, and neither :313 nor :314 is tested.

With this fixture, the import is the only path that reaches the completion. To confirm the import as the cause of :313 directly, the product change (collect or import before clearGeneration is recorded) is the test.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251605132 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251605132). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-18T15:20:36Z. --- The `APS5_NO_HOST_IMPORT=1` control from my last comment doesn't separate the two. It runs on the same local tree (42cbe0c33 + b7bc78656 + trace). - No host import happens. - The `DriverDispatch` case never gets to the check. The clear is recognized and accepted, then the worker fails the dispatch with "AGC graphics: sample-preserving guest publication of native multisample depth is not implemented". - That message's only source is `RequireNoResidentDepthRead_nid_no_patch` (`Graphics/src/DepthSurface.cpp:1286`). Without an import, the dispatch has to copy the HTILE block in through a guest read, and the resident native depth surface refuses that read. - So the completion is never attached, `CheckCurrent` never runs for this clear, and neither `:313` nor `:314` is tested. With this fixture, the import is the only path that reaches the completion. To confirm the import as the cause of `:313` directly, the product change (collect or import before `clearGeneration` is recorded) is the test. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 15:21:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T15:21:41Z.


Thanks for the follow-up control on #7220. APS5_NO_HOST_IMPORT=1 exits at the resident-depth read refusal before the completion/check path, so it does not discriminate the import race. That confirms the import-enabled driver-device path is the only current way to exercise this check; the fixture’s separate recorder cannot validate it. I agree the proposed production change remains unverified until a test or real-device run covers that path.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251616404 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251616404). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T15:21:41Z. --- Thanks for the follow-up control on #7220. `APS5_NO_HOST_IMPORT=1` exits at the resident-depth read refusal before the completion/check path, so it does not discriminate the import race. That confirms the import-enabled driver-device path is the only current way to exercise this check; the fixture’s separate recorder cannot validate it. I agree the proposed production change remains unverified until a test or real-device run covers that path.
milescoviello commented 2026-10-18 16:20:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T16:20:28Z.


A title-level datapoint for the containment reuse, which #6868 also has. Ruffle (PPSA68091) was on main 385ed71f2c + #6543 + #7250 (Ruffle stops earlier without them), running Ruffle's own visual test SWFs, Linux, RTX 4070 Ti.

The driver rewrites an 8-byte word at 0x400461a000 every frame, just after a 4x multisampled target's DCC (0x4004606000+0x14000) and in the same 64 KiB block. A temporary print in StoredOver showed the block's four pieces all at [0xa000, 0xa008), at generations 8385, 9011, 9637 and 10263, and dropped 7758, newer than the target's 7143. So four frames after the target took a fast clear, its DCC read as stored over, though all 0x14000 bytes still held the clear key 0xc0. The next use stopped on writes to a resident multisampled DCC target or its metadata are not implemented.

Test SWF without + this PR (42cbe0c334)
filters__bevel_full, filters__bevel_inner, filters__bevel_outer, filters__glow_with_alpha_strength, filters__displacement_map stop at 11 to 12 s on the line above run to the 32 s limit. Their last frame matches the test's output.expected.png: a mean difference of 2.4 to 3.1 of 255 over 32x24 cells.
blend_modes__shader_as_mask stops at 11 s still stops on the same line (I haven't traced it)

I ran this PR because #6868 conflicts with that stack in the debt file. The change that matters here is the containment reuse both PRs share.

Neither PR changes one thing: after a fifth distinct store in a block, dropped still makes every range of the block read as stored over and lose its coverage. I have a local change that also keeps the span of the pieces a block drops, so that only ranges overlapping it are affected. I'll offer it once this has landed rather than conflict with it.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252212976 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6252212976). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-18T16:20:28Z. --- A title-level datapoint for the containment reuse, which #6868 also has. Ruffle (PPSA68091) was on `main` 385ed71f2c + #6543 + #7250 (Ruffle stops earlier without them), running Ruffle's own visual test SWFs, Linux, RTX 4070 Ti. The driver rewrites an 8-byte word at 0x400461a000 every frame, just after a 4x multisampled target's DCC (0x4004606000+0x14000) and in the same 64 KiB block. A temporary print in `StoredOver` showed the block's four pieces all at `[0xa000, 0xa008)`, at generations 8385, 9011, 9637 and 10263, and `dropped` 7758, newer than the target's 7143. So four frames after the target took a fast clear, its DCC read as stored over, though all 0x14000 bytes still held the clear key 0xc0. The next use stopped on `writes to a resident multisampled DCC target or its metadata are not implemented`. | Test SWF | without | + this PR (42cbe0c334) | |---|---|---| | `filters__bevel_full`, `filters__bevel_inner`, `filters__bevel_outer`, `filters__glow_with_alpha_strength`, `filters__displacement_map` | stop at 11 to 12 s on the line above | run to the 32 s limit. Their last frame matches the test's `output.expected.png`: a mean difference of 2.4 to 3.1 of 255 over 32x24 cells. | | `blend_modes__shader_as_mask` | stops at 11 s | still stops on the same line (I haven't traced it) | I ran this PR because #6868 conflicts with that stack in the debt file. The change that matters here is the containment reuse both PRs share. Neither PR changes one thing: after a fifth distinct store in a block, `dropped` still makes every range of the block read as stored over and lose its coverage. I have a local change that also keeps the span of the pieces a block drops, so that only ranges overlapping it are affected. I'll offer it once this has landed rather than conflict with it. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-18 22:09:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T22:09:29Z.


Thanks for the title-level comparison. It shows the containment-reuse change lets five of the six SWFs reach the 32 s limit with frames close to their expected images; blend_modes__shader_as_mask still stops at the same refusal. The fifth-store coverage loss is a separate gap, and I’ll leave that follow-up to your planned change after this PR lands.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255761362 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6255761362). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T22:09:29Z. --- Thanks for the title-level comparison. It shows the containment-reuse change lets five of the six SWFs reach the 32 s limit with frames close to their expected images; `blend_modes__shader_as_mask` still stops at the same refusal. The fifth-store coverage loss is a separate gap, and I’ll leave that follow-up to your planned change after this PR lands.
MarcZX10 commented 2026-10-19 17:51:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T17:51:56Z.


Merged current upstream main (b6583dd868) into this PR as f0a05131bb and resolved the write-tracking, depth-clear, and regression-test conflicts. The updated diff still includes the possible-write history coverage and native HTILE completion proof; I kept the upstream shared-block proof tests alongside this PR's possible-write eviction tests.

Validation on Linux Release:

  • agc_write_tracking_tests builds successfully.
  • Running it exits 77 with no write watching: skipped; this host does not provide the write-watch facility, so the runtime assertions did not run here.
  • python3 tools/check_conventions.py --base upstream/main passes.
  • git diff upstream/main...HEAD --check passes.

The overlap scan finds #7371 explicitly depends on this PR. It also reports shared AGC files in #7432 and several unrelated dispatch/graphics PRs; those paths were manually retained while resolving the merge. The current Windows CI result is pending.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273625321 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6273625321). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T17:51:56Z. --- Merged current upstream `main` (`b6583dd868`) into this PR as `f0a05131bb` and resolved the write-tracking, depth-clear, and regression-test conflicts. The updated diff still includes the possible-write history coverage and native HTILE completion proof; I kept the upstream shared-block proof tests alongside this PR's possible-write eviction tests. Validation on Linux Release: - `agc_write_tracking_tests` builds successfully. - Running it exits 77 with `no write watching: skipped`; this host does not provide the write-watch facility, so the runtime assertions did not run here. - `python3 tools/check_conventions.py --base upstream/main` passes. - `git diff upstream/main...HEAD --check` passes. The overlap scan finds #7371 explicitly depends on this PR. It also reports shared AGC files in #7432 and several unrelated dispatch/graphics PRs; those paths were manually retained while resolving the merge. The current Windows CI result is pending.
SleglJan commented 2026-10-19 20:15:17 +00:00 (Migrated from github.com)

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


@MarcZX10 f0a05131bb on the RTX 3080, where write watching is available (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with BUILD_TESTING=ON, only agc_write_tracking_tests and agc_driver_native_multisample_depth_tests built). Each ctest ran 3 times:

  • agc_write_tracking runs and passes, 3 of 3 (it prints write tracking tests passed, not the exit-77 skip).
  • agc_driver_native_multisample_depth, agc_driver_native_depth_retirement and agc_driver_native_depth_clear_refusals pass, 3 of 3.
  • agc_driver_native_depth_clears times out at its 30 s limit, 3 of 3.
    • Run directly with line-buffered output, --clears completes the same 25 cases as 42cbe0c33 did on 2026-10-18 (the 24 regular ones and CompletedPossibleStore). It then prints nothing in DriverDispatch until killed at 120 s.
    • In this tree, SubmitDriverHtileClear still calls AgcDriverWaitIdle_nid_postfix() while the test's lock_guard on GuestMemory::GpuMutex() is held. The merge doesn't carry b7bc786560, as oneandonlydean noted for 42cbe0c33.
  • main b6583dd868, built the same way, passes all five 3 of 3. Its --clears runs only the 24 regular cases (no CompletedPossibleStore or DriverDispatch) and takes 0.39 to 0.40 s.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6276361654 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6276361654). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-19T20:15:17Z. --- @MarcZX10 f0a05131bb on the RTX 3080, where write watching is available (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with `BUILD_TESTING=ON`, only `agc_write_tracking_tests` and `agc_driver_native_multisample_depth_tests` built). Each ctest ran 3 times: - `agc_write_tracking` runs and passes, 3 of 3 (it prints `write tracking tests passed`, not the exit-77 skip). - `agc_driver_native_multisample_depth`, `agc_driver_native_depth_retirement` and `agc_driver_native_depth_clear_refusals` pass, 3 of 3. - `agc_driver_native_depth_clears` times out at its 30 s limit, 3 of 3. - Run directly with line-buffered output, `--clears` completes the same 25 cases as 42cbe0c33 did on 2026-10-18 (the 24 regular ones and `CompletedPossibleStore`). It then prints nothing in `DriverDispatch` until killed at 120 s. - In this tree, `SubmitDriverHtileClear` still calls `AgcDriverWaitIdle_nid_postfix()` while the test's `lock_guard` on `GuestMemory::GpuMutex()` is held. The merge doesn't carry b7bc786560, as oneandonlydean noted for 42cbe0c33. - `main` b6583dd868, built the same way, passes all five 3 of 3. Its `--clears` runs only the 24 regular cases (no `CompletedPossibleStore` or `DriverDispatch`) and takes 0.39 to 0.40 s. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-19 20:22:37 +00:00 (Migrated from github.com)

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


Thanks for the RTX 3080 run. It isolated a test-harness deadlock: the DriverDispatch case waited for the submitted queue while holding GuestMemory::GpuMutex(). I pushed ac0a545fe to release the unique_lock around AgcDriverWaitIdle_nid_postfix() and reacquire it even if the wait throws.

On this host the changed test source compiles and the executable links against the existing build artifacts, but the focused CTest aborts at the project CPU-feature guard (this E5-1620 v2 lacks required features). A full rebuild also stops earlier in SrtDescriptorEvaluation.cpp with GCC 12's dependent-template parse error. I cannot claim a runtime pass here. Could you rerun agc_driver_native_depth_clears on the supported RTX 3080 host against ac0a545fe to confirm it completes and preserves the expected cases?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6276504093 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6276504093). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T20:22:37Z. --- Thanks for the RTX 3080 run. It isolated a test-harness deadlock: the `DriverDispatch` case waited for the submitted queue while holding `GuestMemory::GpuMutex()`. I pushed `ac0a545fe` to release the `unique_lock` around `AgcDriverWaitIdle_nid_postfix()` and reacquire it even if the wait throws. On this host the changed test source compiles and the executable links against the existing build artifacts, but the focused CTest aborts at the project CPU-feature guard (this E5-1620 v2 lacks required features). A full rebuild also stops earlier in `SrtDescriptorEvaluation.cpp` with GCC 12's dependent-template parse error. I cannot claim a runtime pass here. Could you rerun `agc_driver_native_depth_clears` on the supported RTX 3080 host against `ac0a545fe` to confirm it completes and preserves the expected cases?
SleglJan commented 2026-10-19 20:55:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T20:55:37Z.


@MarcZX10 ac0a545fe on the RTX 3080, same build directory and settings as for f0a05131bb, rebuilt incrementally (the commit only changes NativeMultisampleDepth.cpp, so only agc_driver_native_multisample_depth_tests was relinked). Three ctest runs and one direct --clears run:

  • agc_driver_native_depth_clears no longer hangs. It fails in 0.49–0.78 s, 3 of 3, with "AGC graphics: CPU writes raced native multisample depth clear".
  • Run directly, --clears completes the same 25 cases (the 24 regular ones and CompletedPossibleStore). It then fails in DriverDispatch with that message and exits 1.
  • That matches 42cbe0c33 with b7bc78656 on top in my 2026-10-18 comment (https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250518395). There, CheckCurrent threw at DepthSurface.cpp:313 before CompleteHtileDepthClear ran. I didn't take a stack trace this time, so I haven't confirmed it's the same check.
  • agc_write_tracking, agc_driver_native_multisample_depth, agc_driver_native_depth_retirement and agc_driver_native_depth_clear_refusals still pass, 3 of 3.

This head still calls DepthSurfaceHolds right after the wait, with the fixture's recorder.Sync() after that check. The order from your 2026-10-18 14:07Z comment, a recorder.Sync() right after SubmitDriverHtileClear returns, I tried locally that day (https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251315588). It gave the same throw at CheckCurrent with the completion still after the check, because the dispatch's completion is registered on the driver device's own recorder, not the fixture's.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6277126682 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6277126682). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-19T20:55:37Z. --- @MarcZX10 ac0a545fe on the RTX 3080, same build directory and settings as for f0a05131bb, rebuilt incrementally (the commit only changes `NativeMultisampleDepth.cpp`, so only `agc_driver_native_multisample_depth_tests` was relinked). Three ctest runs and one direct `--clears` run: - `agc_driver_native_depth_clears` no longer hangs. It fails in 0.49–0.78 s, 3 of 3, with "AGC graphics: CPU writes raced native multisample depth clear". - Run directly, `--clears` completes the same 25 cases (the 24 regular ones and `CompletedPossibleStore`). It then fails in `DriverDispatch` with that message and exits 1. - That matches 42cbe0c33 with b7bc78656 on top in my 2026-10-18 comment (https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6250518395). There, `CheckCurrent` threw at `DepthSurface.cpp:313` before `CompleteHtileDepthClear` ran. I didn't take a stack trace this time, so I haven't confirmed it's the same check. - `agc_write_tracking`, `agc_driver_native_multisample_depth`, `agc_driver_native_depth_retirement` and `agc_driver_native_depth_clear_refusals` still pass, 3 of 3. This head still calls `DepthSurfaceHolds` right after the wait, with the fixture's `recorder.Sync()` after that check. The order from your 2026-10-18 14:07Z comment, a `recorder.Sync()` right after `SubmitDriverHtileClear` returns, I tried locally that day (https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251315588). It gave the same throw at `CheckCurrent` with the completion still after the check, because the dispatch's completion is registered on the driver device's own recorder, not the fixture's. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-19 21:28:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T21:28:08Z.


Thanks for the RTX 3080 rerun. It confirms the unlocked wait fixed the hang, and isolates the remaining failure: AgcDriverWaitIdle_nid_postfix() returned before the recorder ran the HTILE completion action. I pushed two commits: the regression now asserts complete-write evidence immediately after driver idle, and Driver::WaitIdle() drains the Vulkan recorder after queued submissions finish. The updated sources and test target link in a current-main integration build. My Linux runtime stops at the Xeon feature guard before reaching the assertion. Could you rerun agc_driver_native_depth_clears on the RTX 3080 against head 2e048f56ff37441ac6bb19b01db6bf8d4a5db621 and confirm both completion and the full clear matrix?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6277709524 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6277709524). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T21:28:08Z. --- Thanks for the RTX 3080 rerun. It confirms the unlocked wait fixed the hang, and isolates the remaining failure: `AgcDriverWaitIdle_nid_postfix()` returned before the recorder ran the HTILE completion action. I pushed two commits: the regression now asserts complete-write evidence immediately after driver idle, and `Driver::WaitIdle()` drains the Vulkan recorder after queued submissions finish. The updated sources and test target link in a current-main integration build. My Linux runtime stops at the Xeon feature guard before reaching the assertion. Could you rerun `agc_driver_native_depth_clears` on the RTX 3080 against head `2e048f56ff37441ac6bb19b01db6bf8d4a5db621` and confirm both completion and the full clear matrix?
SleglJan commented 2026-10-19 22:00:07 +00:00 (Migrated from github.com)

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


@MarcZX10 2e048f56ff on the RTX 3080, same build directory, rebuilt incrementally. Lifecycle.cpp and the test were recompiled, libSceAgcDriver.prx was relinked, and the test executable loads that .prx. Three ctest runs and one direct --clears run:

  • agc_driver_native_depth_clears fails in 0.50–0.51 s, 3 of 3.
  • Run directly, --clears completes the same 25 cases as before. In DriverDispatch it then prints these two lines and exits 1:
    [gpu] deferred write-back failed: AGC graphics: CPU writes raced native multisample depth clear
    AGC graphics: driver idle returned before recording the completed HTILE dispatch
    
  • On ac0a545fe the same message came as the thrown error. Here it is logged as a failed deferred write-back just before your new assertion, so the completion now runs before driver idle returns, but it still isn't recorded.
  • That fits the guard counting the driver's own host import of the HTILE block as CPU writes, as discussed on 2026-10-18 (oneandonlydean's 13:54Z comment, your 14:00Z one, and mine at https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251315588). In that trace run (42cbe0c33 + b7bc78656, local), it was the only host import in --clears. I haven't traced this head.
  • agc_write_tracking, agc_driver_native_multisample_depth, agc_driver_native_depth_retirement and agc_driver_native_depth_clear_refusals still pass, 3 of 3.

Driver::WaitIdle now changes for every caller. If you want, I can run the wider ^agc set on this head and on its merge base b6583dd868.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278328482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6278328482). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-19T22:00:07Z. --- @MarcZX10 2e048f56ff on the RTX 3080, same build directory, rebuilt incrementally. `Lifecycle.cpp` and the test were recompiled, `libSceAgcDriver.prx` was relinked, and the test executable loads that `.prx`. Three ctest runs and one direct `--clears` run: - `agc_driver_native_depth_clears` fails in 0.50–0.51 s, 3 of 3. - Run directly, `--clears` completes the same 25 cases as before. In `DriverDispatch` it then prints these two lines and exits 1: ``` [gpu] deferred write-back failed: AGC graphics: CPU writes raced native multisample depth clear AGC graphics: driver idle returned before recording the completed HTILE dispatch ``` - On ac0a545fe the same message came as the thrown error. Here it is logged as a failed deferred write-back just before your new assertion, so the completion now runs before driver idle returns, but it still isn't recorded. - That fits the guard counting the driver's own host import of the HTILE block as CPU writes, as discussed on 2026-10-18 (oneandonlydean's 13:54Z comment, your 14:00Z one, and mine at https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251315588). In that trace run (42cbe0c33 + b7bc78656, local), it was the only host import in `--clears`. I haven't traced this head. - `agc_write_tracking`, `agc_driver_native_multisample_depth`, `agc_driver_native_depth_retirement` and `agc_driver_native_depth_clear_refusals` still pass, 3 of 3. `Driver::WaitIdle` now changes for every caller. If you want, I can run the wider `^agc` set on this head and on its merge base b6583dd868. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-19 22:36:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T22:36:39Z.


@SleglJan Thanks for rerunning the updated head. I traced the failure path: NoteHtileDepthClear captures clearGeneration before PrepareDispatch/resource construction, while CompleteHtileDepthClear later rejects any CPU page stamp newer than that baseline. prepareDepthSampling already calls HostImportFor for the HTILE range before its initial baseline, so I cannot yet attribute the newer stamp to that import; the earlier import explanation remains unconfirmed on this head. Could you run the DriverDispatch case with APS5_TRACE_HOST_IMPORT=1 and, if feasible, add a temporary trace of clearGeneration, TrackerGeneration, and HTILE CPU page stamps around NoteHtileDepthClear, host import, and completion? That should tell us whether there is a second import/collection or a real CPU store after recognition. I am holding off on changing the conservative race guard until we can identify the stamp source. The wider ^agc comparison against b6583dd868 would also be useful if it is convenient.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278887902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6278887902). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T22:36:39Z. --- @SleglJan Thanks for rerunning the updated head. I traced the failure path: `NoteHtileDepthClear` captures `clearGeneration` before `PrepareDispatch`/resource construction, while `CompleteHtileDepthClear` later rejects any CPU page stamp newer than that baseline. `prepareDepthSampling` already calls `HostImportFor` for the HTILE range before its initial baseline, so I cannot yet attribute the newer stamp to that import; the earlier import explanation remains unconfirmed on this head. Could you run the `DriverDispatch` case with `APS5_TRACE_HOST_IMPORT=1` and, if feasible, add a temporary trace of `clearGeneration`, `TrackerGeneration`, and HTILE CPU page stamps around `NoteHtileDepthClear`, host import, and completion? That should tell us whether there is a second import/collection or a real CPU store after recognition. I am holding off on changing the conservative race guard until we can identify the stamp source. The wider `^agc` comparison against `b6583dd868` would also be useful if it is convenient.
MarcZX10 commented 2026-10-19 22:37:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T22:37:44Z.


Correction to my previous note: I misread prepareDepthSampling. It calls GuestMemory::Read for HTILE, but that read/flush path does not itself call HostImportFor; the dispatch resource build can still make the first host import after NoteHtileDepthClear captures clearGeneration. So the host-import explanation remains plausible and needs the requested exact-head trace. I should not have said the initial sampling path had already imported the range.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278903519 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6278903519). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T22:37:44Z. --- Correction to my previous note: I misread `prepareDepthSampling`. It calls `GuestMemory::Read` for HTILE, but that read/flush path does not itself call `HostImportFor`; the dispatch resource build can still make the first host import after `NoteHtileDepthClear` captures `clearGeneration`. So the host-import explanation remains plausible and needs the requested exact-head trace. I should not have said the initial sampling path had already imported the range.
SleglJan commented 2026-10-19 22:58:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T22:58:32Z.


@MarcZX10 here is the trace on 2e048f56ff (RTX 3080, Linux), with APS5_TRACE_HOST_IMPORT=1 plus local [htile] lines. The local lines record:

  • every CPU page stamp on the HTILE range, with its call stack;
  • clearGeneration and TrackerGeneration() at the note and at completion;
  • which check in UnchangedSinceCollected fails.

In DriverDispatch's driver-path cycle (its first, fixture-path cycle passes with no stamps on the range), in order:

  1. NoteHtileDepthClear collects clearGeneration 3909, with TrackerGeneration() also at 3909.
  2. The dispatch's resource build imports the HTILE block, through ShaderResources::Complete → prepareAddressBindings → GuestBufferMemory::AcquireRegistered → ImportWatched.
    • Its post-import walk (GuestWriteWatchCollectArmed → stampWrittenRun, with StampKind::Cpu and the import window set) stamps all of the 32 KiB HTILE range's pages at generation 3911.
    • Then comes [gpu] host import of <HTILE block>+0x10000 ok.
    • ImportWatched's pre-import walk (same kind, no window) has to succeed for this walk to run, and it logs nothing on the range, so the pages became written inside the import call itself.
  3. The completion runs inside driver idle and logs clearGeneration 3909, TrackerGeneration() 3913. UnchangedSinceCollected collects (3914), then fails on page 0 of the block, whose page stamp is 3911.
    • That throws "CPU writes raced native multisample depth clear", which is logged as the failed deferred write-back.
    • Your new assertion follows.

Between the note and the completion, nothing else stamps the range: no Rewatch, no watchPrivateMapping, and no other written run. The whole --clears run makes two host imports of guest memory (the per-device write-watch probe imports only its own scratch pages): this one, and a 2 MiB import elsewhere just before it. On 42cbe0c33 + b7bc78656 on 2026-10-18, the HTILE import was the only one, so the 2 MiB one is new on this head. In the 24 regular cases and CompletedPossibleStore, the range's CPU stamps come only from written runs without an import window, none newer than that case's clearGeneration, and no host import touches the range.

So the newer stamp comes from the import's own walk, not from a second collection or a CPU store after recognition. That matches what you traced in the code on 2026-10-18 at 14:00Z: stampWrittenRun calls noteCpuStore for every non-Driver run before it checks the window. The window only switches the kind passed to stamp() to ImportWindow, which skips the stored block stamp but still sets the CPU block stamp. The page stamp that UnchangedSinceCollected reads comes from the unconditional noteCpuStore.

I'll run the wider ^agc comparison against b6583dd868 overnight and post it.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279197350 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6279197350). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-19T22:58:32Z. --- @MarcZX10 here is the trace on 2e048f56ff (RTX 3080, Linux), with `APS5_TRACE_HOST_IMPORT=1` plus local `[htile]` lines. The local lines record: - every CPU page stamp on the HTILE range, with its call stack; - `clearGeneration` and `TrackerGeneration()` at the note and at completion; - which check in `UnchangedSinceCollected` fails. In `DriverDispatch`'s driver-path cycle (its first, fixture-path cycle passes with no stamps on the range), in order: 1. `NoteHtileDepthClear` collects `clearGeneration` 3909, with `TrackerGeneration()` also at 3909. 2. The dispatch's resource build imports the HTILE block, through `ShaderResources::Complete` → `prepareAddressBindings` → `GuestBufferMemory::AcquireRegistered` → `ImportWatched`. - Its post-import walk (`GuestWriteWatchCollectArmed` → `stampWrittenRun`, with `StampKind::Cpu` and the import window set) stamps all of the 32 KiB HTILE range's pages at generation 3911. - Then comes `[gpu] host import of <HTILE block>+0x10000 ok`. - `ImportWatched`'s pre-import walk (same kind, no window) has to succeed for this walk to run, and it logs nothing on the range, so the pages became written inside the import call itself. 3. The completion runs inside driver idle and logs `clearGeneration 3909, TrackerGeneration() 3913`. `UnchangedSinceCollected` collects (3914), then fails on page 0 of the block, whose page stamp is 3911. - That throws "CPU writes raced native multisample depth clear", which is logged as the failed deferred write-back. - Your new assertion follows. Between the note and the completion, nothing else stamps the range: no `Rewatch`, no `watchPrivateMapping`, and no other written run. The whole `--clears` run makes two host imports of guest memory (the per-device write-watch probe imports only its own scratch pages): this one, and a 2 MiB import elsewhere just before it. On 42cbe0c33 + b7bc78656 on 2026-10-18, the HTILE import was the only one, so the 2 MiB one is new on this head. In the 24 regular cases and `CompletedPossibleStore`, the range's CPU stamps come only from written runs without an import window, none newer than that case's `clearGeneration`, and no host import touches the range. So the newer stamp comes from the import's own walk, not from a second collection or a CPU store after recognition. That matches what you traced in the code on 2026-10-18 at 14:00Z: `stampWrittenRun` calls `noteCpuStore` for every non-Driver run before it checks the window. The window only switches the kind passed to `stamp()` to `ImportWindow`, which skips the stored block stamp but still sets the CPU block stamp. The page stamp that `UnchangedSinceCollected` reads comes from the unconditional `noteCpuStore`. I'll run the wider `^agc` comparison against b6583dd868 overnight and post it. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-19 22:59:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T22:59:37Z.


@SleglJan Thanks for the exact-head trace. It confirms that the import’s post-walk creates the newer page stamp: the ImportWindow path updates the CPU page stamp even though no guest CPU store occurred, and UnchangedSinceCollected then correctly rejects it as newer than the baseline.

I have a local fix that leaves a recognized clear pending, then arms its generation baseline after dispatch resource construction/imports and immediately before resources.MarkGpuWrites. The existing post-arm CPU-write refusal remains in place. I added a regression that runs ImportWatched before arming and retains the existing post-arm CPU-write refusal case. The rebased driver and test targets compile; local CTest still stops at this Xeon’s CPU-feature guard before Vulkan. I have not pushed yet because #8105 uses the same recognition path for its buffer-mask clear, and I asked its author to coordinate the baseline hook for that path.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279212349 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6279212349). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T22:59:37Z. --- @SleglJan Thanks for the exact-head trace. It confirms that the import’s post-walk creates the newer page stamp: the `ImportWindow` path updates the CPU page stamp even though no guest CPU store occurred, and `UnchangedSinceCollected` then correctly rejects it as newer than the baseline. I have a local fix that leaves a recognized clear pending, then arms its generation baseline after dispatch resource construction/imports and immediately before `resources.MarkGpuWrites`. The existing post-arm CPU-write refusal remains in place. I added a regression that runs `ImportWatched` before arming and retains the existing post-arm CPU-write refusal case. The rebased driver and test targets compile; local CTest still stops at this Xeon’s CPU-feature guard before Vulkan. I have not pushed yet because #8105 uses the same recognition path for its buffer-mask clear, and I asked its author to coordinate the baseline hook for that path.
MarcZX10 commented 2026-10-19 23:02:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T23:02:47Z.


@SleglJan I pushed a validation-only branch at codex/7233-import-baseline, head cae2e8a997d8b9340de55553d34d86c9ec638ba3. It is rebased on current main; the open #7233 head is unchanged.

The new ImportWindowWrite case mutates HTILE inside the ImportWatched callback, asserts that the import window creates a newer tracked generation, then arms the baseline. The existing post-arm CpuWrite refusal case remains. Could you run agc_driver_native_depth_clears (or the executable with --clears) on this branch when convenient, along with the related native-depth groups? For the AGC validation comparison, please run the focused cases on current main and this branch with the validation layer and report any new VUID- messages. This host built the targets but its CPU feature guard stops CTest before Vulkan.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279257228 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6279257228). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T23:02:47Z. --- @SleglJan I pushed a validation-only branch at [codex/7233-import-baseline](https://github.com/MarcZX10/AnyPS5/tree/codex/7233-import-baseline), head `cae2e8a997d8b9340de55553d34d86c9ec638ba3`. It is rebased on current `main`; the open #7233 head is unchanged. The new `ImportWindowWrite` case mutates HTILE inside the `ImportWatched` callback, asserts that the import window creates a newer tracked generation, then arms the baseline. The existing post-arm `CpuWrite` refusal case remains. Could you run `agc_driver_native_depth_clears` (or the executable with `--clears`) on this branch when convenient, along with the related native-depth groups? For the AGC validation comparison, please run the focused cases on current `main` and this branch with the validation layer and report any new `VUID-` messages. This host built the targets but its CPU feature guard stops CTest before Vulkan.
SleglJan commented 2026-10-19 23:25:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T23:25:00Z.


@MarcZX10 results from the RTX 3080 (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with BUILD_TESTING=ON), for the wider set first and then your validation branch.

ctest -R '^agc', 795 tests, on 2e048f56ff and its merge base b6583dd868, built the same way:

  • 2e048f56ff fails 2, and both fail again when rerun one at a time:
    • agc_driver_native_depth_clears, the DriverDispatch case from my trace;
    • agc_driver_native_depth_bda_clear, which prints "Native full BDA clear: exact 32768-byte metadata readback passed; complete=0" and then fails with "native multisample depth clear has no complete tracked HTILE store", as on 42cbe0c33 on 2026-10-18.
  • b6583dd868 passes 794. On both trees agc_driver_stencil_ref_export skips itself, as on 42cbe0c33.

codex/7233-import-baseline cae2e8a997 against its base, main f29546ac4e. I built agc_write_tracking_tests, agc_driver_native_multisample_depth_tests and agc_driver_native_depth_bda_clear_tests on each. The focused ctest set ran twice:

  • On cae2e8a997, agc_write_tracking, agc_driver_native_multisample_depth, agc_driver_native_depth_retirement and agc_driver_native_depth_clear_refusals pass 2 of 2. agc_driver_native_depth_clears and agc_driver_native_depth_bda_clear fail 2 of 2.
  • On f29546ac4e, all six pass 2 of 2 (its --clears has only the 24 regular cases).
  • Run directly, --clears on cae2e8a997 completes the 24 regular cases, CompletedPossibleStore and your new ImportWindowWrite. DriverDispatch then fails with "a native multisampled depth target is sampled only by recorded draws and dispatches". Nothing prints "CPU writes raced" and the driver-idle assertion holds, so the CPU-writes guard no longer trips there.
  • With a breakpoint on __cxa_throw, the stack at that throw is CheckDepthTarget → CachedSampledTexture → cachedTexture → DepthSurfaceTexture → Require(recorder != nullptr, …). That Require checks RecorderFor(context)'s result, so Recorder::Active() is either null there or on another device; I haven't checked which.
  • agc_driver_native_depth_bda_clear on cae2e8a997 prints the same readback line with "complete=0", then fails with "native multisample depth clear has not been recorded", which is CheckCurrent's clearPending check.

Validation layer: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, layers 1.4.363. Each of the six cases ran once as its executable, on both trees.

  • No VUID- message on either tree, in any of them. On cae2e8a997 the two failing executables stop at their failures, so they cover less than on main.
  • On cae2e8a997, --clears under the layer then aborts (exit 134) after the failure above, with the layer's "The VkDevice dispatch handle was not found and Validation will crash. If you are using exit() …" message. On f29546ac4e it exits 0.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279572344 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6279572344). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-19T23:25:00Z. --- @MarcZX10 results from the RTX 3080 (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with `BUILD_TESTING=ON`), for the wider set first and then your validation branch. **`ctest -R '^agc'`, 795 tests, on 2e048f56ff and its merge base b6583dd868, built the same way:** - 2e048f56ff fails 2, and both fail again when rerun one at a time: - `agc_driver_native_depth_clears`, the `DriverDispatch` case from my trace; - `agc_driver_native_depth_bda_clear`, which prints "Native full BDA clear: exact 32768-byte metadata readback passed; complete=0" and then fails with "native multisample depth clear has no complete tracked HTILE store", as on 42cbe0c33 on 2026-10-18. - b6583dd868 passes 794. On both trees `agc_driver_stencil_ref_export` skips itself, as on 42cbe0c33. **codex/7233-import-baseline cae2e8a997 against its base, `main` f29546ac4e.** I built `agc_write_tracking_tests`, `agc_driver_native_multisample_depth_tests` and `agc_driver_native_depth_bda_clear_tests` on each. The focused ctest set ran twice: - On cae2e8a997, `agc_write_tracking`, `agc_driver_native_multisample_depth`, `agc_driver_native_depth_retirement` and `agc_driver_native_depth_clear_refusals` pass 2 of 2. `agc_driver_native_depth_clears` and `agc_driver_native_depth_bda_clear` fail 2 of 2. - On f29546ac4e, all six pass 2 of 2 (its `--clears` has only the 24 regular cases). - Run directly, `--clears` on cae2e8a997 completes the 24 regular cases, `CompletedPossibleStore` and your new `ImportWindowWrite`. `DriverDispatch` then fails with "a native multisampled depth target is sampled only by recorded draws and dispatches". Nothing prints "CPU writes raced" and the driver-idle assertion holds, so the CPU-writes guard no longer trips there. - With a breakpoint on `__cxa_throw`, the stack at that throw is `CheckDepthTarget` → `CachedSampledTexture` → `cachedTexture` → `DepthSurfaceTexture` → `Require(recorder != nullptr, …)`. That `Require` checks `RecorderFor(context)`'s result, so `Recorder::Active()` is either null there or on another device; I haven't checked which. - `agc_driver_native_depth_bda_clear` on cae2e8a997 prints the same readback line with "complete=0", then fails with "native multisample depth clear has not been recorded", which is `CheckCurrent`'s `clearPending` check. **Validation layer:** `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, layers 1.4.363. Each of the six cases ran once as its executable, on both trees. - No `VUID-` message on either tree, in any of them. On cae2e8a997 the two failing executables stop at their failures, so they cover less than on main. - On cae2e8a997, `--clears` under the layer then aborts (exit 134) after the failure above, with the layer's "The VkDevice dispatch handle was not found and Validation will crash. If you are using exit() …" message. On f29546ac4e it exits 0. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-19 23:54:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T23:54:22Z.


Thanks for the detailed RTX 3080 traces and the 795-test comparison. They show two failures on this head: agc_driver_native_depth_clears and agc_driver_native_depth_bda_clear.

The first trace isolates a false CPU-write stamp from the post-import write-watch walk: stampWrittenRun records the entire dirty run in cpuPages before checking WindowCopy::Holds(), even though unchanged import-window pages are separately classified as ImportWindow. I am adding focused tracking coverage for unchanged versus changed pages in that window.

I am treating the BDA clear failure as a separate unresolved regression; I will trace its missing complete-store proof and will not consider the PR validated until both failures are resolved and the broader AGC suite is rerun.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279956897 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6279956897). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T23:54:22Z. --- Thanks for the detailed RTX 3080 traces and the 795-test comparison. They show two failures on this head: `agc_driver_native_depth_clears` and `agc_driver_native_depth_bda_clear`. The first trace isolates a false CPU-write stamp from the post-import write-watch walk: `stampWrittenRun` records the entire dirty run in `cpuPages` before checking `WindowCopy::Holds()`, even though unchanged import-window pages are separately classified as `ImportWindow`. I am adding focused tracking coverage for unchanged versus changed pages in that window. I am treating the BDA clear failure as a separate unresolved regression; I will trace its missing complete-store proof and will not consider the PR validated until both failures are resolved and the broader AGC suite is rerun.
MarcZX10 commented 2026-10-20 00:15:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:15:45Z.


I rebased this PR onto current main (fafadca12caabaef739f8765159f9fbd9c5744ed) and resolved the conflicts while retaining the newer main APIs and tests. I also added two focused commits: one adds unchanged-versus-changed import-window page assertions, and the next avoids advancing a CPU page stamp for an import page whose bytes match the pre-import snapshot. The import still counts as a possible CPU touch in block-level reporting.

Validation on this Linux host: syntax-only compilation passed for GuestMemory.cpp, WriteTracking.cpp, DepthSurface.cpp, and NativeMultisampleDepth.cpp; tools/check_conventions.py --base upstream/main and git diff --check passed. The agc_write_tracking CTest skips here because this kernel/header setup does not enable the Linux write-watch backend, so I do not have local runtime confirmation.

Could you rerun ctest -R '^agc' on this updated head, especially agc_driver_native_depth_clears, agc_driver_native_depth_bda_clear, and agc_write_tracking, and share the result? The previous RTX 3080 report was against the old head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280244459 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6280244459). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T00:15:45Z. --- I rebased this PR onto current `main` (`fafadca12caabaef739f8765159f9fbd9c5744ed`) and resolved the conflicts while retaining the newer main APIs and tests. I also added two focused commits: one adds unchanged-versus-changed import-window page assertions, and the next avoids advancing a CPU page stamp for an import page whose bytes match the pre-import snapshot. The import still counts as a possible CPU touch in block-level reporting. Validation on this Linux host: syntax-only compilation passed for `GuestMemory.cpp`, `WriteTracking.cpp`, `DepthSurface.cpp`, and `NativeMultisampleDepth.cpp`; `tools/check_conventions.py --base upstream/main` and `git diff --check` passed. The `agc_write_tracking` CTest skips here because this kernel/header setup does not enable the Linux write-watch backend, so I do not have local runtime confirmation. Could you rerun `ctest -R '^agc'` on this updated head, especially `agc_driver_native_depth_clears`, `agc_driver_native_depth_bda_clear`, and `agc_write_tracking`, and share the result? The previous RTX 3080 report was against the old head.
MarcZX10 commented 2026-10-20 00:22:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:22:30Z.


Correction after reviewing the complete RTX 3080 report in comment 6279572344: the earlier codex/7233-import-baseline run already showed that arming the clear baseline after imports stopped the CPU-race refusal. The remaining DriverDispatch and BDA failures came from separate paths, so I removed the redundant tracker-stamp experiment from this PR.

The updated head cd6dd42743 is rebased on current main (34b1b77abf). It keeps the post-import baseline, restores the native-depth fixture recorder after driver idle before the next cached texture lookup, and updates the BDA test to pass its recognized clear-completion candidate through the same VulkanDevice::Dispatch argument used by the driver. The test changes are separate commits.

Syntax-only compilation passed for DepthSurface.cpp, VulkanDevice.cpp, NativeMultisampleDepth.cpp, and NativeDepthBdaClear.cpp; conventions and git diff --check passed. Runtime tests are still unverified here: this Linux host lacks the write-watch backend, the automatic PR workflow skipped platform builds, and manual dispatch requires repository admin rights. Could you rerun agc_driver_native_depth_clears and agc_driver_native_depth_bda_clear on this head and share whether both now pass?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280334232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6280334232). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T00:22:30Z. --- Correction after reviewing the complete RTX 3080 report in comment 6279572344: the earlier `codex/7233-import-baseline` run already showed that arming the clear baseline after imports stopped the CPU-race refusal. The remaining `DriverDispatch` and BDA failures came from separate paths, so I removed the redundant tracker-stamp experiment from this PR. The updated head `cd6dd42743` is rebased on current `main` (`34b1b77abf`). It keeps the post-import baseline, restores the native-depth fixture recorder after driver idle before the next cached texture lookup, and updates the BDA test to pass its recognized clear-completion candidate through the same `VulkanDevice::Dispatch` argument used by the driver. The test changes are separate commits. Syntax-only compilation passed for `DepthSurface.cpp`, `VulkanDevice.cpp`, `NativeMultisampleDepth.cpp`, and `NativeDepthBdaClear.cpp`; conventions and `git diff --check` passed. Runtime tests are still unverified here: this Linux host lacks the write-watch backend, the automatic PR workflow skipped platform builds, and manual dispatch requires repository admin rights. Could you rerun `agc_driver_native_depth_clears` and `agc_driver_native_depth_bda_clear` on this head and share whether both now pass?
SleglJan commented 2026-10-20 00:47:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T00:47:49Z.


@MarcZX10 RTX 3080 results for 18ed64a111 and cd6dd42743. Each ran ctest -R '^agc' (806 tests) against its own base, built the same way, with failures rerun one at a time. On all four builds, agc_write_tracking runs (not skipped) and passes, and agc_driver_stencil_ref_export skips itself.

cd6dd42743 against main 34b1b77abf:

  • agc_driver_native_depth_clears and agc_driver_native_depth_bda_clear pass. Run directly, --clears checks all 27 cases and exits 0.
  • One test fails, in both the full run and the rerun: agc_driver_flat_store.
    • It fails with "AGC graphics: flat store: the stored block is not stamped as written".
    • It also logs "[gpu] deferred write-back failed: … reason=2" for a 64 KiB block "read-only in the BDA table: …", but 34b1b77abf logs the same refusal and passes.
  • 34b1b77abf has no failures out of 806.

18ed64a111 against main fafadca12c: 4 failures, while fafadca12c has none.

  • the two native-depth tests;
  • agc_driver_flat_store, with the same message;
  • agc_driver_image_table_reuse, with "an entry a dispatch wrote in the epoch kept its old texels". It passes on cd6dd42743; I didn't isolate why.

agc_driver_flat_store, building only its test target in the same build directory:

  • 34b1b77abf passes.
  • I built 11 of the PR's 18 commits: all seven fix commits plus four test commits. Each fails with the same message: 005109e7bb, d091cc0065, 69fc6ee568, af65de1d00, 8c65753d3f, f466a98f05, 447d0c082b, 7001698a41, 40ec9f378c, 28f2a3911d and cd6dd42743.
  • On 2e048f56ff (base b6583dd868), it passed in the full run.
  • So 005109e7bb, or how its rebase onto main was resolved, interacts with something main gained between b6583dd868 and 34b1b77abf. The main merges in that range that touch FlatStore.cpp, GuestMemory.cpp, BdaResources.cpp or GuestBufferMemory.cpp are #6457, #6479, #6701, #6730 and #7432.
  • I couldn't bisect main further, because my bisect setup broke at configure.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280665585 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6280665585). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T00:47:49Z. --- @MarcZX10 RTX 3080 results for 18ed64a111 and cd6dd42743. Each ran `ctest -R '^agc'` (806 tests) against its own base, built the same way, with failures rerun one at a time. On all four builds, `agc_write_tracking` runs (not skipped) and passes, and `agc_driver_stencil_ref_export` skips itself. **cd6dd42743 against `main` 34b1b77abf:** - `agc_driver_native_depth_clears` and `agc_driver_native_depth_bda_clear` pass. Run directly, `--clears` checks all 27 cases and exits 0. - One test fails, in both the full run and the rerun: `agc_driver_flat_store`. - It fails with "AGC graphics: flat store: the stored block is not stamped as written". - It also logs "[gpu] deferred write-back failed: … reason=2" for a 64 KiB block "read-only in the BDA table: …", but 34b1b77abf logs the same refusal and passes. - 34b1b77abf has no failures out of 806. **18ed64a111 against `main` fafadca12c:** 4 failures, while fafadca12c has none. - the two native-depth tests; - `agc_driver_flat_store`, with the same message; - `agc_driver_image_table_reuse`, with "an entry a dispatch wrote in the epoch kept its old texels". It passes on cd6dd42743; I didn't isolate why. **`agc_driver_flat_store`, building only its test target in the same build directory:** - 34b1b77abf passes. - I built 11 of the PR's 18 commits: all seven fix commits plus four test commits. Each fails with the same message: 005109e7bb, d091cc0065, 69fc6ee568, af65de1d00, 8c65753d3f, f466a98f05, 447d0c082b, 7001698a41, 40ec9f378c, 28f2a3911d and cd6dd42743. - On 2e048f56ff (base b6583dd868), it passed in the full run. - So 005109e7bb, or how its rebase onto `main` was resolved, interacts with something `main` gained between b6583dd868 and 34b1b77abf. The `main` merges in that range that touch `FlatStore.cpp`, `GuestMemory.cpp`, `BdaResources.cpp` or `GuestBufferMemory.cpp` are #6457, #6479, #6701, #6730 and #7432. - I couldn't bisect `main` further, because my bisect setup broke at configure. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 00:51:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:51:43Z.


Thanks for narrowing this to agc_driver_flat_store. I traced the regression to the possible-write bookkeeping added by this PR: StoredOver() checks possibleWhole, possibleDropped, and possiblePieces, but UnchangedSince() calls the separate WriteTracker::storedOver() helper, which did not. When an exact possible-write interval overlapped the query, that helper could therefore report the range unchanged.

I pushed two focused commits to the PR:

  • test(agc): include possible writes in unchanged checks adds exact-overlap and adjacent-range assertions.
  • fix(agc): include possible writes in unchanged checks makes the unchanged query account for the possible-write records.

The new head is b0d4e988d5, rebased on current main. Local syntax-only compilation passed for GuestMemory.cpp and WriteTracking.cpp; conventions and git diff --check pass. I could not run the Vulkan tests here. Could you rerun agc_driver_flat_store first, then the ^agc suite on this head and report whether the failure is gone?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280714908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6280714908). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T00:51:43Z. --- Thanks for narrowing this to `agc_driver_flat_store`. I traced the regression to the possible-write bookkeeping added by this PR: `StoredOver()` checks `possibleWhole`, `possibleDropped`, and `possiblePieces`, but `UnchangedSince()` calls the separate `WriteTracker::storedOver()` helper, which did not. When an exact possible-write interval overlapped the query, that helper could therefore report the range unchanged. I pushed two focused commits to the PR: - `test(agc): include possible writes in unchanged checks` adds exact-overlap and adjacent-range assertions. - `fix(agc): include possible writes in unchanged checks` makes the unchanged query account for the possible-write records. The new head is `b0d4e988d5`, rebased on current `main`. Local syntax-only compilation passed for `GuestMemory.cpp` and `WriteTracking.cpp`; conventions and `git diff --check` pass. I could not run the Vulkan tests here. Could you rerun `agc_driver_flat_store` first, then the `^agc` suite on this head and report whether the failure is gone?
MarcZX10 commented 2026-10-20 00:53:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:53:47Z.


I rebased the updated series onto the latest main (a569f47cb7) after it advanced. The possible-write regression test and fix are unchanged; the new PR head is 96b16cc20f. Syntax-only compilation for GuestMemory.cpp and WriteTracking.cpp, conventions, and git diff --check still pass locally. Could you rerun agc_driver_flat_store and then ctest -R '^agc' on this head? The previous RTX 3080 run was against cd6dd42743, before the two follow-up commits.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280745879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6280745879). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T00:53:47Z. --- I rebased the updated series onto the latest `main` (`a569f47cb7`) after it advanced. The possible-write regression test and fix are unchanged; the new PR head is `96b16cc20f`. Syntax-only compilation for `GuestMemory.cpp` and `WriteTracking.cpp`, conventions, and `git diff --check` still pass locally. Could you rerun `agc_driver_flat_store` and then `ctest -R '^agc'` on this head? The previous RTX 3080 run was against `cd6dd42743`, before the two follow-up commits.
SleglJan commented 2026-10-20 01:14:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T01:14:08Z.


@MarcZX10 96b16cc20f on the RTX 3080, against its base main a569f47cb7, both built the same way. I ran ctest -R '^agc' (806 tests) on each:

  • 96b16cc20f has no failures out of 806, and neither has a569f47cb7. On both, agc_driver_stencil_ref_export skips itself.
  • On 96b16cc20f these pass: agc_driver_flat_store, agc_driver_native_depth_clears, agc_driver_native_depth_bda_clear, agc_driver_image_table_reuse and agc_write_tracking. agc_write_tracking ran, not skipped.
  • Run directly, agc_driver_native_multisample_depth_tests --clears checks all 27 cases and exits 0.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281000723 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6281000723). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T01:14:08Z. --- @MarcZX10 96b16cc20f on the RTX 3080, against its base `main` a569f47cb7, both built the same way. I ran `ctest -R '^agc'` (806 tests) on each: - 96b16cc20f has no failures out of 806, and neither has a569f47cb7. On both, `agc_driver_stencil_ref_export` skips itself. - On 96b16cc20f these pass: `agc_driver_flat_store`, `agc_driver_native_depth_clears`, `agc_driver_native_depth_bda_clear`, `agc_driver_image_table_reuse` and `agc_write_tracking`. `agc_write_tracking` ran, not skipped. - Run directly, `agc_driver_native_multisample_depth_tests --clears` checks all 27 cases and exits 0. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 01:28:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T01:28:03Z.


Thanks for running the matrix on the exact current head and base. This supplies the GPU evidence we were waiting for: all 806 AGC tests pass on both, the focused native depth-clear cases pass, and agc_write_tracking ran rather than skipping. I have recorded that scope and the stencil-export skip as reported; I am not extending the claim beyond those checks.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281172190 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6281172190). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T01:28:03Z. --- Thanks for running the matrix on the exact current head and base. This supplies the GPU evidence we were waiting for: all 806 AGC tests pass on both, the focused native depth-clear cases pass, and `agc_write_tracking` ran rather than skipping. I have recorded that scope and the stencil-export skip as reported; I am not extending the claim beyond those checks.
oneandonlydean commented 2026-10-20 01:53:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T01:53:31Z.


Thanks. Arming the clear baseline after the import and draining in WaitIdle answers both points, and SleglJan's matrix looks good.

One thing came in with the rebase. Main's 5532d51 changed GuestMemory::StoredOver to return tracker.storedOver(address, address + bytes, generation, false);, so a block with no driver pieces counts as stored over only when its walk pages are newer. 96b16cc20f keeps the older inlined body, which returns true for any such block. That quietly undoes part of 5532d51 for every StoredOver caller: texture re-uploads, CMASK proofs, and the DCC range check in MultisampleTarget.cpp. Your storedOver member already has the possible-write checks, so could you restore main's one-line body?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281483649 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6281483649). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T01:53:31Z. --- Thanks. Arming the clear baseline after the import and draining in WaitIdle answers both points, and SleglJan's matrix looks good. One thing came in with the rebase. Main's 5532d51 changed `GuestMemory::StoredOver` to `return tracker.storedOver(address, address + bytes, generation, false);`, so a block with no driver pieces counts as stored over only when its walk pages are newer. 96b16cc20f keeps the older inlined body, which returns true for any such block. That quietly undoes part of 5532d51 for every StoredOver caller: texture re-uploads, CMASK proofs, and the DCC range check in MultisampleTarget.cpp. Your `storedOver` member already has the possible-write checks, so could you restore main's one-line body?
MarcZX10 commented 2026-10-20 08:18:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:18:33Z.


Thanks for catching the behavior restored from #5532. I pushed two focused commits: 6d0cf4792c adds a page-precision regression (a collected CPU write on one 4 KiB page must not make the adjacent page in the same 64 KiB block count as stored over), and 5c4b9fe129 restores StoredOver() delegation to tracker.storedOver(..., false). That keeps the possible-write evidence handled by the helper while restoring main’s page-specific walk behavior. Diff and conventions checks pass, but I cannot run agc_write_tracking on this Xeon host because the CPU guard fails before test code; no current-head runtime result is claimed. I updated the PR description to distinguish the earlier 806-test GPU report on 96b16cc20f from this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6286631750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6286631750). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T08:18:33Z. --- Thanks for catching the behavior restored from #5532. I pushed two focused commits: `6d0cf4792c` adds a page-precision regression (a collected CPU write on one 4 KiB page must not make the adjacent page in the same 64 KiB block count as stored over), and `5c4b9fe129` restores `StoredOver()` delegation to `tracker.storedOver(..., false)`. That keeps the possible-write evidence handled by the helper while restoring main’s page-specific walk behavior. Diff and conventions checks pass, but I cannot run `agc_write_tracking` on this Xeon host because the CPU guard fails before test code; no current-head runtime result is claimed. I updated the PR description to distinguish the earlier 806-test GPU report on `96b16cc20f` from this head.
milescoviello commented 2026-10-20 08:37:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T08:37:57Z.


@MarcZX10 runtime results for the current head 5c4b9fe129, since your Xeon can't run them: Ubuntu 24.04 (Linux 6.8), NVIDIA RTX 4070 Ti (595.99.02), GCC 13.3, Release with BUILD_TESTING=ON. I built agc_write_tracking_tests, agc_driver_native_multisample_depth_tests and agc_driver_native_depth_bda_clear_tests at the head and at its base main a569f47cb7, each in the same build directory, and ran ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_write_tracking|^agc_driver_native_depth' 3 times on each:

  • Base: 5 of 5 pass in each run.
  • Head: 5 of 5 pass in each run.
  • The 5 tests are agc_write_tracking, agc_driver_native_depth_bda_clear, agc_driver_native_depth_retirement, agc_driver_native_depth_clears and agc_driver_native_depth_clear_refusals. None skipped. agc_write_tracking ran, and at the head that includes your new CheckStoredOverUsesPageEvidence.

Not run: the full ^agc matrix, the validation layer, other GPUs.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6286958382 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6286958382). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-20T08:37:57Z. --- @MarcZX10 runtime results for the current head `5c4b9fe129`, since your Xeon can't run them: Ubuntu 24.04 (Linux 6.8), NVIDIA RTX 4070 Ti (595.99.02), GCC 13.3, Release with `BUILD_TESTING=ON`. I built `agc_write_tracking_tests`, `agc_driver_native_multisample_depth_tests` and `agc_driver_native_depth_bda_clear_tests` at the head and at its base `main` `a569f47cb7`, each in the same build directory, and ran `ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_write_tracking|^agc_driver_native_depth'` 3 times on each: - Base: 5 of 5 pass in each run. - Head: 5 of 5 pass in each run. - The 5 tests are `agc_write_tracking`, `agc_driver_native_depth_bda_clear`, `agc_driver_native_depth_retirement`, `agc_driver_native_depth_clears` and `agc_driver_native_depth_clear_refusals`. None skipped. `agc_write_tracking` ran, and at the head that includes your new `CheckStoredOverUsesPageEvidence`. Not run: the full `^agc` matrix, the validation layer, other GPUs. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 09:39:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T09:39:52Z.


Thanks for running the repeated exact-head/base comparison on the RTX 4070 Ti and for reporting the scope precisely. I verified that the current head 5c4b9fe129 restores GuestMemory::StoredOver to main’s page-aware storedOver(..., false) delegation, so the reviewed rebase regression is addressed in the published branch. The 5/5 results across three runs on both base and head are useful focused evidence; I have not generalized them to the broader AGC suite.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288048228 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6288048228). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T09:39:52Z. --- Thanks for running the repeated exact-head/base comparison on the RTX 4070 Ti and for reporting the scope precisely. I verified that the current head `5c4b9fe129` restores `GuestMemory::StoredOver` to main’s page-aware `storedOver(..., false)` delegation, so the reviewed rebase regression is addressed in the published branch. The 5/5 results across three runs on both base and head are useful focused evidence; I have not generalized them to the broader AGC suite.
SleglJan commented 2026-10-20 09:42:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T09:42:46Z.


@MarcZX10 the wider set for 5c4b9fe129, since milescoviello covered the focused tests: RTX 3080 (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with BUILD_TESTING=ON), against its base main a569f47cb7, built the same way. I ran ctest -R '^agc' (806 tests) on each:

  • 5c4b9fe129 has no failures out of 806, and neither has a569f47cb7. On both, agc_driver_stencil_ref_export skips itself.
  • One run each. On 5c4b9fe129 these pass: agc_write_tracking (it ran, including your new CheckStoredOverUsesPageEvidence), agc_driver_flat_store, agc_driver_native_depth_clears and agc_driver_native_depth_bda_clear.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288097673 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6288097673). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T09:42:46Z. --- @MarcZX10 the wider set for 5c4b9fe129, since milescoviello covered the focused tests: RTX 3080 (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with `BUILD_TESTING=ON`), against its base `main` a569f47cb7, built the same way. I ran `ctest -R '^agc'` (806 tests) on each: - 5c4b9fe129 has no failures out of 806, and neither has a569f47cb7. On both, `agc_driver_stencil_ref_export` skips itself. - One run each. On 5c4b9fe129 these pass: `agc_write_tracking` (it ran, including your new `CheckStoredOverUsesPageEvidence`), `agc_driver_flat_store`, `agc_driver_native_depth_clears` and `agc_driver_native_depth_bda_clear`. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 09:44:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T09:44:11Z.


Thanks for running the full 806-test AGC selection on both the PR head and its base, and for noting the one expected self-skip. That comparison shows no new failures in this selected suite on 5c4b9fe129; I will keep the scope limited to these reported tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288121484 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6288121484). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T09:44:11Z. --- Thanks for running the full 806-test AGC selection on both the PR head and its base, and for noting the one expected self-skip. That comparison shows no new failures in this selected suite on `5c4b9fe129`; I will keep the scope limited to these reported tests.
oneandonlydean commented 2026-10-20 12:04:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T12:04:14Z.


Thanks for the rebase. CI on 1c210cd21d (merged into main d50ec76da0, run 39416473533) still fails one test on Linux, the same way as the two runs on 5c4b9fe129 before it:

890/1707 Test #890: agc_driver_native_depth_clears ...***Failed    0.63 sec
Selected GPU name=llvmpipe (LLVM 20.1.2, 256 bits) vendor=0x10005 device=0x0 subgroup=8
[gpu] open /dev/udmabuf: Permission denied; shared direct memory is copied instead of imported, and GPU stores through FLAT/GLOBAL addresses do not reach it
...
Native depth format=126 samples=4 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts
[Shaders/ShaderRegistry.cpp:606 ReportPreparedAtUse] Compute shader ... was not registered; preparing its artifact at dispatch
AGC graphics: driver idle returned before recording the completed HTILE dispatch

That's the Require at NativeMultisampleDepth.cpp:821 in the ClearFault::DriverDispatch case: after SubmitDriverHtileClear and the driver idle, StoredAllSince(htileAddress, metadataBytes, generation) is false. The other cases in the test pass first. It fails 3 of 3 runs on Linux CI (lavapipe). Testers on NVIDIA (RTX 3080, RTX 4070 Ti) pass, and the same test passes on main in other runs, so it looks specific to this PR on lavapipe.

The rebase doesn't change the HTILE path (the production code is the same as 5c4b9fe129 apart from the Dispatch.cpp capture list), so the failure is expected to repeat until that path changes.

Reading the path, the idle itself looks ordered: the dispatch is recorded before markCompleted, Driver::WaitIdle syncs the recorder and runs its completions, and MarkWritten bumps the generation before it stamps. So StoredAllSince returning false points at one of these:

  1. The clear was never armed or completed for this surface. ArmHtileDepthClear didn't arm (no pending clear, or CollectWritesUncached returned 0 and refused), or CompleteHtileDepthClear ran without matching the surface.
  2. The write-watch collection inside markWritten failed. Then the range is unwatched (!collected → unwatch → noteUnstampedStore), and StoredAllSince returns false at !tracker.covers.
  3. An unstamped store newer than the snapshot landed in the same block slot.

The /dev/udmabuf: Permission denied line is worth checking first. On the CI runner, shared direct memory is copied rather than imported, which changes how the HTILE range is imported and watched. Your NVIDIA testers probably have udmabuf access. That would fit 1 or 2 and would explain why only CI sees it.

Could you:

  • find which of these is happening (a print at each StoredAllSince exit, and at the arm/complete match for the surface, shows it in one run), and push a fix to the product code or to the fixture, whichever is right; if lavapipe can't prove the store in this setup, the test should skip that case with a skipped, the device ... reason rather than fail;
  • run agc_driver_native_depth_clears locally on lavapipe before pushing: Mesa's lvp_icd via VK_DRIVER_FILES=<path>/lvp_icd.x86_64.json (or VK_ICD_FILENAMES), ideally also without access to /dev/udmabuf, as on the CI runner, and post the output.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6290416817 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6290416817). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T12:04:14Z. --- Thanks for the rebase. CI on `1c210cd21d` (merged into main `d50ec76da0`, run 39416473533) still fails one test on Linux, the same way as the two runs on `5c4b9fe129` before it: ``` 890/1707 Test #890: agc_driver_native_depth_clears ...***Failed 0.63 sec Selected GPU name=llvmpipe (LLVM 20.1.2, 256 bits) vendor=0x10005 device=0x0 subgroup=8 [gpu] open /dev/udmabuf: Permission denied; shared direct memory is copied instead of imported, and GPU stores through FLAT/GLOBAL addresses do not reach it ... Native depth format=126 samples=4 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts [Shaders/ShaderRegistry.cpp:606 ReportPreparedAtUse] Compute shader ... was not registered; preparing its artifact at dispatch AGC graphics: driver idle returned before recording the completed HTILE dispatch ``` That's the `Require` at `NativeMultisampleDepth.cpp:821` in the `ClearFault::DriverDispatch` case: after `SubmitDriverHtileClear` and the driver idle, `StoredAllSince(htileAddress, metadataBytes, generation)` is false. The other cases in the test pass first. It fails 3 of 3 runs on Linux CI (lavapipe). Testers on NVIDIA (RTX 3080, RTX 4070 Ti) pass, and the same test passes on main in other runs, so it looks specific to this PR on lavapipe. The rebase doesn't change the HTILE path (the production code is the same as `5c4b9fe129` apart from the Dispatch.cpp capture list), so the failure is expected to repeat until that path changes. Reading the path, the idle itself looks ordered: the dispatch is recorded before `markCompleted`, `Driver::WaitIdle` syncs the recorder and runs its completions, and `MarkWritten` bumps the generation before it stamps. So `StoredAllSince` returning false points at one of these: 1. **The clear was never armed or completed for this surface.** `ArmHtileDepthClear` didn't arm (no pending clear, or `CollectWritesUncached` returned 0 and refused), or `CompleteHtileDepthClear` ran without matching the surface. 2. **The write-watch collection inside `markWritten` failed.** Then the range is unwatched (`!collected` → unwatch → `noteUnstampedStore`), and `StoredAllSince` returns false at `!tracker.covers`. 3. **An unstamped store newer than the snapshot** landed in the same block slot. The `/dev/udmabuf: Permission denied` line is worth checking first. On the CI runner, shared direct memory is copied rather than imported, which changes how the HTILE range is imported and watched. Your NVIDIA testers probably have udmabuf access. That would fit 1 or 2 and would explain why only CI sees it. Could you: - find which of these is happening (a print at each `StoredAllSince` exit, and at the arm/complete match for the surface, shows it in one run), and push a fix to the product code or to the fixture, whichever is right; if lavapipe can't prove the store in this setup, the test should skip that case with a `skipped, the device ...` reason rather than fail; - run `agc_driver_native_depth_clears` locally on lavapipe before pushing: Mesa's `lvp_icd` via `VK_DRIVER_FILES=<path>/lvp_icd.x86_64.json` (or `VK_ICD_FILENAMES`), ideally also without access to `/dev/udmabuf`, as on the CI runner, and post the output.
SleglJan commented 2026-10-20 14:11:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T14:11:30Z.


@MarcZX10 @oneandonlydean this reproduces locally, and udmabuf doesn't cause it.

Setup:

  • 1c210cd21d on Linux 7.2.10, GCC 16.2.1, Release with BUILD_TESTING=ON.
  • lavapipe (Mesa 26.2.4, LLVM 23.1.1) as the only Vulkan driver, through VK_DRIVER_FILES.
  • Guest write watching through userfaultfd is available.

Results:

  • agc_driver_native_multisample_depth_tests --clears fails (exit 1) in all 3 runs in each of two setups: with access to /dev/udmabuf, and without it (under bwrap with a minimal /dev, "open /dev/udmabuf: No such file or directory"). The diag run below shows it stops at "driver idle returned before recording the completed HTILE dispatch".
  • agc_driver_native_depth_bda_clear skips itself in both setups ("skipped, the device does not retain guest write watching for native clear imports").

What the DriverDispatch case does on lavapipe, from prints at the arm, the completion, the write marks and each StoredAllSince exit (local only):

  1. In the DriverDispatch case itself, the fixture's first clear of the metadata arms with a nonzero generation, and StoredAllSince returns true. So the range is watched just before the driver dispatch.
  2. Then the driver dispatch carries the HTILE clear, and ArmHtileDepthClear matches the pending surface.
  3. CollectWritesUncached over the 32 KiB metadata returns 0. So clearGeneration stays 0 and the sampling is refused ("requires tracked HTILE generations"). That's your case 1.
  4. The dispatch's write mark for that range takes the unstamped path: the tracker is watched, but covers is false.
  5. CompleteHtileDepthClear skips the surface, because clearGeneration is 0.
  6. StoredAllSince_nid_no_patch returns false at !tracker.covers(address, bytes).

Why lavapipe:

  • Its host-import probe reports "host imports resolve write protection: yes (0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import); imported ranges are compared".
  • So when the driver's dispatch imports the metadata, GuestBufferMemory.cpp calls GuestMemory::ImportWatched with staysWatched false, and that unwatches the range.
  • The fixture's memory is private, so the import is a host-pointer import whether or not udmabuf is available. That's why udmabuf access makes no difference.
  • On our RTX 3080 this case passed on 5c4b9fe129; I haven't run 1c210cd21d there.

What to change: the refusal is the product's path for an untracked range, so it's the test case that assumes the range stays watched. NativeDepthBdaClear.cpp already checks this after its warm-up dispatch, with Memory::Watched on depth and metadata and the "does not retain guest write watching" skip. The same check in the DriverDispatch case would have to go after SubmitDriverHtileClear returns, since the range is still watched before the dispatch imports it. I haven't tested that. #7371 carries the same DriverDispatch case, so this applies there too.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6292873486 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6292873486). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T14:11:30Z. --- @MarcZX10 @oneandonlydean this reproduces locally, and udmabuf doesn't cause it. **Setup:** - 1c210cd21d on Linux 7.2.10, GCC 16.2.1, Release with `BUILD_TESTING=ON`. - lavapipe (Mesa 26.2.4, LLVM 23.1.1) as the only Vulkan driver, through `VK_DRIVER_FILES`. - Guest write watching through userfaultfd is available. **Results:** - `agc_driver_native_multisample_depth_tests --clears` fails (exit 1) in all 3 runs in each of two setups: with access to `/dev/udmabuf`, and without it (under bwrap with a minimal `/dev`, "open /dev/udmabuf: No such file or directory"). The diag run below shows it stops at "driver idle returned before recording the completed HTILE dispatch". - `agc_driver_native_depth_bda_clear` skips itself in both setups ("skipped, the device does not retain guest write watching for native clear imports"). **What the `DriverDispatch` case does on lavapipe**, from prints at the arm, the completion, the write marks and each `StoredAllSince` exit (local only): 1. In the `DriverDispatch` case itself, the fixture's first clear of the metadata arms with a nonzero generation, and `StoredAllSince` returns true. So the range is watched just before the driver dispatch. 2. Then the driver dispatch carries the HTILE clear, and `ArmHtileDepthClear` matches the pending surface. 3. `CollectWritesUncached` over the 32 KiB metadata returns 0. So `clearGeneration` stays 0 and the sampling is refused ("requires tracked HTILE generations"). That's your case 1. 4. The dispatch's write mark for that range takes the unstamped path: the tracker is watched, but `covers` is false. 5. `CompleteHtileDepthClear` skips the surface, because `clearGeneration` is 0. 6. `StoredAllSince_nid_no_patch` returns false at `!tracker.covers(address, bytes)`. **Why lavapipe:** - Its host-import probe reports "host imports resolve write protection: yes (0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import); imported ranges are compared". - So when the driver's dispatch imports the metadata, `GuestBufferMemory.cpp` calls `GuestMemory::ImportWatched` with `staysWatched` false, and that unwatches the range. - The fixture's memory is private, so the import is a host-pointer import whether or not udmabuf is available. That's why udmabuf access makes no difference. - On our RTX 3080 this case passed on 5c4b9fe129; I haven't run 1c210cd21d there. **What to change:** the refusal is the product's path for an untracked range, so it's the test case that assumes the range stays watched. `NativeDepthBdaClear.cpp` already checks this after its warm-up dispatch, with `Memory::Watched` on depth and metadata and the "does not retain guest write watching" skip. The same check in the `DriverDispatch` case would have to go after `SubmitDriverHtileClear` returns, since the range is still watched before the dispatch imports it. I haven't tested that. #7371 carries the same `DriverDispatch` case, so this applies there too. AI-assisted: yes (Claude Code)
SleglJan commented 2026-10-20 17:23:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T17:23:50Z.


@Amoenus @MarcZX10 one more lavapipe run, since the 2e048f56ff Windows results don't fit the generation-zero path alone. Same build and setup as above.

With APS5_WRITE_WATCH_IMPORTS=watch, so that imports stay watched, the DriverDispatch case still fails 3 of 3, but at the other guard:

  1. The clear arms with a nonzero generation.
  2. lavapipe runs the dispatch on CPU threads, so its stores into the imported metadata are CPU stores the write watch sees. That matches its probe's "4 after a GPU write".
  3. At completion, UnchangedSinceCollected finds those pages newer than the clear's generation. CompleteHtileDepthClear throws "CPU writes raced native multisample depth clear", logged as a deferred write-back failure, so the completed store is never recorded.
  4. StoredAllSince_nid_no_patch then returns false at the driver-piece covers check, and the test fails with the same message.

How that maps to the Windows logs: that race message is the one in Amoenus's 2e048f56ff logs. His 1c210cd21d logs have none. That fits the generation-zero path only if the HTILE range left the watch, and his probe line ("keep the write watch: yes", nothing after the GPU write) points the other way.

So on a device whose GPU writes to an imported range show up in the write watch, one of the two guards refuses this clear either way:

  • unwatched, the clear never gets a generation;
  • watched, the race guard trips.

The case can pass only where the imported range stays watched and the GPU's writes don't mark it. That's the case on the RTX 3080 under Linux, whose probe reports "0 after a GPU write … imported ranges stay watched". By that probe, Windows is the same configuration, so it looks like a third case. What would separate it is the metadata range's own state right after SubmitDriverHtileClear: Memory::Watched on depth and metadata, as NativeDepthBdaClear.cpp checks.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6296900572 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6296900572). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T17:23:50Z. --- @Amoenus @MarcZX10 one more lavapipe run, since the 2e048f56ff Windows results don't fit the generation-zero path alone. Same build and setup as above. **With `APS5_WRITE_WATCH_IMPORTS=watch`,** so that imports stay watched, the `DriverDispatch` case still fails 3 of 3, but at the other guard: 1. The clear arms with a nonzero generation. 2. lavapipe runs the dispatch on CPU threads, so its stores into the imported metadata are CPU stores the write watch sees. That matches its probe's "4 after a GPU write". 3. At completion, `UnchangedSinceCollected` finds those pages newer than the clear's generation. `CompleteHtileDepthClear` throws "CPU writes raced native multisample depth clear", logged as a deferred write-back failure, so the completed store is never recorded. 4. `StoredAllSince_nid_no_patch` then returns false at the driver-piece `covers` check, and the test fails with the same message. **How that maps to the Windows logs:** that race message is the one in Amoenus's 2e048f56ff logs. His 1c210cd21d logs have none. That fits the generation-zero path only if the HTILE range left the watch, and his probe line ("keep the write watch: yes", nothing after the GPU write) points the other way. **So on a device whose GPU writes to an imported range show up in the write watch, one of the two guards refuses this clear either way:** - unwatched, the clear never gets a generation; - watched, the race guard trips. The case can pass only where the imported range stays watched and the GPU's writes don't mark it. That's the case on the RTX 3080 under Linux, whose probe reports "0 after a GPU write … imported ranges stay watched". By that probe, Windows is the same configuration, so it looks like a third case. What would separate it is the metadata range's own state right after `SubmitDriverHtileClear`: `Memory::Watched` on depth and metadata, as `NativeDepthBdaClear.cpp` checks. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 19:09:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T19:09:48Z.


Thanks for the two lavapipe traces. I pushed 8073c2e532 on the rebased head (main 434e965d46). The DriverDispatch case now checks UnchangedSinceCollected after the dispatch and WaitIdle restores the fixture recorder. That detects both conditions in the reports: the import path no longer covers the metadata range, and a CPU-executed dispatch writes through the watch as though it were a CPU race. In either unsupported case the native-depth clear test reports a skip (77); when the device retains usable write-watch evidence, the existing StoredAllSince_nid_no_patch assertion still has to pass. This is test gating only; it does not weaken production clear validation.

On this host, python3 tools/check_conventions.py --base upstream/main and git diff --check pass. I could not run the Vulkan test locally because no configured build is available and the filesystem has only 30 MiB free. Could you rerun agc_driver_native_depth_clears on the exact head, including lavapipe and a hardware GPU if available? The runtime result for this head is not yet verified.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6299021882 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6299021882). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T19:09:48Z. --- Thanks for the two lavapipe traces. I pushed `8073c2e532` on the rebased head (`main` `434e965d46`). The `DriverDispatch` case now checks `UnchangedSinceCollected` after the dispatch and `WaitIdle` restores the fixture recorder. That detects both conditions in the reports: the import path no longer covers the metadata range, and a CPU-executed dispatch writes through the watch as though it were a CPU race. In either unsupported case the native-depth clear test reports a skip (77); when the device retains usable write-watch evidence, the existing `StoredAllSince_nid_no_patch` assertion still has to pass. This is test gating only; it does not weaken production clear validation. On this host, `python3 tools/check_conventions.py --base upstream/main` and `git diff --check` pass. I could not run the Vulkan test locally because no configured build is available and the filesystem has only 30 MiB free. Could you rerun `agc_driver_native_depth_clears` on the exact head, including lavapipe and a hardware GPU if available? The runtime result for this head is not yet verified.
oneandonlydean commented 2026-10-20 19:25:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T19:25:40Z.


Thanks for the update. 8073c2e532 is test-only, and the rebase leaves the other 22 commits unchanged (range-diff against 1c210cd21d).

One request on the new skip. It fires when UnchangedSinceCollected reports a change after the dispatch, which is right for lavapipe, where device writes are CPU-thread stores that write-watch sees. But because it's keyed on the observed result, a later regression that makes the driver's own HTILE write look like a CPU write (or any stray CPU store into that range) would also turn this case into a skip on real GPUs, instead of failing at the StoredAllSince check.

Could the skip be keyed on the device instead, for example VK_PHYSICAL_DEVICE_TYPE_CPU? The fixture already reads deviceType when it picks the device, and BdaDevice.cpp uses the same check. The StoredAllSince requirement would then stay unconditional on hardware GPUs. Since Linux CI runs on llvmpipe, a run of this case on a hardware GPU at the new head (showing it ran rather than skipped) would also help.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6299395535 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6299395535). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T19:25:40Z. --- Thanks for the update. `8073c2e532` is test-only, and the rebase leaves the other 22 commits unchanged (range-diff against `1c210cd21d`). One request on the new skip. It fires when `UnchangedSinceCollected` reports a change after the dispatch, which is right for lavapipe, where device writes are CPU-thread stores that write-watch sees. But because it's keyed on the observed result, a later regression that makes the driver's own HTILE write look like a CPU write (or any stray CPU store into that range) would also turn this case into a skip on real GPUs, instead of failing at the `StoredAllSince` check. Could the skip be keyed on the device instead, for example `VK_PHYSICAL_DEVICE_TYPE_CPU`? The fixture already reads `deviceType` when it picks the device, and `BdaDevice.cpp` uses the same check. The `StoredAllSince` requirement would then stay unconditional on hardware GPUs. Since Linux CI runs on llvmpipe, a run of this case on a hardware GPU at the new head (showing it ran rather than skipped) would also help.
Amoenus commented 2026-10-20 19:44:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-20T19:44:42Z.


@MarcZX10 @oneandonlydean completed the exact 8073c2e532 hardware retest: DriverDispatch still skips on RTX 5080 and Radeon Graphics. Maintained results and the one-line CI skip-message proposal. The hardware-gating concern remains open; no lavapipe run claimed.

AI-assisted: yes (Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6299866235 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6299866235). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-20T19:44:42Z. --- @MarcZX10 @oneandonlydean completed the exact `8073c2e532` hardware retest: DriverDispatch still skips on RTX 5080 and Radeon Graphics. [Maintained results and the one-line CI skip-message proposal](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6244828184). The hardware-gating concern remains open; no lavapipe run claimed. AI-assisted: yes (Codex). <!-- codex-7233-8073-retest-reply-v1 -->
SleglJan commented 2026-10-20 20:06:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T20:06:45Z.


@MarcZX10 @oneandonlydean results for 8073c2e532, the exact head on main 434e965d46.

Setup: Linux 7.2.10, GCC 16.2.1, Release with BUILD_TESTING=ON. I ran the test binaries directly, outside ctest, so without the ctest environment.

lavapipe (Mesa 26.2.4, LLVM 23.1.1):

  • agc_driver_native_multisample_depth_tests --clears skips (77) 3 of 3 with the new message, both with /dev/udmabuf access and without it.
  • agc_driver_native_depth_bda_clear skips 3 of 3 with its existing message.

RTX 3080 (NVIDIA 615.78.08):

  • --clears also skips 3 of 3 with the new message, while agc_driver_native_depth_bda_clear passes 3 of 3.
  • The probe here reports "host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched". On 5c4b9fe129 this case ran and passed on this GPU.
  • So on this hardware GPU, UnchangedSinceCollected returns false after the dispatch. That fits dean's point. I haven't separated a newer CPU stamp from lost coverage or a failed page walk. The probe covers scratch pages, not the HTILE range, and I didn't run this head with the skip removed.
  • Under VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, --clears logs no VUID-, and its subcase lines match the plain runs. It then aborts at shutdown (core dump after the host-import summary line), so its buffered skip or result line isn't in the log.

Windows: the exact head also skips on Amoenus's RTX 5080 and Radeon, so no hardware GPU has run this case at this head yet. His control fa23b5820a (8073c2e532 without the skip) fails DriverDispatch 3 of 3 on both. So a skip keyed only on VK_PHYSICAL_DEVICE_TYPE_CPU would turn those runs into the control's failures instead of skips.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6300348531 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6300348531). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T20:06:45Z. --- @MarcZX10 @oneandonlydean results for 8073c2e532, the exact head on `main` 434e965d46. **Setup:** Linux 7.2.10, GCC 16.2.1, Release with `BUILD_TESTING=ON`. I ran the test binaries directly, outside ctest, so without the ctest environment. **lavapipe** (Mesa 26.2.4, LLVM 23.1.1): - `agc_driver_native_multisample_depth_tests --clears` skips (77) 3 of 3 with the new message, both with `/dev/udmabuf` access and without it. - `agc_driver_native_depth_bda_clear` skips 3 of 3 with its existing message. **RTX 3080** (NVIDIA 615.78.08): - `--clears` also skips 3 of 3 with the new message, while `agc_driver_native_depth_bda_clear` passes 3 of 3. - The probe here reports "host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import); imported ranges stay watched". On 5c4b9fe129 this case ran and passed on this GPU. - So on this hardware GPU, `UnchangedSinceCollected` returns false after the dispatch. That fits dean's point. I haven't separated a newer CPU stamp from lost coverage or a failed page walk. The probe covers scratch pages, not the HTILE range, and I didn't run this head with the skip removed. - Under `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `--clears` logs no `VUID-`, and its subcase lines match the plain runs. It then aborts at shutdown (core dump after the host-import summary line), so its buffered skip or result line isn't in the log. **Windows:** the exact head also skips on Amoenus's RTX 5080 and Radeon, so no hardware GPU has run this case at this head yet. His control fa23b5820a (8073c2e532 without the skip) fails `DriverDispatch` 3 of 3 on both. So a skip keyed only on `VK_PHYSICAL_DEVICE_TYPE_CPU` would turn those runs into the control's failures instead of skips. AI-assisted: yes (Claude Code)
simonbbby commented 2026-10-20 20:26:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-20T20:26:32Z.


I separated the skip cases on Linux at exact head 8073c2e532bca758fdd37c54c2626f6c9227f30a (Ubuntu 24.04, GCC 13.3 Release). Direct agc_driver_native_multisample_depth_tests --clears, fresh processes, shader cache disabled, ANYPS5_REQUIRE_VULKAN=1:

GPU / ICD Unmodified head Diagnostic: bypass only the new result-based skip
RTX 3090 / NVIDIA 595.99.02 3/3 exit 77 3/3 pass, checked=27 unavailable=0
gfx1036 / RADV Mesa 25.2.8 3/3 exit 77 3/3 fail at the existing completed-HTILE assertion
lavapipe / Mesa 25.2.8, LLVM 20.1.2 3/3 exit 77 3/3 fail at the same assertion

Immediately after the dispatch and UnchangedSinceCollected call, a temporary print gives:

NVIDIA:  watched=1 unchangedCPU=0 storedAll=1
RADV:    watched=0 unchangedCPU=0 storedAll=0
lavapipe:watched=0 unchangedCPU=0 storedAll=0

The diagnostic leaves StoredAllSince, all clear-value/readback checks and the production CompleteHtileDepthClear CPU-race guard intact. NVIDIA reaches and passes those checks, including DriverDispatch. Its current skip therefore hides a working clear; lost coverage is not the NVIDIA explanation. On RADV/lavapipe the metadata really leaves the watch, so a CPU-device-only gate would still expose a hardware RADV failure in this private host-pointer-import setup.

I also tried collecting metadata writes immediately before the fixture's generation snapshot, retaining the new guard: NVIDIA still skips 3/3. That rules out fixing this merely by collecting pending writes before the call. I have not isolated the origin of the newer CPU-kind stamp; the successful completion guard uses the clear's later armed generation, while the fixture compares against its earlier pre-submit snapshot.

This is a diagnostic hardware pass, not a pass of the unmodified head. No production edits were made. All temporary fixture edits are removed; rebuilt stock head reproduces exit 77 again with a clean checkout. No Khronos validation layer is installed here, and no retail title was run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6300729278 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6300729278). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-20T20:26:32Z. --- I separated the skip cases on Linux at exact head `8073c2e532bca758fdd37c54c2626f6c9227f30a` (Ubuntu 24.04, GCC 13.3 Release). Direct `agc_driver_native_multisample_depth_tests --clears`, fresh processes, shader cache disabled, `ANYPS5_REQUIRE_VULKAN=1`: | GPU / ICD | Unmodified head | Diagnostic: bypass only the new result-based skip | |---|---|---| | RTX 3090 / NVIDIA 595.99.02 | 3/3 exit 77 | **3/3 pass**, `checked=27 unavailable=0` | | gfx1036 / RADV Mesa 25.2.8 | 3/3 exit 77 | 3/3 fail at the existing completed-HTILE assertion | | lavapipe / Mesa 25.2.8, LLVM 20.1.2 | 3/3 exit 77 | 3/3 fail at the same assertion | Immediately after the dispatch and `UnchangedSinceCollected` call, a temporary print gives: ``` NVIDIA: watched=1 unchangedCPU=0 storedAll=1 RADV: watched=0 unchangedCPU=0 storedAll=0 lavapipe:watched=0 unchangedCPU=0 storedAll=0 ``` The diagnostic leaves `StoredAllSince`, all clear-value/readback checks and the production `CompleteHtileDepthClear` CPU-race guard intact. NVIDIA reaches and passes those checks, including DriverDispatch. Its current skip therefore hides a working clear; lost coverage is not the NVIDIA explanation. On RADV/lavapipe the metadata really leaves the watch, so a CPU-device-only gate would still expose a hardware RADV failure in this private host-pointer-import setup. I also tried collecting metadata writes immediately before the fixture's generation snapshot, retaining the new guard: NVIDIA still skips 3/3. That rules out fixing this merely by collecting pending writes before the call. I have not isolated the origin of the newer CPU-kind stamp; the successful completion guard uses the clear's later armed generation, while the fixture compares against its earlier pre-submit snapshot. This is a diagnostic hardware pass, **not a pass of the unmodified head**. No production edits were made. All temporary fixture edits are removed; rebuilt stock head reproduces exit 77 again with a clean checkout. No Khronos validation layer is installed here, and no retail title was run.
MarcZX10 commented 2026-10-20 21:27:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:27:16Z.


Thanks for separating the diagnostic from the unmodified test result. This shows the current result-based gate skips the NVIDIA case even though bypassing only that gate reaches and passes the clear checks, while the same bypass fails on RADV/lavapipe in the reported host-import setup. I am treating that as a test-coverage gap to investigate; the diagnostic is not a pass of the current test or evidence of a RADV fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6301856583 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6301856583). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T21:27:16Z. --- Thanks for separating the diagnostic from the unmodified test result. This shows the current result-based gate skips the NVIDIA case even though bypassing only that gate reaches and passes the clear checks, while the same bypass fails on RADV/lavapipe in the reported host-import setup. I am treating that as a test-coverage gap to investigate; the diagnostic is not a pass of the current test or evidence of a RADV fix.
MarcZX10 commented 2026-10-20 21:34:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:34:10Z.


Rebased to current main at 73b6a4cc71 and pushed head 374b3f9c97; the dispatch resolution preserves both mainline thread-group arguments and this PR’s HTILE completion argument. The test gate now skips only when both CPU-write stability and complete-store evidence are unavailable, so supported complete-store evidence should allow the NVIDIA clear case to run.

Static diff and conventions checks pass. I have not run the AGC GPU regression locally on this head. @simonbbby, could you rerun agc_driver_native_multisample_depth_tests --clears on 374b3f9c97 with the same NVIDIA/RADV/lavapipe setup and report the exact-head results?

The overlap report also identifies open #8105 and #8126 touching intersecting dispatch/depth and direct-write completion lines. I have not folded either branch into this PR; merge order will need coordination.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6302002778 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6302002778). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T21:34:10Z. --- Rebased to current `main` at `73b6a4cc71` and pushed head `374b3f9c97`; the dispatch resolution preserves both mainline thread-group arguments and this PR’s HTILE completion argument. The test gate now skips only when both CPU-write stability and complete-store evidence are unavailable, so supported complete-store evidence should allow the NVIDIA clear case to run. Static diff and conventions checks pass. I have not run the AGC GPU regression locally on this head. @simonbbby, could you rerun `agc_driver_native_multisample_depth_tests --clears` on `374b3f9c97` with the same NVIDIA/RADV/lavapipe setup and report the exact-head results? The overlap report also identifies open #8105 and #8126 touching intersecting dispatch/depth and direct-write completion lines. I have not folded either branch into this PR; merge order will need coordination.
oneandonlydean commented 2026-10-20 21:46:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T21:46:12Z.


@MarcZX10 thanks, the rebase looks right (the dispatch now carries both main's thread-group argument and the HTILE completion argument), and the new condition does let the NVIDIA clear case run.

One small test change is still needed. On RADV and lavapipe storedAll is false, and that is exactly the failure the completed-HTILE assertion checks for, so !unchanged && !storedAll still skips precisely when the assertion would fail. On a real GPU (RADV) that hides a reproducible failure as a skip. Could the skip key on the device instead, e.g. only for VK_PHYSICAL_DEVICE_TYPE_CPU (lavapipe)? If RADV's failure is a separate known gap, a named expected-fail tracked by an issue would also work; it just shouldn't turn into a skip on a GPU.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6302308429 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6302308429). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T21:46:12Z. --- @MarcZX10 thanks, the rebase looks right (the dispatch now carries both main's thread-group argument and the HTILE completion argument), and the new condition does let the NVIDIA clear case run. One small test change is still needed. On RADV and lavapipe `storedAll` is false, and that is exactly the failure the completed-HTILE assertion checks for, so `!unchanged && !storedAll` still skips precisely when the assertion would fail. On a real GPU (RADV) that hides a reproducible failure as a skip. Could the skip key on the device instead, e.g. only for `VK_PHYSICAL_DEVICE_TYPE_CPU` (lavapipe)? If RADV's failure is a separate known gap, a named expected-fail tracked by an issue would also work; it just shouldn't turn into a skip on a GPU.
MarcZX10 commented 2026-10-20 21:48:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:48:09Z.


Thanks for the updated consumer-handoff report and for keeping the prerequisite Driver clear case separate from the passing matrix. I’ve recorded the 57 focused invocations and the documented Linux BDA write-watch skip. The report follows the 348a5345d3 production commits; my current PR head also includes the later test-gate commit 374b3f9c97, which only changes the regression-test gate.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6302362534 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6302362534). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T21:48:09Z. --- Thanks for the updated consumer-handoff report and for keeping the prerequisite Driver clear case separate from the passing matrix. I’ve recorded the 57 focused invocations and the documented Linux BDA write-watch skip. The report follows the `348a5345d3` production commits; my current PR head also includes the later test-gate commit `374b3f9c97`, which only changes the regression-test gate.
MarcZX10 commented 2026-10-20 22:12:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:12:16Z.


Addressed the latest test-gate review request in dc960cf765: the driver-dispatch evidence skip is now limited to VK_PHYSICAL_DEVICE_TYPE_CPU; on hardware GPU devices the StoredAllSince assertion remains unconditional. I also rebased the branch onto current main (339217ebc9). Validation on this host: git diff --check passed, python3 tools/check_conventions.py --base upstream/main passed, and the changed test translation unit passed a C++20 -fsyntax-only compile using the PR source and available dependency headers. I could not run agc_driver_native_multisample_depth_tests --clears: no compatible executable is present and only about 460 MiB is free. The build/test result for this head remains unverified locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6302937177 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6302937177). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T22:12:16Z. --- Addressed the latest test-gate review request in `dc960cf765`: the driver-dispatch evidence skip is now limited to `VK_PHYSICAL_DEVICE_TYPE_CPU`; on hardware GPU devices the `StoredAllSince` assertion remains unconditional. I also rebased the branch onto current `main` (`339217ebc9`). Validation on this host: `git diff --check` passed, `python3 tools/check_conventions.py --base upstream/main` passed, and the changed test translation unit passed a C++20 `-fsyntax-only` compile using the PR source and available dependency headers. I could not run `agc_driver_native_multisample_depth_tests --clears`: no compatible executable is present and only about 460 MiB is free. The build/test result for this head remains unverified locally.
simonbbby commented 2026-10-20 22:23:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-20T22:23:31Z.


Exact-head runtime check of dc960cf76594cf96ac07b804ddd3f310ecc47c9d, including the CPU-device-only gate and rebase onto 339217ebc9. No local source changes.

Ubuntu 24.04, GCC 13.3 Release, direct agc_driver_native_multisample_depth_tests --clears, ANYPS5_REQUIRE_VULKAN=1, shader cache disabled, three fresh processes per ICD:

Device Result
RTX 3090 / NVIDIA 595.99.02 3/3 exit 0, Native depth completed clear cases checked=27 unavailable=0
gfx1036 / RADV Mesa 25.2.8 3/3 exit 1, driver idle returned before recording the completed HTILE dispatch
lavapipe / Mesa 25.2.8, LLVM 20.1.2 3/3 exit 77 at the HTILE evidence skip

The NVIDIA runs reach the final count after DriverDispatch and do not take the skip. On the previous 8073c2e532 head all three ICDs skipped here, as in my earlier report. The new gate therefore restores stock NVIDIA coverage and exposes the RADV failure instead of hiding it as a hardware skip. RADV's failed assertion still needs resolution; this is not an all-GPU pass.

No Khronos validation layer is installed here, and no retail title was run. Exact PR checkout remains clean.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303114436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303114436). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-20T22:23:31Z. --- Exact-head runtime check of `dc960cf76594cf96ac07b804ddd3f310ecc47c9d`, including the CPU-device-only gate and rebase onto `339217ebc9`. No local source changes. Ubuntu 24.04, GCC 13.3 Release, direct `agc_driver_native_multisample_depth_tests --clears`, `ANYPS5_REQUIRE_VULKAN=1`, shader cache disabled, three fresh processes per ICD: | Device | Result | |---|---| | RTX 3090 / NVIDIA 595.99.02 | **3/3 exit 0**, `Native depth completed clear cases checked=27 unavailable=0` | | gfx1036 / RADV Mesa 25.2.8 | **3/3 exit 1**, `driver idle returned before recording the completed HTILE dispatch` | | lavapipe / Mesa 25.2.8, LLVM 20.1.2 | 3/3 exit 77 at the HTILE evidence skip | The NVIDIA runs reach the final count after DriverDispatch and do not take the skip. On the previous `8073c2e532` head all three ICDs skipped here, as in my earlier report. The new gate therefore restores stock NVIDIA coverage and exposes the RADV failure instead of hiding it as a hardware skip. RADV's failed assertion still needs resolution; this is not an all-GPU pass. No Khronos validation layer is installed here, and no retail title was run. Exact PR checkout remains clean.
SleglJan commented 2026-10-20 22:25:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T22:25:01Z.


@MarcZX10 @oneandonlydean results for dc960cf765, the exact head on main 339217ebc9. Linux 7.2.10, GCC 16.2.1, Release; I ran the test binaries directly, outside ctest, so without the ctest environment.

RTX 3080 (NVIDIA 615.78.08):

  • agc_driver_native_multisample_depth_tests --clears passes (exit 0) 3 of 3, without a skip. Each run prints two more case lines than the skipping runs on 8073c2e532, plus the summary checked=27 unavailable=0, so the DriverDispatch case runs and its StoredAllSince assertion holds.
  • agc_driver_native_depth_bda_clear passes 3 of 3.

lavapipe (Mesa 26.2.4, LLVM 23.1.1):

  • --clears skips (77) 3 of 3 with the same message as on 8073c2e532, both with /dev/udmabuf access and without it.
  • agc_driver_native_depth_bda_clear skips 3 of 3 with its existing message.

Ryzen 9 7950X3D iGPU (gfx1036, RADV, Mesa 26.2.4): --clears fails (exit 1) 3 of 3 at "driver idle returned before recording the completed HTILE dispatch". That's what simonbbby saw on Mesa 25.2.8, so it holds on current Mesa too. Its probe reports "host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared".

Validation layer: under VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation on the RTX, --clears logs no VUID-. It aborts at shutdown (core dump after the host-import summary line), as on 8073c2e532, so its last buffered subcase lines aren't in the log. I haven't checked whether main does the same.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303137502 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303137502). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T22:25:01Z. --- @MarcZX10 @oneandonlydean results for dc960cf765, the exact head on `main` 339217ebc9. Linux 7.2.10, GCC 16.2.1, Release; I ran the test binaries directly, outside ctest, so without the ctest environment. **RTX 3080** (NVIDIA 615.78.08): - `agc_driver_native_multisample_depth_tests --clears` passes (exit 0) 3 of 3, without a skip. Each run prints two more case lines than the skipping runs on 8073c2e532, plus the summary `checked=27 unavailable=0`, so the `DriverDispatch` case runs and its `StoredAllSince` assertion holds. - `agc_driver_native_depth_bda_clear` passes 3 of 3. **lavapipe** (Mesa 26.2.4, LLVM 23.1.1): - `--clears` skips (77) 3 of 3 with the same message as on 8073c2e532, both with `/dev/udmabuf` access and without it. - `agc_driver_native_depth_bda_clear` skips 3 of 3 with its existing message. **Ryzen 9 7950X3D iGPU** (gfx1036, RADV, Mesa 26.2.4): `--clears` fails (exit 1) 3 of 3 at "driver idle returned before recording the completed HTILE dispatch". That's what simonbbby saw on Mesa 25.2.8, so it holds on current Mesa too. Its probe reports "host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared". **Validation layer:** under `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` on the RTX, `--clears` logs no `VUID-`. It aborts at shutdown (core dump after the host-import summary line), as on 8073c2e532, so its last buffered subcase lines aren't in the log. I haven't checked whether `main` does the same. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 22:26:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:26:21Z.


Thanks for the exact-head cross-check. The CPU-only gate now runs the completed-clear case on both NVIDIA devices (3/3 each, checked=27 unavailable=0), while RADV consistently reaches the assertion and fails 3/3 on Mesa 25.2.8 and 26.2.4; lavapipe takes the CPU evidence skip. This confirms the gate behavior and exposes a separate RADV HTILE completion/evidence failure, but it does not show that production path is fixed on RADV. I am keeping that distinction explicit and will not label the full GPU matrix as passing.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303158142 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303158142). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T22:26:21Z. --- Thanks for the exact-head cross-check. The CPU-only gate now runs the completed-clear case on both NVIDIA devices (3/3 each, `checked=27 unavailable=0`), while RADV consistently reaches the assertion and fails 3/3 on Mesa 25.2.8 and 26.2.4; lavapipe takes the CPU evidence skip. This confirms the gate behavior and exposes a separate RADV HTILE completion/evidence failure, but it does not show that production path is fixed on RADV. I am keeping that distinction explicit and will not label the full GPU matrix as passing.
MarcZX10 commented 2026-10-20 22:37:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:37:07Z.


Thanks both for the exact-head runs. The independent NVIDIA results confirm the gate now reaches the DriverDispatch case (checked=27, no skip), while RADV fails the same completed-HTILE assertion on Mesa 25.2.8 and 26.2.4; lavapipe remains an evidence skip. I will keep that RADV failure explicit and won’t characterize this as a cross-GPU pass. The validation run on NVIDIA had no VUIDs before its shutdown abort; do you have a matching main result for that abort?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303332480 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303332480). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T22:37:07Z. --- Thanks both for the exact-head runs. The independent NVIDIA results confirm the gate now reaches the DriverDispatch case (`checked=27`, no skip), while RADV fails the same completed-HTILE assertion on Mesa 25.2.8 and 26.2.4; lavapipe remains an evidence skip. I will keep that RADV failure explicit and won’t characterize this as a cross-GPU pass. The validation run on NVIDIA had no VUIDs before its shutdown abort; do you have a matching `main` result for that abort?
MarcZX10 commented 2026-10-20 22:46:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:46:49Z.


I traced the current exact-head path: Driver::WaitIdle() waits for accepted submissions; VulkanDevice::WaitIdle() calls Recorder::Sync() before vkDeviceWaitIdle; and the recognized HTILE completion callback calls CompleteHtileDepthClear(), which validates no CPU race and then MarkWritten() over the metadata range. So a false StoredAllSince on RADV means full-range completion evidence is absent or not recognized, but the present assertion does not identify where it drops. Could you capture, on the failing RADV run, whether HtileDepthClearAddress matches, NoteHtileDepthClear returns a completion candidate, the recorded dispatch carries htileClear, ArmHtileDepthClear collects a nonzero generation, and the completion callback calls MarkWritten with a nonzero result? Those checkpoints should distinguish recognition/arming from completion/evidence without weakening the GPU assertion. I have not changed production code or run a local GPU build.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303483609 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303483609). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T22:46:49Z. --- I traced the current exact-head path: `Driver::WaitIdle()` waits for accepted submissions; `VulkanDevice::WaitIdle()` calls `Recorder::Sync()` before `vkDeviceWaitIdle`; and the recognized HTILE completion callback calls `CompleteHtileDepthClear()`, which validates no CPU race and then `MarkWritten()` over the metadata range. So a false `StoredAllSince` on RADV means full-range completion evidence is absent or not recognized, but the present assertion does not identify where it drops. Could you capture, on the failing RADV run, whether `HtileDepthClearAddress` matches, `NoteHtileDepthClear` returns a completion candidate, the recorded dispatch carries `htileClear`, `ArmHtileDepthClear` collects a nonzero generation, and the completion callback calls `MarkWritten` with a nonzero result? Those checkpoints should distinguish recognition/arming from completion/evidence without weakening the GPU assertion. I have not changed production code or run a local GPU build.
milescoviello commented 2026-10-20 23:02:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T23:02:34Z.


@MarcZX10 on the shutdown abort under the validation layer: main doesn't show it. It comes from the new DriverDispatch case, and it isn't a VUID. Linux, RTX 4070 Ti (NVIDIA 595.99.02), GCC 13.3, Release, Khronos validation layer 1.4.363 (LunarG SDK), ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1:

--clears on with the layer without
base main 339217ebc9 passes, checked=24, no VUID (ctest) not run
head dc960cf765 aborts 4 of 4 (1 under ctest, 3 direct), no VUID, right after the host-import summary line passes 3 of 3, checked=27
head + the 2 lines below passes 3 of 3, checked=27, no VUID passes 3 of 3, checked=27

Backtrace of the abort:

#4  abort ()
#5  vvl::GetDeviceFromKey (dispatch_object_manual.cpp:671)
#7  vulkan_layer_chassis::DeviceWaitIdle
#8  AgcDriver::VulkanDevice::State::~State()
#9  AgcDriver::VulkanDevice::~VulkanDevice()
#12 AgcDriver::DriverDetail::Driver::stop()
#13 AgcDriver::DriverDetail::Driver::~Driver()
#14 __run_exit_handlers

SubmitDriverHtileClear starts the global driver through sceAgcDriverSubmitDcb, and the test never shuts it down. So the driver's static destructor runs at exit and calls vkDeviceWaitIdle after the layer has dropped its device record, and the layer aborts. The checked=27 line is lost because stdout is still buffered when the abort comes. Without the layer, NVIDIA's driver accepts the late call, which is why the plain runs pass.

Other tests that submit through the driver end with AgcDriverShutdown_nid_postfix(), for example AddressPasses.cpp. Doing the same after the DriverDispatch case fixes it here:

             ++checked;
+            lock.unlock();
+            AgcDriverShutdown_nid_postfix();
             std::printf("Native depth completed clear cases checked=%u unavailable=%u\n", checked, unavailable);

I didn't try it without the unlock. The return VulkanTestSkipped just above also leaves the driver running, so lavapipe under the layer probably needs the same call on that path. I only ran NVIDIA.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303725973 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303725973). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-20T23:02:34Z. --- @MarcZX10 on the shutdown abort under the validation layer: `main` doesn't show it. It comes from the new `DriverDispatch` case, and it isn't a VUID. Linux, RTX 4070 Ti (NVIDIA 595.99.02), GCC 13.3, Release, Khronos validation layer 1.4.363 (LunarG SDK), `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`: | `--clears` on | with the layer | without | |---|---|---| | base `main` 339217ebc9 | passes, `checked=24`, no VUID (ctest) | not run | | head dc960cf765 | aborts 4 of 4 (1 under ctest, 3 direct), no VUID, right after the host-import summary line | passes 3 of 3, `checked=27` | | head + the 2 lines below | passes 3 of 3, `checked=27`, no VUID | passes 3 of 3, `checked=27` | Backtrace of the abort: ``` #4 abort () #5 vvl::GetDeviceFromKey (dispatch_object_manual.cpp:671) #7 vulkan_layer_chassis::DeviceWaitIdle #8 AgcDriver::VulkanDevice::State::~State() #9 AgcDriver::VulkanDevice::~VulkanDevice() #12 AgcDriver::DriverDetail::Driver::stop() #13 AgcDriver::DriverDetail::Driver::~Driver() #14 __run_exit_handlers ``` `SubmitDriverHtileClear` starts the global driver through `sceAgcDriverSubmitDcb`, and the test never shuts it down. So the driver's static destructor runs at exit and calls `vkDeviceWaitIdle` after the layer has dropped its device record, and the layer aborts. The `checked=27` line is lost because stdout is still buffered when the abort comes. Without the layer, NVIDIA's driver accepts the late call, which is why the plain runs pass. Other tests that submit through the driver end with `AgcDriverShutdown_nid_postfix()`, for example `AddressPasses.cpp`. Doing the same after the `DriverDispatch` case fixes it here: ```diff ++checked; + lock.unlock(); + AgcDriverShutdown_nid_postfix(); std::printf("Native depth completed clear cases checked=%u unavailable=%u\n", checked, unavailable); ``` I didn't try it without the `unlock`. The `return VulkanTestSkipped` just above also leaves the driver running, so lavapipe under the layer probably needs the same call on that path. I only ran NVIDIA. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 23:14:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:14:41Z.


Pushed acaff99f44 with a local shutdown guard around the DriverDispatch path. It shuts the singleton driver down when that case exits normally, takes the CPU-device evidence skip, or throws at the GPU assertion, so the validation layer does not see the driver static destructor call after its device record is gone. The guard runs after SubmitDriverHtileClear has returned from WaitIdle; it does not unlock the fixture mutex again. git diff --check and python3 tools/check_conventions.py --base upstream/main pass. I could not run the runtime test locally because this host has about 393 MiB free; hosted checks are pending.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6303901661 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6303901661). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T23:14:41Z. --- Pushed `acaff99f44` with a local shutdown guard around the DriverDispatch path. It shuts the singleton driver down when that case exits normally, takes the CPU-device evidence skip, or throws at the GPU assertion, so the validation layer does not see the driver static destructor call after its device record is gone. The guard runs after `SubmitDriverHtileClear` has returned from `WaitIdle`; it does not unlock the fixture mutex again. `git diff --check` and `python3 tools/check_conventions.py --base upstream/main` pass. I could not run the runtime test locally because this host has about 393 MiB free; hosted checks are pending.
SleglJan commented 2026-10-20 23:23:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T23:23:17Z.


@MarcZX10 your checkpoints on the failing RADV runs, on the Ryzen 9 7950X3D iGPU (gfx1036, RADV, Mesa 26.2.4), with the RTX 3080 for comparison.

Build: dc960cf765 plus local prints. acaff99f44 since adds only the five-line shutdown guard in the test, nothing on this path. Our prints are local. Both RADV runs show the same sequence for the DriverDispatch clear:

checkpoint RADV RTX 3080
HtileDepthClearAddress matches the metadata yes yes
NoteHtileDepthClear returns a completion candidate yes yes
the recorded dispatch carries htileClear yes yes
ArmHtileDepthClear finds the pending surface yes yes
ArmHtileDepthClear's CollectWritesUncached generation 0 nonzero
the dispatch's write mark for the range unstamped: watched, but covers false stamped
CompleteHtileDepthClear skips the surface (clearGeneration 0) MarkWritten returns a nonzero generation
StoredAllSince_nid_no_patch false at !tracker.covers true

So on RADV recognition works and the arm finds the surface, but its collect returns 0: the metadata range is no longer covered when the clear arms, so it never gets a generation. All 79 earlier arms on the same metadata, before the driver dispatch, get nonzero generations on RADV too.

That fits RADV's host-import probe here: "host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared". With that result the host-pointer import path calls ImportWatched with staysWatched false, so the import made for the driver dispatch takes the range out of the watch, as on lavapipe. RADV's dma-buf probe reports that dma-buf imports stay watched, but the fixture's private memory goes through the host-pointer path. Nothing prints at the import itself, so this step comes from the code path, not from a print.

On the shutdown abort, milescoviello's comparison with main above answers it, so I've dropped our queued main run.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304036521 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304036521). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T23:23:17Z. --- @MarcZX10 your checkpoints on the failing RADV runs, on the Ryzen 9 7950X3D iGPU (gfx1036, RADV, Mesa 26.2.4), with the RTX 3080 for comparison. **Build:** dc960cf765 plus local prints. acaff99f44 since adds only the five-line shutdown guard in the test, nothing on this path. Our prints are local. Both RADV runs show the same sequence for the `DriverDispatch` clear: | checkpoint | RADV | RTX 3080 | |---|---|---| | `HtileDepthClearAddress` matches the metadata | yes | yes | | `NoteHtileDepthClear` returns a completion candidate | yes | yes | | the recorded dispatch carries `htileClear` | yes | yes | | `ArmHtileDepthClear` finds the pending surface | yes | yes | | `ArmHtileDepthClear`'s `CollectWritesUncached` generation | **0** | nonzero | | the dispatch's write mark for the range | unstamped: watched, but `covers` false | stamped | | `CompleteHtileDepthClear` | skips the surface (`clearGeneration` 0) | `MarkWritten` returns a nonzero generation | | `StoredAllSince_nid_no_patch` | false at `!tracker.covers` | true | So on RADV recognition works and the arm finds the surface, but its collect returns 0: the metadata range is no longer covered when the clear arms, so it never gets a generation. All 79 earlier arms on the same metadata, before the driver dispatch, get nonzero generations on RADV too. That fits RADV's host-import probe here: "host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared". With that result the host-pointer import path calls `ImportWatched` with `staysWatched` false, so the import made for the driver dispatch takes the range out of the watch, as on lavapipe. RADV's dma-buf probe reports that dma-buf imports stay watched, but the fixture's private memory goes through the host-pointer path. Nothing prints at the import itself, so this step comes from the code path, not from a print. On the shutdown abort, milescoviello's comparison with `main` above answers it, so I've dropped our queued `main` run. AI-assisted: yes (Claude Code)
milescoviello commented 2026-10-20 23:25:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T23:25:53Z.


@MarcZX10 acaff99f44 on the same host (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release, Khronos validation layer 1.4.363):

  • --clears under the layer: passes 3 of 3, checked=27 unavailable=0, no VUID, no shutdown abort.
  • --clears without it: passes 3 of 3, checked=27.
  • ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$' under the layer: 4 of 4 pass.

So the guard works without unlocking the fixture mutex. Not run: RADV, lavapipe, Windows.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304075511 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304075511). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-20T23:25:53Z. --- @MarcZX10 acaff99f44 on the same host (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release, Khronos validation layer 1.4.363): - `--clears` under the layer: passes 3 of 3, `checked=27 unavailable=0`, no VUID, no shutdown abort. - `--clears` without it: passes 3 of 3, `checked=27`. - `ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$'` under the layer: 4 of 4 pass. So the guard works without unlocking the fixture mutex. Not run: RADV, lavapipe, Windows. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 23:27:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:27:35Z.


Thanks for the checkpoint report. It identifies the failure precisely: RADV recognizes and arms the clear, but its host-pointer import leaves this metadata range outside write-watch coverage, so the generation is zero before dispatch. The same range remains covered on NVIDIA.

I pushed bfb76ebda5 to the PR. The regression now checks GuestMemory::Watched for the actual metadata range and only skips the write-coverage assertion when that range is not tracked. In that case it continues through the test's clear-output checks, so the RADV path still exercises the dispatch and validates its result. The gate no longer infers tracking support from CPU versus GPU device type.

git diff --check and the conventions checker pass. I could not run the GPU test locally in this disk-constrained environment; please rerun the exact head on RADV and NVIDIA to confirm the RADV case reaches the output checks and the NVIDIA tracking assertion still passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304100983 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304100983). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T23:27:35Z. --- Thanks for the checkpoint report. It identifies the failure precisely: RADV recognizes and arms the clear, but its host-pointer import leaves this metadata range outside write-watch coverage, so the generation is zero before dispatch. The same range remains covered on NVIDIA. I pushed `bfb76ebda5` to the PR. The regression now checks `GuestMemory::Watched` for the actual metadata range and only skips the write-coverage assertion when that range is not tracked. In that case it continues through the test's clear-output checks, so the RADV path still exercises the dispatch and validates its result. The gate no longer infers tracking support from CPU versus GPU device type. `git diff --check` and the conventions checker pass. I could not run the GPU test locally in this disk-constrained environment; please rerun the exact head on RADV and NVIDIA to confirm the RADV case reaches the output checks and the NVIDIA tracking assertion still passes.
oneandonlydean commented 2026-10-20 23:32:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T23:32:29Z.


@MarcZX10 Thanks, bfb76ebda5 is close to what we asked: the skip now keys on the write-watch coverage of the actual metadata range, says why, and the rest of the case (the completed-clear view checks, publication and refusals) still runs.

One small change, so NVIDIA doesn't lose the assertion: today, if a later change dropped the HTILE range's coverage on a device whose host imports stay watched, this case would print the skip line and pass, where acaff99f44 failed. Could the skip branch also require that the device actually unwatches imports? Something like:

if (!AgcDriver::GuestMemory::Watched(target.htileAddress, metadataBytes)) {
    Require(Graphics::PrepareImportWatch(context) == Graphics::ImportWatch::Unwatch,
            "the HTILE metadata range lost write-watch coverage on a device whose host imports stay watched");
    std::puts("skipped native HTILE write-coverage assertion: ...");
}

(PrepareImportWatch is cached per device, and BdaResources.cpp / Graphics.cpp already call it from tests.)

Also, since the post-skip checks never ran on RADV or lavapipe before (RADV stopped at the storedAll assertion, lavapipe skipped the case), one RADV --clears run on the new head would confirm they hold there. Linux CI covers lavapipe.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304173763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304173763). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T23:32:29Z. --- @MarcZX10 Thanks, bfb76ebda5 is close to what we asked: the skip now keys on the write-watch coverage of the actual metadata range, says why, and the rest of the case (the completed-clear view checks, publication and refusals) still runs. One small change, so NVIDIA doesn't lose the assertion: today, if a later change dropped the HTILE range's coverage on a device whose host imports stay watched, this case would print the skip line and pass, where acaff99f44 failed. Could the skip branch also require that the device actually unwatches imports? Something like: ```cpp if (!AgcDriver::GuestMemory::Watched(target.htileAddress, metadataBytes)) { Require(Graphics::PrepareImportWatch(context) == Graphics::ImportWatch::Unwatch, "the HTILE metadata range lost write-watch coverage on a device whose host imports stay watched"); std::puts("skipped native HTILE write-coverage assertion: ..."); } ``` (`PrepareImportWatch` is cached per device, and BdaResources.cpp / Graphics.cpp already call it from tests.) Also, since the post-skip checks never ran on RADV or lavapipe before (RADV stopped at the storedAll assertion, lavapipe skipped the case), one RADV `--clears` run on the new head would confirm they hold there. Linux CI covers lavapipe.
MarcZX10 commented 2026-10-20 23:35:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:35:49Z.


Added the requested policy guard in e87e649a49: the write-coverage assertion is skipped only when the metadata range is unwatched and PrepareImportWatch(context) confirms this device's host imports use ImportWatch::Unwatch. If the range becomes unwatched on a device that promises watched imports, the test now fails, preserving the NVIDIA-side assertion.

git diff --check and the conventions checker pass. I cannot run the GPU test locally in this container (the test binary is absent and only ~370 MiB of disk is free); Linux CI covers lavapipe. Could someone with RADV run agc_driver_native_multisample_depth_tests --clears on this exact head to confirm the post-skip output checks pass there?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304219844 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304219844). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T23:35:49Z. --- Added the requested policy guard in `e87e649a49`: the write-coverage assertion is skipped only when the metadata range is unwatched and `PrepareImportWatch(context)` confirms this device's host imports use `ImportWatch::Unwatch`. If the range becomes unwatched on a device that promises watched imports, the test now fails, preserving the NVIDIA-side assertion. `git diff --check` and the conventions checker pass. I cannot run the GPU test locally in this container (the test binary is absent and only ~370 MiB of disk is free); Linux CI covers lavapipe. Could someone with RADV run `agc_driver_native_multisample_depth_tests --clears` on this exact head to confirm the post-skip output checks pass there?
milescoviello commented 2026-10-20 23:44:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T23:44:33Z.


@MarcZX10 the NVIDIA side of e87e649a49 (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release):

  • --clears: passes 3 of 3 without the validation layer and 3 of 3 with it (Khronos 1.4.363), checked=27 unavailable=0, no VUID.
  • None of the six runs prints the new "skipped native HTILE write-coverage assertion" line, so the write-coverage assertion runs and holds.
  • ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$': 4 of 4 pass with the layer and 4 of 4 without.

I have no RADV device here.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304335872 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304335872). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-20T23:44:33Z. --- @MarcZX10 the NVIDIA side of e87e649a49 (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release): - `--clears`: passes 3 of 3 without the validation layer and 3 of 3 with it (Khronos 1.4.363), `checked=27 unavailable=0`, no VUID. - None of the six runs prints the new "skipped native HTILE write-coverage assertion" line, so the write-coverage assertion runs and holds. - `ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$'`: 4 of 4 pass with the layer and 4 of 4 without. I have no RADV device here. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-20 23:45:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:45:29Z.


Thanks for the exact-head matrix. The six NVIDIA runs confirm the import-policy gate keeps StoredAllSince enabled on NVIDIA, with checked=27, no skip, and no validation-layer VUID; the four related CTest cases also pass with and without the layer. This verifies the NVIDIA side of the guard. RADV still needs the requested exact-head output-check run; I will keep that result separate.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304348177 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304348177). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T23:45:29Z. --- Thanks for the exact-head matrix. The six NVIDIA runs confirm the import-policy gate keeps `StoredAllSince` enabled on NVIDIA, with `checked=27`, no skip, and no validation-layer VUID; the four related CTest cases also pass with and without the layer. This verifies the NVIDIA side of the guard. RADV still needs the requested exact-head output-check run; I will keep that result separate.
MarcZX10 commented 2026-10-20 23:55:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:55:36Z.


Cross-reference for the RADV/lavapipe side: issue #8759 reports that the generic host-pointer import path passes staysWatched=false when this device policy is selected. That un-watches HTILE, so CollectWritesUncached yields generation 0 and the native clear completion path does not engage on those devices; it remains fail-safe and falls back to the import-window comparison path.

This is separate from #7233's exact-store coverage change, and I am not treating it as a blocker to that narrower fix. Please make the device scope clear in the PR summary: NVIDIA confirms the tracked path, while RADV/lavapipe need the separate import-watch/HTILE completion work from #8759 before the native path is validated there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304481065 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304481065). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T23:55:36Z. --- Cross-reference for the RADV/lavapipe side: issue #8759 reports that the generic host-pointer import path passes `staysWatched=false` when this device policy is selected. That un-watches HTILE, so `CollectWritesUncached` yields generation 0 and the native clear completion path does not engage on those devices; it remains fail-safe and falls back to the import-window comparison path. This is separate from #7233's exact-store coverage change, and I am not treating it as a blocker to that narrower fix. Please make the device scope clear in the PR summary: NVIDIA confirms the tracked path, while RADV/lavapipe need the separate import-watch/HTILE completion work from #8759 before the native path is validated there.
SleglJan commented 2026-10-20 23:57:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T23:57:30Z.


@MarcZX10 @oneandonlydean results for e87e649a49, the exact head. Linux 7.2.10, GCC 16.2.1, Release; test binaries run directly, outside ctest.

RTX 3080 (NVIDIA 615.78.08):

  • agc_driver_native_multisample_depth_tests --clears passes 3 of 3 (checked=27 unavailable=0).
  • Under VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation it passes too, with no VUID- and no shutdown abort, so the shutdown guard works here.
  • agc_driver_native_depth_bda_clear passes 3 of 3.

lavapipe (Mesa 26.2.4, with and without /dev/udmabuf) and RADV (gfx1036, Mesa 26.2.4):

  • --clears fails 3 of 3 at the new guard, "the HTILE metadata range lost write-watch coverage on a device whose host imports stay watched".
  • Yet both devices' probes report "host imports resolve write protection: yes (…); imported ranges are compared".

Why the guard reads "watched" there, from a print at PrepareImportWatch's entry and exit (local only):

  • The driver's VulkanDevice decides at creation (VulkanDevice.cpp:1988) with hostImportAlignment 4096 and gets unwatchImports 1.
  • The fixture's call passes the context of the fixture's own device. The test's Device class creates it with a plain vkCreateDevice, so its hostImportAlignment is 0 and it can't host-import at all. decideImportWatch re-decides for that device, sets unwatchImports to false and returns at the hostImportAlignment == 0 check. So the guard gets Watch.
  • The cache holds one decision, not one per device, so that call also replaces the driver's decision until the driver's next import decides again.

So the guard needs the decision for the device that imported the metadata. That's the driver's: the fixture's device can't host-import. On Windows the same call returns Unwatch either way, so the guard can't fail there.

This is separate from #8759, which is about the import policy itself. Here the test's guard misreads the policy that the driver already applied. agc_driver_native_depth_bda_clear still skips 3 of 3 on lavapipe with its existing message.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304506161 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304506161). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-20T23:57:30Z. --- @MarcZX10 @oneandonlydean results for e87e649a49, the exact head. Linux 7.2.10, GCC 16.2.1, Release; test binaries run directly, outside ctest. **RTX 3080** (NVIDIA 615.78.08): - `agc_driver_native_multisample_depth_tests --clears` passes 3 of 3 (`checked=27 unavailable=0`). - Under `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` it passes too, with no `VUID-` and no shutdown abort, so the shutdown guard works here. - `agc_driver_native_depth_bda_clear` passes 3 of 3. **lavapipe** (Mesa 26.2.4, with and without `/dev/udmabuf`) **and RADV** (gfx1036, Mesa 26.2.4): - `--clears` fails 3 of 3 at the new guard, "the HTILE metadata range lost write-watch coverage on a device whose host imports stay watched". - Yet both devices' probes report "host imports resolve write protection: yes (…); imported ranges are compared". **Why the guard reads "watched" there**, from a print at `PrepareImportWatch`'s entry and exit (local only): - The driver's `VulkanDevice` decides at creation (`VulkanDevice.cpp:1988`) with `hostImportAlignment` 4096 and gets `unwatchImports` 1. - The fixture's call passes the context of the fixture's own device. The test's `Device` class creates it with a plain `vkCreateDevice`, so its `hostImportAlignment` is 0 and it can't host-import at all. `decideImportWatch` re-decides for that device, sets `unwatchImports` to false and returns at the `hostImportAlignment == 0` check. So the guard gets `Watch`. - The cache holds one decision, not one per device, so that call also replaces the driver's decision until the driver's next import decides again. So the guard needs the decision for the device that imported the metadata. That's the driver's: the fixture's device can't host-import. On Windows the same call returns `Unwatch` either way, so the guard can't fail there. This is separate from #8759, which is about the import policy itself. Here the test's guard misreads the policy that the driver already applied. `agc_driver_native_depth_bda_clear` still skips 3 of 3 on lavapipe with its existing message. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-21 00:07:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:07:00Z.


Thanks for the exact-head RTX 3080 run. This adds an independent NVIDIA result for the clear path: 3/3 runs with and without validation, checked=27, unavailable=0, and no shutdown VUIDs. It does not change the platform gap from my prior note: the output-check path still needs a RADV/lavapipe run, where the import watcher behavior from #8759 changes the evidence available to this optimization.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304634642 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304634642). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T00:07:00Z. --- Thanks for the exact-head RTX 3080 run. This adds an independent NVIDIA result for the clear path: 3/3 runs with and without validation, `checked=27`, `unavailable=0`, and no shutdown VUIDs. It does not change the platform gap from my prior note: the output-check path still needs a RADV/lavapipe run, where the import watcher behavior from #8759 changes the evidence available to this optimization.
oneandonlydean commented 2026-10-21 00:07:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T00:07:03Z.


@MarcZX10 @SleglJan thanks, SleglJan, your trace is right, and the mistake is in the guard I asked for. decideImportWatch keeps one decision for one device (GuestBufferMemory.cpp:1203). The guard in CheckDepthTarget passes the fixture's own vkCreateDevice context, which has no hostImportAlignment. So on Linux it re-decides Watch for a device that can't host-import, and it also replaces the driver's decision. Windows sets Unwatch before that check, which is why only RADV and lavapipe fail.

Could you make the guard ask for the decision of the device that imported the metadata, i.e. the driver's VulkanDevice::graphicsContext()? Pass it into CheckDepthTarget for the driver-dispatch case, and don't call PrepareImportWatch with the fixture's context there. On RADV and lavapipe the run should then print the "skipped native HTILE write-coverage assertion" line and pass, while NVIDIA keeps the StoredAllSince check. Please also add your device-scope sentence to the summary: NVIDIA confirms the tracked path, and RADV/lavapipe depend on #8759. An exact-head --clears run on RADV or lavapipe after the change would close this.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304635171 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304635171). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T00:07:03Z. --- @MarcZX10 @SleglJan thanks, SleglJan, your trace is right, and the mistake is in the guard I asked for. `decideImportWatch` keeps one decision for one device (`GuestBufferMemory.cpp:1203`). The guard in `CheckDepthTarget` passes the fixture's own `vkCreateDevice` context, which has no `hostImportAlignment`. So on Linux it re-decides `Watch` for a device that can't host-import, and it also replaces the driver's decision. Windows sets `Unwatch` before that check, which is why only RADV and lavapipe fail. Could you make the guard ask for the decision of the device that imported the metadata, i.e. the driver's `VulkanDevice::graphicsContext()`? Pass it into `CheckDepthTarget` for the driver-dispatch case, and don't call `PrepareImportWatch` with the fixture's context there. On RADV and lavapipe the run should then print the "skipped native HTILE write-coverage assertion" line and pass, while NVIDIA keeps the `StoredAllSince` check. Please also add your device-scope sentence to the summary: NVIDIA confirms the tracked path, and RADV/lavapipe depend on #8759. An exact-head `--clears` run on RADV or lavapipe after the change would close this.
MarcZX10 commented 2026-10-21 00:25:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:25:30Z.


Follow-up pushed as 077e2d43d523ec7433a01edfcb794e5f72ba73c2. The driver-dispatch --clears case now captures the active driver device context and passes it into CheckDepthTarget; the guard no longer re-evaluates import policy with the fixture device. That should preserve the driver’s watchDevice decision, skip only the uncovered tracker assertion on RADV/lavapipe, and keep StoredAllSince on NVIDIA. I could not rebuild/run the focused binary in this environment (no configured build for this worktree and only 378 MiB free on the filesystem), so the requested exact-head RADV/lavapipe run remains outstanding. The PR summary should also state the platform scope: NVIDIA confirms the tracked path; RADV/lavapipe depend on #8759.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304886390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304886390). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T00:25:30Z. --- Follow-up pushed as `077e2d43d523ec7433a01edfcb794e5f72ba73c2`. The driver-dispatch `--clears` case now captures the active driver device context and passes it into `CheckDepthTarget`; the guard no longer re-evaluates import policy with the fixture device. That should preserve the driver’s `watchDevice` decision, skip only the uncovered tracker assertion on RADV/lavapipe, and keep `StoredAllSince` on NVIDIA. I could not rebuild/run the focused binary in this environment (no configured build for this worktree and only 378 MiB free on the filesystem), so the requested exact-head RADV/lavapipe run remains outstanding. The PR summary should also state the platform scope: NVIDIA confirms the tracked path; RADV/lavapipe depend on #8759.
simonbbby commented 2026-10-21 00:27:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-21T00:27:07Z.


The new head 077e2d43d523ec7433a01edfcb794e5f72ba73c2 does not build with GCC 13.3:

NativeMultisampleDepth.cpp:1246:78: error: 'AgcDriver::DriverDetail::DevicePointer AgcDriver::DriverDetail::Driver::device' is private within this context

The new Driver::Get().device.Load() needs test access rather than direct private-member access.

There is also a downstream runtime blocker after correcting the context access. Before that push, I independently tested the requested driver-device context correction against e87e649a4904bb557922b1d37b5578ca753058fe using test-access helpers; the compiling patch and results follow. It fixes the policy guard, but RADV/lavapipe still do not pass the output-check path.

Ubuntu 24.04, GCC 13.3 Release, --clears, ANYPS5_REQUIRE_VULKAN=1, shader cache disabled:

Device Unmodified head (one process) Driver-context correction (three fresh processes)
RTX 3090 / NVIDIA 595.99.02 exit 0 3/3 exit 0, checked=27 unavailable=0, no assertion skip
gfx1036 / RADV Mesa 25.2.8 exit 1 at the import-policy guard 3/3 exit 1 after the intended assertion-skip line
lavapipe / Mesa 25.2.8, LLVM 20.1.2 same guard failure same later failure, 3/3

The correction gets the driver's live VulkanDevice after SubmitDriverHtileClear, returns its graphicsContext() to the caller and uses it for PrepareImportWatch; the fixture device no longer replaces the importer's decision. The tested patch is below (test access follows the existing VulkanDeviceTestAccess pattern).

The new failure is:

skipped native HTILE write-coverage assertion: the write tracker does not cover the imported metadata range; clear output checks still run
AGC graphics: native multisample depth clear requires tracked HTILE generations

The stdout/stderr lines can appear reversed because stdout is buffered. The causal path in the source is ArmHtileDepthClear -> generation 0 on the unwatched metadata -> sampling.Refuse(...); after the assertion is skipped, DepthSurfaceHolds calls CheckCurrent, which requires that refusal to be empty. Thus correcting the policy context alone cannot leave these output checks running successfully with #8759 unresolved. This is a partial fixture correction, not a fix for the production tracking gap.

All existing completion/value checks were retained. Restoring the original files and rebuilding reproduces the original RADV policy-guard failure. Checkout is clean. No Khronos validation layer is installed here; no retail title was run.

Tested driver-context correction
diff --git a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
index 06125edca..22810c28c 100644
--- a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
+++ b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
@@ -85,6 +85,7 @@ private:
     friend class SampledReadScope;
     friend struct PendingView;
     friend struct PacketTimer;
+    friend struct DriverTestAccess;
     void stop();
     Driver();
     void rethrowFailure() const;
diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
index 58820395b..2349a7f84 100644
--- a/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
+++ b/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
@@ -8,6 +8,7 @@
 #include "prx/libSceAgcDriver/Graphics/include/Draw.hpp"
 #include "prx/libSceAgcDriver/Execution/include/GuestMemory.hpp"
 #include "prx/libSceAgcDriver/Execution/include/Driver.hpp"
+#include "prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp"
 #include "prx/libSceAgcDriver/Submit/include/Dcb.hpp"
 #include "prx/libc/include/GuestArena.hpp"
 #include "prx/libc/include/GuestAllocations.hpp"
@@ -38,6 +39,18 @@
 #include <sys/mman.h>
 #endif
 
+namespace AgcDriver {
+struct VulkanDeviceTestAccess {
+    static Graphics::Context ContextOf(const VulkanDevice& device) { return device.graphicsContext(); }
+};
+}
+
+namespace AgcDriver::DriverDetail {
+struct DriverTestAccess {
+    static std::shared_ptr<VulkanDevice> GetDevice() { return Driver::Get().device.Load(); }
+};
+}
+
 namespace {
 
 using namespace AgcDriver::Graphics;
@@ -188,7 +201,7 @@ std::vector<std::uint32_t> DriverPm4Packet(std::uint32_t opcode, std::initialize
     return words;
 }
 
-void SubmitDriverHtileClear(std::uint64_t address, std::unique_lock<AgcDriver::GuestMemory::GpuMutexType>& gpuLock) {
+Context SubmitDriverHtileClear(std::uint64_t address, std::unique_lock<AgcDriver::GuestMemory::GpuMutexType>& gpuLock) {
     const auto shader = reinterpret_cast<std::uintptr_t>(HtileMaskKernel.data());
     std::vector<std::uint32_t> commands;
     const auto append = [&commands](std::vector<std::uint32_t> packet) { commands.insert(commands.end(), packet.begin(), packet.end()); };
@@ -211,6 +224,9 @@ void SubmitDriverHtileClear(std::uint64_t address, std::unique_lock<AgcDriver::G
     try { AgcDriverWaitIdle_nid_postfix(); }
     catch (...) { gpuLock.lock(); throw; }
     gpuLock.lock();
+    const auto driverDevice = AgcDriver::DriverDetail::DriverTestAccess::GetDevice();
+    Require(driverDevice != nullptr, "HTILE clear driver device is missing");
+    return AgcDriver::VulkanDeviceTestAccess::ContextOf(*driverDevice);
 }
 
 template<typename Action>
@@ -820,11 +836,11 @@ void CheckDepthTarget(Context context, VkFormat format, std::uint32_t fragments,
                         }
                     } shutdownDriver;
                     const auto generation = AgcDriver::GuestMemory::TrackerGeneration();
-                    SubmitDriverHtileClear(target.htileAddress, gpuLock);
+                    const auto driverContext = SubmitDriverHtileClear(target.htileAddress, gpuLock);
                     recorder.Activate();
                     Require(Recorder::Active() == &recorder, "driver idle did not restore the native depth fixture recorder");
                     if (!AgcDriver::GuestMemory::Watched(target.htileAddress, metadataBytes)) {
-                        Require(PrepareImportWatch(context) == ImportWatch::Unwatch,
+                        Require(PrepareImportWatch(driverContext) == ImportWatch::Unwatch,
                                 "the HTILE metadata range lost write-watch coverage on a device whose host imports stay watched");
                         std::puts("skipped native HTILE write-coverage assertion: the write tracker does not cover the imported metadata range; clear output checks still run");
                     } else {

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304907966 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304907966). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-21T00:27:07Z. --- The new head `077e2d43d523ec7433a01edfcb794e5f72ba73c2` does not build with GCC 13.3: ``` NativeMultisampleDepth.cpp:1246:78: error: 'AgcDriver::DriverDetail::DevicePointer AgcDriver::DriverDetail::Driver::device' is private within this context ``` The new `Driver::Get().device.Load()` needs test access rather than direct private-member access. There is also a downstream runtime blocker after correcting the context access. Before that push, I independently tested the requested driver-device context correction against `e87e649a4904bb557922b1d37b5578ca753058fe` using test-access helpers; the compiling patch and results follow. It fixes the policy guard, but RADV/lavapipe still do not pass the output-check path. Ubuntu 24.04, GCC 13.3 Release, `--clears`, `ANYPS5_REQUIRE_VULKAN=1`, shader cache disabled: | Device | Unmodified head (one process) | Driver-context correction (three fresh processes) | |---|---|---| | RTX 3090 / NVIDIA 595.99.02 | exit 0 | 3/3 exit 0, `checked=27 unavailable=0`, no assertion skip | | gfx1036 / RADV Mesa 25.2.8 | exit 1 at the import-policy guard | 3/3 exit 1 **after** the intended assertion-skip line | | lavapipe / Mesa 25.2.8, LLVM 20.1.2 | same guard failure | same later failure, 3/3 | The correction gets the driver's live `VulkanDevice` after `SubmitDriverHtileClear`, returns its `graphicsContext()` to the caller and uses it for `PrepareImportWatch`; the fixture device no longer replaces the importer's decision. The tested patch is below (test access follows the existing VulkanDeviceTestAccess pattern). The new failure is: ``` skipped native HTILE write-coverage assertion: the write tracker does not cover the imported metadata range; clear output checks still run AGC graphics: native multisample depth clear requires tracked HTILE generations ``` The stdout/stderr lines can appear reversed because stdout is buffered. The causal path in the source is `ArmHtileDepthClear` -> generation 0 on the unwatched metadata -> `sampling.Refuse(...)`; after the assertion is skipped, `DepthSurfaceHolds` calls `CheckCurrent`, which requires that refusal to be empty. Thus correcting the policy context alone cannot leave these output checks running successfully with #8759 unresolved. This is a partial fixture correction, not a fix for the production tracking gap. All existing completion/value checks were retained. Restoring the original files and rebuilding reproduces the original RADV policy-guard failure. Checkout is clean. No Khronos validation layer is installed here; no retail title was run. <details><summary>Tested driver-context correction</summary> ```diff diff --git a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp index 06125edca..22810c28c 100644 --- a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp +++ b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp @@ -85,6 +85,7 @@ private: friend class SampledReadScope; friend struct PendingView; friend struct PacketTimer; + friend struct DriverTestAccess; void stop(); Driver(); void rethrowFailure() const; diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp index 58820395b..2349a7f84 100644 --- a/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp @@ -8,6 +8,7 @@ #include "prx/libSceAgcDriver/Graphics/include/Draw.hpp" #include "prx/libSceAgcDriver/Execution/include/GuestMemory.hpp" #include "prx/libSceAgcDriver/Execution/include/Driver.hpp" +#include "prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp" #include "prx/libSceAgcDriver/Submit/include/Dcb.hpp" #include "prx/libc/include/GuestArena.hpp" #include "prx/libc/include/GuestAllocations.hpp" @@ -38,6 +39,18 @@ #include <sys/mman.h> #endif +namespace AgcDriver { +struct VulkanDeviceTestAccess { + static Graphics::Context ContextOf(const VulkanDevice& device) { return device.graphicsContext(); } +}; +} + +namespace AgcDriver::DriverDetail { +struct DriverTestAccess { + static std::shared_ptr<VulkanDevice> GetDevice() { return Driver::Get().device.Load(); } +}; +} + namespace { using namespace AgcDriver::Graphics; @@ -188,7 +201,7 @@ std::vector<std::uint32_t> DriverPm4Packet(std::uint32_t opcode, std::initialize return words; } -void SubmitDriverHtileClear(std::uint64_t address, std::unique_lock<AgcDriver::GuestMemory::GpuMutexType>& gpuLock) { +Context SubmitDriverHtileClear(std::uint64_t address, std::unique_lock<AgcDriver::GuestMemory::GpuMutexType>& gpuLock) { const auto shader = reinterpret_cast<std::uintptr_t>(HtileMaskKernel.data()); std::vector<std::uint32_t> commands; const auto append = [&commands](std::vector<std::uint32_t> packet) { commands.insert(commands.end(), packet.begin(), packet.end()); }; @@ -211,6 +224,9 @@ void SubmitDriverHtileClear(std::uint64_t address, std::unique_lock<AgcDriver::G try { AgcDriverWaitIdle_nid_postfix(); } catch (...) { gpuLock.lock(); throw; } gpuLock.lock(); + const auto driverDevice = AgcDriver::DriverDetail::DriverTestAccess::GetDevice(); + Require(driverDevice != nullptr, "HTILE clear driver device is missing"); + return AgcDriver::VulkanDeviceTestAccess::ContextOf(*driverDevice); } template<typename Action> @@ -820,11 +836,11 @@ void CheckDepthTarget(Context context, VkFormat format, std::uint32_t fragments, } } shutdownDriver; const auto generation = AgcDriver::GuestMemory::TrackerGeneration(); - SubmitDriverHtileClear(target.htileAddress, gpuLock); + const auto driverContext = SubmitDriverHtileClear(target.htileAddress, gpuLock); recorder.Activate(); Require(Recorder::Active() == &recorder, "driver idle did not restore the native depth fixture recorder"); if (!AgcDriver::GuestMemory::Watched(target.htileAddress, metadataBytes)) { - Require(PrepareImportWatch(context) == ImportWatch::Unwatch, + Require(PrepareImportWatch(driverContext) == ImportWatch::Unwatch, "the HTILE metadata range lost write-watch coverage on a device whose host imports stay watched"); std::puts("skipped native HTILE write-coverage assertion: the write tracker does not cover the imported metadata range; clear output checks still run"); } else { ``` </details>
MarcZX10 commented 2026-10-21 00:33:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:33:34Z.


Thanks for the compile finding and exact-head matrix. I have not pushed another revision yet. I confirmed the RADV/lavapipe run exposes a second, expected production limitation after the guard: generation zero is rejected by DepthSurface::ArmHtileDepthClear, and subsequent CheckCurrent refuses sampling. I am revising the test to use the existing test-access friend pattern for the private driver device and to assert the safe refusal on uncovered HTILE imports, instead of claiming output checks pass there. That will keep the NVIDIA complete-store assertion and make the RADV/lavapipe behavior explicit. The import/HTILE tracking implementation remains #8759; I will not fold that wider behavior into this focused test/coverage PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304992717 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304992717). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T00:33:34Z. --- Thanks for the compile finding and exact-head matrix. I have not pushed another revision yet. I confirmed the RADV/lavapipe run exposes a second, expected production limitation after the guard: generation zero is rejected by `DepthSurface::ArmHtileDepthClear`, and subsequent `CheckCurrent` refuses sampling. I am revising the test to use the existing test-access friend pattern for the private driver device and to assert the safe refusal on uncovered HTILE imports, instead of claiming output checks pass there. That will keep the NVIDIA complete-store assertion and make the RADV/lavapipe behavior explicit. The import/HTILE tracking implementation remains #8759; I will not fold that wider behavior into this focused test/coverage PR.
MarcZX10 commented 2026-10-21 00:33:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:33:49Z.


Follow-up pushed as eb55d58728f367f527253b3ae5b30ed45030fdf3. This uses the established DriverTestAccess friend helper so the driver device is accessed legally, returns that device context from SubmitDriverHtileClear, and queries import policy on that context. If the metadata is uncovered, the regression now asserts the observed production refusal (native multisample depth clear requires tracked HTILE generations) and exits that fixture case; it no longer claims output checks pass on RADV/lavapipe. The NVIDIA path still requires complete tracked-store evidence and continues through its existing output checks. The production import-watch support remains separate in #8759. I have not locally compiled or run this revision due the 378 MiB free disk constraint; hosted checks are starting.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304996003 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6304996003). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T00:33:49Z. --- Follow-up pushed as `eb55d58728f367f527253b3ae5b30ed45030fdf3`. This uses the established `DriverTestAccess` friend helper so the driver device is accessed legally, returns that device context from `SubmitDriverHtileClear`, and queries import policy on that context. If the metadata is uncovered, the regression now asserts the observed production refusal (`native multisample depth clear requires tracked HTILE generations`) and exits that fixture case; it no longer claims output checks pass on RADV/lavapipe. The NVIDIA path still requires complete tracked-store evidence and continues through its existing output checks. The production import-watch support remains separate in #8759. I have not locally compiled or run this revision due the 378 MiB free disk constraint; hosted checks are starting.
MarcZX10 commented 2026-10-21 00:34:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:34:29Z.


Correction to the existing PR summary: its older tested section predates the RADV/lavapipe finding and should not be read as claiming that this new head passes those output checks. At exact head 077e2d43d523ec7433a01edfcb794e5f72ba73c2, simonbbby reports the intended write-coverage skip followed by the fail-safe production refusal native multisample depth clear requires tracked HTILE generations on RADV and lavapipe; RTX 3090 completed 3/3 on that test correction. Commit eb55d58728f367f527253b3ae5b30ed45030fdf3 now expects this refusal on uncovered HTILE ranges and uses the DriverTestAccess friend helper, while keeping the NVIDIA complete-store check. The current PR body edit did not apply, so this comment is the authoritative scope note for the new head. Local build remains unavailable due to disk capacity; hosted compile/runtime jobs are path-skipped.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6305004737 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6305004737). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T00:34:29Z. --- Correction to the existing PR summary: its older tested section predates the RADV/lavapipe finding and should not be read as claiming that this new head passes those output checks. At exact head `077e2d43d523ec7433a01edfcb794e5f72ba73c2`, simonbbby reports the intended write-coverage skip followed by the fail-safe production refusal `native multisample depth clear requires tracked HTILE generations` on RADV and lavapipe; RTX 3090 completed 3/3 on that test correction. Commit `eb55d58728f367f527253b3ae5b30ed45030fdf3` now expects this refusal on uncovered HTILE ranges and uses the `DriverTestAccess` friend helper, while keeping the NVIDIA complete-store check. The current PR body edit did not apply, so this comment is the authoritative scope note for the new head. Local build remains unavailable due to disk capacity; hosted compile/runtime jobs are path-skipped.
oneandonlydean commented 2026-10-21 00:41:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T00:41:38Z.


@MarcZX10 Thanks, the guard change does what we asked, and the uncovered-HTILE case now checks the fail-safe refusal. One small thing: the device-scope sentence didn't land in the PR description (the edit seems not to have applied). Could you add it there: NVIDIA confirms the tracked path, and RADV/lavapipe depend on #8759? Full CI is running on eb55d58728 now.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6305099529 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6305099529). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T00:41:38Z. --- @MarcZX10 Thanks, the guard change does what we asked, and the uncovered-HTILE case now checks the fail-safe refusal. One small thing: the device-scope sentence didn't land in the PR description (the edit seems not to have applied). Could you add it there: NVIDIA confirms the tracked path, and RADV/lavapipe depend on #8759? Full CI is running on `eb55d58728` now.
milescoviello commented 2026-10-21 00:51:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T00:51:01Z.


@MarcZX10 eb55d58728 builds and runs here (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release), so the DriverTestAccess change compiles with GCC 13.3:

  • --clears: passes 3 of 3 without the validation layer and 3 of 3 with it (Khronos 1.4.363), checked=27 unavailable=0, no VUID.
  • No run prints the write-coverage skip or the "requires tracked HTILE generations" refusal, so the NVIDIA path still takes the complete-store assertion and the output checks.
  • ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$': 4 of 4 pass with the layer and 4 of 4 without.

No RADV here.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6305226092 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6305226092). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-21T00:51:01Z. --- @MarcZX10 eb55d58728 builds and runs here (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release), so the `DriverTestAccess` change compiles with GCC 13.3: - `--clears`: passes 3 of 3 without the validation layer and 3 of 3 with it (Khronos 1.4.363), `checked=27 unavailable=0`, no VUID. - No run prints the write-coverage skip or the "requires tracked HTILE generations" refusal, so the NVIDIA path still takes the complete-store assertion and the output checks. - `ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$'`: 4 of 4 pass with the layer and 4 of 4 without. No RADV here. AI-assisted: yes (Claude Code)
SleglJan commented 2026-10-21 00:52:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-21T00:52:17Z.


@MarcZX10 @oneandonlydean eb55d58728, the exact head, builds here (GCC 16.2.1, Release) and passes agc_driver_native_multisample_depth_tests --clears on all three devices. Linux 7.2.10; test binaries run directly, outside ctest.

device --clears, 3 runs each summary line
RTX 3080, NVIDIA 615.78.08 exit 0, no skip line checked=27 unavailable=0
Ryzen 9 7950X3D iGPU, RADV, Mesa 26.2.4 exit 0, with the write-coverage skip line checked=27 unavailable=0
lavapipe, Mesa 26.2.4, with and without /dev/udmabuf exit 0, with the write-coverage skip line checked=19 unavailable=8

On RADV and lavapipe the skip line is followed by the check this head adds, and it holds: sampling is refused with "native multisample depth clear requires tracked HTILE generations". The test prints nothing for that check, but a missing or different refusal would exit 1 before the summary line. The RTX takes the tracked-store branch.

  • Under VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation on the RTX it passes with no VUID-.
  • agc_driver_native_depth_bda_clear_tests passes 3 of 3 on the RTX and skips 3 of 3 on lavapipe with its existing message.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6305242381 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6305242381). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-21T00:52:17Z. --- @MarcZX10 @oneandonlydean eb55d58728, the exact head, builds here (GCC 16.2.1, Release) and passes `agc_driver_native_multisample_depth_tests --clears` on all three devices. Linux 7.2.10; test binaries run directly, outside ctest. | device | `--clears`, 3 runs each | summary line | |---|---|---| | RTX 3080, NVIDIA 615.78.08 | exit 0, no skip line | `checked=27 unavailable=0` | | Ryzen 9 7950X3D iGPU, RADV, Mesa 26.2.4 | exit 0, with the write-coverage skip line | `checked=27 unavailable=0` | | lavapipe, Mesa 26.2.4, with and without `/dev/udmabuf` | exit 0, with the write-coverage skip line | `checked=19 unavailable=8` | On RADV and lavapipe the skip line is followed by the check this head adds, and it holds: sampling is refused with "native multisample depth clear requires tracked HTILE generations". The test prints nothing for that check, but a missing or different refusal would exit 1 before the summary line. The RTX takes the tracked-store branch. - Under `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` on the RTX it passes with no `VUID-`. - `agc_driver_native_depth_bda_clear_tests` passes 3 of 3 on the RTX and skips 3 of 3 on lavapipe with its existing message. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-21 00:55:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:55:57Z.


Updated the Tested section and GPU checklist to describe the exact-head reports and device scope. NVIDIA RTX 4070 Ti/RTX 3080 reports cover the tracked-clear path; RADV/lavapipe report the uncovered-HTILE fail-safe refusal, and full write-watch coverage on those drivers remains tied to #8759. Thanks for the exact-head runs and for flagging the missing scope sentence.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6305289660 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6305289660). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T00:55:57Z. --- Updated the `Tested` section and GPU checklist to describe the exact-head reports and device scope. NVIDIA RTX 4070 Ti/RTX 3080 reports cover the tracked-clear path; RADV/lavapipe report the uncovered-HTILE fail-safe refusal, and full write-watch coverage on those drivers remains tied to #8759. Thanks for the exact-head runs and for flagging the missing scope sentence.
MarcZX10 commented 2026-10-21 03:26:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:26:06Z.


Thanks for the current consumer-handoff report. The fact that #7371 follows the rebased #7233 head directly, with its handoff commits unchanged and the focused Windows/Linux matrix passing, is useful integration evidence. I’ll keep the separate fixture-lock issue and its validation scoped to the reports already recorded here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6307265242 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6307265242). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T03:26:06Z. --- Thanks for the current consumer-handoff report. The fact that #7371 follows the rebased #7233 head directly, with its handoff commits unchanged and the focused Windows/Linux matrix passing, is useful integration evidence. I’ll keep the separate fixture-lock issue and its validation scoped to the reports already recorded here.
JJenkx commented 2026-10-21 13:22:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T13:22:43Z.


@MarcZX10 @Amoenus, coordinating an upcoming follow-up to #6300 before opening it. The #6300 author confirmed that initial uncompressed stencil import and depth-only HTILE fills preserving raster-written stencil are separate from their planned work: https://github.com/boykopovar/AnyPS5/pull/6300#issuecomment-6316567312.

My follow-up accepts a separate uncompressed stencil plane only when every byte of its complete watched range equals DB_STENCIL_CLEAR; depth-only HTILE fills then clear depth alone. Unknown or intervening writes still refuse sampling. It does not implement the possible/exact write accounting, ArmHtileDepthClear/completion lifecycle in #7233, or the queued-clear settling in #7371.

The overlap tool reports shared DepthSurface.cpp and NativeMultisampleDepth.cpp hunks with both PRs. I propose giving #7233 and #7371 precedence for those clear-lifecycle changes and adapting the stencil follow-up to preserve their pending/queued completion guards. Does that ordering fit your plans, or is there a specific dependency you would prefer? I will disclose these overlaps in the new PR rather than imply the changes merge independently.

The earlier stencil stack passed focused paired RADV tests with required Vulkan and per-test Khronos validation; a fresh pair against current main is running. No Windows/BDA result, title unblock, or performance gain is claimed.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6317157262 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6317157262). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-21T13:22:43Z. --- @MarcZX10 @Amoenus, coordinating an upcoming follow-up to #6300 before opening it. The #6300 author confirmed that initial uncompressed stencil import and depth-only HTILE fills preserving raster-written stencil are separate from their planned work: https://github.com/boykopovar/AnyPS5/pull/6300#issuecomment-6316567312. My follow-up accepts a separate uncompressed stencil plane only when every byte of its complete watched range equals `DB_STENCIL_CLEAR`; depth-only HTILE fills then clear depth alone. Unknown or intervening writes still refuse sampling. It does not implement the possible/exact write accounting, `ArmHtileDepthClear`/completion lifecycle in #7233, or the queued-clear settling in #7371. The overlap tool reports shared `DepthSurface.cpp` and `NativeMultisampleDepth.cpp` hunks with both PRs. I propose giving #7233 and #7371 precedence for those clear-lifecycle changes and adapting the stencil follow-up to preserve their pending/queued completion guards. Does that ordering fit your plans, or is there a specific dependency you would prefer? I will disclose these overlaps in the new PR rather than imply the changes merge independently. The earlier stencil stack passed focused paired RADV tests with required Vulkan and per-test Khronos validation; a fresh pair against current main is running. No Windows/BDA result, title unblock, or performance gain is claimed. AI-assisted: yes.
Amoenus commented 2026-10-21 21:47:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-21T21:47:38Z.


@JJenkx That ordering fits our side: #7233 first, then #7371, then the separate stencil follow-up adapted to both. Please retain the queued-clear completion guards and consumer-side settling in #7371; initial stencil import should not turn an armed or pending HTILE clear into completed sampling state. No additional dependency is requested on our side.

For the current-main adaptation, #9026 has also landed with range-limited depth-plane stores; please retain that writeback behavior while checking depth-only clears preserve stencil. #7371 currently merges cleanly with main a6dcea9279; that is a source/merge check, not a fresh runtime result for the stencil composition. Our existing validation pins and the uncovered-HTILE limitation remain as recorded.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6327284067 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6327284067). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-21T21:47:38Z. --- @JJenkx That ordering fits our side: #7233 first, then #7371, then the separate stencil follow-up adapted to both. Please retain the queued-clear completion guards and consumer-side settling in #7371; initial stencil import should not turn an armed or pending HTILE clear into completed sampling state. No additional dependency is requested on our side. For the current-main adaptation, #9026 has also landed with range-limited depth-plane stores; please retain that writeback behavior while checking depth-only clears preserve stencil. #7371 currently merges cleanly with main `a6dcea9279`; that is a source/merge check, not a fresh runtime result for the stencil composition. Our existing validation pins and the uncovered-HTILE limitation remain as recorded.
EagleBearerYS commented 2026-10-22 02:03:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T02:03:38Z.


@MarcZX10 a merge-order note for this one as its author: #9533 changes NoteHtileDepthClear in DepthSurface.cpp and the native multisample depth tests next to this PR, for native multisample D32S8 targets with a separate stencil plane. This one goes first: #9533 lists it under Depends on and rebases on it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6330907233 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6330907233). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-22T02:03:38Z. --- @MarcZX10 a merge-order note for this one as its author: #9533 changes `NoteHtileDepthClear` in `DepthSurface.cpp` and the native multisample depth tests next to this PR, for native multisample D32S8 targets with a separate stencil plane. This one goes first: #9533 lists it under Depends on and rebases on it.
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!7233
No description provided.