feat(agc): publish a written native multisample D32S8 surface to its guest planes on a guest read #13021

Merged
JAB-dev merged 14 commits from upstream-pr/13021 into main 2026-11-03 21:08:53 +00:00
JAB-dev commented 2026-10-29 21:58:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-29T21:58:14Z.


What

Arcade Game Zone (PPSA19015) stops on a guest read of a native multisample D32S8 depth surface that a draw has written, with sample-preserving guest publication of native multisample depth is not implemented. With this change, a guest read now publishes the surface back to guest memory, and the title keeps playing: it ran for 27 minutes without a stop on this change together with the pull requests listed below.

A read over a written native multisample D32S8 surface (a CPU read, a DMA source, a texture, storage, index or vertex read) now reads the samples back in the guest's layer, row, column, fragment order, retiles them into the Z_X planes with the descriptor's pipe-bank XOR, and rewrites the HTILE words to the expanded clear word. The surface keeps its host image and stays resident. The planes the guest wrote are never overwritten: the guest's bytes are snapshotted when the host takes ownership (and again after a proven whole-plane clear), and a byte is taken from the host only where the write tracker proves the guest did not write it. A byte it cannot prove (the guest stored the value the byte already held, which the tracker cannot tell from no store) throws native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store rather than guess. A capture that cannot be taken (a colour alias, a pending GPU write, an unproven store since import) leaves the owner unavailable for publication: draws keep rendering and a guest read throws the earlier refusal. D16 and D32-only owners, unproven clear transitions and publication inside a GPU completion still throw.

After a guest byte was merged over the host's, a later draw on that target throws guest writes over native multisample depth instead of re-importing a cleared image. Publication's own stores are recorded as possible stores, not complete ones, so the HTILE clear proof is unaffected; WriteChanged and every other caller are unchanged from main.

Late guest stores. Each changed byte is exchanged with a compare-and-swap (8-byte words when aligned, bytes otherwise) only while it still holds the snapshot value, and a part is refused when the tracker saw a CPU store since its last collect. A late store of any other value is kept and the read throws guest writes raced native multisample depth publication; planes already committed stay published and later reads throw. The one case still overwritten is a CPU store of the snapshot's own value that lands in a byte the host changes while that part commits. It is in the debt entry.

Lock order. GpuMutex, surfacesMutex, the multisample targets mutex, then guardedMutex or depthGuardMutex, then the write tracker. The allocation lease is a snapshot taken under the registry mutex and released at once, and publication drops depthGuardMutex before the colour-target lookup. Publication runs with GpuMutex held, so the flush hook re-enters it at depth 2 and never releases it while surfacesMutex is held. By reading the code, no production thread takes GpuMutex while holding the targets mutex (nothing enforces it, and some tests acquire targets without GpuMutex): acquisition, sampling, storage and resolve record commands under GpuMutex, and NoteColorMetadataFill holds the targets mutex without GpuMutex but waits on nothing. Read-guard callers without GpuMutex are game-thread host reads and the PM4 DMA-source check; they take GpuMutex as their outermost driver lock.

Other titles. NoteDepthSurfaceWrite returns at once for a single-sample target. For a multisample depth-writing draw it takes the surfaces lock, marks every active matching owner as host-written, and throws a native multisample depth attachment was retired while its draw resolved resources when no active owner matches the draw's target; it now runs after the resources and the recipe proof, so a draw that a proof or a resource build refuses no longer marks the surface written.

Evidence limits. The Z_X retile, the pipe-bank XOR and the HTILE word expansion are checked against this driver's own import path, not against an independent reading of the console. The title run was on a stack of four changes (this one, the stencil plane change, the staged 4_4_4_4 partial write change and the D32S8 import change), not on this one alone.

Tested

Windows 11, NVIDIA RTX 4070 SUPER, driver 610.88.

  • agc_driver_native_depth_publication (new): 2, 4 and 8 samples with each kind of clear; guest writes to depth, stencil and HTILE pages; a driver store of the same value; a queued fill; partial unmaps, remapped and inaccessible holes; a write during the copy; a concurrent read from two threads; a colour alias, a pending draw and publication inside a GPU completion (each throws with its own message); a draw after publishing sees the published samples; a DCC colour target over a host-written surface throws instead of deadlocking. A guest store after the last validation and one between the plane commits are kept and refused; WriteChangedIfHeld is checked on unaligned heads and tails, on a byte the host leaves alone and on a byte it changes; publication while another thread holds the GPU mutex and the multisampled target list completes once it is released. States that are valid but not implemented (a GPU completion, a colour alias, a pending draw, a same-value store, a DCC target) assert that a refusal changes no guest byte and keeps the owner, and that a publication writes only host bytes and keeps every byte the guest stored.
  • agc_driver_native_multisample_depth and the other agc_driver_native_depth_* tests, agc_driver_multisample_retirement, DepthPlaneFill, DepthSurfaceFromStorage and NativeDepthBdaClear.
  • The 79 agc_driver tests that touch draws, targets, multisampling and pipelines, and check_conventions.py.
  • Validation layers: same VUID sets as the base (main with the open D32S8 import change) in all 37 focused tests (the VUIDs are VUID-VkDeviceCreateInfo-pNext-pNext, VUID-VkPhysicalDeviceProperties2-pNext-pNext, VUID-VkGraphicsPipelineCreateInfo-renderPass-06053 and VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605, all reported by the base), and no log reports was not found but was requested by env var VK_INSTANCE_LAYERS. agc_driver_native_depth_publication reports none.
  • Arcade Game Zone: 27 minutes of play without a stop (this change, the stencil plane change and the staged 4_4_4_4 partial write change together).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none; the two imports it was built on have merged. It overlaps https://github.com/boykopovar/AnyPS5/pull/9950, which publishes a written D32 surface, in DepthSurface.cpp and its test, and the maintainers can pick the order
  • Fixes: none
  • Unblocks: PPSA19015 https://github.com/boykopovar/AnyPS5/discussions/8562
  • GPUs tested: NVIDIA RTX 4070 SUPER, driver 610.88, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5076149333 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13021). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-29T21:58:14Z. --- ### What Arcade Game Zone (PPSA19015) stops on a guest read of a native multisample D32S8 depth surface that a draw has written, with `sample-preserving guest publication of native multisample depth is not implemented`. With this change, a guest read now publishes the surface back to guest memory, and the title keeps playing: it ran for 27 minutes without a stop on this change together with the pull requests listed below. A read over a written native multisample D32S8 surface (a CPU read, a DMA source, a texture, storage, index or vertex read) now reads the samples back in the guest's layer, row, column, fragment order, retiles them into the Z_X planes with the descriptor's pipe-bank XOR, and rewrites the HTILE words to the expanded clear word. The surface keeps its host image and stays resident. The planes the guest wrote are never overwritten: the guest's bytes are snapshotted when the host takes ownership (and again after a proven whole-plane clear), and a byte is taken from the host only where the write tracker proves the guest did not write it. A byte it cannot prove (the guest stored the value the byte already held, which the tracker cannot tell from no store) throws `native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store` rather than guess. A capture that cannot be taken (a colour alias, a pending GPU write, an unproven store since import) leaves the owner unavailable for publication: draws keep rendering and a guest read throws the earlier refusal. D16 and D32-only owners, unproven clear transitions and publication inside a GPU completion still throw. After a guest byte was merged over the host's, a later draw on that target throws `guest writes over native multisample depth` instead of re-importing a cleared image. Publication's own stores are recorded as possible stores, not complete ones, so the HTILE clear proof is unaffected; `WriteChanged` and every other caller are unchanged from `main`. **Late guest stores.** Each changed byte is exchanged with a compare-and-swap (8-byte words when aligned, bytes otherwise) only while it still holds the snapshot value, and a part is refused when the tracker saw a CPU store since its last collect. A late store of any other value is kept and the read throws `guest writes raced native multisample depth publication`; planes already committed stay published and later reads throw. The one case still overwritten is a CPU store of the snapshot's own value that lands in a byte the host changes while that part commits. It is in the debt entry. **Lock order.** `GpuMutex`, `surfacesMutex`, the multisample targets mutex, then `guardedMutex` or `depthGuardMutex`, then the write tracker. The allocation lease is a snapshot taken under the registry mutex and released at once, and publication drops `depthGuardMutex` before the colour-target lookup. Publication runs with `GpuMutex` held, so the flush hook re-enters it at depth 2 and never releases it while `surfacesMutex` is held. By reading the code, no production thread takes `GpuMutex` while holding the targets mutex (nothing enforces it, and some tests acquire targets without `GpuMutex`): acquisition, sampling, storage and resolve record commands under `GpuMutex`, and `NoteColorMetadataFill` holds the targets mutex without `GpuMutex` but waits on nothing. Read-guard callers without `GpuMutex` are game-thread host reads and the PM4 DMA-source check; they take `GpuMutex` as their outermost driver lock. **Other titles.** `NoteDepthSurfaceWrite` returns at once for a single-sample target. For a multisample depth-writing draw it takes the surfaces lock, marks every active matching owner as host-written, and throws `a native multisample depth attachment was retired while its draw resolved resources` when no active owner matches the draw's target; it now runs after the resources and the recipe proof, so a draw that a proof or a resource build refuses no longer marks the surface written. **Evidence limits.** The Z_X retile, the pipe-bank XOR and the HTILE word expansion are checked against this driver's own import path, not against an independent reading of the console. The title run was on a stack of four changes (this one, the stencil plane change, the staged 4_4_4_4 partial write change and the D32S8 import change), not on this one alone. ### Tested Windows 11, NVIDIA RTX 4070 SUPER, driver 610.88. - `agc_driver_native_depth_publication` (new): 2, 4 and 8 samples with each kind of clear; guest writes to depth, stencil and HTILE pages; a driver store of the same value; a queued fill; partial unmaps, remapped and inaccessible holes; a write during the copy; a concurrent read from two threads; a colour alias, a pending draw and publication inside a GPU completion (each throws with its own message); a draw after publishing sees the published samples; a DCC colour target over a host-written surface throws instead of deadlocking. A guest store after the last validation and one between the plane commits are kept and refused; `WriteChangedIfHeld` is checked on unaligned heads and tails, on a byte the host leaves alone and on a byte it changes; publication while another thread holds the GPU mutex and the multisampled target list completes once it is released. States that are valid but not implemented (a GPU completion, a colour alias, a pending draw, a same-value store, a DCC target) assert that a refusal changes no guest byte and keeps the owner, and that a publication writes only host bytes and keeps every byte the guest stored. - `agc_driver_native_multisample_depth` and the other `agc_driver_native_depth_*` tests, `agc_driver_multisample_retirement`, `DepthPlaneFill`, `DepthSurfaceFromStorage` and `NativeDepthBdaClear`. - The 79 `agc_driver` tests that touch draws, targets, multisampling and pipelines, and `check_conventions.py`. - Validation layers: same VUID sets as the base (`main` with the open D32S8 import change) in all 37 focused tests (the VUIDs are `VUID-VkDeviceCreateInfo-pNext-pNext`, `VUID-VkPhysicalDeviceProperties2-pNext-pNext`, `VUID-VkGraphicsPipelineCreateInfo-renderPass-06053` and `VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605`, all reported by the base), and no log reports `was not found but was requested by env var VK_INSTANCE_LAYERS`. `agc_driver_native_depth_publication` reports none. - Arcade Game Zone: 27 minutes of play without a stop (this change, the stencil plane change and the staged 4_4_4_4 partial write change together). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none; the two imports it was built on have merged. It overlaps https://github.com/boykopovar/AnyPS5/pull/9950, which publishes a written D32 surface, in `DepthSurface.cpp` and its test, and the maintainers can pick the order <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: PPSA19015 https://github.com/boykopovar/AnyPS5/discussions/8562 <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA RTX 4070 SUPER, driver 610.88, Windows 11 <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jotitadev commented 2026-10-30 23:56:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T23:56:01Z.

Review: COMMENTED


Linux run of head bb085f7a40, since the description and the AMD data point are both Windows. On Linux NVIDIA the queued-fill HTILE check that skips on bunbeans2-arch's RX 9070 XT does run.

Setup: Ubuntu 26.04, GCC 15.2, Release. RTX 3070 (NVIDIA 595.99.02) and lavapipe (Mesa 26.0.3), one at a time via VK_DRIVER_FILES. Khronos validation layer 1.4.341, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, ctest -j1. The head merged --no-ff onto current main de96e3efbd with no conflicts. Every executable of the focused set was rebuilt for the tree.

  • Focused set, 15 tests: agc_driver_native_multisample_depth, the agc_driver_native_depth_* tests (including publication, driver_path and driver_queued_fill), multisample_retirement, depth_plane_fill and depth_surface_from_storage. 15/15 in 3 of 3 runs on each device, 0 VUID- lines.
  • agc_driver_native_depth_driver_queued_fill is not skipped here:
    • RTX 3070: cases checked=6 unavailable=0. Each case prints cleared by a queued DMA_DATA fill of 128 KiB from its HTILE through the driver and sampled.
    • lavapipe: cases checked=4 unavailable=2. The 2-sample cases are the unavailable ones; the 4- and 8-sample cases pass.
    • So the HTILE proof that bunbeans2-arch's Windows AMD setup skips ("host imports are compared here, not write-watched") is exercised on Linux NVIDIA.
  • agc_driver_native_depth_bda_clear skips on lavapipe (the device does not keep write watching for native clear imports), as on main.
  • Full ^agc suite (without display/flip/lds_atomics64, no layer, --timeout 60) on #13023's head, which contains this branch: 1136/1136 on the RTX 3070 and 1136/1136 on lavapipe.
  • ninja all plus every agc*_tests target builds. GCC prints no warnings on the lines this PR adds.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux); lavapipe (Mesa 26.0.3, Linux).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5719935125 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13021#pullrequestreview-5719935125). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-30T23:56:01Z. **Review:** COMMENTED --- Linux run of head `bb085f7a40`, since the description and the AMD data point are both Windows. On Linux NVIDIA the queued-fill HTILE check that skips on bunbeans2-arch's RX 9070 XT does run. Setup: Ubuntu 26.04, GCC 15.2, Release. RTX 3070 (NVIDIA 595.99.02) and lavapipe (Mesa 26.0.3), one at a time via `VK_DRIVER_FILES`. Khronos validation layer 1.4.341, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `ctest -j1`. The head merged `--no-ff` onto current `main` `de96e3efbd` with no conflicts. Every executable of the focused set was rebuilt for the tree. - **Focused set, 15 tests:** `agc_driver_native_multisample_depth`, the `agc_driver_native_depth_*` tests (including `publication`, `driver_path` and `driver_queued_fill`), `multisample_retirement`, `depth_plane_fill` and `depth_surface_from_storage`. 15/15 in 3 of 3 runs on each device, 0 `VUID-` lines. - **`agc_driver_native_depth_driver_queued_fill` is not skipped here:** - RTX 3070: `cases checked=6 unavailable=0`. Each case prints `cleared by a queued DMA_DATA fill of 128 KiB from its HTILE through the driver and sampled`. - lavapipe: `cases checked=4 unavailable=2`. The 2-sample cases are the unavailable ones; the 4- and 8-sample cases pass. - So the HTILE proof that bunbeans2-arch's Windows AMD setup skips ("host imports are compared here, not write-watched") is exercised on Linux NVIDIA. - `agc_driver_native_depth_bda_clear` skips on lavapipe (the device does not keep write watching for native clear imports), as on `main`. - **Full `^agc` suite** (without display/flip/`lds_atomics64`, no layer, `--timeout 60`) on #13023's head, which contains this branch: 1136/1136 on the RTX 3070 and 1136/1136 on lavapipe. - `ninja all` plus every `agc*_tests` target builds. GCC prints no warnings on the lines this PR adds. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux); lavapipe (Mesa 26.0.3, Linux). Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
CnRJay commented 2026-11-01 19:50:44 +00:00 (Migrated from github.com)

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

Review: COMMENTED


For the reviewer's benefit: this branch carries about 40 commits, including the whole separate-stencil import series (feat(agc): import cleared native multisample D32S8 targets..., the fix(agc): ... native multisample depth ... run and a merge of origin/pr-9533), and #13023 carries the same commits plus its own. The "What" describes only the publication change. Please state which commits in this PR are new here and which belong to the prerequisite PR(s), and what the dependency order is (Depends on), so the two can be reviewed and merged without the same hunks landing twice. A diff of +2368/-171 over 16 files is hard to attribute otherwise.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729926511 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13021#pullrequestreview-5729926511). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:50:44Z. **Review:** COMMENTED --- For the reviewer's benefit: this branch carries about 40 commits, including the whole separate-stencil import series (`feat(agc): import cleared native multisample D32S8 targets...`, the `fix(agc): ... native multisample depth ...` run and a merge of `origin/pr-9533`), and #13023 carries the same commits plus its own. The "What" describes only the publication change. Please state which commits in this PR are new here and which belong to the prerequisite PR(s), and what the dependency order is (`Depends on`), so the two can be reviewed and merged without the same hunks landing twice. A diff of +2368/-171 over 16 files is hard to attribute otherwise.
XairRrR commented 2026-11-02 21:16:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T21:16:15Z.

Review: APPROVED


Reviewed — approved

The merged tree builds, and the new publication test and its neighbours pass on lavapipe. Two mutations each make the new test fail: one turns publication off, the other removes the compare-and-swap guard on late guest stores. I found nothing blocking; three non-blocking notes on scope and documentation follow.

What I ran

Head f6e7798ba98dd9aa8e0ad7a2036588c61a65684c, main 9090972b7e91fd266819cbd77a8b058e177b5682, merged --no-ff in a clean worktree (Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, lavapipe Mesa 26.1.6 / LLVM 19, no GPU).

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...f6e7798ba98dd9aa8e0ad7a2036588c61a65684c
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage"
ctest --test-dir build -V -R "^agc_driver_native_depth_publication$"
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_native_depth_publication$"
# negative controls (see below), each followed by
ninja -C build -j32 -l32 agc_driver_native_multisample_depth_tests
ctest --test-dir build --output-on-failure -R "^agc_driver_native_depth_publication$"

Results

Check Result
git diff --check clean
check_conventions.py 0 errors, 1 warning: the debt entry at docs/dev/debt/libSceAgcDriver.md:67 has 3982 characters (the limit is 1000)
Configure / build / libs (script) ok
Selected tests (script, 2099 run) 0 new failures, 0 timeouts; 7 known failures that fail on main too (agc_driver_division, the denormal-mode tests, unwrap_self, vector_constant_factor_tininess)
Focused set (17 tests) 16 passed, 1 skipped (agc_driver_native_depth_bda_clear, which skips on lavapipe on main too)
agc_driver_native_depth_publication passed in about 1 s; every case reports checked for 2, 4 and 8 samples and each kind of clear, write and unmap
Validation (script, 757 tests, layer loaded in 756) 0 tests with new VUIDs
Validation, new test run alone layer inserted, 0 VUID- lines, no "was not found but was requested" line
Publication test, end of the verbose run
1680: Native D32S8 publication samples=4 write=24 depthOnly=1 unmap=0 clear=0 checked
1680: Native D32S8 publication samples=4 write=15 depthOnly=1 unmap=0 clear=0 checked
1/1 Test #1680: agc_driver_native_depth_publication ...   Passed    1.02 sec

Negative control

The new tests call entry points that only this PR adds (WriteChangedIfHeld, SetDepthPublicationHookForTest, WithMultisampleTargetsLockForTest), so restoring the production files from main would only break the build. I mutated the production code instead:

  1. In DepthSurface.cpp, I replaced the publishWrittenDepth(written) call in RequireNoResidentDepthRead_nid_no_patch with a no-op. agc_driver_native_depth_publication failed: AGC graphics: sample-preserving guest publication of native multisample depth is not implemented.
  2. In GuestMemory.cpp's WriteChangedIfHeld, I replaced both compare-and-swaps with plain stores and turned off the "CPU store since last collect" refusal. The test failed: AGC graphics: a guarded publication store overwrote a guest byte stored after the snapshot. The late-store tests that the first review requested do catch the race they target.

After both mutations I restored the merged files, rebuilt and re-ran the test, which passed. git status --porcelain is empty.

Findings

Blocking

None.

Non-blocking

  1. NoteDepthSurfaceWrite now throws for every multisample depth draw, not only for this feature's owners (core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:2644-2655).

    • The !anyDepthGuard() early return is gone, so every multisample depth-writing draw now takes surfacesMutex.
    • The new Require(attached, "a native multisample depth attachment was retired while its draw resolved resources") throws when no active surface matches.
    • The description says the function "only sets the surface's host-written flag", which no longer covers this.

    I found no case where main kept rendering and this now throws:

    • The only ways an owner becomes inactive are a guest read that retires a never-written owner (line 2626) and an unmap (line 2682).
    • In the read-during-resolve case, main already threw "not implemented", because NoteHostWrite used to run first.

    Still, please mention the new throw in the description, or make it cheap to rule out on other titles.

  2. Capture cost on the draw path is unmeasured. When a written D32S8 owner's host-written flag first goes from false to true, NoteHostWrite (DepthSurface.cpp:705-725) runs CollectWritesUncached and copies all three planes. That happens on the first depth write after import and again after every publication, inside prepareDraw with GpuMutex and surfacesMutex held. For a 1080p 4× D32S8 target that is about 41 MB per draw-then-read cycle, on top of the publication readback. A title that publishes every frame pays this per frame. This is not a perf PR, so no numbers are required, but one frame-time pair on the PPSA19015 scene would show whether it matters.

  3. The debt entry does not list the "another identity" refusal.

    • An owner that has been published stays resident, because hostEverWritten stops the retirement at line 2626.
    • A new depth target of another identity over its planes throws a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented (line 2757; at head).
    • hugodearaujo reports Assassin's Creed Mirage (PPSA13960) stopping there on the PR thread. main also throws in that case, with a different message, so this is not a regression.

    The new "Native D32S8 guest publication" entry only says that a plane that took a guest byte throws at its next use. Please add this case. The same entry is the one that trips the 1000-character warning; the rationale in it (late-store and same-value detail) could be shortened.

On the earlier review: requests 1, 2, 4, 5 and 6 are addressed in the code and the description, and the two mutations above confirm request 1. Request 3, the overlap with #9950 over PublishToGuest, is still the maintainers' decision.

Not verified

  • The Z_X retile, pipe-bank XOR and HTILE word expansion against console behaviour. Like the author, I only see them checked against this driver's own import path.
  • The full lock-order claim. I checked that every targetsMutex() holder now goes through TargetsLock, so HoldsMultisampleTargetsLock sees all of them, and that surfacesMutex is recursive. I did not trace every path that might hold surfacesMutex without GpuMutex and then reach the read guard through GuestMemory::Read or the host read hook.
  • The title run (PPSA19015) and any hardware GPU: this machine only has lavapipe.
  • The recordDispatch and StartDrawPass reordering (commit 24869a37ea) has no test. As the author says, the fixtures do not reproduce a flush between bind and record.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743461966 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13021#pullrequestreview-5743461966). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T21:16:15Z. **Review:** APPROVED --- # Reviewed — approved The merged tree builds, and the new publication test and its neighbours pass on lavapipe. Two mutations each make the new test fail: one turns publication off, the other removes the compare-and-swap guard on late guest stores. I found nothing blocking; three non-blocking notes on scope and documentation follow. ## What I ran Head `f6e7798ba98dd9aa8e0ad7a2036588c61a65684c`, `main` `9090972b7e91fd266819cbd77a8b058e177b5682`, merged `--no-ff` in a clean worktree (Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, lavapipe Mesa 26.1.6 / LLVM 19, no GPU). ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...f6e7798ba98dd9aa8e0ad7a2036588c61a65684c python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage" ctest --test-dir build -V -R "^agc_driver_native_depth_publication$" VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_native_depth_publication$" # negative controls (see below), each followed by ninja -C build -j32 -l32 agc_driver_native_multisample_depth_tests ctest --test-dir build --output-on-failure -R "^agc_driver_native_depth_publication$" ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors, 1 warning: the debt entry at `docs/dev/debt/libSceAgcDriver.md:67` has 3982 characters (the limit is 1000) | | Configure / build / `libs` (script) | ok | | Selected tests (script, 2099 run) | 0 new failures, 0 timeouts; 7 known failures that fail on `main` too (`agc_driver_division`, the denormal-mode tests, `unwrap_self`, `vector_constant_factor_tininess`) | | Focused set (17 tests) | 16 passed, 1 skipped (`agc_driver_native_depth_bda_clear`, which skips on lavapipe on `main` too) | | `agc_driver_native_depth_publication` | passed in about 1 s; every case reports `checked` for 2, 4 and 8 samples and each kind of clear, write and unmap | | Validation (script, 757 tests, layer loaded in 756) | 0 tests with new VUIDs | | Validation, new test run alone | layer inserted, 0 `VUID-` lines, no "was not found but was requested" line | <details><summary>Publication test, end of the verbose run</summary> ``` 1680: Native D32S8 publication samples=4 write=24 depthOnly=1 unmap=0 clear=0 checked 1680: Native D32S8 publication samples=4 write=15 depthOnly=1 unmap=0 clear=0 checked 1/1 Test #1680: agc_driver_native_depth_publication ... Passed 1.02 sec ``` </details> ## Negative control The new tests call entry points that only this PR adds (`WriteChangedIfHeld`, `SetDepthPublicationHookForTest`, `WithMultisampleTargetsLockForTest`), so restoring the production files from `main` would only break the build. I mutated the production code instead: 1. In `DepthSurface.cpp`, I replaced the `publishWrittenDepth(written)` call in `RequireNoResidentDepthRead_nid_no_patch` with a no-op. `agc_driver_native_depth_publication` **failed**: `AGC graphics: sample-preserving guest publication of native multisample depth is not implemented`. 2. In `GuestMemory.cpp`'s `WriteChangedIfHeld`, I replaced both compare-and-swaps with plain stores and turned off the "CPU store since last collect" refusal. The test **failed**: `AGC graphics: a guarded publication store overwrote a guest byte stored after the snapshot`. The late-store tests that the first review requested do catch the race they target. After both mutations I restored the merged files, rebuilt and re-ran the test, which passed. `git status --porcelain` is empty. ## Findings ### Blocking None. ### Non-blocking 1. **`NoteDepthSurfaceWrite` now throws for every multisample depth draw, not only for this feature's owners** (`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:2644-2655`). - The `!anyDepthGuard()` early return is gone, so every multisample depth-writing draw now takes `surfacesMutex`. - The new `Require(attached, "a native multisample depth attachment was retired while its draw resolved resources")` throws when no active surface matches. - The description says the function "only sets the surface's host-written flag", which no longer covers this. I found no case where `main` kept rendering and this now throws: - The only ways an owner becomes inactive are a guest read that retires a never-written owner (line 2626) and an unmap (line 2682). - In the read-during-resolve case, `main` already threw "not implemented", because `NoteHostWrite` used to run first. Still, please mention the new throw in the description, or make it cheap to rule out on other titles. 2. **Capture cost on the draw path is unmeasured.** When a written D32S8 owner's host-written flag first goes from false to true, `NoteHostWrite` (`DepthSurface.cpp:705-725`) runs `CollectWritesUncached` and copies all three planes. That happens on the first depth write after import and again after every publication, inside `prepareDraw` with `GpuMutex` and `surfacesMutex` held. For a 1080p 4× D32S8 target that is about 41 MB per draw-then-read cycle, on top of the publication readback. A title that publishes every frame pays this per frame. This is not a `perf` PR, so no numbers are required, but one frame-time pair on the PPSA19015 scene would show whether it matters. 3. **The debt entry does not list the "another identity" refusal.** - An owner that has been published stays resident, because `hostEverWritten` stops the retirement at line 2626. - A new depth target of another identity over its planes throws `a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented` (line 2757; [at head](https://github.com/boykopovar/AnyPS5/blob/f6e7798ba98dd9aa8e0ad7a2036588c61a65684c/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L2728-L2734)). - hugodearaujo reports Assassin's Creed Mirage (PPSA13960) stopping there on the PR thread. `main` also throws in that case, with a different message, so this is not a regression. The new "Native D32S8 guest publication" entry only says that a plane that took a guest byte throws at its next use. Please add this case. The same entry is the one that trips the 1000-character warning; the rationale in it (late-store and same-value detail) could be shortened. On the earlier review: requests 1, 2, 4, 5 and 6 are addressed in the code and the description, and the two mutations above confirm request 1. Request 3, the overlap with #9950 over `PublishToGuest`, is still the maintainers' decision. ## Not verified - The Z_X retile, pipe-bank XOR and HTILE word expansion against console behaviour. Like the author, I only see them checked against this driver's own import path. - The full lock-order claim. I checked that every `targetsMutex()` holder now goes through `TargetsLock`, so `HoldsMultisampleTargetsLock` sees all of them, and that `surfacesMutex` is recursive. I did not trace every path that might hold `surfacesMutex` without `GpuMutex` and then reach the read guard through `GuestMemory::Read` or the host read hook. - The title run (PPSA19015) and any hardware GPU: this machine only has lavapipe. - The `recordDispatch` and `StartDrawPass` reordering (commit `24869a37ea`) has no test. As the author says, the fixtures do not reproduce a flush between bind and record. <!-- anyps5-bots job=1916 head=f6e7798ba98dd9aa8e0ad7a2036588c61a65684c -->
XairRrR commented 2026-11-02 23:48:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T23:48:41Z.

Review: APPROVED


Re-checked — approved

Since my last review the only change is a merge of main (456c2ef40b). It resolves a conflict in VulkanDevice.cpp correctly: RequireGuestBuffers() still runs before recordDispatch takes its command buffer. The focused depth tests pass, and the two new failures in the script's run come from main, not from this PR.

What changed since my last review

  • The PR's five commits (0a3252876f to f6e7798ba9) are unchanged. The range-diff shows every one as =.
  • One new commit, 456c2ef40b, merges origin/main and resolves a conflict in core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp.
    • Against main, the PR's only change to that file is still the single resources.RequireGuestBuffers(); line in recordDispatch.
    • main added the scratch-pool block right after that point. The merge keeps the check before that block, before TakeDispatchOrder, and before recorder.Commands / OverlapCommands take commands.
    • So the ordering fix from 24869a37ea (the command buffer freed by a publication flush, reported by XatiX on PPSA06866) survives the merge.
  • No author replies and no description edits since my review.

What I ran

Head 456c2ef40b64786b4ce572b6632a001e88f96fda, main 5cb015caaaaf83f8ee431414ee6a457b5b307d49, merged --no-ff (tree eae4fc57aa52e4cf7087939c3780c46c1b7781c6) in a clean worktree. The machine is a Debian 13 VM with 2× Xeon Gold 6136, GCC 14.2.0 and lavapipe (Mesa 26.1.6 / LLVM 19); there is no GPU.

git show --stat 456c2ef40b64786b4ce572b6632a001e88f96fda
git diff 5cb015caaaaf83f8ee431414ee6a457b5b307d49 eae4fc57aa52e4cf7087939c3780c46c1b7781c6 -- core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...456c2ef40b64786b4ce572b6632a001e88f96fda
python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49
ctest --test-dir build -j4 --test-load 32 --output-on-failure -R "agc_driver_image_sample_lod_clamp_shader_lane|unwrap_self_UnwrapTest_test_new_output_inherits"
# the PR's 9 production files under core/libs/prx/libSceAgcDriver restored from main
ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests
ctest --test-dir build --output-on-failure -R "^agc_driver_image_sample_lod_clamp_shader_lane$"
# merged files restored; git status --porcelain empty
ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests agc_driver_native_multisample_depth_tests
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage"
Check Result
git diff --check clean
check_conventions.py 0 errors, 1 warning: the debt entry at docs/dev/debt/libSceAgcDriver.md:67 has 3982 characters (unchanged)
Configure / build / libs (script) ok
Selected tests (script, 2235 run) 2 "new" failures, both from main (see below); 6 known failures; unwrap_self fixed relative to the older baseline
agc_driver_image_sample_lod_clamp_shader_lane fails on the merged tree, and fails the same way with the PR's production files restored from main (thread 0 component 1 is 0.000000, expected 0.062500). It comes from main: the MIN_LOD work merged after the baseline (a5c53e975c, fe18496c95). Not this PR.
unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group os.chown returns EINVAL in this sandbox. The test was added on main after the baseline, and this PR touches no file in tools/. Environmental, not this PR.
Focused set (17 tests) 16 passed, 1 skipped (agc_driver_native_depth_bda_clear, which skips on lavapipe on main too)
Validation (script, 759 tests, layer loaded in 758, none missing) 0 tests with new VUIDs

Negative control

The tests are unchanged since my last review. The two production mutations I ran then each made agc_driver_native_depth_publication fail: one turned publication off, the other removed the compare-and-swap. The only production change since then is the merge resolution, which leaves the PR's code paths the same, so I did not repeat them. After the main-restore check above, git status --porcelain is empty and the focused set passes on the rebuilt merged tree.

Previous findings

  1. NoteDepthSurfaceWrite throws for every multisample depth draw when no active surface matches (DepthSurface.cpp:2655). Still open, non-blocking. The code is unchanged and the description does not mention the new throw.
  2. Unmeasured capture cost on the draw path: NoteHostWrite (DepthSurface.cpp:705) copies all three planes on each false-to-true flip. Still open, non-blocking. No frame-time numbers yet.
  3. The debt entry omits the "another identity" refusal (DepthSurface.cpp:2758), and the entry is 3982 characters. Still open, non-blocking. docs/dev/debt/libSceAgcDriver.md still does not mention it.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • The Z_X retile, pipe-bank XOR and HTILE word expansion against console behaviour. They are only checked against this driver's own import path.
  • The title runs (PPSA19015, PPSA06866) and any hardware GPU: this machine only has lavapipe.
  • The recordDispatch / StartDrawPass ordering still has no test. I checked it by reading the merged code only.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5745064792 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13021#pullrequestreview-5745064792). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T23:48:41Z. **Review:** APPROVED --- # Re-checked — approved Since my last review the only change is a merge of `main` (`456c2ef40b`). It resolves a conflict in `VulkanDevice.cpp` correctly: `RequireGuestBuffers()` still runs before `recordDispatch` takes its command buffer. The focused depth tests pass, and the two new failures in the script's run come from `main`, not from this PR. ## What changed since my last review - The PR's five commits (`0a3252876f` to `f6e7798ba9`) are unchanged. The range-diff shows every one as `=`. - One new commit, `456c2ef40b`, merges `origin/main` and resolves a conflict in `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`. - Against `main`, the PR's only change to that file is still the single `resources.RequireGuestBuffers();` line in `recordDispatch`. - `main` added the scratch-pool block right after that point. The merge keeps the check before that block, before `TakeDispatchOrder`, and before `recorder.Commands` / `OverlapCommands` take `commands`. - So the ordering fix from `24869a37ea` (the command buffer freed by a publication flush, reported by XatiX on PPSA06866) survives the merge. - No author replies and no description edits since my review. ## What I ran Head `456c2ef40b64786b4ce572b6632a001e88f96fda`, `main` `5cb015caaaaf83f8ee431414ee6a457b5b307d49`, merged `--no-ff` (tree `eae4fc57aa52e4cf7087939c3780c46c1b7781c6`) in a clean worktree. The machine is a Debian 13 VM with 2× Xeon Gold 6136, GCC 14.2.0 and lavapipe (Mesa 26.1.6 / LLVM 19); there is no GPU. ``` git show --stat 456c2ef40b64786b4ce572b6632a001e88f96fda git diff 5cb015caaaaf83f8ee431414ee6a457b5b307d49 eae4fc57aa52e4cf7087939c3780c46c1b7781c6 -- core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...456c2ef40b64786b4ce572b6632a001e88f96fda python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 ctest --test-dir build -j4 --test-load 32 --output-on-failure -R "agc_driver_image_sample_lod_clamp_shader_lane|unwrap_self_UnwrapTest_test_new_output_inherits" # the PR's 9 production files under core/libs/prx/libSceAgcDriver restored from main ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests ctest --test-dir build --output-on-failure -R "^agc_driver_image_sample_lod_clamp_shader_lane$" # merged files restored; git status --porcelain empty ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests agc_driver_native_multisample_depth_tests ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage" ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors, 1 warning: the debt entry at `docs/dev/debt/libSceAgcDriver.md:67` has 3982 characters (unchanged) | | Configure / build / `libs` (script) | ok | | Selected tests (script, 2235 run) | 2 "new" failures, both from `main` (see below); 6 known failures; `unwrap_self` fixed relative to the older baseline | | `agc_driver_image_sample_lod_clamp_shader_lane` | fails on the merged tree, and fails the same way with the PR's production files restored from `main` (`thread 0 component 1 is 0.000000, expected 0.062500`). It comes from `main`: the MIN_LOD work merged after the baseline (`a5c53e975c`, `fe18496c95`). Not this PR. | | `unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group` | `os.chown` returns `EINVAL` in this sandbox. The test was added on `main` after the baseline, and this PR touches no file in `tools/`. Environmental, not this PR. | | Focused set (17 tests) | 16 passed, 1 skipped (`agc_driver_native_depth_bda_clear`, which skips on lavapipe on `main` too) | | Validation (script, 759 tests, layer loaded in 758, none missing) | 0 tests with new VUIDs | ## Negative control The tests are unchanged since my last review. The two production mutations I ran then each made `agc_driver_native_depth_publication` fail: one turned publication off, the other removed the compare-and-swap. The only production change since then is the merge resolution, which leaves the PR's code paths the same, so I did not repeat them. After the main-restore check above, `git status --porcelain` is empty and the focused set passes on the rebuilt merged tree. ## Previous findings 1. `NoteDepthSurfaceWrite` throws for every multisample depth draw when no active surface matches (`DepthSurface.cpp:2655`). **Still open, non-blocking.** The code is unchanged and the description does not mention the new throw. 2. Unmeasured capture cost on the draw path: `NoteHostWrite` (`DepthSurface.cpp:705`) copies all three planes on each false-to-true flip. **Still open, non-blocking.** No frame-time numbers yet. 3. The debt entry omits the "another identity" refusal (`DepthSurface.cpp:2758`), and the entry is 3982 characters. **Still open, non-blocking.** `docs/dev/debt/libSceAgcDriver.md` still does not mention it. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - The Z_X retile, pipe-bank XOR and HTILE word expansion against console behaviour. They are only checked against this driver's own import path. - The title runs (PPSA19015, PPSA06866) and any hardware GPU: this machine only has lavapipe. - The `recordDispatch` / `StartDrawPass` ordering still has no test. I checked it by reading the merged code only. <!-- anyps5-bots job=2873 head=456c2ef40b64786b4ce572b6632a001e88f96fda -->
XairRrR commented 2026-11-03 06:22:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T06:22:56Z.

Review: APPROVED


Re-checked — approved

Since my last review the only change is a merge of main (6e2b8263c2). It resolves a conflict in Draw.cpp correctly: it keeps main's stencil write intent view and the PR's late NoteDepthSurfaceWrite, and the guest buffer check still runs before StartDrawPass. The focused depth tests pass.

What changed since my last review

  • The PR's five commits (0a3252876f to f6e7798ba9) are unchanged. The range-diff shows = for every one.
  • One new commit, 6e2b8263c2, merges origin/main and resolves a conflict in core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp. Against main, the merged Draw.cpp still differs only in the PR's three edits:
    • resources.RequireGuestBuffers(); runs before PrepareMeshWindow and StartDrawPass in recordDraw (Draw.cpp:2504).
    • In prepareDraw, NoteDepthSurfaceWrite moves from the depth view block to just after resolveDrawResources (Draw.cpp:3089).
    • In DrawWithRecipe, it moves after CheckBufferAliases (Draw.cpp:3879).
  • main also brought in writesStencilTarget and DepthSurfaceViewWithStencilWriteIntent. The merge takes main's view lines unchanged and does not bring back the old DepthSurfaceView call. writesDepthTarget now treats all-KEEP stencil ops as no write, and the PR's moved NoteDepthSurfaceWrite uses that definition. This matches main's intent.
  • main widened the write tracker generations to std::uint64_t. I checked that the PR's additions do not store a generation in a 32-bit type. cpuUnchanged, UnchangedSinceLastCollect and the publication stores all take std::uint64_t.
  • VulkanDevice.cpp still differs from main only by the one resources.RequireGuestBuffers(); line in recordDispatch.
  • No author replies and no description edits since my review.

What I ran

Head 6e2b8263c24640287f790cd0e3a5dfc80d6cc349, main d1ae628bc2f62459cce1e9872ba5632c938c71f2, merged --no-ff (tree 25e7f9399ff516f50ab05a1638edd12278d1bc41) in a clean worktree. The machine is a Debian 13 VM with 2× Xeon Gold 6136, GCC 14.2.0 and lavapipe (Mesa 26.1.6 / LLVM 19). It has no GPU.

git show --stat 6e2b8263c24640287f790cd0e3a5dfc80d6cc349
git diff d1ae628bc2f62459cce1e9872ba5632c938c71f2 25e7f9399ff516f50ab05a1638edd12278d1bc41 -- core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
git diff 456c2ef40b64786b4ce572b6632a001e88f96fda 6e2b8263c24640287f790cd0e3a5dfc80d6cc349 -- core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
git diff 5cb015caaaaf83f8ee431414ee6a457b5b307d49 d1ae628bc2f62459cce1e9872ba5632c938c71f2 -- core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...6e2b8263c24640287f790cd0e3a5dfc80d6cc349
python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage|stencil_write_intent"
git status --porcelain
Check Result
git diff --check clean
check_conventions.py 0 errors, 1 warning: the debt entry at docs/dev/debt/libSceAgcDriver.md:67 has 3982 characters (unchanged)
Configure / build / libs (script) ok
Selected tests (script, 2199 run) 0 new failures, 0 timeouts; 7 known failures that also fail on main (agc_driver_division, the denormal-mode tests, vector_constant_factor_tininess, unwrap_self_…)
Skips (script) 113, all expected according to check_skips.py
Validation (script, 767 tests, layer loaded in 766, none missing) 0 tests with new VUIDs
Focused set (17 tests) 16 passed, 1 skipped (agc_driver_native_depth_bda_clear, which skips on lavapipe on main too)

The script's baseline is the same commit as main this time, so the two failures from main that I noted last time are not counted against this run.

Negative control

None this time. The tests are unchanged since my last review, and the production change is only a merge resolution that leaves the PR's code paths the same. In an earlier round, two production mutations each made agc_driver_native_depth_publication fail: one turned publication off, the other removed the compare-and-swap. git status --porcelain is empty.

Previous findings

  1. NoteDepthSurfaceWrite throws for every multisample depth draw when no active surface matches (now DepthSurface.cpp:2671). Still open, non-blocking. The code is unchanged, and the description still does not mention this new throw.
  2. Unmeasured capture cost on the draw path: NoteHostWrite (now DepthSurface.cpp:721) copies all three planes on each false-to-true flip. Still open, non-blocking. There are still no frame-time numbers.
  3. The debt entry does not mention the "another identity" refusal (now DepthSurface.cpp:2778), and the entry is 3982 characters. Still open, non-blocking. docs/dev/debt/libSceAgcDriver.md still has no mention of it.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • The Z_X retile, the pipe-bank XOR and the HTILE word expansion against console behaviour. They are only checked against this driver's own import path.
  • The title runs (PPSA19015, PPSA06866) and any hardware GPU: this machine only has lavapipe.
  • The recordDispatch / StartDrawPass ordering still has no test. I checked it by reading the merged code only.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5747995951 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13021#pullrequestreview-5747995951). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T06:22:56Z. **Review:** APPROVED --- # Re-checked — approved Since my last review the only change is a merge of `main` (`6e2b8263c2`). It resolves a conflict in `Draw.cpp` correctly: it keeps `main`'s stencil write intent view and the PR's late `NoteDepthSurfaceWrite`, and the guest buffer check still runs before `StartDrawPass`. The focused depth tests pass. ## What changed since my last review - The PR's five commits (`0a3252876f` to `f6e7798ba9`) are unchanged. The range-diff shows `=` for every one. - One new commit, `6e2b8263c2`, merges `origin/main` and resolves a conflict in `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`. Against `main`, the merged `Draw.cpp` still differs only in the PR's three edits: - `resources.RequireGuestBuffers();` runs before `PrepareMeshWindow` and `StartDrawPass` in `recordDraw` (`Draw.cpp:2504`). - In `prepareDraw`, `NoteDepthSurfaceWrite` moves from the depth view block to just after `resolveDrawResources` (`Draw.cpp:3089`). - In `DrawWithRecipe`, it moves after `CheckBufferAliases` (`Draw.cpp:3879`). - `main` also brought in `writesStencilTarget` and `DepthSurfaceViewWithStencilWriteIntent`. The merge takes `main`'s view lines unchanged and does not bring back the old `DepthSurfaceView` call. `writesDepthTarget` now treats all-KEEP stencil ops as no write, and the PR's moved `NoteDepthSurfaceWrite` uses that definition. This matches `main`'s intent. - `main` widened the write tracker generations to `std::uint64_t`. I checked that the PR's additions do not store a generation in a 32-bit type. `cpuUnchanged`, `UnchangedSinceLastCollect` and the publication stores all take `std::uint64_t`. - `VulkanDevice.cpp` still differs from `main` only by the one `resources.RequireGuestBuffers();` line in `recordDispatch`. - No author replies and no description edits since my review. ## What I ran Head `6e2b8263c24640287f790cd0e3a5dfc80d6cc349`, `main` `d1ae628bc2f62459cce1e9872ba5632c938c71f2`, merged `--no-ff` (tree `25e7f9399ff516f50ab05a1638edd12278d1bc41`) in a clean worktree. The machine is a Debian 13 VM with 2× Xeon Gold 6136, GCC 14.2.0 and lavapipe (Mesa 26.1.6 / LLVM 19). It has no GPU. ``` git show --stat 6e2b8263c24640287f790cd0e3a5dfc80d6cc349 git diff d1ae628bc2f62459cce1e9872ba5632c938c71f2 25e7f9399ff516f50ab05a1638edd12278d1bc41 -- core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp git diff 456c2ef40b64786b4ce572b6632a001e88f96fda 6e2b8263c24640287f790cd0e3a5dfc80d6cc349 -- core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp git diff 5cb015caaaaf83f8ee431414ee6a457b5b307d49 d1ae628bc2f62459cce1e9872ba5632c938c71f2 -- core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...6e2b8263c24640287f790cd0e3a5dfc80d6cc349 python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage|stencil_write_intent" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors, 1 warning: the debt entry at `docs/dev/debt/libSceAgcDriver.md:67` has 3982 characters (unchanged) | | Configure / build / `libs` (script) | ok | | Selected tests (script, 2199 run) | 0 new failures, 0 timeouts; 7 known failures that also fail on `main` (`agc_driver_division`, the denormal-mode tests, `vector_constant_factor_tininess`, `unwrap_self_…`) | | Skips (script) | 113, all expected according to `check_skips.py` | | Validation (script, 767 tests, layer loaded in 766, none missing) | 0 tests with new VUIDs | | Focused set (17 tests) | 16 passed, 1 skipped (`agc_driver_native_depth_bda_clear`, which skips on lavapipe on `main` too) | The script's baseline is the same commit as `main` this time, so the two failures from `main` that I noted last time are not counted against this run. ## Negative control None this time. The tests are unchanged since my last review, and the production change is only a merge resolution that leaves the PR's code paths the same. In an earlier round, two production mutations each made `agc_driver_native_depth_publication` fail: one turned publication off, the other removed the compare-and-swap. `git status --porcelain` is empty. ## Previous findings 1. `NoteDepthSurfaceWrite` throws for every multisample depth draw when no active surface matches (now `DepthSurface.cpp:2671`). **Still open, non-blocking.** The code is unchanged, and the description still does not mention this new throw. 2. Unmeasured capture cost on the draw path: `NoteHostWrite` (now `DepthSurface.cpp:721`) copies all three planes on each false-to-true flip. **Still open, non-blocking.** There are still no frame-time numbers. 3. The debt entry does not mention the "another identity" refusal (now `DepthSurface.cpp:2778`), and the entry is 3982 characters. **Still open, non-blocking.** `docs/dev/debt/libSceAgcDriver.md` still has no mention of it. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - The Z_X retile, the pipe-bank XOR and the HTILE word expansion against console behaviour. They are only checked against this driver's own import path. - The title runs (PPSA19015, PPSA06866) and any hardware GPU: this machine only has lavapipe. - The `recordDispatch` / `StartDrawPass` ordering still has no test. I checked it by reading the merged code only. <!-- anyps5-bots job=3130 head=6e2b8263c24640287f790cd0e3a5dfc80d6cc349 -->
XairRrR commented 2026-11-03 09:20:44 +00:00 (Migrated from github.com)

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

Review: APPROVED


Re-checked — approved

The only change since my last review is a merge of main (0180bafe62). It resolves the conflicts in GuestMemory.cpp and the AGC debt file correctly, and it brings in #14005's D32S8 owner without HTILE. The PR now refuses that owner cleanly. The focused depth tests pass. The one new validation message the script reported comes from main's own test, not from this PR.

What changed since my last review

  • The PR's five commits (0a3252876f to f6e7798ba9) are unchanged. The range-diff shows = for each one.
  • One new commit, 0180bafe62, merges origin/main 4f41f4c375. It resolves conflicts in Execution/src/GuestMemory.cpp and docs/dev/debt/libSceAgcDriver.md:
    • GuestMemory.cpp: main (#6185) split WriteChanged into a static writeChanged(..., keepGuest) and added WriteChangedKeepingGuest. The merge keeps both of main's functions unchanged. The PR's own additions sit beside them: cpuUnchanged, UnchangedSinceLastCollect, the walked parameter of rangeUnchanged (default true, so existing callers behave as before), storeOwn's complete parameter (default true) and WriteChangedIfHeld. WriteChanged is still main's for every other caller.
    • Debt file: the merge keeps main's edits to the "Native multisampled depth sampling" entry. It also keeps the PR's dropped "Guest publication of a written surface" phrase, which was oneandonlydean's earlier request, and the new "Native D32S8 guest publication" entry.
  • From main, #14005 adds uniformPlaneTarget: D32S8 with a separate stencil plane and no HTILE, whose sampling.initial has 2 ranges ({depth, stencil}). I checked how the PR handles these owners:
    • NoteHostWrite captures both ranges (DepthSurface.cpp:797).
    • PublishToGuest then refuses with ... not implemented for this owner, because publication.size() == 3u fails (DepthSurface.cpp:2170). This happens before any readback dispatch.
    • RebasePublication(2u) and RebasePublication(1u) cannot index out of range for these owners. The stencil-fill path that sets stencilClearGeneration requires sampling.initial.size() > 2u. Both places that set clearGeneration need an HTILE range, and this owner has none.
    • So a guest read of a written owner without HTILE still throws, as it does on main, only with a different message.
  • No author replies and no description edits since my last review.

What I ran

Head 0180bafe62f4dee4cdc04aee0d565be70c838460, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged --no-ff (tree d8eebd68d272cf9c6f239d7842d913b1dfd5119b) in a clean worktree. The machine is a Debian 13 VM with 2× Xeon Gold 6136, GCC 14.2.0 and lavapipe (Mesa 26.1.6, LLVM 19). It has no GPU.

git show --stat 0180bafe62f4dee4cdc04aee0d565be70c838460
git diff 4f41f4c375f5abb487dbd184fbc150f31994d762 d8eebd68d272cf9c6f239d7842d913b1dfd5119b -- core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp docs/dev/debt/libSceAgcDriver.md
git diff d1ae628bc2f62459cce1e9872ba5632c938c71f2 4f41f4c375f5abb487dbd184fbc150f31994d762 -- core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...0180bafe62f4dee4cdc04aee0d565be70c838460
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage|stencil_write_intent"
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$"
diff <(git show 4f41f4c375:…/NativeMultisampleDepth.cpp | sed -n '/^void CheckUniformPlanesWithoutHtile/,/^}/p') <(sed -n '/^void CheckUniformPlanesWithoutHtile/,/^}/p' …/NativeMultisampleDepth.cpp)
git status --porcelain
Check Result
git diff --check clean
check_conventions.py 0 errors, 1 warning: the debt entry at docs/dev/debt/libSceAgcDriver.md:69 has 3982 characters (unchanged)
Configure / build / libs (script) ok
Selected tests (script, 2230 run) 0 new failures, 0 timeouts. 7 known failures also fail on main: agc_driver_division, the denormal-mode tests, vector_constant_factor_tininess and unwrap_self_…
Skips (script) 114, all expected according to check_skips.py
Validation (script, 770 tests, layer loaded in 769, none missing) 1 test with a VUID not in the baseline: agc_driver_native_depth_uniform_planes, a test the baseline did not run. It comes from main; details below
Focused set (18 tests) 17 passed. 1 skipped: agc_driver_native_depth_bda_clear, which skips on lavapipe on main too
Where the VUID-vkCmdDispatch-groupCountX-00386 comes from
Native D32S8 without HTILE, samples=4: uniform planes imported and sampled, other planes refused
Validation Error: [ VUID-vkCmdDispatch-groupCountX-00386 ] | MessageID = 0x8e927036
vkCmdDispatch(): groupCountX (69144) exceeds device limit maxComputeWorkGroupCount[0] (65535).
… (4 times)
Native D32S8 without HTILE, samples=8: uniform planes imported and sampled, other planes refused
  • 69144 = 129 × 67 × 8. That is the test-side fetch.Run(batch.Handle(), extent.width * extent.height * samples) in CheckUniformPlanesWithoutHtile, which issues one workgroup per sample. It runs twice per value pair: once for the depth fetch and once for the stencil fetch.
  • That function came from main with #14005. It is byte-identical in the merged tree (the diff above prints nothing).
  • None of the PR's dispatches run for this owner: PublishToGuest refuses before its readback.
  • So this is not a finding against this PR. It belongs to #14005's test on main, which should split the dispatch across X/Y.

I tried a second check: restore main's versions of the PR's files and rebuild, to rerun the test on main directly. The build tree could not be regenerated in this sandbox: configure_file fails with "Operation not permitted". I restored the merged files without rebuilding anything, so the binaries I tested are the script's build of the merged tree. git status --porcelain is empty.

Previous findings

  1. NoteDepthSurfaceWrite throws for every multisample depth draw when no active surface matches (now DepthSurface.cpp:2741). Still open, non-blocking. The code is unchanged and the description still does not mention this throw.
  2. Unmeasured capture cost on the draw path: NoteHostWrite (now DepthSurface.cpp:792-808) copies every plane on each false-to-true flip. Still open, non-blocking. It now also runs for #14005's owners without HTILE, which can never be published (see the new finding), so that copy buys nothing for them. There are still no frame-time numbers.
  3. The debt entry does not mention the "another identity" refusal (now DepthSurface.cpp:2848), and the entry is 3982 characters. Still open, non-blocking. The debt file still does not mention it.

New findings

Blocking

None.

Non-blocking

  • Owners without HTILE now reach PublishToGuest and are refused, but neither the debt entry nor the description says so (core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:2170, docs/dev/debt/libSceAgcDriver.md:68).
    • In the 2026-11-02 reply to hugodearaujo, the author said "an owner without HTILE cannot exist on this branch". That was true then. With #14005 merged into main, a two-plane D32S8 owner now exists.
    • On a guest read after a draw, such an owner throws sample-preserving guest publication of native multisample depth is not implemented for this owner.
    • The new debt entry lists only "D16/D32-only owners" among the owners that throw.
    • Suggested fix: add "D32S8 owners without HTILE" to that list. Alternatively, now that the two-plane owner and its --uniform-planes fixture are on main, take hugodearaujo's two-plane change (skip the HTILE rewrite when there is none) as a follow-up.
    • Either way, skip the capture in NoteHostWrite for owners that cannot be published.

Not verified

  • Running agc_driver_native_depth_uniform_planes on main directly: the build tree could not be regenerated in this sandbox. Its VUID is attributed to main by reading the code: the function that emits it is unchanged from main, and the dispatch size matches the test's own fetch.
  • The Z_X retile, the pipe-bank XOR and the HTILE word expansion against console behaviour. They are only checked against this driver's own import path.
  • The title runs (PPSA19015, PPSA06866) and any hardware GPU: this machine only has lavapipe.
  • The recordDispatch / StartDrawPass ordering still has no test. I checked it only by reading the merged code.
  • No negative control this round. The PR's tests are unchanged and the new commit is only a merge. In an earlier round, two production mutations each made agc_driver_native_depth_publication fail.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5749649071 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13021#pullrequestreview-5749649071). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T09:20:44Z. **Review:** APPROVED --- # Re-checked — approved The only change since my last review is a merge of `main` (`0180bafe62`). It resolves the conflicts in `GuestMemory.cpp` and the AGC debt file correctly, and it brings in #14005's D32S8 owner without HTILE. The PR now refuses that owner cleanly. The focused depth tests pass. The one new validation message the script reported comes from `main`'s own test, not from this PR. ## What changed since my last review - The PR's five commits (`0a3252876f` to `f6e7798ba9`) are unchanged. The range-diff shows `=` for each one. - One new commit, `0180bafe62`, merges `origin/main` `4f41f4c375`. It resolves conflicts in `Execution/src/GuestMemory.cpp` and `docs/dev/debt/libSceAgcDriver.md`: - `GuestMemory.cpp`: `main` (#6185) split `WriteChanged` into a static `writeChanged(..., keepGuest)` and added `WriteChangedKeepingGuest`. The merge keeps both of `main`'s functions unchanged. The PR's own additions sit beside them: `cpuUnchanged`, `UnchangedSinceLastCollect`, the `walked` parameter of `rangeUnchanged` (default `true`, so existing callers behave as before), `storeOwn`'s `complete` parameter (default `true`) and `WriteChangedIfHeld`. `WriteChanged` is still `main`'s for every other caller. - Debt file: the merge keeps `main`'s edits to the "Native multisampled depth sampling" entry. It also keeps the PR's dropped "Guest publication of a written surface" phrase, which was oneandonlydean's earlier request, and the new "Native D32S8 guest publication" entry. - From `main`, #14005 adds `uniformPlaneTarget`: D32S8 with a separate stencil plane and no HTILE, whose `sampling.initial` has 2 ranges (`{depth, stencil}`). I checked how the PR handles these owners: - `NoteHostWrite` captures both ranges (`DepthSurface.cpp:797`). - `PublishToGuest` then refuses with `... not implemented for this owner`, because `publication.size() == 3u` fails (`DepthSurface.cpp:2170`). This happens before any readback dispatch. - `RebasePublication(2u)` and `RebasePublication(1u)` cannot index out of range for these owners. The stencil-fill path that sets `stencilClearGeneration` requires `sampling.initial.size() > 2u`. Both places that set `clearGeneration` need an HTILE range, and this owner has none. - So a guest read of a written owner without HTILE still throws, as it does on `main`, only with a different message. - No author replies and no description edits since my last review. ## What I ran Head `0180bafe62f4dee4cdc04aee0d565be70c838460`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged `--no-ff` (tree `d8eebd68d272cf9c6f239d7842d913b1dfd5119b`) in a clean worktree. The machine is a Debian 13 VM with 2× Xeon Gold 6136, GCC 14.2.0 and lavapipe (Mesa 26.1.6, LLVM 19). It has no GPU. ``` git show --stat 0180bafe62f4dee4cdc04aee0d565be70c838460 git diff 4f41f4c375f5abb487dbd184fbc150f31994d762 d8eebd68d272cf9c6f239d7842d913b1dfd5119b -- core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp docs/dev/debt/libSceAgcDriver.md git diff d1ae628bc2f62459cce1e9872ba5632c938c71f2 4f41f4c375f5abb487dbd184fbc150f31994d762 -- core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...0180bafe62f4dee4cdc04aee0d565be70c838460 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_native_depth|agc_driver_native_multisample_depth|multisample_retirement|depth_plane_fill|depth_surface_from_storage|stencil_write_intent" VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$" diff <(git show 4f41f4c375:…/NativeMultisampleDepth.cpp | sed -n '/^void CheckUniformPlanesWithoutHtile/,/^}/p') <(sed -n '/^void CheckUniformPlanesWithoutHtile/,/^}/p' …/NativeMultisampleDepth.cpp) git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | 0 errors, 1 warning: the debt entry at `docs/dev/debt/libSceAgcDriver.md:69` has 3982 characters (unchanged) | | Configure / build / `libs` (script) | ok | | Selected tests (script, 2230 run) | 0 new failures, 0 timeouts. 7 known failures also fail on `main`: `agc_driver_division`, the denormal-mode tests, `vector_constant_factor_tininess` and `unwrap_self_…` | | Skips (script) | 114, all expected according to `check_skips.py` | | Validation (script, 770 tests, layer loaded in 769, none missing) | 1 test with a VUID not in the baseline: `agc_driver_native_depth_uniform_planes`, a test the baseline did not run. It comes from `main`; details below | | Focused set (18 tests) | 17 passed. 1 skipped: `agc_driver_native_depth_bda_clear`, which skips on lavapipe on `main` too | <details><summary>Where the <code>VUID-vkCmdDispatch-groupCountX-00386</code> comes from</summary> ``` Native D32S8 without HTILE, samples=4: uniform planes imported and sampled, other planes refused Validation Error: [ VUID-vkCmdDispatch-groupCountX-00386 ] | MessageID = 0x8e927036 vkCmdDispatch(): groupCountX (69144) exceeds device limit maxComputeWorkGroupCount[0] (65535). … (4 times) Native D32S8 without HTILE, samples=8: uniform planes imported and sampled, other planes refused ``` - 69144 = 129 × 67 × 8. That is the test-side `fetch.Run(batch.Handle(), extent.width * extent.height * samples)` in `CheckUniformPlanesWithoutHtile`, which issues one workgroup per sample. It runs twice per value pair: once for the depth fetch and once for the stencil fetch. - That function came from `main` with #14005. It is byte-identical in the merged tree (the `diff` above prints nothing). - None of the PR's dispatches run for this owner: `PublishToGuest` refuses before its readback. - So this is not a finding against this PR. It belongs to #14005's test on `main`, which should split the dispatch across X/Y. </details> I tried a second check: restore `main`'s versions of the PR's files and rebuild, to rerun the test on `main` directly. The build tree could not be regenerated in this sandbox: `configure_file` fails with "Operation not permitted". I restored the merged files without rebuilding anything, so the binaries I tested are the script's build of the merged tree. `git status --porcelain` is empty. ## Previous findings 1. `NoteDepthSurfaceWrite` throws for every multisample depth draw when no active surface matches (now `DepthSurface.cpp:2741`). **Still open, non-blocking.** The code is unchanged and the description still does not mention this throw. 2. Unmeasured capture cost on the draw path: `NoteHostWrite` (now `DepthSurface.cpp:792-808`) copies every plane on each false-to-true flip. **Still open, non-blocking.** It now also runs for #14005's owners without HTILE, which can never be published (see the new finding), so that copy buys nothing for them. There are still no frame-time numbers. 3. The debt entry does not mention the "another identity" refusal (now `DepthSurface.cpp:2848`), and the entry is 3982 characters. **Still open, non-blocking.** The debt file still does not mention it. ## New findings ### Blocking None. ### Non-blocking - **Owners without HTILE now reach `PublishToGuest` and are refused, but neither the debt entry nor the description says so** (`core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:2170`, `docs/dev/debt/libSceAgcDriver.md:68`). - In the 2026-11-02 reply to hugodearaujo, the author said "an owner without HTILE cannot exist on this branch". That was true then. With #14005 merged into `main`, a two-plane D32S8 owner now exists. - On a guest read after a draw, such an owner throws `sample-preserving guest publication of native multisample depth is not implemented for this owner`. - The new debt entry lists only "D16/D32-only owners" among the owners that throw. - Suggested fix: add "D32S8 owners without HTILE" to that list. Alternatively, now that the two-plane owner and its `--uniform-planes` fixture are on `main`, take hugodearaujo's two-plane change (skip the HTILE rewrite when there is none) as a follow-up. - Either way, skip the capture in `NoteHostWrite` for owners that cannot be published. ## Not verified - Running `agc_driver_native_depth_uniform_planes` on `main` directly: the build tree could not be regenerated in this sandbox. Its VUID is attributed to `main` by reading the code: the function that emits it is unchanged from `main`, and the dispatch size matches the test's own fetch. - The Z_X retile, the pipe-bank XOR and the HTILE word expansion against console behaviour. They are only checked against this driver's own import path. - The title runs (PPSA19015, PPSA06866) and any hardware GPU: this machine only has lavapipe. - The `recordDispatch` / `StartDrawPass` ordering still has no test. I checked it only by reading the merged code. - No negative control this round. The PR's tests are unchanged and the new commit is only a merge. In an earlier round, two production mutations each made `agc_driver_native_depth_publication` fail. <!-- anyps5-bots job=3244 head=0180bafe62f4dee4cdc04aee0d565be70c838460 -->
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!13021
No description provided.