fix(agc): copy only the viewed slices of a 2D array over a depth surface #22778

Merged
milescoviello merged 2 commits from upstream-pr/22778 into main 2026-11-27 15:02:22 +00:00
milescoviello commented 2026-11-18 08:47:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-18T08:47:09Z.


What

DepthSurfaceTexture builds a plane copy when a 2D array texture sits over a depth surface. It built that copy from slice 0 to the view's last slice, whatever the view's base slice was. For each slice with no depth surface, DepthPlaneCopy::Refresh uploads the guest layer through its own host buffer, and the staging buffer covers every layer. A view of one slice far into the array therefore allocated, uploaded and staged every slice before it.

Crimson Desert (PPSA25286) hits this about two minutes into a warm-cache boot. A diagnostic print at the copy's creation shows the descriptor:

depth surface 0x20dcb80000 2048x2048 vk format 130 samples 1: texture 0x20dcb80000 2048x2048 format 22 dimension 2 tile 4 base array 327 last array 327 layers 328, 1 slices held, 5248 MiB

That's one viewed slice in a 328-layer, 5248 MiB copy. In another run the texture cache was asked for 14432 MiB for the same kind of copy. With the per-layer host uploads, the process's RSS reached 29 GB. Three such runs on the same build and cache ended at 100 s and 125 s (killed at the 22 GB cgroup limit) and at 124 s (host memory guard).

Changes:

  • The plane copy is built from ViewedArrayWindow of the view, the helper cachedTexture already uses for arrays. It moves the base to the first viewed slice, rounded down to the swizzle's slice alignment, and shortens the array to match. The slices, the copy's key, its layer count and the Refresh view all come from that window, so the copy holds only slices the view can read.
  • A copy of the whole array that already exists and holds the view's slices is still used. Views of smaller ranges of an array keep sharing one copy, as SharedLayerRanges checks.
  • Cube views and views that start at slice 0 are unchanged.

The viewed slices get the same contents as before. Only the slices outside the view are no longer copied.

Tested

11-24, merge e83fe3cf0a (main adacf0bd83 merged into the branch): #26579 and #25871 (birdmarty) made DepthSurfaceTexture sample stencil planes too, from base.stencilAddress with stencilSlice and the stencil copy format, which conflicted with this PR's moved copy-key code. The resolution keeps both: the copy key, the shared-copy lookup and the slice addresses start from the plane's address (stencil or depth), offset by the viewed window (viewed.baseAddress - resource.baseAddress), and the stencil format and mirror sync come from main unchanged. Linux, the same setup as below:

  • the 23 agc_driver_depth_plane_*, agc_driver_depth_surface_*, agc_driver_native_multisample_depth* and agc_driver_graphics tests, which include birdmarty's new stencil-plane cases, pass in 3 of 3 runs;
  • negative control: with main's DepthSurface.cpp, agc_driver_depth_plane_guest_layers fails with sampling only the last slice of the array read 2 times from the guest layers before it.
  • mihiii1337's Windows run of this head (Windows 11 26300, WinLibs GCC 15.2.0, Release, Vulkan validation with synchronization validation): DepthPlaneGuestLayers, DepthPlaneSampling, NativeMultisampleDepth and DepthPlaneSampling_evicting pass in 3 of 3 rounds on an Intel UHD (driver 101.6127) and on an RTX 4070 Laptop (621.01), with no VUID- or SYNC-HAZARD messages. A local stencil-array variant of theirs (not in this PR), whose view starts at slice 1, passes on both GPUs and fails on the RTX when only viewedAddress is put back to planeAddress, so the adjusted stencil address is exercised. They also note that #25534 conflicts with this PR around DepthPlaneCopy; whichever lands second needs a rebase that keeps both.

Earlier heads:

Linux (Ubuntu 26.04.1, kernel 7.0), GCC 15.2, Ninja, Release, -DBUILD_TESTING=ON, RTX 4070 Ti (NVIDIA 615.71.09):

  • agc_driver_depth_plane_guest_layers gains ViewedSliceWindow. A 4-slice array has a depth surface at slice 0 only, and a view of slice 3 alone must:

    • read none of the guest layers 1 and 2;
    • copy nothing from the slice-0 surface and fill the copy once;
    • view one layer.
  • The 21 agc_driver_depth_plane_* and agc_driver_depth_surface_* tests pass, 3 runs.

  • Negative control: with main's DepthSurface.cpp and the new test, only agc_driver_depth_plane_guest_layers fails, with sampling only the last slice of the array read 2 times from the guest layers before it.

  • domx4q's run with the Khronos validation layer (Arch Linux, GCC 16.2.1, RTX 4090, NVIDIA 620.70.06, layer 1.4.363.1), this head merged onto main 1ccc399b17: the 21 tests pass on both main and this PR with no VUID- errors, and the negative control fails agc_driver_depth_plane_guest_layers in 2 of 2 runs with the same message.

  • maskym's Windows run (Windows 11, RTX 2070 SUPER, WinLibs GCC 15.2.0), this head merged alone onto main 6286d36449: ctest -R '^(agc|guest_video_out|video_out|pad_sdl)' with the Khronos validation layer passes 2050 of 2054 on both trees, with the same VUID- set. The failures on this PR's tree also fail on main there.

  • git merge-tree against main is clean. Of the 42 open PRs that edit DepthSurface.cpp or DepthPlaneGuestLayers.cpp, 23 merge with this branch cleanly. 18 others already conflict with main on their own.

  • #22531 (bagodees, opened first) is the remaining one. It also changes how plane copies are allocated and edits the same line of DepthSurfaceTexture, so the two conflict textually. They cover different cases:

    • #22531 leaves an unbacked tail of the viewed range unbound in a sparse copy (a view from slice 0 with a large LAST_ARRAY);
    • this PR drops the slices before a view's base slice, which the view never reads.

    The two combine: the window would go first, and #22531's backed-slice count would apply inside it. If #22531 merges first, I'll rebase this onto it.

  • tools/check_conventions.py passes on the branch and this body.

Crimson Desert (PPSA25286), warm shader cache, APS5_NET_DISCONNECTED=1, 22 GB cap. Both arms are main 604828bd44 + #22534 + #22609 + #22690 + diagnostic prints; the second adds this change:

build runs end
without this change 3 killed at 100 s and 125 s (22 GB cgroup cap) and 124 s (host memory guard). Two logged a 5248 MiB plane copy or a 14432 MiB texture cache release request just before; the third reached 29 GB RSS before the kill
with this change 6 one ended at 355 s in a segfault in title code under an AvPlayer event callback (a separate stop, 1 of these 6 runs); five ran to the 600 s timeout (579 to 623 presents) and played the title's ui/media/titleview_*.mp4 videos. None asked the texture caches for more than 1 GiB

Presents ran at about 1 to 2 per second in both arms, so this changes how long the title runs, not its frame rate. The five 600 s runs also carried a diagnostic print in libSceAvPlayer (logging only), and no frames were dumped, so I'm not claiming a new screen.

The same A/B on current main, without the diagnostic prints: base 452e171f80 (main 6119c53c4b + #22534 + #22609) and fix 1e1230ed68 (base + this change), same warm cache, cap and presses, interleaved:

build run end peak RSS host-placed device buffers
base 1 604 s timeout, 51 presents 19.1 GB none logged
fix 1 segfault at 125 s, in the same title code under the AvPlayer event callback as above 18.8 GB none logged
base 2 killed at 130 s by the 22 GB cap, just after 4831838208 bytes placed in host memory type 0 (one 4608 MiB buffer) 26.7 GB 1, 4608 MiB
fix 2 902 s timeout, 1029 presents 20.7 GB 8, 292 MiB in all

Three more fix runs with logging-only prints in libSceAvPlayer (e9b89ad8ce) ran to the 600 s timeout (553 to 604 presents, peak RSS 19.9 to 20.7 GB). They placed two to eight 832 MiB buffers in host memory, 1664 to 6656 MiB in all, and stayed under the cap. No fix run logged a single buffer near the base run's 4608 MiB.

  • Colewiz7's RADV run of b92cb7f02c merged onto main d89f26516c (Linux 7.3.4, GCC 16.2.1, Mesa 26.2.6, RX 7900 XT and the Ryzen 7 7800X3D iGPU, Khronos validation layer 1.4.363.1): no new failures against main (6171 tests on the 7900 XT, the 2007 GPU tests on the iGPU, and ^agc with the layer), and no VUID- or SYNC-HAZARD lines.

Helldiverr's Windows run of b92cb7f02c merged onto main c3aec4c2f3, AMD Radeon AI PRO R9700 (RDNA4, driver 32.0.31044.16), WinLibs GCC 15.2, Release, with the Khronos validation layer:

  • The 21 depth plane and depth surface tests pass on main and in each of 3 runs at the head.
  • With main's DepthSurface.cpp, the new case fails 3 of 3 with the message above.
  • 0 VUID- and 0 SYNC-HAZARD lines in every log.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 4070 Ti (615.71.09), Linux, AMD RX 7900 XT and the Ryzen 7 7800X3D iGPU (gfx1036) (Linux, RADV, Colewiz7); AMD Radeon AI PRO R9700 (RDNA4), Windows 11 (Helldiverr)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5372766362 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22778). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-11-18T08:47:09Z. --- ### What `DepthSurfaceTexture` builds a plane copy when a 2D array texture sits over a depth surface. It built that copy from slice 0 to the view's last slice, whatever the view's base slice was. For each slice with no depth surface, `DepthPlaneCopy::Refresh` uploads the guest layer through its own host buffer, and the staging buffer covers every layer. A view of one slice far into the array therefore allocated, uploaded and staged every slice before it. Crimson Desert (PPSA25286) hits this about two minutes into a warm-cache boot. A diagnostic print at the copy's creation shows the descriptor: ``` depth surface 0x20dcb80000 2048x2048 vk format 130 samples 1: texture 0x20dcb80000 2048x2048 format 22 dimension 2 tile 4 base array 327 last array 327 layers 328, 1 slices held, 5248 MiB ``` That's one viewed slice in a 328-layer, 5248 MiB copy. In another run the texture cache was asked for 14432 MiB for the same kind of copy. With the per-layer host uploads, the process's RSS reached 29 GB. Three such runs on the same build and cache ended at 100 s and 125 s (killed at the 22 GB cgroup limit) and at 124 s (host memory guard). Changes: - The plane copy is built from `ViewedArrayWindow` of the view, the helper `cachedTexture` already uses for arrays. It moves the base to the first viewed slice, rounded down to the swizzle's slice alignment, and shortens the array to match. The slices, the copy's key, its layer count and the `Refresh` view all come from that window, so the copy holds only slices the view can read. - A copy of the whole array that already exists and holds the view's slices is still used. Views of smaller ranges of an array keep sharing one copy, as `SharedLayerRanges` checks. - Cube views and views that start at slice 0 are unchanged. The viewed slices get the same contents as before. Only the slices outside the view are no longer copied. ### Tested **11-24, merge `e83fe3cf0a` (`main` `adacf0bd83` merged into the branch):** #26579 and #25871 (birdmarty) made `DepthSurfaceTexture` sample stencil planes too, from `base.stencilAddress` with `stencilSlice` and the stencil copy format, which conflicted with this PR's moved copy-key code. The resolution keeps both: the copy key, the shared-copy lookup and the slice addresses start from the plane's address (stencil or depth), offset by the viewed window (`viewed.baseAddress - resource.baseAddress`), and the stencil format and mirror sync come from `main` unchanged. Linux, the same setup as below: - the 23 `agc_driver_depth_plane_*`, `agc_driver_depth_surface_*`, `agc_driver_native_multisample_depth*` and `agc_driver_graphics` tests, which include birdmarty's new stencil-plane cases, pass in 3 of 3 runs; - negative control: with `main`'s `DepthSurface.cpp`, `agc_driver_depth_plane_guest_layers` fails with `sampling only the last slice of the array read 2 times from the guest layers before it`. - mihiii1337's [Windows run](https://github.com/boykopovar/AnyPS5/pull/22778#pullrequestreview-6046740078) of this head (Windows 11 26300, WinLibs GCC 15.2.0, Release, Vulkan validation with synchronization validation): `DepthPlaneGuestLayers`, `DepthPlaneSampling`, `NativeMultisampleDepth` and `DepthPlaneSampling_evicting` pass in 3 of 3 rounds on an Intel UHD (driver 101.6127) and on an RTX 4070 Laptop (621.01), with no `VUID-` or `SYNC-HAZARD` messages. A local stencil-array variant of theirs (not in this PR), whose view starts at slice 1, passes on both GPUs and fails on the RTX when only `viewedAddress` is put back to `planeAddress`, so the adjusted stencil address is exercised. They also note that #25534 conflicts with this PR around `DepthPlaneCopy`; whichever lands second needs a rebase that keeps both. Earlier heads: Linux (Ubuntu 26.04.1, kernel 7.0), GCC 15.2, Ninja, Release, `-DBUILD_TESTING=ON`, RTX 4070 Ti (NVIDIA 615.71.09): - `agc_driver_depth_plane_guest_layers` gains `ViewedSliceWindow`. A 4-slice array has a depth surface at slice 0 only, and a view of slice 3 alone must: - read none of the guest layers 1 and 2; - copy nothing from the slice-0 surface and fill the copy once; - view one layer. - The 21 `agc_driver_depth_plane_*` and `agc_driver_depth_surface_*` tests pass, 3 runs. - Negative control: with `main`'s `DepthSurface.cpp` and the new test, only `agc_driver_depth_plane_guest_layers` fails, with `sampling only the last slice of the array read 2 times from the guest layers before it`. - domx4q's [run](https://github.com/boykopovar/AnyPS5/pull/22778#issuecomment-6974882780) with the Khronos validation layer (Arch Linux, GCC 16.2.1, RTX 4090, NVIDIA 620.70.06, layer 1.4.363.1), this head merged onto `main` `1ccc399b17`: the 21 tests pass on both `main` and this PR with no `VUID-` errors, and the negative control fails `agc_driver_depth_plane_guest_layers` in 2 of 2 runs with the same message. - maskym's [Windows run](https://github.com/boykopovar/AnyPS5/pull/22778#issuecomment-6986481660) (Windows 11, RTX 2070 SUPER, WinLibs GCC 15.2.0), this head merged alone onto `main` `6286d36449`: `ctest -R '^(agc|guest_video_out|video_out|pad_sdl)'` with the Khronos validation layer passes 2050 of 2054 on both trees, with the same `VUID-` set. The failures on this PR's tree also fail on `main` there. - `git merge-tree` against `main` is clean. Of the 42 open PRs that edit `DepthSurface.cpp` or `DepthPlaneGuestLayers.cpp`, 23 merge with this branch cleanly. 18 others already conflict with `main` on their own. - #22531 (bagodees, opened first) is the remaining one. It also changes how plane copies are allocated and edits the same line of `DepthSurfaceTexture`, so the two conflict textually. They cover different cases: - #22531 leaves an unbacked tail of the viewed range unbound in a sparse copy (a view from slice 0 with a large `LAST_ARRAY`); - this PR drops the slices before a view's base slice, which the view never reads. The two combine: the window would go first, and #22531's backed-slice count would apply inside it. If #22531 merges first, I'll rebase this onto it. - `tools/check_conventions.py` passes on the branch and this body. Crimson Desert (PPSA25286), warm shader cache, `APS5_NET_DISCONNECTED=1`, 22 GB cap. Both arms are `main` `604828bd44` + #22534 + #22609 + #22690 + diagnostic prints; the second adds this change: | build | runs | end | |---|---|---| | without this change | 3 | killed at 100 s and 125 s (22 GB cgroup cap) and 124 s (host memory guard). Two logged a 5248 MiB plane copy or a 14432 MiB texture cache release request just before; the third reached 29 GB RSS before the kill | | with this change | 6 | one ended at 355 s in a segfault in title code under an AvPlayer event callback (a separate stop, 1 of these 6 runs); five ran to the 600 s timeout (579 to 623 presents) and played the title's `ui/media/titleview_*.mp4` videos. None asked the texture caches for more than 1 GiB | Presents ran at about 1 to 2 per second in both arms, so this changes how long the title runs, not its frame rate. The five 600 s runs also carried a diagnostic print in libSceAvPlayer (logging only), and no frames were dumped, so I'm not claiming a new screen. The same A/B on current `main`, without the diagnostic prints: base `452e171f80` (`main` `6119c53c4b` + #22534 + #22609) and fix `1e1230ed68` (base + this change), same warm cache, cap and presses, interleaved: | build | run | end | peak RSS | host-placed device buffers | |---|---|---|---|---| | base | 1 | 604 s timeout, 51 presents | 19.1 GB | none logged | | fix | 1 | segfault at 125 s, in the same title code under the AvPlayer event callback as above | 18.8 GB | none logged | | base | 2 | killed at 130 s by the 22 GB cap, just after `4831838208 bytes placed in host memory type 0` (one 4608 MiB buffer) | 26.7 GB | 1, 4608 MiB | | fix | 2 | 902 s timeout, 1029 presents | 20.7 GB | 8, 292 MiB in all | Three more fix runs with logging-only prints in libSceAvPlayer (`e9b89ad8ce`) ran to the 600 s timeout (553 to 604 presents, peak RSS 19.9 to 20.7 GB). They placed two to eight 832 MiB buffers in host memory, 1664 to 6656 MiB in all, and stayed under the cap. No fix run logged a single buffer near the base run's 4608 MiB. - Colewiz7's [RADV run](https://github.com/boykopovar/AnyPS5/pull/22778#issuecomment-6997633426) of `b92cb7f02c` merged onto `main` `d89f26516c` (Linux 7.3.4, GCC 16.2.1, Mesa 26.2.6, RX 7900 XT and the Ryzen 7 7800X3D iGPU, Khronos validation layer 1.4.363.1): no new failures against `main` (6171 tests on the 7900 XT, the 2007 GPU tests on the iGPU, and `^agc` with the layer), and no `VUID-` or `SYNC-HAZARD` lines. [Helldiverr's Windows run](https://github.com/boykopovar/AnyPS5/pull/22778#issuecomment-7106605335) of `b92cb7f02c` merged onto `main` `c3aec4c2f3`, AMD Radeon AI PRO R9700 (RDNA4, driver 32.0.31044.16), WinLibs GCC 15.2, Release, with the Khronos validation layer: - The 21 depth plane and depth surface tests pass on `main` and in each of 3 runs at the head. - With `main`'s `DepthSurface.cpp`, the new case fails 3 of 3 with the message above. - 0 `VUID-` and 0 `SYNC-HAZARD` lines in every log. ### Checklist - [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) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 4070 Ti (615.71.09), Linux, AMD RX 7900 XT and the Ryzen 7 7800X3D iGPU (gfx1036) (Linux, RADV, Colewiz7); AMD Radeon AI PRO R9700 (RDNA4), Windows 11 (Helldiverr) - [x] AI-assisted: yes
MarcZX10 commented 2026-11-19 05:26:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T05:26:09Z.

Review: APPROVED


Reviewed — looks good

The change limits depth plane copies to the viewed array window, and the inspected implementation and regression test support that behavior.

What I ran

Head: b92cb7f02cf4e23993bce2550fe6669d35613644. I read the prepared diff and changed code through repo_read.py; I ran no commands or tests. Test results in the description are author or CI reports.

Results

Check Result Note
Diff and changed lines passed Both changed files inspected
Tests not run Results reported by author and CI
Repository file coverage passed All files marked reviewed were read

Findings

Blocking

None.

Non-blocking

None.

Sources

The relevant slice-window behavior is implemented in TextureTiling.cpp, and the copy refresh uses the supplied resource window in DepthSurface.cpp.

Not verified

No tests were run in this review. I read DepthSurface.cpp and DepthPlaneGuestLayers.cpp; files.json was not provided in the review folder, so exclusions listed there could not be checked. The prepared manifest lists both changed files as included, and all added lines in each were read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5969760376 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22778#pullrequestreview-5969760376). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T05:26:09Z. **Review:** APPROVED --- # Reviewed — looks good The change limits depth plane copies to the viewed array window, and the inspected implementation and regression test support that behavior. ## What I ran Head: `b92cb7f02cf4e23993bce2550fe6669d35613644`. I read the prepared diff and changed code through `repo_read.py`; I ran no commands or tests. Test results in the description are author or CI reports. ## Results | Check | Result | Note | |---|---|---| | Diff and changed lines | passed | Both changed files inspected | | Tests | not run | Results reported by author and CI | | Repository file coverage | passed | All files marked reviewed were read | ## Findings ### Blocking None. ### Non-blocking None. ## Sources The relevant slice-window behavior is implemented in `TextureTiling.cpp`, and the copy refresh uses the supplied resource window in `DepthSurface.cpp`. ## Not verified No tests were run in this review. I read `DepthSurface.cpp` and `DepthPlaneGuestLayers.cpp`; `files.json` was not provided in the review folder, so exclusions listed there could not be checked. The prepared manifest lists both changed files as included, and all added lines in each were read. ## To get this to a good state Nothing is required.
mihiii1337 commented 2026-11-24 20:21:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-24T20:21:31Z.

Review: APPROVED


Approved at exact head e83fe3cf0aec4aeea72ac46c432d2c3d168defae after a fresh Windows build, source/merge-resolution review, and physical Intel + NVIDIA validation.

The merge reconciliation looks consistent: the whole-plane lookup remains keyed by the original depth/stencil plane address, while a narrowed array view uses its adjusted address for slice discovery and its copy key. The stencil-specific format/address, per-slice synchronization, reuse callback, and copy eviction path remain intact.

Hardware setup: Windows 11 build 26300, Release, WinLibs GCC 15.2.0 r7, Vulkan validation 1.4.369 with synchronization validation and loader layer tracing. Each GPU was pinned with VK_DRIVER_FILES only; shader cache and pipeline journal were disabled and ANYPS5_REQUIRE_VULKAN=1 was set.

  • Intel UHD 8086:a78b, driver 101.6127, Vulkan 1.3.295: DepthPlaneGuestLayers, DepthPlaneSampling, NativeMultisampleDepth, and DepthPlaneSampling_evicting passed in 3/3 rounds (12/12 CTest outcomes). Every Vulkan process selected the Intel device and inserted the validation layer; 0 VUID-, 0 SYNC-HAZARD, no skips.
  • NVIDIA RTX 4070 Laptop 10de:2860, driver 621.01, Vulkan 1.4.357: the same matrix passed in 3/3 rounds (12/12 outcomes), with the RTX and validation layer confirmed in every process; 0 VUID-, 0 SYNC-HAZARD, no skips.

I also made a local test-only coverage variant, not part of this PR: StencilArrayCase used the compatible standard 64 KiB swizzle and performed the cold baseArray=1 reads before creating a whole-array copy. That makes the viewed stencil address advance by one 64 KiB layer. Both normal and evicting tests passed in 3/3 rounds on each GPU (6/6 outcomes per GPU), with the same device/layer and validation checks. As a negative control, changing only viewedAddress back to planeAddress made the RTX run fail at the intended first marker: it read 0x5a instead of 0xa5. This demonstrates that the variant actually exercises the adjusted-address path rather than merely a cold cache path.

Both local source changes were then restored byte-for-byte to the PR blobs, the target was rebuilt, the tracked worktree was clean, and both sampling tests passed once more on each GPU with validation (4/4 outcomes, 0 VUID/SYNC).

Non-blocking integration note: #25534 is individually mergeable but pairwise conflicts with this PR around DepthPlaneCopy; whichever lands second will need a rebase that preserves both the narrowed viewed-layer/address logic and the copy replacement/eviction behavior.

No PS5/title run was performed.

AI-assisted: yes (OpenAI Codex); the exact heads, source blobs, device selection, layer insertion, outputs, and restoration were checked directly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6046740078 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22778#pullrequestreview-6046740078). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-24T20:21:31Z. **Review:** APPROVED --- Approved at exact head `e83fe3cf0aec4aeea72ac46c432d2c3d168defae` after a fresh Windows build, source/merge-resolution review, and physical Intel + NVIDIA validation. The merge reconciliation looks consistent: the whole-plane lookup remains keyed by the original depth/stencil plane address, while a narrowed array view uses its adjusted address for slice discovery and its copy key. The stencil-specific format/address, per-slice synchronization, reuse callback, and copy eviction path remain intact. Hardware setup: Windows 11 build 26300, Release, WinLibs GCC 15.2.0 r7, Vulkan validation 1.4.369 with synchronization validation and loader layer tracing. Each GPU was pinned with `VK_DRIVER_FILES` only; shader cache and pipeline journal were disabled and `ANYPS5_REQUIRE_VULKAN=1` was set. - Intel UHD `8086:a78b`, driver 101.6127, Vulkan 1.3.295: `DepthPlaneGuestLayers`, `DepthPlaneSampling`, `NativeMultisampleDepth`, and `DepthPlaneSampling_evicting` passed in 3/3 rounds (12/12 CTest outcomes). Every Vulkan process selected the Intel device and inserted the validation layer; 0 `VUID-`, 0 `SYNC-HAZARD`, no skips. - NVIDIA RTX 4070 Laptop `10de:2860`, driver 621.01, Vulkan 1.4.357: the same matrix passed in 3/3 rounds (12/12 outcomes), with the RTX and validation layer confirmed in every process; 0 `VUID-`, 0 `SYNC-HAZARD`, no skips. I also made a local test-only coverage variant, not part of this PR: `StencilArrayCase` used the compatible standard 64 KiB swizzle and performed the cold `baseArray=1` reads before creating a whole-array copy. That makes the viewed stencil address advance by one 64 KiB layer. Both normal and evicting tests passed in 3/3 rounds on each GPU (6/6 outcomes per GPU), with the same device/layer and validation checks. As a negative control, changing only `viewedAddress` back to `planeAddress` made the RTX run fail at the intended first marker: it read `0x5a` instead of `0xa5`. This demonstrates that the variant actually exercises the adjusted-address path rather than merely a cold cache path. Both local source changes were then restored byte-for-byte to the PR blobs, the target was rebuilt, the tracked worktree was clean, and both sampling tests passed once more on each GPU with validation (4/4 outcomes, 0 VUID/SYNC). Non-blocking integration note: #25534 is individually mergeable but pairwise conflicts with this PR around `DepthPlaneCopy`; whichever lands second will need a rebase that preserves both the narrowed viewed-layer/address logic and the copy replacement/eviction behavior. No PS5/title run was performed. AI-assisted: yes (OpenAI Codex); the exact heads, source blobs, device selection, layer insertion, outputs, and restoration were checked directly.
MarcZX10 commented 2026-11-25 08:54:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T08:54:15Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected changes limit depth plane copies to the viewed array window; I found no concrete blocking defect, but did not run the reported checks.

What I ran

Reviewed head e83fe3cf0aec4aeea72ac46c432d2c3d168defae using the prepared diff and repo_read.py to inspect the changed code and relevant helpers. No tests or build commands were run. The author-reported test results are not runs performed in this review.

Results

Check Result Note
Changed-code review passed Two changed files inspected
Tests and build not run Results in description are author reported
Negative control not run No local control run

Findings

Blocking

None found in the inspected changes.

Non-blocking

None.

Not verified

  • Tests, build, and runtime behavior were not run or independently confirmed.
  • The change is in DepthSurface.cpp and DepthPlaneGuestLayers.cpp; both are marked included in the manifest and relevant changed sections were read. No files were excluded in the manifest. files.json was unavailable in the review folder, so additional exclusions are not verified.
  • Test setup details and results in the PR description were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6054452672 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22778#pullrequestreview-6054452672). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T08:54:15Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected changes limit depth plane copies to the viewed array window; I found no concrete blocking defect, but did not run the reported checks. ## What I ran Reviewed head `e83fe3cf0aec4aeea72ac46c432d2c3d168defae` using the prepared diff and `repo_read.py` to inspect the changed code and relevant helpers. No tests or build commands were run. The author-reported test results are not runs performed in this review. ## Results | Check | Result | Note | |---|---|---| | Changed-code review | passed | Two changed files inspected | | Tests and build | not run | Results in description are author reported | | Negative control | not run | No local control run | ## Findings ### Blocking None found in the inspected changes. ### Non-blocking None. ## Not verified - Tests, build, and runtime behavior were not run or independently confirmed. - The change is in `DepthSurface.cpp` and `DepthPlaneGuestLayers.cpp`; both are marked included in the manifest and relevant changed sections were read. No files were excluded in the manifest. `files.json` was unavailable in the review folder, so additional exclusions are not verified. - Test setup details and results in the PR description were not independently verified. ## To get this to a good state Nothing is required.
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!22778
No description provided.