feat(agc): sample native multisampled depth attachments #5496

Merged
Amoenus merged 8 commits from upstream-pr/5496 into main 2026-10-15 08:54:19 +00:00
Amoenus commented 2026-10-13 21:08:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-13T21:08:35Z.


What

Support numeric sampling of resident D16/D32 depth attachments with 2, 4 or 8 samples, one Z_X slice/mip, and a proven initial zero/one HTILE clear. Preserve ITERATE_256, attachment identity and image lifetime, and barrier depth writes before shader reads. Sampling an attached native depth image is refused before pipeline creation.

The existing stencil byte-format filter runs before multisample routing, so a color texture at a stencil-plane address is not claimed as a depth reader. Stencil import, comparison/raw-bit/storage/array sampling, unproven guest/external GPU changes and unsupported metadata/publication transitions remain explicit refusals. Retirement and completion-proven clears are separate follow-ups (#5524/#5554).

The conditional Sonic Unleashed Recompiled PPSA99902 need and pinned title controls are documented in #3262 and bring-up #4443. This focused PR builds independently; its current head has not been replayed on the title. The retained bring-up integration contains additional work and its progress is reported separately.

Sources: PAL ITERATE_256 bit10, descriptor construction, Addrlib dimensions. HTILE restrictions follow the Mesa sources recorded in #3262 and library debt. PS5 equivalence has not been measured on a console.

Tested

Head 008f91501, base main3c87cdfda, Windows 11 Enterprise 26200, WinLibs GCC15.2.0, Release, bundled dependencies, SPIRV-Tools enabled:

  • Full Windows application/library build, patched-library validation, conventions and test registration pass.
  • Native-depth regression passes first, then14 selected groups pass once and five repetitions under each NVIDIA/AMD selector: no CTest failures/skips, slowest5.52633s repeated/5.50905s once; timeout30s.
  • Per-fixture output confirms nine runtime groups on each physical vendor. Other groups are CPU/unit evidence. Native D16/D32 ×2/4/8 samples ×zero/one clears execute12 cases per vendor, unavailable0.
  • The review follow-up adds an actual driver draw sampling its attached native depth image, and four contradictory HTILE/clear configurations: zero HTILE with clear1 in both layouts, and 0xfffc0000/0xfffffff0 with clear0.
  • Three one-line controls (delete Draw's feedback call; admit wrong zero-clear; admit wrong one-clear) each fail for the intended assertion five times per physical vendor: 30 expected failures. Controls ran on source-tree-equivalent9a74c0393. Production files were restored byte-for-byte, then the complete build and test matrix above was rerun on008f91501.
  • Requested depth_surface_reuse and guest_texture_resource cases execute through agc_driver_graphics; they are not separate CTest registrations.
  • Merge-tree check into later mainab9a47684 is clean. That merged composition is not runtime-tested. Full upstream CI still requires maintainer dispatch.

The earlier stencil-ordering control and title/source history remain in #3262. Current evidence covers Windows fixtures; Linux, a full CTest suite and an isolated title replay were not run for this head. No performance claim.

Checklist

  • Based on recent main (tested3c87; clean merge intoab9 checked); 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; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source: n/a, none added
  • Generic behaviour, not specific to one title
  • Depends on: none (#4820 merged)
  • Unblocks: PPSA99902 #4443 (conditional native-depth sampling stop; not whole-game boot)
  • GPUs tested: NVIDIA GeForce RTX5080, driver610.62/32.0.16.1062; AMD Radeon(TM) Graphics (Ryzen9950X3D integrated), driver32.0.21036.18; both Windows11 Enterprise26200
  • AI-assisted: yes, Codex; author reviewed and tested locally
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4849499371 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-13T21:08:35Z. --- ### What Support numeric sampling of resident D16/D32 depth attachments with 2, 4 or 8 samples, one Z_X slice/mip, and a proven initial zero/one HTILE clear. Preserve ITERATE_256, attachment identity and image lifetime, and barrier depth writes before shader reads. Sampling an attached native depth image is refused before pipeline creation. The existing stencil byte-format filter runs before multisample routing, so a color texture at a stencil-plane address is not claimed as a depth reader. Stencil import, comparison/raw-bit/storage/array sampling, unproven guest/external GPU changes and unsupported metadata/publication transitions remain explicit refusals. Retirement and completion-proven clears are separate follow-ups (#5524/#5554). The conditional Sonic Unleashed Recompiled **PPSA99902** need and pinned title controls are documented in [#3262](https://github.com/boykopovar/AnyPS5/issues/3262) and [bring-up #4443](https://github.com/boykopovar/AnyPS5/discussions/4443). This focused PR builds independently; its current head has not been replayed on the title. The retained bring-up integration contains additional work and its progress is reported separately. Sources: [PAL ITERATE_256 bit10](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/hw/gfxip/gfx9/chip/gfx10_sq_ko_reg.h#L384), [descriptor construction](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/hw/gfxip/gfx9/gfx9Device.cpp#L4335-L4337), [Addrlib dimensions](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/imported/addrlib/src/core/addrlib2.cpp#L1680-L1712). HTILE restrictions follow the Mesa sources recorded in #3262 and library debt. PS5 equivalence has not been measured on a console. ### Tested **Head [008f91501](https://github.com/Amoenus/AnyPS5/commit/008f91501abe20f90da411bce10caddebabe35d5), base main3c87cdfda**, Windows 11 Enterprise 26200, WinLibs GCC15.2.0, Release, bundled dependencies, SPIRV-Tools enabled: - Full Windows application/library build, patched-library validation, conventions and test registration pass. - Native-depth regression passes first, then14 selected groups pass once and five repetitions under each NVIDIA/AMD selector: no CTest failures/skips, slowest5.52633s repeated/5.50905s once; timeout30s. - Per-fixture output confirms nine runtime groups on each physical vendor. Other groups are CPU/unit evidence. Native D16/D32 ×2/4/8 samples ×zero/one clears execute12 cases per vendor, unavailable0. - The review follow-up adds an actual driver draw sampling its attached native depth image, and four contradictory HTILE/clear configurations: zero HTILE with clear1 in both layouts, and `0xfffc0000`/`0xfffffff0` with clear0. - Three one-line controls (delete Draw's feedback call; admit wrong zero-clear; admit wrong one-clear) each fail for the intended assertion five times per physical vendor: **30 expected failures**. Controls ran on source-tree-equivalent9a74c0393. Production files were restored byte-for-byte, then the complete build and test matrix above was rerun on008f91501. - Requested `depth_surface_reuse` and `guest_texture_resource` cases execute through `agc_driver_graphics`; they are not separate CTest registrations. - Merge-tree check into later mainab9a47684 is clean. That merged composition is not runtime-tested. Full upstream CI still requires maintainer dispatch. The [earlier stencil-ordering control](https://github.com/Amoenus/AnyPS5/commit/b20f7ce6550a159103ba599918b282b6e2913d49) and title/source history remain in [#3262](https://github.com/boykopovar/AnyPS5/issues/3262). Current evidence covers Windows fixtures; Linux, a full CTest suite and an isolated title replay were not run for this head. No performance claim. ### Checklist - [x] Based on recent `main` (tested3c87; clean merge intoab9 checked); 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 - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source: n/a, none added - [x] Generic behaviour, not specific to one title - [x] Depends on: none (#4820 merged) - [x] Unblocks: PPSA99902 #4443 (conditional native-depth sampling stop; not whole-game boot) - [x] GPUs tested: NVIDIA GeForce RTX5080, driver610.62/32.0.16.1062; AMD Radeon(TM) Graphics (Ryzen9950X3D integrated), driver32.0.21036.18; both Windows11 Enterprise26200 - [x] AI-assisted: yes, Codex; author reviewed and tested locally
Amoenus commented 2026-10-13 22:30:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-13T22:30:35Z.


Checked the newly surfaced overlaps at main bf8dc610e. #5445 imports uniform guest color memory; #5499 performs a DB depth-to-color copy. Neither duplicates descriptor-based native-depth sampling here or the release retirement in #5524.

@codingreapermaps: #5499 and this PR share sampled-depth image/capability setup. I propose merging #5496 then #5524 first, so your copy path can reuse that foundation and skip inactive owners in its new lookup. If #5499 lands first, I can rebase this pair instead. The separate copy eligibility needs to remain explicit: your no-HTILE/two-sample clear0.375 fixture differs from this PR's creation-proven numeric sampling subset; this is a source composition check, not runtime validation of your PR.

@nicolasabosch: #5445 builds on #4820's color lookup. The inactive-owner correction is being validated in our existing #4820 comment. #5445's uniform import makes a no-resident lookup a supported path, so the important remap control there is selecting the new contents rather than imposing #4820's current no-draw refusal.

The functional prerequisites for this PR remain #4820; #5524 depends on this PR. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156599707 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#issuecomment-6156599707). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-13T22:30:35Z. --- <!-- codex-depth-overlap-coordination --> Checked the newly surfaced overlaps at main bf8dc610e. #5445 imports uniform guest **color** memory; #5499 performs a DB depth-to-color copy. Neither duplicates descriptor-based native-depth sampling here or the release retirement in #5524. @codingreapermaps: #5499 and this PR share sampled-depth image/capability setup. I propose merging #5496 then #5524 first, so your copy path can reuse that foundation and skip inactive owners in its new lookup. If #5499 lands first, I can rebase this pair instead. The separate copy eligibility needs to remain explicit: your no-HTILE/two-sample clear0.375 fixture differs from this PR's creation-proven numeric sampling subset; this is a source composition check, not runtime validation of your PR. @nicolasabosch: #5445 builds on #4820's color lookup. The inactive-owner correction is being validated in our existing #4820 comment. #5445's uniform import makes a no-resident lookup a supported path, so the important remap control there is selecting the new contents rather than imposing #4820's current no-draw refusal. The functional prerequisites for this PR remain #4820; #5524 depends on this PR. AI-assisted: Codex.
adriadam10 commented 2026-10-14 11:50:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T11:50:31Z.

Review: CHANGES_REQUESTED


Thanks for the detailed validation notes. I could not review this head yet:

  • On its own the head does not build: Graphics/src/DepthSurface.cpp:203-204 and :248 use GuestTextureResource::samples and TextureDimension::k2DMsaa, which only exist in #4820.
  • It also conflicts with main in tests/DepthSurfaceReuse.cpp.
  • Composed on top of main + #4820 it conflicts again, in Graphics/src/DepthSurface.cpp, core/libs/prx/libSceAgcDriver/CMakeLists.txt, tests/DepthSurfaceReuse.cpp and tests/GuestTextureResource.cpp. The DepthSurface.cpp conflict touches logic, so I'm not resolving it for you.

Once #4820 is merged, please rebase onto main so the branch builds without extra commits, and re-run agc_driver_native_multisample_depth, depth_surface_reuse and guest_texture_resource on that result. I'll review the logic, the HTILE/ITERATE_256 handling and the tests at that point.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5517413119 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#pullrequestreview-5517413119). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T11:50:31Z. **Review:** CHANGES_REQUESTED --- Thanks for the detailed validation notes. I could not review this head yet: - On its own the head does not build: `Graphics/src/DepthSurface.cpp:203-204` and `:248` use `GuestTextureResource::samples` and `TextureDimension::k2DMsaa`, which only exist in #4820. - It also conflicts with `main` in `tests/DepthSurfaceReuse.cpp`. - Composed on top of `main` + #4820 it conflicts again, in `Graphics/src/DepthSurface.cpp`, `core/libs/prx/libSceAgcDriver/CMakeLists.txt`, `tests/DepthSurfaceReuse.cpp` and `tests/GuestTextureResource.cpp`. The `DepthSurface.cpp` conflict touches logic, so I'm not resolving it for you. Once #4820 is merged, please rebase onto `main` so the branch builds without extra commits, and re-run `agc_driver_native_multisample_depth`, `depth_surface_reuse` and `guest_texture_resource` on that result. I'll review the logic, the HTILE/ITERATE_256 handling and the tests at that point.
adriadam10 commented 2026-10-14 12:34:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T12:34:28Z.

Review: CHANGES_REQUESTED


Thanks for the update. The head no longer conflicts with main, but it still does not build on its own, which is the blocker from my last comment:

  • Graphics/src/DepthSurface.cpp:203, :204, :248 and :251 use GuestTextureResource::samples and TextureDimension::k2DMsaa, which only exist in #4820 (still open).
  • Composed on top of #4820 it still conflicts, now in tests/GuestTextureResource.cpp.

Once #4820 is merged, please rebase onto main so the branch builds without extra commits, and re-run agc_driver_native_multisample_depth, depth_surface_reuse and guest_texture_resource on that result. I'll review the logic, the HTILE/ITERATE_256 handling and the tests then.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5517939461 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#pullrequestreview-5517939461). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T12:34:28Z. **Review:** CHANGES_REQUESTED --- Thanks for the update. The head no longer conflicts with `main`, but it still does not build on its own, which is the blocker from my last comment: - `Graphics/src/DepthSurface.cpp:203`, `:204`, `:248` and `:251` use `GuestTextureResource::samples` and `TextureDimension::k2DMsaa`, which only exist in #4820 (still open). - Composed on top of #4820 it still conflicts, now in `tests/GuestTextureResource.cpp`. Once #4820 is merged, please rebase onto `main` so the branch builds without extra commits, and re-run `agc_driver_native_multisample_depth`, `depth_surface_reuse` and `guest_texture_resource` on that result. I'll review the logic, the HTILE/ITERATE_256 handling and the tests then.
Gashrod1 commented 2026-10-14 17:22:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Gashrod1 on 2026-10-14T17:22:34Z.


A title case for the native multisample depth path: DAVE THE DIVER (PPSA19115, 01.041.000) samples a 2-sample D32S8 Z_X depth target, and this PR's refusals are its next stops. Bring-up thread: #5963.

Tested composition: main 956269ad1 + #4820 (84f636494) + this PR at 213050f32 + #5445 (556890fb3), Windows 11, MinGW-w64 GCC 15.2.0, RTX 5060. I have not run 7b5cbb814, but the refusals and the lookup below are unchanged there.

To reach the game I had to bypass, in this order:

  1. native multisample depth metadata fill transition is not implemented: the HTILE fill covers the whole target, so the result is a known clear rather than an unknown metadata state.
  2. native multisample stencil or depth format import is not implemented: the target is VK_FORMAT_D32_SFLOAT_S8_UINT with a stencil plane.
  3. native multisample depth import requires watched accessible guest memory, then the same at sampling: on Windows, direct host imports are compared and not watched (#5596).
  4. native multisample depth fast-clear transition is not implemented: the target is fast-cleared while it is sampled.
  5. native multisample depth sampled identity or format mismatch, when the player goes back to the boat.

The fifth one looks like a lookup issue rather than missing support. The texture read there is not a multisample depth read:

target  0x241510000 1920x1080, 2 samples, VK_FORMAT_D32_SFLOAT_S8_UINT
texture 0x242610000 1920x1080, 1 sample, guest format 36 (R11G11B10 float)

0x242610000 is target + 0x1100000 (2048 x 1088 x 4 bytes x 2 samples), which is the target's stencil plane address. That is the only way planeSurface matches a texture whose base is not the depth address. In DepthSurfaceTexture, base.samples != 1u sends any reader of the stencil address down the multisample branch, and CheckResource throws. The single-sample branch would have returned nullptr for this resource, because a stencil read needs BytesPerElement(resource.format) == 1. Locally I return nullptr when the identity does not match, so the texture goes down the color path. It fires about 28,000 times per session, and the crash on the way back to the boat is gone. Rejecting non-stencil formats on the stencil address before the multisample branch would be the narrower version of that.

My bypasses for items 1 to 4 (which include skipping the initial-state proof) are workarounds, not suggestions. I list them only to show what this title hits.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6174183086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#issuecomment-6174183086). Originally posted by [Gashrod1](https://github.com/Gashrod1) on 2026-10-14T17:22:34Z. --- A title case for the native multisample depth path: DAVE THE DIVER (PPSA19115, 01.041.000) samples a 2-sample D32S8 Z_X depth target, and this PR's refusals are its next stops. Bring-up thread: #5963. Tested composition: `main` 956269ad1 + #4820 (84f636494) + this PR at 213050f32 + #5445 (556890fb3), Windows 11, MinGW-w64 GCC 15.2.0, RTX 5060. I have not run 7b5cbb814, but the refusals and the lookup below are unchanged there. To reach the game I had to bypass, in this order: 1. `native multisample depth metadata fill transition is not implemented`: the HTILE fill covers the whole target, so the result is a known clear rather than an unknown metadata state. 2. `native multisample stencil or depth format import is not implemented`: the target is `VK_FORMAT_D32_SFLOAT_S8_UINT` with a stencil plane. 3. `native multisample depth import requires watched accessible guest memory`, then the same at sampling: on Windows, direct host imports are compared and not watched (#5596). 4. `native multisample depth fast-clear transition is not implemented`: the target is fast-cleared while it is sampled. 5. `native multisample depth sampled identity or format mismatch`, when the player goes back to the boat. The fifth one looks like a lookup issue rather than missing support. The texture read there is not a multisample depth read: ``` target 0x241510000 1920x1080, 2 samples, VK_FORMAT_D32_SFLOAT_S8_UINT texture 0x242610000 1920x1080, 1 sample, guest format 36 (R11G11B10 float) ``` `0x242610000` is target + `0x1100000` (2048 x 1088 x 4 bytes x 2 samples), which is the target's stencil plane address. That is the only way `planeSurface` matches a texture whose base is not the depth address. In `DepthSurfaceTexture`, `base.samples != 1u` sends any reader of the stencil address down the multisample branch, and `CheckResource` throws. The single-sample branch would have returned `nullptr` for this resource, because a stencil read needs `BytesPerElement(resource.format) == 1`. Locally I return `nullptr` when the identity does not match, so the texture goes down the color path. It fires about 28,000 times per session, and the crash on the way back to the boat is gone. Rejecting non-stencil formats on the stencil address before the multisample branch would be the narrower version of that. My bypasses for items 1 to 4 (which include skipping the initial-state proof) are workarounds, not suggestions. I list them only to show what this title hits. AI-assisted: yes
Amoenus commented 2026-10-14 18:37:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-14T18:37:44Z.


@adriadam10 Current standalone retest: 804c1b390, based on main411e5e6d9 with #4820 merged. Full Windows app/libs/conventions/registration and14 groups once+5 under NVIDIA/AMD selectors pass, no failures/skips, maximum5.85142s. Logs verify physical device identity for the runtime groups; CPU checks are separately identified.

agc_driver_graphics executes both RunDepthSurfaceReuseTests() and RunGuestTextureResourceTests(); the native numeric sampling fixture also ran. There are no copied foreign dependencies or child commits. The newly reported stencil-address/color-format classification bug is corrected with failing-old/passing-new CPU coverage and native-device refusal checks; its source/control/scope is in the updated PR body. The requested build/rebase/test blockers are addressed; the existing logic/HTILE/ITERATE_256 review remains pending.

Previous615 retest, preserved

@adriadam10 #4820 has merged, and I rebased this PR directly onto main f25386b90. Published head: 61546403b. It builds on its own; no copied dependency or follow-up commits are included.

Full Windows app/libraries, conventions and registration pass. agc_driver_native_multisample_depth and agc_driver_graphics pass once plus five repeats on both RTX5080 and AMD Radeon Graphics. The graphics group invokes RunDepthSurfaceReuseTests() and RunGuestTextureResourceTests(); all requested checks ran on this standalone result. Fourteen groups including depth/storage/color-MSAA regressions pass without failures/skips, maximum individual iteration5.65s with shader caches disabled. GPU/driver/OS details and source pins are in the updated description.

GitHub confirms the head merges with subsequent maincb893e0f. It is ready for the logic/HTILE/ITERATE_256 review you requested. Full CI still requires maintainer dispatch; no fresh title or Linux/full-suite result is claimed. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6175599791 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#issuecomment-6175599791). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-14T18:37:44Z. --- @adriadam10 Current standalone retest: [804c1b390](https://github.com/Amoenus/AnyPS5/commit/804c1b39085179c995c0768cd70eadfd5224adbe), based on main411e5e6d9 with #4820 merged. Full Windows app/libs/conventions/registration and14 groups once+5 under NVIDIA/AMD selectors pass, no failures/skips, maximum5.85142s. Logs verify physical device identity for the runtime groups; CPU checks are separately identified. `agc_driver_graphics` executes both `RunDepthSurfaceReuseTests()` and `RunGuestTextureResourceTests()`; the native numeric sampling fixture also ran. There are no copied foreign dependencies or child commits. The newly reported stencil-address/color-format classification bug is corrected with failing-old/passing-new CPU coverage and native-device refusal checks; its source/control/scope is in the updated PR body. The requested build/rebase/test blockers are addressed; the existing logic/HTILE/ITERATE_256 review remains pending. <details><summary>Previous615 retest, preserved</summary> @adriadam10 #4820 has merged, and I rebased this PR directly onto main f25386b90. Published head: [61546403b](https://github.com/Amoenus/AnyPS5/commit/61546403b43c2f0e2a798b09ec3e3bf47451b497). It builds on its own; no copied dependency or follow-up commits are included. Full Windows app/libraries, conventions and registration pass. `agc_driver_native_multisample_depth` and `agc_driver_graphics` pass once plus five repeats on both RTX5080 and AMD Radeon Graphics. The graphics group invokes `RunDepthSurfaceReuseTests()` and `RunGuestTextureResourceTests()`; all requested checks ran on this standalone result. Fourteen groups including depth/storage/color-MSAA regressions pass without failures/skips, maximum individual iteration5.65s with shader caches disabled. GPU/driver/OS details and source pins are in the updated description. GitHub confirms the head merges with subsequent maincb893e0f. It is ready for the logic/HTILE/ITERATE_256 review you requested. Full CI still requires maintainer dispatch; no fresh title or Linux/full-suite result is claimed. AI-assisted: Codex. </details>
Amoenus commented 2026-10-14 19:51:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-14T19:51:26Z.


@Gashrod1 Implemented and tested the narrow ordering correction in head804c1b390, rebased onto main411e5e6d9. The existing stencil byte-format filter now runs before native multisample routing.

The CPU regression covers D16S8/D24S8/D32S8 ×2/4/8 samples:27 color aliases are declined and18 plane-reader recording checks remain. The native device fixture checks a single-sample R11G11B10 request at a D32S8 stencil address is declined while actual stencil access retains its unsupported-import refusal. Published615 production with test-only additions builds and fails on the erroneous recording requirement;804 passes.

Full Windows app/libs/checkers and14 groups once+5 under NVIDIA/AMD selectors pass without failures/skips, max5.85142s; runtime device identities are verified. Combined depth/stencil import and Windows tracking remain unsupported. This is classification validation, not a replay of DAVE THE DIVER or verification of its other bypasses. Items1/4 remain associated with #5554's completion-proven clear work.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177002027 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#issuecomment-6177002027). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-14T19:51:26Z. --- @Gashrod1 Implemented and tested the narrow ordering correction in [head804c1b390](https://github.com/Amoenus/AnyPS5/commit/804c1b39085179c995c0768cd70eadfd5224adbe), rebased onto main411e5e6d9. The existing stencil byte-format filter now runs before native multisample routing. The CPU regression covers D16S8/D24S8/D32S8 ×2/4/8 samples:27 color aliases are declined and18 plane-reader recording checks remain. The native device fixture checks a single-sample R11G11B10 request at a D32S8 stencil address is declined while actual stencil access retains its unsupported-import refusal. [Published615 production with test-only additions](https://github.com/Amoenus/AnyPS5/commit/b20f7ce6550a159103ba599918b282b6e2913d49) builds and fails on the erroneous recording requirement;804 passes. Full Windows app/libs/checkers and14 groups once+5 under NVIDIA/AMD selectors pass without failures/skips, max5.85142s; runtime device identities are verified. Combined depth/stencil import and Windows tracking remain unsupported. This is classification validation, not a replay of DAVE THE DIVER or verification of its other bypasses. Items1/4 remain associated with #5554's completion-proven clear work.
adriadam10 commented 2026-10-14 21:05:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T21:05:29Z.

Review: CHANGES_REQUESTED


Thanks for the update, the head builds on its own now. I rebuilt it merged onto current main (the only conflict was the include list in MultisampleTarget.cpp:3, keep both ColorTargetLayout.hpp and DepthSurface.hpp), agc_driver_native_multisample_depth passes. I then mutated the code to check that the new tests pin the behaviour, and two mutants survive:

  • Graphics/src/Draw.cpp:2115: deleting the RequireNoNativeDepthFeedback_nid_no_patch(...) call leaves every test green. tests/execution/NativeMultisampleDepth.cpp:536-547 calls the function directly, so nothing checks that Draw actually calls it before the pipeline is created. Please add a case that goes through a draw sampling the attached native depth image and expects the refusal.
  • Graphics/src/DepthSurface.cpp:67: changing if (depth == 0u) return clearDepth == 0.0f; to return true; also passes. The clear-value refusals at NativeMultisampleDepth.cpp:668-674 never use all-zero HTILE with clearDepth = 1.0f, which is the case that would import a wrong initial depth. Please add it (and the mirror: 0xfffc0000 / 0xfffffff0 words with clearDepth = 0).

Please also rebase onto main for the include conflict above and re-run agc_driver_native_multisample_depth, depth_surface_reuse and guest_texture_resource.

Not covered by what I could run here: the HTILE encodings and ITERATE_256 behaviour follow Mesa/PAL, not measured on a console, and nothing ran on NVIDIA/Windows.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5524651064 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#pullrequestreview-5524651064). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T21:05:29Z. **Review:** CHANGES_REQUESTED --- Thanks for the update, the head builds on its own now. I rebuilt it merged onto current `main` (the only conflict was the include list in `MultisampleTarget.cpp:3`, keep both `ColorTargetLayout.hpp` and `DepthSurface.hpp`), `agc_driver_native_multisample_depth` passes. I then mutated the code to check that the new tests pin the behaviour, and two mutants survive: - `Graphics/src/Draw.cpp:2115`: deleting the `RequireNoNativeDepthFeedback_nid_no_patch(...)` call leaves every test green. `tests/execution/NativeMultisampleDepth.cpp:536-547` calls the function directly, so nothing checks that `Draw` actually calls it before the pipeline is created. Please add a case that goes through a draw sampling the attached native depth image and expects the refusal. - `Graphics/src/DepthSurface.cpp:67`: changing `if (depth == 0u) return clearDepth == 0.0f;` to `return true;` also passes. The clear-value refusals at `NativeMultisampleDepth.cpp:668-674` never use all-zero HTILE with `clearDepth = 1.0f`, which is the case that would import a wrong initial depth. Please add it (and the mirror: `0xfffc0000` / `0xfffffff0` words with `clearDepth = 0`). Please also rebase onto `main` for the include conflict above and re-run `agc_driver_native_multisample_depth`, `depth_surface_reuse` and `guest_texture_resource`. Not covered by what I could run here: the HTILE encodings and ITERATE_256 behaviour follow Mesa/PAL, not measured on a console, and nothing ran on NVIDIA/Windows.
Amoenus commented 2026-10-15 00:00:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T00:00:06Z.


@adriadam10 Addressed both surviving mutants in 008f91501: the regression goes through the driver draw, and the four contradictory HTILE/clear cases are covered. All three fault controls fail for the intended assertion ×5 on NVIDIA and ×5 on AMD; production restored/rebuilt,14 groups pass once+5 per GPU. Depth-reuse/guest-texture cases run inside agc_driver_graphics. Rebased onto main3c87; merge into later mainab9 is clean. The PR description now contains only current validation and links to the older evidence. AI-assisted: yes.

Merged: #5496 landed as c4f03522a70d0392d1426f092f712009b1d55675 and is included in main 0afa6a607. @adriadam10's approval and independent validation remain linked; no re-review request is pending. Our follow-up compositions and their residual import-tracking failure are separately scoped in #6060's maintained report. Earlier local evidence above retains its tested pins.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181165852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#issuecomment-6181165852). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-15T00:00:06Z. --- @adriadam10 Addressed both surviving mutants in [008f91501](https://github.com/Amoenus/AnyPS5/commit/008f91501abe20f90da411bce10caddebabe35d5): the regression goes through the driver draw, and the four contradictory HTILE/clear cases are covered. All three fault controls fail for the intended assertion ×5 on NVIDIA and ×5 on AMD; production restored/rebuilt,14 groups pass once+5 per GPU. Depth-reuse/guest-texture cases run inside `agc_driver_graphics`. Rebased onto main3c87; merge into later mainab9 is clean. The PR description now contains only current validation and links to the older evidence. AI-assisted: yes. <!-- codex-pr5496-rereview-v1 --> **Merged:** #5496 landed as `c4f03522a70d0392d1426f092f712009b1d55675` and is included in main `0afa6a607`. @adriadam10's [approval and independent validation](https://github.com/boykopovar/AnyPS5/pull/5496#pullrequestreview-5529793886) remain linked; no re-review request is pending. Our follow-up compositions and their residual import-tracking failure are separately scoped in [#6060's maintained report](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180274490). Earlier local evidence above retains its tested pins.
github-actions[bot] commented 2026-10-15 00:40:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T00:40:06Z.


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

Pull request Conflicting files (lines on main) Same exports Same new files
#454 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L125-126, L139-141, L863-864
#5982 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L856-857
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181678122 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#issuecomment-6181678122). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T00:40:06Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #454 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L125-126](https://github.com/boykopovar/AnyPS5/blob/c0be1f69bc04c2ec4ba2b79919d89cdc41509084/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L125-L126), [L139-141](https://github.com/boykopovar/AnyPS5/blob/c0be1f69bc04c2ec4ba2b79919d89cdc41509084/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L139-L141), [L863-864](https://github.com/boykopovar/AnyPS5/blob/c0be1f69bc04c2ec4ba2b79919d89cdc41509084/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L863-L864) | | | | #5982 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L856-857](https://github.com/boykopovar/AnyPS5/blob/c0be1f69bc04c2ec4ba2b79919d89cdc41509084/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L856-L857) | | |
Gashrod1 commented 2026-10-15 00:40:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Gashrod1 on 2026-10-15T00:40:26Z.


Independent test of 008f91501 on a title: DAVE THE DIVER (PPSA19115), Windows 11, NVIDIA GeForce RTX 5060 (596.36). Same session, same dump, only the libs change:

Build Stops at
main ab9a47684 frame 1: guest texture descriptor uses MSAA which is not implemented
main + #5496 (008f91501) frame 1: sampling the 1920x1080 multisampled texture 0x22b790000 of 2 samples, which no draw rendered to and whose tile mode 4 has no modeled multisampled color footprint, is not implemented

So this PR moves the title past the ITERATE_256 refusal on current main; the merge onto ab9a47684 was clean.

The next stop is outside this PR: a 2x Z_X depth texture sampled before any draw, with an all-zero HTILE. I have a follow-up for it (undrawn Z/D 64 KiB swizzle textures, and Z ones whose HTILE is all cleared, load as a uniform value). With it on top of this PR the title reaches frame 17 and stops on the D32S8 native depth case I described on #5554. I will open it once this PR is merged, since it is only reachable after it.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181682341 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#issuecomment-6181682341). Originally posted by [Gashrod1](https://github.com/Gashrod1) on 2026-10-15T00:40:26Z. --- Independent test of 008f91501 on a title: DAVE THE DIVER (PPSA19115), Windows 11, NVIDIA GeForce RTX 5060 (596.36). Same session, same dump, only the libs change: | Build | Stops at | |---|---| | `main` ab9a47684 | frame 1: `guest texture descriptor uses MSAA which is not implemented` | | `main` + #5496 (008f91501) | frame 1: `sampling the 1920x1080 multisampled texture 0x22b790000 of 2 samples, which no draw rendered to and whose tile mode 4 has no modeled multisampled color footprint, is not implemented` | So this PR moves the title past the ITERATE_256 refusal on current `main`; the merge onto ab9a47684 was clean. The next stop is outside this PR: a 2x Z_X depth texture sampled before any draw, with an all-zero HTILE. I have a follow-up for it (undrawn Z/D 64 KiB swizzle textures, and Z ones whose HTILE is all cleared, load as a uniform value). With it on top of this PR the title reaches frame 17 and stops on the D32S8 native depth case I described on #5554. I will open it once this PR is merged, since it is only reachable after it. AI-assisted: yes
adriadam10 commented 2026-10-15 07:47:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T07:47:11Z.

Review: APPROVED


Checked the new head: the two surviving mutants now fail (removing the RequireNoNativeDepthFeedback_nid_no_patch call in Draw.cpp:2203 and return true at DepthSurface.cpp:74 both fail agc_driver_native_multisample_depth). Built merged onto current main with no conflicts; agc_driver_native_multisample_depth and agc_driver_graphics (which runs depth_surface_reuse and guest_texture_resource) pass. agc_driver_tessellation segfaults here, but it does the same on a plain main build. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5529793886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5496#pullrequestreview-5529793886). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T07:47:11Z. **Review:** APPROVED --- Checked the new head: the two surviving mutants now fail (removing the `RequireNoNativeDepthFeedback_nid_no_patch` call in `Draw.cpp:2203` and `return true` at `DepthSurface.cpp:74` both fail `agc_driver_native_multisample_depth`). Built merged onto current `main` with no conflicts; `agc_driver_native_multisample_depth` and `agc_driver_graphics` (which runs `depth_surface_reuse` and `guest_texture_resource`) pass. `agc_driver_tessellation` segfaults here, but it does the same on a plain `main` build. Merging once the full Build is green.
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!5496
No description provided.