feat(agc): multisampled color and depth targets with CB resolves #419

Merged
MichonGoddijn231849 merged 8 commits from upstream-pr/419 into main 2026-10-11 22:01:38 +00:00
MichonGoddijn231849 commented 2026-10-02 23:10:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-02T23:10:12Z.


What

Draws with multisampling enabled were refused (multisampling or coverage conversion is unsupported). They now render:

  • State: PA_SC_AA_CONFIG with 2, 4 or 8 samples is accepted when all of the following hold:
    • every color target has that many samples and fragments (CB_COLOR_ATTRIB);
    • the depth target has that many samples (DB_Z_INFO);
    • MSAA_ENABLE is set;
    • the sample locations of all four quad pixels are the standard ones Vulkan rasterizes with.
  • Targets: a multisampled color target is a host-only multisampled image, and a multisampled depth target is a multisampled depth surface. The pipeline and render pass use the draw's sample count. The guest sample planes and FMASK are never read or written. Sampling a multisampled surface is still refused, and MSAA image types already were.
  • Resolve: a CB_COLOR_CONTROL resolve over a multisampled CB0 runs as a render pass whose resolve attachment is CB1's resident image. A single-sample resolve is still refused as before.
  • Fast clear: a zero fill of a target's CMASK (fill kernel or CP DMA, next to the HTILE hook) fast-clears it. Its next use clears it to that use's CB_COLOR_CLEAR_WORD.

EQAA (fewer fragments than samples), coverage conversion, nonstandard sample locations and multisampled mips stay refused. The draw key gains the sample-location and CMASK_BASE_EXT registers.

GTA V renders its reflection cube's faces into a 256x256 2x target and resolves each face into the cube.

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.

  • ctest: all tests pass. New cases cover:
    • 2x decode and the precheck;
    • nonstandard sample locations, EQAA, a single-sample target under 2x, MSAA_ENABLE cleared, coverage conversion;
    • the CMASK address;
    • CMASK compression on a single-sample target, still refused;
    • the resolve pass and a resolve between different formats.
  • GTA V (PPSA04264), Prologue: about 13k multisampled draws and resolves per 10 s were skipped before. They now render with no rejections, the CMASK fast clears are taken, and fps is unchanged. This was tested on my branch that combines this change with my other open PRs, not on this branch alone.
  • Dreaming Sarah and Demon's Souls were not re-run; neither multisamples in the scenes I know.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #374 (the depth HTILE fast clear, which multisampled depth surfaces use); its commit is included here until it merges. #376 also edits DrawKeyRegisters; whichever merges second keeps both sets of ranges. GTA V resolves into 4 KiB standard targets, which #377 adds: whichever of #377 and this merges second lets RunColorMetadataPass accept ColorTileMode::Standard4KB destinations too (one condition)
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4722417192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-02T23:10:12Z. --- ### What Draws with multisampling enabled were refused (`multisampling or coverage conversion is unsupported`). They now render: - **State:** PA_SC_AA_CONFIG with 2, 4 or 8 samples is accepted when all of the following hold: - every color target has that many samples and fragments (CB_COLOR_ATTRIB); - the depth target has that many samples (DB_Z_INFO); - MSAA_ENABLE is set; - the sample locations of all four quad pixels are the standard ones Vulkan rasterizes with. - **Targets:** a multisampled color target is a host-only multisampled image, and a multisampled depth target is a multisampled depth surface. The pipeline and render pass use the draw's sample count. The guest sample planes and FMASK are never read or written. Sampling a multisampled surface is still refused, and MSAA image types already were. - **Resolve:** a `CB_COLOR_CONTROL` resolve over a multisampled CB0 runs as a render pass whose resolve attachment is CB1's resident image. A single-sample resolve is still refused as before. - **Fast clear:** a zero fill of a target's CMASK (fill kernel or CP DMA, next to the HTILE hook) fast-clears it. Its next use clears it to that use's `CB_COLOR_CLEAR_WORD`. EQAA (fewer fragments than samples), coverage conversion, nonstandard sample locations and multisampled mips stay refused. The draw key gains the sample-location and CMASK_BASE_EXT registers. GTA V renders its reflection cube's faces into a 256x256 2x target and resolves each face into the cube. ### Tested Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0. - `ctest`: all tests pass. New cases cover: - 2x decode and the precheck; - nonstandard sample locations, EQAA, a single-sample target under 2x, MSAA_ENABLE cleared, coverage conversion; - the CMASK address; - CMASK compression on a single-sample target, still refused; - the resolve pass and a resolve between different formats. - GTA V (PPSA04264), Prologue: about 13k multisampled draws and resolves per 10 s were skipped before. They now render with no rejections, the CMASK fast clears are taken, and fps is unchanged. This was tested on my branch that combines this change with my other open PRs, not on this branch alone. - Dreaming Sarah and Demon's Souls were not re-run; neither multisamples in the scenes I know. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #374 (the depth HTILE fast clear, which multisampled depth surfaces use); its commit is included here until it merges. #376 also edits `DrawKeyRegisters`; whichever merges second keeps both sets of ranges. GTA V resolves into 4 KiB standard targets, which #377 adds: whichever of #377 and this merges second lets `RunColorMetadataPass` accept `ColorTileMode::Standard4KB` destinations too (one condition) - [x] AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ThisIsAkill commented 2026-10-04 01:00:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T01:00:31Z.


A data point on the fast-clear part, in case it helps scope it: PPSA21567 (Astro Bot) fast-clears single-sample color targets through their CMASK, which this PR's multisampleInfo (applied only when samples > 1) leaves refused on main and here.

What the title's draws show (Linux, main with other open PRs and local changes, not clean main):

  • CB_COLOR_INFO = 0x00042730 and 0x10042730 (with DCC) on 11 distinct targets. The only bit the State.cpp mask rejects is 13 (FAST_CLEAR); DCC (28) and ROUND_MODE (18) are already accepted.
  • CB_COLOR_ATTRIB = 0 on all of them (1 sample, 1 fragment).
  • Every target with FAST_CLEAR set has a non-zero CB_COLOR_CMASK; the two targets without it have none.
  • The clear words are non-zero on several, for example CB_COLOR_CLEAR_WORD0/1 = 0x38003800 / 0x00005650 and 0x00000000 / 0xbc003c00.

These draws are currently skipped (color compression, DCC, ... is unsupported (CB_COLOR_INFO 0x00042730)), so the title's main targets are never rendered. I have not yet checked whether its CMASK clears are whole-target zero fills like the ones this PR hooks.

Do you plan to cover single-sample targets in this PR, or would you welcome that as a follow-up on top of it? I'm trying the obvious extension locally (the same zero-fill hook and clear-on-next-use for 1-sample targets, anything else refused) and can report how it behaves.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5975205729 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-5975205729). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-04T01:00:31Z. --- A data point on the fast-clear part, in case it helps scope it: PPSA21567 (Astro Bot) fast-clears **single-sample** color targets through their CMASK, which this PR's `multisampleInfo` (applied only when `samples > 1`) leaves refused on `main` and here. What the title's draws show (Linux, `main` with other open PRs and local changes, not clean `main`): - `CB_COLOR_INFO` = `0x00042730` and `0x10042730` (with DCC) on 11 distinct targets. The only bit the `State.cpp` mask rejects is 13 (`FAST_CLEAR`); DCC (28) and `ROUND_MODE` (18) are already accepted. - `CB_COLOR_ATTRIB` = 0 on all of them (1 sample, 1 fragment). - Every target with `FAST_CLEAR` set has a non-zero `CB_COLOR_CMASK`; the two targets without it have none. - The clear words are non-zero on several, for example `CB_COLOR_CLEAR_WORD0/1` = `0x38003800` / `0x00005650` and `0x00000000` / `0xbc003c00`. These draws are currently skipped (`color compression, DCC, ... is unsupported (CB_COLOR_INFO 0x00042730)`), so the title's main targets are never rendered. I have not yet checked whether its CMASK clears are whole-target zero fills like the ones this PR hooks. Do you plan to cover single-sample targets in this PR, or would you welcome that as a follow-up on top of it? I'm trying the obvious extension locally (the same zero-fill hook and clear-on-next-use for 1-sample targets, anything else refused) and can report how it behaves.
ThisIsAkill commented 2026-10-04 01:37:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T01:37:47Z.


Follow-up on the single-sample case, with what Mesa's AMD drivers say about the CMASK codes (Mesa e5f06878):

  • src/amd/common/ac_descriptors.h:57-58: single-sample CMASK codes are CMASK_NOAA_COLOR_CLEAR_REG = 0x0 (fast-cleared to the clear register, "illegal with DCC") and CMASK_NOAA_COLOR_EXPANDED = 0xF (0xffffffff as a fill: expanded, not fast-cleared). Caveat: both are commented "only valid on gfx6-9".
  • radv initializes a CMASK to COLOR_EXPANDED (radv_init_color_image_metadata in radv_cmd_buffer.c). When it fast-clears an image that has both DCC and CMASK, it writes COLOR_EXPANDED to the CMASK and carries the clear in the DCC keys (radv_get_cmask_fast_clear_value, meta/radv_meta_clear.c:771-786).
  • radeonsi does use the zero code on GFX10: in the gfx_level >= GFX10 path of si_clear.c (around lines 654-707) it fast-clears a single-sample texture without DCC by filling a separately allocated CMASK with CMASK_NOAA_COLOR_CLEAR_REG. So the "gfx6-9" comment does not hold for that code, at least.

That matches what PPSA21567 does. Its non-DCC targets (CB_COLOR_INFO 0x00042730) get zero fills over the whole CMASK. Its DCC targets (0x10042730) get 0xffffffff fills, with the clear expected in the DCC keys, which main already models.

I tried the extension locally on top of this PR (Linux, with other open PRs and local changes, not clean main). A single-sample target may set FAST_CLEAR when it has a CMASK. A full zero fill fast-clears it to CB_COLOR_CLEAR_WORD on its next use or eliminate pass, a full 0xffffffff fill cancels a pending clear, and any other pattern or partial fill throws. Result: 8 targets were fast-cleared through their CMASK, the 0xffffffff fills cancel without error, and the title's distinct skipped-draw reasons went from 23 to 3. The run then stops at an unrelated depth storage-image path (#425's area). The branch is ready if you'd like it as a follow-up.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5975454328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-5975454328). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-04T01:37:47Z. --- Follow-up on the single-sample case, with what Mesa's AMD drivers say about the CMASK codes (Mesa `e5f06878`): - `src/amd/common/ac_descriptors.h:57-58`: single-sample CMASK codes are `CMASK_NOAA_COLOR_CLEAR_REG = 0x0` (fast-cleared to the clear register, "illegal with DCC") and `CMASK_NOAA_COLOR_EXPANDED = 0xF` (`0xffffffff` as a fill: expanded, not fast-cleared). Caveat: both are commented "only valid on gfx6-9". - radv initializes a CMASK to `COLOR_EXPANDED` (`radv_init_color_image_metadata` in `radv_cmd_buffer.c`). When it fast-clears an image that has both DCC and CMASK, it writes `COLOR_EXPANDED` to the CMASK and carries the clear in the DCC keys (`radv_get_cmask_fast_clear_value`, `meta/radv_meta_clear.c:771-786`). - radeonsi does use the zero code on GFX10: in the `gfx_level >= GFX10` path of `si_clear.c` (around lines 654-707) it fast-clears a single-sample texture without DCC by filling a separately allocated CMASK with `CMASK_NOAA_COLOR_CLEAR_REG`. So the "gfx6-9" comment does not hold for that code, at least. That matches what PPSA21567 does. Its non-DCC targets (`CB_COLOR_INFO 0x00042730`) get zero fills over the whole CMASK. Its DCC targets (`0x10042730`) get `0xffffffff` fills, with the clear expected in the DCC keys, which `main` already models. I tried the extension locally on top of this PR (Linux, with other open PRs and local changes, not clean `main`). A single-sample target may set FAST_CLEAR when it has a CMASK. A full zero fill fast-clears it to `CB_COLOR_CLEAR_WORD` on its next use or eliminate pass, a full `0xffffffff` fill cancels a pending clear, and any other pattern or partial fill throws. Result: 8 targets were fast-cleared through their CMASK, the `0xffffffff` fills cancel without error, and the title's distinct skipped-draw reasons went from 23 to 3. The run then stops at an unrelated depth storage-image path (#425's area). The branch is ready if you'd like it as a follow-up.
oneandonlydean commented 2026-10-04 07:10:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T07:10:17Z.


@boykopovar this one needs your call: should multisampled colour targets be host-only images? With this PR their guest sample planes and FMASK are never written or read, so guest memory never holds an MSAA target's contents. Sampling one stays refused, and a CB resolve lands in the single-sample destination's resident image. That is the model main already uses for depth surfaces (a host image with no write-back), so it's an architecture choice more than a correctness question.

My read: fine as a step, because every shader path that would read the sample planes still throws, but a CPU or DMA read of that memory would see stale bytes without an error, as with depth today. Either way it needs a rebase: it conflicts with main in Graphics/src/Draw.cpp now.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5977587626 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-5977587626). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T07:10:17Z. --- @boykopovar this one needs your call: should multisampled colour targets be host-only images? With this PR their guest sample planes and FMASK are never written or read, so guest memory never holds an MSAA target's contents. Sampling one stays refused, and a CB resolve lands in the single-sample destination's resident image. That is the model main already uses for depth surfaces (a host image with no write-back), so it's an architecture choice more than a correctness question. My read: fine as a step, because every shader path that would read the sample planes still throws, but a CPU or DMA read of that memory would see stale bytes without an error, as with depth today. Either way it needs a rebase: it conflicts with main in `Graphics/src/Draw.cpp` now.
MichonGoddijn231849 commented 2026-10-04 08:13:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T08:13:39Z.


Thanks. Yes, host-only multisampled color targets are meant as a step. Every shader path that would read the sample planes or FMASK still throws, so the gap is the one you name: a CPU or DMA read of that memory sees stale bytes, as with depth surfaces on main. If @boykopovar wants write-back for both, I'd do depth and MSAA together in one follow-up, since they need the same machinery (see #425). I'll rebase this today.

@ThisIsAkill, thanks for the CMASK data and the Mesa references. Single-sample CMASK fast clears fit better as a follow-up on top of this than in it. Your rules (a whole zero fill fast-clears to CB_COLOR_CLEAR_WORD, a whole 0xffffffff fill cancels, anything else throws) match how I'd scope it, so please open it as a PR once this lands.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978008366 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-5978008366). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-04T08:13:39Z. --- Thanks. Yes, host-only multisampled color targets are meant as a step. Every shader path that would read the sample planes or FMASK still throws, so the gap is the one you name: a CPU or DMA read of that memory sees stale bytes, as with depth surfaces on `main`. If @boykopovar wants write-back for both, I'd do depth and MSAA together in one follow-up, since they need the same machinery (see #425). I'll rebase this today. @ThisIsAkill, thanks for the CMASK data and the Mesa references. Single-sample CMASK fast clears fit better as a follow-up on top of this than in it. Your rules (a whole zero fill fast-clears to `CB_COLOR_CLEAR_WORD`, a whole `0xffffffff` fill cancels, anything else throws) match how I'd scope it, so please open it as a PR once this lands.
MichonGoddijn231849 commented 2026-10-04 08:39:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T08:39:43Z.


Rebased onto main and the updated #374 (which it builds on). The Draw.cpp conflict was with the draw templates' moved-buffer rebinding from #424; multisampled draws still take no recipe. Build and ctest are clean apart from the failures main has locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978185828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-5978185828). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-04T08:39:43Z. --- Rebased onto `main` and the updated #374 (which it builds on). The `Draw.cpp` conflict was with the draw templates' moved-buffer rebinding from #424; multisampled draws still take no recipe. Build and ctest are clean apart from the failures `main` has locally.
oneandonlydean commented 2026-10-04 09:52:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T09:52:09Z.


Thanks for the rebase. The #374 commits it carries now match #374's head, and the Draw.cpp resolution keeps multisampled draws out of the recipe path next to #424's moved-buffer check. The host-only question is still with @boykopovar.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978692595 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-5978692595). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T09:52:09Z. --- Thanks for the rebase. The #374 commits it carries now match #374's head, and the `Draw.cpp` resolution keeps multisampled draws out of the recipe path next to #424's moved-buffer check. The host-only question is still with @boykopovar.
MichonGoddijn231849 commented 2026-10-05 15:41:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-05T15:41:10Z.


Rebased onto current main and today's rebase of #374. The conflicts were ColorTarget's fields and the colour-target loop in State.cpp, against main's 3D colour targets and compacted exports. Both sides stay: depth, depthSlice and exportIndex from main, samples and cmaskAddress from this PR, with the sample-count check after exportIndex is set. Build and ctest are clean apart from the failures main has locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5997835197 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-5997835197). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-05T15:41:10Z. --- Rebased onto current `main` and today's rebase of #374. The conflicts were `ColorTarget`'s fields and the colour-target loop in `State.cpp`, against `main`'s 3D colour targets and compacted exports. Both sides stay: `depth`, `depthSlice` and `exportIndex` from `main`, `samples` and `cmaskAddress` from this PR, with the sample-count check after `exportIndex` is set. Build and ctest are clean apart from the failures `main` has locally.
MichonGoddijn231849 commented 2026-10-06 15:43:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-06T15:43:56Z.


Rebased onto current main and #374, which is rebased too so the commits this PR carries match its head (now d7ce17d0). The only conflict was in Texture.cpp: main gave StorageTexture::createView a format parameter, next to this PR's ClearColorForTexel. Both are kept. #790's image_msaa_load is the shader side of multisampled images and doesn't overlap with the targets and resolves here. Builds; the driver tests pass apart from agc_driver_scalar_sop1, which fails without this PR too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6019920691 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6019920691). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-06T15:43:56Z. --- Rebased onto current `main` and #374, which is rebased too so the commits this PR carries match its head (now d7ce17d0). The only conflict was in `Texture.cpp`: `main` gave `StorageTexture::createView` a format parameter, next to this PR's `ClearColorForTexel`. Both are kept. #790's `image_msaa_load` is the shader side of multisampled images and doesn't overlap with the targets and resolves here. Builds; the driver tests pass apart from `agc_driver_scalar_sop1`, which fails without this PR too.
MichonGoddijn231849 commented 2026-10-07 17:31:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T17:31:11Z.


Rebased onto current main and the rebased #374 (now 8aef734c), no conflicts. One more commit drops code comments that the conventions check now rejects. #1189 (CB resolve into any tiled target) builds on this one. Build and ctest pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6043248524 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6043248524). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-07T17:31:11Z. --- Rebased onto current `main` and the rebased #374 (now 8aef734c), no conflicts. One more commit drops code comments that the conventions check now rejects. #1189 (CB resolve into any tiled target) builds on this one. Build and ctest pass.
TheAggie commented 2026-10-08 04:05:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T04:05:17Z.


Tested #419 with a second title: ProsperoPuzzles (PPSA99006, blackbearreloaded/ProsperoPuzzles, Mesa 26.2 via ps5-opengl), which renders its puzzle thumbnails into 4× MSAA canvases. Merged onto a local branch that also carries other pending fixes (#1412, #1414, #1415, #1419 and a few unpublished ones).

With #419, the 48 draws that failed on PA_SC_AA_CONFIG / CB_COLOR_ATTRIB get past those checks. Two gaps remain for this title, both outside what #419 sets out to do:

  1. Draws with MSAA rasterization off into a 4× target (48 draws): PA_SC_AA_CONFIG = 0, PA_SC_MODE_CNTL_0 = 0x22 (no MSAA_ENABLE), CB_COLOR0_ATTRIB = 0x12000. These are rejected with a color target's sample count differs from the rasterizer's. radeonsi does the same whenever GL multisampling is disabled on a multisampled framebuffer: si_emit_msaa_config (si_state.c) leaves PA_SC_AA_CONFIG at 0 unless multisample_enable is set. Rasterizing at the target's sample count with every sample location at the pixel centre (VK_EXT_sample_locations) would match the hardware's broadcast.
  2. image_load from a multisampled image (89 draws): the resolve is a pixel shader doing four image_loads at sample indices 0–3 and averaging them (a box-filter resolve), failing with DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape. You note sampling multisampled surfaces is still refused.

Are either of these on your list? If not, I'm happy to try them as a follow-up PR based on #419. I'd rather not overlap with you. Shader dumps and register files are available if useful.

Investigated with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051964025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6051964025). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-08T04:05:17Z. --- Tested #419 with a second title: ProsperoPuzzles (PPSA99006, [blackbearreloaded/ProsperoPuzzles](https://github.com/blackbearreloaded/ProsperoPuzzles), Mesa 26.2 via ps5-opengl), which renders its puzzle thumbnails into 4× MSAA canvases. Merged onto a local branch that also carries other pending fixes (#1412, #1414, #1415, #1419 and a few unpublished ones). With #419, the 48 draws that failed on `PA_SC_AA_CONFIG` / `CB_COLOR_ATTRIB` get past those checks. Two gaps remain for this title, both outside what #419 sets out to do: 1. **Draws with MSAA rasterization off into a 4× target** (48 draws): `PA_SC_AA_CONFIG` = 0, `PA_SC_MODE_CNTL_0` = 0x22 (no `MSAA_ENABLE`), `CB_COLOR0_ATTRIB` = 0x12000. These are rejected with `a color target's sample count differs from the rasterizer's`. radeonsi does the same whenever GL multisampling is disabled on a multisampled framebuffer: `si_emit_msaa_config` (`si_state.c`) leaves `PA_SC_AA_CONFIG` at 0 unless `multisample_enable` is set. Rasterizing at the target's sample count with every sample location at the pixel centre (`VK_EXT_sample_locations`) would match the hardware's broadcast. 2. **`image_load` from a multisampled image** (89 draws): the resolve is a pixel shader doing four `image_load`s at sample indices 0–3 and averaging them (a box-filter resolve), failing with `DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape`. You note sampling multisampled surfaces is still refused. Are either of these on your list? If not, I'm happy to try them as a follow-up PR based on #419. I'd rather not overlap with you. Shader dumps and register files are available if useful. Investigated with AI assistance.
adriadam10 commented 2026-10-08 06:09:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T06:09:04Z.


Heads-up: #1072 (single-sample CMASK fast clear) is merging first and adds ColorTarget::cmaskAddress plus the CB_COLOR0_CMASK/CMASK_BASE_EXT decode. Please rebase this PR on top of it and reuse that decode for the multisampled path.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6053564998 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6053564998). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-08T06:09:04Z. --- Heads-up: #1072 (single-sample CMASK fast clear) is merging first and adds `ColorTarget::cmaskAddress` plus the `CB_COLOR0_CMASK`/`CMASK_BASE_EXT` decode. Please rebase this PR on top of it and reuse that decode for the multisampled path.
MichonGoddijn231849 commented 2026-10-08 16:37:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-08T16:37:15Z.


Rebased onto main and onto the updated #374. Main gained CMASK fast-clear color targets meanwhile (61a61016), which this PR duplicated, so it now builds on them:

  • The second ColorTarget::cmaskAddress, its decode and its size helper are gone; multisampled targets use main's cmaskAddress/cmaskBytes (whole metablocks). Single-sample targets keep main's rule (CMASK under FAST_CLEAR); a multisampled target takes its CMASK under FAST_CLEAR or COMPRESSION.
  • The multisampled CMASK state is stricter: a zero fill of the whole CMASK clears at the next use, 0xFFFFFFFF marks it expanded, and any other or partial fill refuses the next use (before, any non-zero fill counted as expanded and partial fills were ignored). Eliminate and DCC passes over a multisampled target, and a CB resolve into a fast-clear destination, now throw.
  • The draw key adds CMASK_BASE_EXT (0x398), which main's decode reads but its key did not list.
  • Tests in agc_driver_graphics pin each of these; the inferred parts (which bit a multisampled CMASK follows, the fill-only state model) are in TechnicalDebt.md.
    GTA V ran with the previous version; it has not been re-run against the new refusals yet.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6064548827 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6064548827). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-08T16:37:15Z. --- Rebased onto main and onto the updated #374. Main gained CMASK fast-clear color targets meanwhile (61a61016), which this PR duplicated, so it now builds on them: - The second `ColorTarget::cmaskAddress`, its decode and its size helper are gone; multisampled targets use main's `cmaskAddress`/`cmaskBytes` (whole metablocks). Single-sample targets keep main's rule (CMASK under FAST_CLEAR); a multisampled target takes its CMASK under FAST_CLEAR or COMPRESSION. - The multisampled CMASK state is stricter: a zero fill of the whole CMASK clears at the next use, 0xFFFFFFFF marks it expanded, and any other or partial fill refuses the next use (before, any non-zero fill counted as expanded and partial fills were ignored). Eliminate and DCC passes over a multisampled target, and a CB resolve into a fast-clear destination, now throw. - The draw key adds CMASK_BASE_EXT (0x398), which main's decode reads but its key did not list. - Tests in `agc_driver_graphics` pin each of these; the inferred parts (which bit a multisampled CMASK follows, the fill-only state model) are in TechnicalDebt.md. GTA V ran with the previous version; it has not been re-run against the new refusals yet.
Raghav314 commented 2026-10-09 08:11:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T08:11:26Z.


Tested this with Hades II (PPSA36082) on Linux with an RTX 4090. With it (plus some unrelated fixes) the 4x targets work and I get all the way into gameplay. Three things in here stopped it or broke rendering on the way, all fixed on top of your branch:

  1. Sample positions. Hades uses an ordered grid instead of the standard one: PA_SC_AA_SAMPLE_LOCS is 0x444cc4cc in all four pixels, so samples at ±4/16. decodeSamples refuses that. I added VK_EXT_sample_locations, only for patterns that are the same in every pixel, since NVIDIA only does a 1x1 grid. MSAA depth images get SAMPLE_LOCATIONS_COMPATIBLE_DEPTH.
  2. Resolve with a 1-sample rasterizer. It resolves with CB_COLOR_CONTROL in resolve mode but no sample count in PA_SC_AA_CONFIG, so it falls through to the normal draw path and throws "only normal color rendering with copy ROP… mode resolve". The target's own sample count is in CB_COLOR0_ATTRIB, separate from the rasterizer's, and radeonsi itself sets PA_SC_AA_CONFIG to 0 with an MSAA framebuffer whenever multisampling is off. So I treat it as a resolve when either the rasterizer or CB0 is multisampled, take the count from CB0, and keep your mismatch check for when the rasterizer is multisampled.
  3. Clears by buffer fill. Hades clears its MSAA targets by filling their color memory with 0, no CMASK involved. Since the image only lives on the GPU, the fill never reaches it, and the previous frame stays: you get ghost copies around the character and a broken shadow. I handle it like the CMASK fast clear: a uniform fill over the whole color memory clears the image to that value at its next use (a pending CMASK clear still wins). One catch: the size has to use the MSAA tile layout. A 64 KiB block holds width × height × samples elements (addrlib's ComputeThinBlockDimension), so an 8-byte 4x target is 64×32 pixels per block. That's exactly what the game fills (0xff0000 for a 960×540 RGBA16F 4x target), while single-sample size × 4 comes out bigger.

I have all three on branches based on yours. Happy to open them as follow-ups after this lands, or share them if you'd rather pull them in here. Whatever's easier for you

LLM assistance was used in the investigation by me.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077082453 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6077082453). Originally posted by [Raghav314](https://github.com/Raghav314) on 2026-10-09T08:11:26Z. --- Tested this with Hades II (PPSA36082) on Linux with an RTX 4090. With it (plus some unrelated fixes) the 4x targets work and I get all the way into gameplay. Three things in here stopped it or broke rendering on the way, all fixed on top of your branch: 1. Sample positions. Hades uses an ordered grid instead of the standard one: PA_SC_AA_SAMPLE_LOCS is 0x444cc4cc in all four pixels, so samples at ±4/16. decodeSamples refuses that. I added VK_EXT_sample_locations, only for patterns that are the same in every pixel, since NVIDIA only does a 1x1 grid. MSAA depth images get SAMPLE_LOCATIONS_COMPATIBLE_DEPTH. 2. Resolve with a 1-sample rasterizer. It resolves with CB_COLOR_CONTROL in resolve mode but no sample count in PA_SC_AA_CONFIG, so it falls through to the normal draw path and throws "only normal color rendering with copy ROP… mode resolve". The target's own sample count is in CB_COLOR0_ATTRIB, separate from the rasterizer's, and radeonsi itself sets PA_SC_AA_CONFIG to 0 with an MSAA framebuffer whenever multisampling is off. So I treat it as a resolve when either the rasterizer or CB0 is multisampled, take the count from CB0, and keep your mismatch check for when the rasterizer is multisampled. 3. Clears by buffer fill. Hades clears its MSAA targets by filling their color memory with 0, no CMASK involved. Since the image only lives on the GPU, the fill never reaches it, and the previous frame stays: you get ghost copies around the character and a broken shadow. I handle it like the CMASK fast clear: a uniform fill over the whole color memory clears the image to that value at its next use (a pending CMASK clear still wins). One catch: the size has to use the MSAA tile layout. A 64 KiB block holds width × height × samples elements (addrlib's ComputeThinBlockDimension), so an 8-byte 4x target is 64×32 pixels per block. That's exactly what the game fills (0xff0000 for a 960×540 RGBA16F 4x target), while single-sample size × 4 comes out bigger. I have all three on branches based on yours. Happy to open them as follow-ups after this lands, or share them if you'd rather pull them in here. Whatever's easier for you LLM assistance was used in the investigation by me.
MichonGoddijn231849 commented 2026-10-09 08:33:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T08:33:32Z.


@Raghav314 thanks, that's a great test, and all three findings make sense (the ordered sample grid through VK_EXT_sample_locations, the resolve with a 1-sample rasterizer taking its count from CB0, and the fill clears sized with the MSAA tile layout). Please open them as follow-ups on top of this one. That keeps this PR reviewable, and they should land under your name.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077399337 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6077399337). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-09T08:33:32Z. --- @Raghav314 thanks, that's a great test, and all three findings make sense (the ordered sample grid through VK_EXT_sample_locations, the resolve with a 1-sample rasterizer taking its count from CB0, and the fill clears sized with the MSAA tile layout). Please open them as follow-ups on top of this one. That keeps this PR reviewable, and they should land under your name.
Raghav314 commented 2026-10-09 08:40:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T08:40:14Z.


Alright, Will do that, Thanks for the reply

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077494099 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6077494099). Originally posted by [Raghav314](https://github.com/Raghav314) on 2026-10-09T08:40:14Z. --- Alright, Will do that, Thanks for the reply
oneandonlydean commented 2026-10-09 23:58:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T23:58:22Z.


Two things so this and the PRs stacked on it (#2169, #2121, #2132, #1189) can go in once #374 lands:

  • It conflicts with main in Texture.hpp. Could you rebase onto main after #374 is merged?
  • Since a multisampled colour target's samples only exist on the host, could a guest access to that memory throw instead of reading what's there? That covers a CPU read through write tracking, a DMA copy, and a texture or image read at the target's address. Sampling a multisampled depth surface already throws (sampling a multisampled depth surface is not implemented); a test that reads a resolved-only colour target's memory and expects the throw would cover the colour side. With that, keeping the targets host-only is exact, and it doesn't need to wait on the write-back question.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6091319131 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6091319131). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T23:58:22Z. --- Two things so this and the PRs stacked on it (#2169, #2121, #2132, #1189) can go in once #374 lands: - It conflicts with main in `Texture.hpp`. Could you rebase onto main after #374 is merged? - Since a multisampled colour target's samples only exist on the host, could a guest access to that memory throw instead of reading what's there? That covers a CPU read through write tracking, a DMA copy, and a texture or image read at the target's address. Sampling a multisampled depth surface already throws (`sampling a multisampled depth surface is not implemented`); a test that reads a resolved-only colour target's memory and expects the throw would cover the colour side. With that, keeping the targets host-only is exact, and it doesn't need to wait on the write-back question.
MichonGoddijn231849 commented 2026-10-10 08:23:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T08:23:47Z.


Will do both once #374 is in. That's where its five HTILE commits come from, so one rebase onto main then fixes this PR and the ones on top of it.

  • Rebase: onto main after #374 merges.
  • Guest access to a multisampled colour target throws: a CPU read through write tracking, a DMA copy, and a texture or image read at the target's address. That keeps the host-only samples exact without waiting on the write-back question. I'll add the resolved-only test you describe, a read of the target's memory that expects the throw.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095646048 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6095646048). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T08:23:47Z. --- Will do both once #374 is in. That's where its five HTILE commits come from, so one rebase onto `main` then fixes this PR and the ones on top of it. - **Rebase:** onto `main` after #374 merges. - **Guest access to a multisampled colour target throws:** a CPU read through write tracking, a DMA copy, and a texture or image read at the target's address. That keeps the host-only samples exact without waiting on the write-back question. I'll add the resolved-only test you describe, a read of the target's memory that expects the throw.
xXPBSXx commented 2026-10-10 22:49:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-10T22:49:19Z.


Another title that stops at a multisampling-related state check: Resident Evil 4 (PPSA07411 v01.000.000). On Windows, with several start-up fixes that are not in main yet (kept on fork branches), it now reaches its first draws and aborts with:

what():  scan conversion mode is unsupported (register 0x292 = 0x00000003)

The check is ScanModeMask = ~0x22u for context register 0x292 in Graphics/src/State.cpp, so only bits 1 and 5 are accepted, and the title sets bit 0 as well. I did not look at the render target of that draw, so I cannot say whether it is actually multisampled or whether the bit is set for a single-sample target. I also did not check what bit 0 of this register means for gfx1013, so I am not claiming that it is the multisample enable bit.

I mention it here because this is the open pull request about multisampled targets; if it already covers register 0x292, this title would be a test case for it. Windows 10 (19045), NVIDIA GeForce RTX 4080 SUPER, Release. Dump from my own digital copy; no game files shared. AI-assisted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103019818 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6103019818). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-10T22:49:19Z. --- Another title that stops at a multisampling-related state check: Resident Evil 4 (PPSA07411 v01.000.000). On Windows, with several start-up fixes that are not in `main` yet (kept on fork branches), it now reaches its first draws and aborts with: ``` what(): scan conversion mode is unsupported (register 0x292 = 0x00000003) ``` The check is `ScanModeMask = ~0x22u` for context register `0x292` in `Graphics/src/State.cpp`, so only bits 1 and 5 are accepted, and the title sets bit 0 as well. I did not look at the render target of that draw, so I cannot say whether it is actually multisampled or whether the bit is set for a single-sample target. I also did not check what bit 0 of this register means for gfx1013, so I am not claiming that it is the multisample enable bit. I mention it here because this is the open pull request about multisampled targets; if it already covers register `0x292`, this title would be a test case for it. Windows 10 (19045), NVIDIA GeForce RTX 4080 SUPER, Release. Dump from my own digital copy; no game files shared. AI-assisted.
Amoenus commented 2026-10-11 04:53:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T04:53:02Z.


Latest local integration validation (2026-10-12)

Sonic Unleashed PPSA99902 now reaches the post-opening-movie NOW LOADING screen, then stops at dithered/rounded alpha-to-coverage0x18701 in fork integration08891d938 (13485ff9f snapshots + constant-fill recognition/allocation accounting). This is the pinned-main a672688e integration with prior color/depth, #4021/#4029, merged #3683 and the independently derived #4141 fixture correction (now merged upstream through #4159); fixed main-f609 conversion, shader cache disabled. Controlled menu-entry input is verified below. Interactive gameplay, audio, rendering accuracy, console/AMD equivalence and unchanged upstream main remain unverified.

What changed and why

Compatible single-slice 2D/2D-array multisample reads copy the retained color image to an independent GPU snapshot, preserving every fragment and raw component before later writes. Ordered barriers and retained source/destination owners protect queued copies; actual image allocation is charged to the recorder's retained-memory budget. Actual CPU reads still use the existing sample-preserving publication path. Unsupported geometry/conversions and uncertain metadata transitions retain explicit failures. Copy/view rules: Vulkan image copies and format compatibility. No shader-instruction semantics changed.

The first snapshot-only experiment exposed a different clear kernel, rather than the previously validated 17-word mask kernel. Two guard-preserving captures agree: six user SGPRs, 11 words, 64×1×1 threads; full DCC552960 bytes become 00, CMASK81920 bytes become CC; tracked guest color/FMASK ranges remain unchanged. The captured constant-fill kernel matches pinned Mesa's fill-memory shader: offset=min((groupX*64+localX)*16,maxOffset), replicated DWORD×4 store. The generic matcher clips coverage to both dispatch count and maximum offset. Dispatch still runs; native reuse requires its newer completed-store evidence, the expected full uniform clear code, unchanged sample/FMASK ranges, no recorded pending writer, no observed CPU metadata race and no intervening native write. Unknown/partial/indirect cases remain unimplemented. StoredOver alone establishes overlap, not full coverage or writer ownership; these are separate checks. CPU atomic exclusion after the final check remains unverified. #3816 matches a distinct 9-word memory-value kernel and was inspected, not applied/tested here.

Validation

Windows11 Enterprise26200 / RTX5080 / WinLibs GCC15.2 r7, Release/testing ON. Full build, all122 patched/unpatched modules, registration and conventions pass. 16 relevant groups ×5 and full recorder ×5.

  • 96 GPU snapshot configurations: eight formats ×2/4/8 samples ×2D/one-layer-array ×recorded/direct; exact fragment/components, output guards, immutable earlier snapshot after a later write, queued source lifetime, no sample-byte publication and allocation accounting.
  • 72 production-recompiler GPU fill configurations: wave32/64 ×groups1/2/80/540 ×below/exact/above clamp boundary ×three values; every DWORD and head/tail guard checked. Pure matcher tests cover both captured allocations and malformed inputs.
  • Four published and four unpublished clear cycles per format/sample configuration, 30 refusal cases each; actual CPU-read publication/padding retained. 14 deliberate faults ×5 reject missing/short copies, missing clear coverage/completion/CPU/write-serial/value guards, missing allocation accounting, disabled clamp/dispatch and incorrect matcher bounds. Sources restored and rebuilt; relevant tests repeated after observers.
  • Full suite:867 pass /0 fail /5 explicit skips of872, slowest15.4859s. New GPU tests take ~0.5–1.4s here. Linux/lavapipe not run for these changes.
Frozen profile Result
Snapshot-only 13485ff9f, before / restored Same metadata refusal,29.130 /30.682s, 0xC0000409
Corrected 08891d938, two normal runs 60s observation limit,61.168 /61.263s including termination; no fatal diagnostic

A separate180s observer finishes at181.095s: 1895 native snapshot lookups,947 clear imports,zero dirty guest publications, no fatal diagnostic; eight distinct GPU frame payloads, visually inspected “PRESS START.” These operation counts are not FPS or presented-frame counts, and no new performance timing is claimed. The stable pre-snapshot cfc9b0411 control also reaches the title screen; this validates removing the sampled-lookup CPU round trip while preserving that milestone.

Original ELF/module, converted guest libc and exact123-file runtime baseline restored/hash-verified; observer/fault sources byte-restored, full build/libs and16 groups ×5 pass again; checkout clean. The integration is now pushed to the fork as linked below; no new PR or proprietary data upload. AI-assisted code/investigation/report: Codex.

Controlled input and next startup boundary

Same production head08891d938, no new production-code changes. Temporary pad-return transition logging and spaced GPU dumps use the existingAPS5_PAD_INPUT_FILE facility; physical UI input is ignored in both control and input cases. The no-input180s control (181.075s including termination) stays at PRESS START. The input180s case (181.124s) records returned pad buttons0x8 and0x4000, each released after its300ms pulse: Options advances to the readable autosave notice; Cross advances to the visible NEW GAME menu. Two fresh240s probes repeat this menu entry. Public port source maps these masks to Start/A, but the dump's exact source revision is unconfirmed; runtime pad-return logs and observed screen responses supply independent evidence.

Selecting NEW GAME shows a dialog whose body text is not visible but whose Cross/Next prompt is visible. A Next press advances through loading to the opening cinematic. The later 480.719s observation captures43 spaced frames: four verified input pulses, then no further input; frames019/034/042 show later battleship, corridor and Super Sonic/Eggman cinematic scenes. No fatal diagnostic; the movie remains active at the observation limit. This establishes extended cinematic progress, not interactive gameplay, audio, FPS or rendering accuracy. Dumps may perturb timing.

Pre-snapshot parent control: frozencfc9b0411 libraries, the same pad-return logging/frame gates and restored empty working saves; three verified1500ms input pulses,481.207s/43 spaced frames, no fatal diagnostic. Its final frame042 shows a fully visible dialog with the Next prompt and no visible body text. The observed absence therefore predates both13485ff9f and08891d938. Its underlying cause/purpose remains untraced; no new AnyPS5 defect is claimed. The parent is the earlier local integration, not unchanged current main; input timing differs, so no performance or pixel-exact comparison is claimed.

All ten temporarily reverted/observer source files restored byte-for-byte to088; full build/libs and four relevant groups ×5 pass again (pad, native snapshots, metadata reset, constant fill). Previous17-group ×5 and full872 results above remain attributed to their prior runs on the unchanged production head; no full-suite rerun in this observation round. Original ELF/module, converted guest libc and exact123-file runtime baseline hash-verified. Generated working save files archived privately and pre-test empty saves/config/achievement-marker state restored exactly after both observations. No production-code change in these observations; the validated integration is now published to the fork, with no new PR or proprietary-data upload.

Published with the user's renewed authorization: experimental integration08891d938, pinned toa672688e. Focused commit diffs: completed native depth clears406838ac7, device-staged readback3d5c594c3, native GPU snapshots13485ff9f, constant-fill recognition/allocation accounting08891d938. These changes depend on the integration's earlier MSAA foundation and validated prerequisites; they are not standalone current-main patches. Snapshot-only134 reproduces the documented metadata refusal; use the corrected088 integration for this title. Existing #4021/#4029 and merged #3683 work remains credited to its authors in the history/commit records. #4159 by MarcZX100 has now merged the equivalent fixture correction and closed #4141; no additional fixture PR is proposed.

Immediately before pushing, exact088 full build/libs/registration/conventions pass; seven relevant groups ×5, then full872:867pass/0fail/5 explicit skips, maximum15.5141s. Windows11/RTX5080/WinLibs15.2, cache disabled; no new Linux/lavapipe or unchanged-current-main validation. Fork branch head independently verified as08891d938 after push. No new PR.

A further480.725s/43-frame movie-control probe repeats normal menu entry and logs an Options/Start pulse and a Cross/A pulse during the visible cinematic, both pressed/released. Later captures remain cinematic (final042: Super Sonic); no fatal diagnostic or verified skip/post-cinematic scene. Sparse captures do not exclude a brief prompt. Original/module/libc/exact123-file runtime and working saves/config/marker restored; no source changes or proprietary upload.

Movie end, new explicit blocker and measured FPS

The longer run is now terminal: 764.735s, exit0xC0000409, not a timeout,71 private spaced frames. Four verified normal menu pulses, then no further input; final070 shows the post-movie NOW LOADING/control-tutorial screen. It then fails withdithered or rounded alpha-to-coverage is unsupported (register 0x2dc = 0x00018701). New issue4285 records this distinct mode, dependencies, exact diagnostic and main-source comparison. A private extension of the existing decoder fixture reproduces the exact DecodeState/precheck refusal 5/5, retaining disabled/undithered and separate dither/round controls. Test source restored; full build/libs and six relevant groups×5 pass. Main d146 still has the same guard, as did the pre-snapshot parent. This is a documented unsupported mode newly reached by this integration; no attributed regression, whole-current-main startup or interactive-gameplay claim. Original/module/libc/exact123 runtime and empty working data restored/hash-verified.

Separate240.734s FPS observation on the unchanged088 frozen observer, same normal menu sequence,19 frames/no fatal. AnyPS5's two-second window-title counter, sampled about1.23s, with188 valid title samples; phase windows matched to actual images:

Phase Median reported FPS Observed range
PRESS START 6.06 5.90–6.20
Autosave notice 5.38 5.26–5.46
NEW GAME menu 13.15 12.82–13.22
Opening cinematic 59.94 59.93–59.95

This counts successful VideoOut presentation calls (UpdateTitle), not verified displayed/unique movie frames, simulation rate or gameplay FPS. One instrumented run,3840×2160 display-buffer captures, AnyPS5 shader cache disabled; GPU dumps and title polling may perturb timing. No before/after FPS improvement claimed. Bundled PresentMon produced no usable trace. The metadata observer hit a PID-exit race after the scheduled game stop; persisted samples and terminal game outcome were retained, and original/baseline/working-data restoration independently reverified after the harness completed. No emulator source change.

Next: independent Windows/RTX5080 validation of discussion2242/phase-B#4152 as requested. The alpha gap stays explicit while its full draw and exact coverage behavior are investigated through4285; absent dialog body remains untraced. This canonical comment is edited in place.

Previous stable integration and staged-readback measurements

Latest local integration validation (2026-10-12)

PPSA99902 reaches the Sonic Unleashed “PRESS START” title screen in the local, unpushed cfc9b0411 integration, on pinned main a672688e with earlier sampled/color/depth support, validated #4021/#4029 corrections, merged #3683 AMM placement and the corrected #4141 test fixture. The staged-readback measurements below remain attributed to 3d5c594c3. This is the fixed main-f609 conversion, Vulkan required and shader cache disabled. There is no input, main-menu navigation, gameplay, rendering-accuracy or console/AMD-equivalence validation here.

Confirmed readback improvement

Resident color samples now gather into a DeviceBuffer, then cross to the host with CopyBuffer; shader→transfer and transfer→host barriers precede fence wait/invalidation. Every sample/component and the original byte count are retained. Upload/readback shaders are unchanged. Scratch adds a full linear sample payload in device memory; allocation failures throw. General behavior, no title check or sample collapse.

Two original and two changed 180s timing observations, followed by a replay of the exact frozen original timing library:

Profile Complete publications Median readback batch Median full publication
Original 1 / 2 71 / 71 998.203 / 998.103 ms 1574.664 / 1573.685 ms
Changed 1 / 2 129 / 129 12.607 / 12.362 ms 594.398 / 592.817 ms
Restored original 71 992.405 ms 1574.688 ms

These are CPU wall times of the instrumented operations, not GPU timestamps or FPS. Target: 3840×2160, eight samples, eight-byte elements; 530,841,600 linear bytes and 534,773,760 physical color bytes. Incomplete final publications are excluded. The earlier runner-NameError attempt is excluded. Remaining median CPU tiling is ~233ms and color guest-store work ~199ms per publication.

Reusable implementation outline in ReadSamples:

DeviceBuffer samples(context, bytes, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
Buffer readback(context, bytes, VK_BUFFER_USAGE_TRANSFER_DST_BIT);
transfer(batch.Handle(), samples.Handle(), true);
RecordMemoryBarrier(context, batch.Handle(), VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT);
CopyBuffer(context, batch.Handle(), samples.Handle(), 0, readback.Handle(), 0, bytes);
RecordMemoryBarrier(context, batch.Handle(), VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT);

bytes is the existing four-byte-aligned sample count. The private transfer helper takes a VkBuffer; the existing producer barrier, submission/wait and host invalidation remain.

Behavioral and startup evidence

Windows11 Enterprise26200 / RTX5080 / WinLibs GCC15.2 r7, Release/testing ON. Full build, all122 patched/unpatched modules, registration and conventions pass. 14 relevant groups ×5, full recorder ×5; target tests now cover 48/48 configurations, including full and forced256-byte descriptor ranges, exact sample/component values, metadata, padding, queued writers and reuse. Omitted DMA copy, four-byte-short copy and incorrect chunk starting element each fail for the expected assertion ×5. Fault/diagnostic sources are byte-restored; full build/libs and14 groups ×5 pass again after restoration.

Latest stability full suite: 865pass/0fail/5 explicit skips of870, maximum15.5673s. Merged #3683 is applied as localcb2c3a7c5, with upstream credit: placement/markers groups each200 passes; restoring only the old fixed-address calculation fails5/5 occupied-top controls; source restored and rebuilt/restored groups ×5 pass. Localcfc9b0411 corrects #4141: allocator guard gap/nonzero-charge assertion, registered cache test50/50; forced-adjacent/unguarded/separated controls ×5 show assertion/FPE/pass as intended. All244 library files stayed byte-identical across the test-only correction. Full build/libs/registration/conventions and14 native groups ×5 pass. Focused one-file local preparation on mainbca7a29d: d32ceb3c6, unpushed; not whole-current-main validation.

The earlier869-test changed runs had the two confirmed failures documented above, before these corrections. The existing #3371 comment is maintained in place with the AMM verification. The four refreshed normal controls reach60s without a fatal diagnostic; a fresh180s GPU observer still captures PRESS START. Original/module/converted libc/exact123-file baseline verified after all runs; temporary source tags restored byte-for-byte, full build/libs and14 groups ×5 pass again. No Linux/lavapipe, rendering accuracy or whole-upstream-head claim.

Normal before/changed1/changed2/restored controls all reach the60s observation limit without a fatal diagnostic. Separate dirty-publication caller observations record 130/130 and122/122 publications from ShaderResources.cpp:580, cachedTexture; standard source_location tags identify the actual requesting call, not an inferred stack. The early GPU dumps show changing intro imagery. A second observer gates dumps until45s after first display-buffer use, then captures every tenth presentation: black at73.916s, and the title prompt in inspected captures at120.243/166.439s. Five late GPU captures have distinct pixel payloads. These are local conditional observations; the readback change is not claimed to have enabled the early intro.

Original ELF/module, converted guest libc and exact123-file runtime baseline restored/hash-verified; source checkout clean. Images, dumps, logs and probes remain private outside the repository. No push or new PR.

Read/write contract confirmed before changing sampling. A separate guard-preserving180s trace tags the active graphics draw with RAII: 131/131 dirty publications read eight-sample RGBA16F0x405fc00000 (534,773,760 physical bytes) while that draw writes a different single-sample/eight-byte 3840×2160 target0x404fc00000 (66,846,720 bytes), with zero range overlap. 65 metadata transitions are imported withdirty=0 after existing publication. No fatal diagnostic. This establishes the observed postprocessing relation, not a general absence of feedback. ImportPublishedClear currently rejects dirty native images, so simply removing sampled-lookup publication would violate that clear-state contract. The current MSAA color lookup also creates a fresh snapshot; a shared live view would require checking read-before-write/feedback behavior and lifetime. The established OwnedImage resource owner and Vulkan image-copy rules are relevant to preserving every sample on a GPU-only snapshot path.

Next: implement and test the general native GPU sampling/copy path with complete known-clear transitions, every sample/component, queued producers, snapshot/feedback semantics, ownership and actual CPU-read publication/conflict guards. Current native images lack sampled/transfer-source usage; new view/copy capabilities need explicit queries. Unknown cases still throw. This canonical report is edited in place. AI-assisted code/investigation/report: Codex.

Earlier validation evidence and historical controls

The records below describe earlier checkpoints and retain their original observation limits. The latest section above supersedes historical statements that no frame had been demonstrated.

Maintained validation report (2026-10-12)

Current source reviewed: #419 c120d995472e2d49b01c7911401aa6675315c881, on main a11c8f7f. Its six commits were also applied without conflicts to our sampled-color/depth integration 7b70443c0. The resulting 663318a1 is an adapted integration, not an unchanged whole-PR build.

Confirmed current-head gap: guest-access guard misses tiled sample memory

The new guard registers max(target.bytes, width * height * elementBytes * samples), but DecodeColorBuffer still supplies a single-sample layout size. This can omit valid texels in multisample tile padding.

Concrete counterexample: 65x65, 4-byte elements, 4 fragments, SW_64KB_R_X, one mip/slice. Single-sample size is 65,536 bytes; the guard covers 67,600 bytes; the fragment-aware physical footprint is 262,144 bytes. Texel (x=64,y=0,fragment=1) lies at byte offset 82,944, outside the guard. Geometry and this address match pinned AMD PAL/addrlib.

I compiled the exact current PR's registration/refusal functions into a probe, installed that callback using the native GuestMemory::SetReadGuard, registered real allocated guest memory, and called native GuestMemory::Read. All five original runs returned bytes from that valid sample without refusal. Giving the same guard the fragment-aware full extent refused all five control reads. A separate 18-configuration geometry/address probe (three extents, 4/8-byte elements, 2/4/8 fragments) also passed five repetitions per original/corrected variant. This exercises the extracted guard and real native CPU-read path; it does not run the whole PR's target constructor, GPU rendering or console hardware.

Suggested correction: compute the supported target's physical sample-aware footprint and slice stride, and use that extent for guest-access checks; throw on layouts not established. #2132 already proposes sample-aware footprints for color fills, so that work should be considered when sharing the calculation. The counterexample is independent of title startup. A local current-base experiment now assigns the complete R_X sample footprint in DecodeColorBuffer; other layouts remain refused by the initial-content path. PPSA99902 then reaches the retained initial-import refusal described below. The current upstream PR still has the footprint gap.

Fresh covered-centroid boundary and initial contents

Two fresh PPSA99902 captures at the current boundary contain PA_SC_AA_CONFIG=0x2030e003, standard 8x positions including sample7 (7,-7), and SPI_PS_INPUT_ENA=SPI_PS_INPUT_ADDR=0x2 (perspective-center only). Context/shader/user-config and all 12,288 effective constant-RAM words were captured; saved-context state was not captured.

Pinned GFX10.3 schema names bit29 COVERED_CENTROID_IS_CENTER; RADV sets it on GFX10.3+. A bounded local follow-up admits that bit only without active perspective/linear centroid inputs, preserving active-centroid refusals in both precheck and decode. The raw captured draw now passes the coverage check and reaches the DCC MSAA-target refusal in five CPU-only repeats. No title register bit was cleared.

Local integration 10103b27f also explicitly refuses multisample target creation because initial guest sample contents are not imported; it disables that render path and is not completed MSAA rendering. Full build/all 122 patched runtime libraries and conventions passed. Eleven relevant registered groups x5 and five actual full-recorder runs passed for both peer and guarded integrations; the guarded recorder fixture checks initial-content refusal, not GPU guest-access behavior. The guarded full suite: 843 total, 836 passed, five skipped, two already tracked failures (#3411, #3526).

Two guarded title runs and an AGC-only replacement control reach DCC over a multisampled color target is unsupported (30.828/29.822/29.722s). Restoring the peer profile reproduces the coverage refusal (29.795s). All use the same fixed main-f609 converted executable, Vulkan required/cache off; no timeout; original dump and exact 123-file baseline restored/hash-verified. These are conditional integration controls, not freshly relinked or stock-main startup.

Refreshed complete metadata at the render refusal

Two new guard-preserving captures on integration 10103b27f confirm CB0 is 3840x2160 RGBA16F, eight samples/fragments, one layer/mip, SW_64KB_R_X. The entire source-derived DCC range (552,960 bytes) is zero; the entire CMASK range (81,920 bytes) is 0xCC. Raw/synchronized payloads and both captures agree; no tracked pending recorder/storage writes, flush or wait was reported. The physical color footprint is 534,773,760 bytes. Color and FMASK were captured only as 64 KiB prefixes; the FMASK prefix is 0x76543210, not proof of its effective mapping.

Against the current native library, ten state probes decode DCC as clear0000, encode all RGBA16F components as zero, and confirm CMASK CC is classified as mixed with a retained refusal. Ten changed-DCC controls are rejected. Pinned Mesa defines CC as FMASK-clear0/color-expanded; it is not a color-register clear. A separate standalone probe calling the expected CMASK throw aborted across the DLL boundary; cause untraced, so the successful state probes do not validate that exception path.

The capture diagnostics were restored byte-for-byte. Two further captures agree on the refusing reader: one-layer, one-mip, eight-sample RGBA16F R_X, 3840×2160, address 0x405fc00000, full footprint 0x1fe00000, XOR 0x8000, DCC 0x40819f4000. This matches the recorded color target; the stop was incomplete residency coherence.

The earlier local, unpushed experimental integration fa08446d6 (on a01b13ea0, main a11c8f7f) publishes each native color sample into guest R_X memory before guest-memory synchronization or sampled-texture lookup. It preserves tile padding and expands full DCC/CMASK/FMASK ranges; FMASK reimport requires a verified complete identity mapping. Expansion values follow PAL Gfx9Dcc::GetInitialValue, Gfx9Cmask::GetInitialValue and Gfx9Fmask::GetPackedExpandedValue at c5e800072a32f68b6ccc4422936d96167c6e0728. Watched guest writes, pending external GPU writes, fills and unsupported transitions still throw. Direct CPU writes racing the final stores are not atomically excluded; eviction publication is incomplete. This remains local validation work, not an unchanged-PR-head test or console-equivalence claim.

Full build, all 122 patched/unpatched libraries, registration and conventions pass. Ten relevant groups each pass five runs; each target run exercises 24/24 GPU configurations. Tests check physical fragments/XOR/padding, real native attachment writes, CPU publication, expanded metadata/reimport, conflict refusals and actual GPU sampled fetches of R32_UINT and RGBA16F/DCC. Five full recorder runs pass. Eight faulty variants are each rejected five times: zeroed samples, damaged padding, incorrect CMASK, incorrect FMASK, omitted dirty tracking, ignored publication conflicts, recursive publication and zeroed readback. Source bytes are restored and full build/tests repeated. Omitting the explicit recorder sync is a passing control five times: CommandBatch still submits prior work, waits on its fence and reaps completions. Ten full captured-metadata positives pass; ten changed-DCC controls reject. The current FMASK helper matches twelve pinned-PAL geometry cases five times.

Full suite: 839 passed / 2 failed / 5 skipped, same failure names as the previous integration (windows_exceptions, agc_driver_emulated_color_compare); slowest test 15.442 s. Those historical full suites were not green.

Controlled before/after1/after2/restored runs take 30.692/32.268/33.964/30.357 s, all 0xC0000409, without timeout. Before/restored reproduce the resident color-texture refusal. Both after runs pass that boundary and stop at sample-preserving readback of a resident depth surface is not implemented. Source inspection confirms the depth-residency guard prevents sampling stale guest bytes; native multisample depth sampling/readback remains incomplete. All runs use the fixed main-f609 conversion and identical controls; original ELF/module and exact 123-file baseline hashes are verified after restoration. No frame or gameplay is established.

Two temporary depth diagnostic captures now agree on the final reader and resident target: 3840×2160 D32, eight samples, Z_X, slice/mip zero, no XOR, depth 0x4081c00000, HTILE 0x4091b00000. The reader is R32_SFLOAT with R/zero/zero/one components. Full physical depth footprint is 0xff00000, while the fa08446d6 overlap guard used the single-sample 0x1fe0000 range; the last logical sample is at 0xfef9afc, outside that guard. Current native layout/HTILE helpers match 36 pinned-PAL geometry cases five times (180 comparisons). This guard undercount belongs to our local integration, not upstream main.

Both full 640 KiB HTILE captures are byte-identical: 163840 clear-zero words, including padding, matching the native target's initial clear value. Ten native helper checks pass; changing the final word to unsupported compression or clear-one refuses in twenty controls. Refusals carry the expected runtime-error diagnostic but terminate through the current Windows libc path with 0xC0000409; they are not caught-exception passes. The second register capture additionally records earlier depthWrite=1 decode calls, so unchanged clear metadata does not establish that the native image was never written. At that capture stage there was no native multisample sampled-view test; arbitrary raw depth import remains unproven.

Diagnostic sources are restored byte-for-byte; full build, all 122 patched/unpatched libraries, registration/conventions, ten relevant groups ×5 and full recorder ×5 pass again. Original dump/module and the 123-file baseline hashes are verified. The two diagnostic title runs stop at the unchanged resident-depth guard in 36.445/33.236 s, without timeout.

Local, unpushed a8eac4dfe now corrects the full Z_X depth/stencil ranges used by overlap guards and array-slice strides; other multisampled attachment layouts throw. This is a prerequisite for resident-depth sampling, which remains refused. Full build/libs/registration/conventions pass, ten relevant groups ×5 and full recorder ×5 pass. Eighteen depth/stencil footprint cases run five times; the actual native helper matches 270 pinned-PAL comparisons. Four old-behavior variants—single-sample depth/stencil guards and depth/stencil strides—each fail five times. Both the library and the separately compiled graphics executable are rebuilt for those controls; the first stale-executable harness observation is preserved and excluded. Sources are restored byte-for-byte.

Full suite: 839 passed / 2 failed / 5 skipped, no new failure names versus fa08446d6, slowest 15.521 s; not green. Controlled before/after1/after2/restored runs take 33.314/33.421/32.850/32.426 s, all stop at the same resident-depth guard without timeout. Original/module and exact baseline hashes are restored and verified after each run. No startup advancement or native per-sample depth rendering/sampling is established by this correction. Array stride arithmetic is tested; slice XOR rotation and metadata slice identity remain unverified.

Two additional pre-construction captures agree: initial depth clear is zero; the full depth/HTILE ranges are mapped and watched; no recorder pending writer overlaps; all 163840 HTILE words are zero. Raw DB_HTILE_SURFACE=0x00040002 retains pipe alignment and zero VRS encoding. These unsynchronized observations are not atomic against CPU stores and do not establish native per-sample contents after draws. Diagnostic sources were restored and full build/tests repeated.

The intermediate local, unpushed integration 7731aa3d1 was based on pinned main 0a8b1d32. The old validated branch is preserved. Rebase dropped the Windows symlink/directory-time changes already merged upstream; the include conflict kept both required headers. Full build/libs/registration/conventions, ten relevant groups ×5 and full recorder ×5 pass. On intermediate main 12c2266, full suite is 841 passed / 1 failed / 5 skipped; only windows_exceptions fails, including five targeted repeats. sRGB comparison now passes. Later main 0a8b1d32 replaces the failing guest-exception-through-call_once test with guest-frame-only coverage and records runtime-DLL unwinding as technical debt. Its registered suite is 842 passed / 0 failed / 5 skipped, slowest 15.362 s; six upstream-related groups pass five repeats. All 244 patched/unpatched production-library outputs are byte-identical across this test-only rebase, so the green result does not establish a runtime-unwind fix.

Controlled old/new/new/restored startup runs on the two rebases take 33.295/30.652/33.611/32.680 s and 32.864/33.267/32.228/32.641 s. All eight retain the resident-depth refusal and 0xC0000409, without timeout; fixed main-f609 conversion, original/module and exact 123-file baseline hashes checked after every restoration. Those rebases established no startup advancement, native multisample depth sampled-view verification, frame or gameplay.

Local native multisample depth sampled views and next boundary

Previous validated local, unpushed integration 2d16b4316 on pinned main 0a8b1d32 adds native one-layer D16/D32 Z_X depth sampled views. Import synchronizes producers, requires watched complete depth/HTILE ranges and uniform HTILE proving the registered zero/one clear, then retains exact attachment/reader identity. Guest CPU writes, external tracked GPU writes, arrays, stencil, VRS, unsupported raw imports, guest publication and metadata clear/fill transitions still throw. CPU stores racing the final generation check are not atomically excluded. This is adapted local integration work, not a change to #419's head or an unchanged-main test.

Full build, all 122 patched/unpatched libraries, registration and conventions pass. Twelve relevant groups ×5 and full recorder ×5 pass. New native GPU tests exercise 12/12 D16/D32 ×2/4/8 samples ×initial-zero/one configurations, synchronize a queued initial metadata producer, rasterize two rounds of distinct per-sample depth values into the actual attachment, and fetch each sample through the retained sampled view with R/zero/zero/one components. D32 values are exact; D16 is within one normalized step. Full-range CPU read/write and external-write refusals, cache identity, metadata/layout and unwatched-memory controls are tested; a separate group checks 21 refusal cases. Six deliberate faults are caught five times each: omitted HTILE proof, ignored guest generations, ignored reader identity, disabled guest-publication guard, all raster masks selecting sample zero, and fetches selecting sample zero. Sources were restored byte-for-byte, full build/libs and native tests ×5 repeated. Full suite: 844 passed / 0 failed / 5 skipped, slowest 15.466 s. Linux/lavapipe and console/AMD semantics remain unverified.

Controlled before/after1/after2/restored runs take 33.144/34.708/34.598/32.777 s, all 0xC0000409, without timeout. Before/restored reproduce the resident-depth readback refusal; both changed runs pass it and stop at guest writes to a resident multisample target or its metadata are not implemented. Fixed main-f609 conversion and identical controls; original ELF/module and exact 123-file runtime baseline restored/hash-verified after every run. This establishes advancement past that conditional startup boundary, not a frame or gameplay.

Two further guard-preserving captures (33.687/35.076 s) agree on the new boundary: existing 3840×2160 RGBA16F, eight-sample R_X color target 0x405fc00000, XOR 0x8000, resident dirty=false. The full 552,960-byte DCC at 0x40819f4000 is zero and full 81,920-byte CMASK at 0x40819e0000 is CC, byte-identical across captures. Both ranges have newer driver-write stamps and StoredOver=true, with no newer CPU-write stamps; color and FMASK have no changed tracker blocks at this boundary. At that capture stage, the exact writer and ordering had not yet been traced; the follow-up below resolves the immediate writer. This is a retained local residency-transition refusal; it is not evidence of an upstream bug or a reason to accept stale native samples. Temporary diagnostics are removed byte-for-byte; full build/libs and twelve relevant groups ×5 pass again, baseline/original hashes verified.

Latest local color metadata reset and HTILE boundary

Two follow-up immediate-caller captures map all post-publication CMASK and DCC MarkWritten calls to BdaResources::markWrittenPages(), reached from shader completion/fault checking. The CMASK extent and five DCC chunks cover the complete recorded metadata. The earlier Windows stack walker returned zero usable frames and is excluded as caller evidence.

Current local, unpushed integration fca91606c on pinned main 0a8b1d32 admits a complete supported numeric DCC clear after native color publication. It requires unchanged color/FMASK, full uniform supported DCC/CMASK, watched generations and no pending external writer; it clears the retained native image and marks it for later publication. Unpublished samples, partial/mixed/unknown metadata, sample writes and recognized fill transitions still throw. CPU stores racing the final generation check remain unexcluded. No title-specific production branch or descriptor bypass was added.

Full build, all 122 patched/unpatched libraries, registration/conventions, 13 relevant groups ×5 and full recorder ×5 pass. The new reset test checks 24/24 RGBA8/RGBA16F ×2/4/8-sample ×four-clear-code cycles, actual per-sample GPU values, cached RGBA16F fetches, same-view retention, physical publication/padding, pending-producer refusal and ten negative transition cases per format/sample configuration. Six faults are each caught ×5: ignored unpublished state, ignored sample conflicts, first-byte-only DCC proof, forced zero clear, omitted dirty tracking and omitted generation refresh. An initial fault-harness line-ending anchor failure applied no dirty-tracking mutation; it is recorded and excluded, and that fault was subsequently run successfully. Sources restored byte-for-byte; full build/libs and tests repeated. Full suite: 845 passed /0 failed /5 skipped of 850, slowest 15.429 s. Windows11/RTX5080/WinLibs GCC15.2; no Linux/lavapipe or console/AMD equivalence claim.

Controlled before/after1/after2/restored runs: 36.083/30.816/33.249/34.784 s, all 0xC0000409, no timeout. Before/restored retain the color metadata refusal; both changed runs pass it and stop at native multisample depth fast-clear transition is not implemented. Same fixed main-f609 conversion and controls; original ELF/module and exact 123-file runtime baseline restored/hash-verified after every run. These timings do not establish a performance change; no frame or gameplay is established.

Two guard-preserving HTILE captures (35.217/34.640 s) agree on the retained 3840×2160 D32, 8-sample depth target 0x4081c00000, HTILE 0x4091b00000. The recognized mask kernel uses 640×1×1 groups, 64×1×1 threads, flags 0x2045, replacement 0, keep mask 0xff0, with no indirect or partial dispatch. The complete 655360-byte pre-dispatch HTILE is zero in both captures. These are pre-dispatch contents, not proof of the resulting HTILE or native depth samples. The current matcher checks kernel/user inputs but not dispatch coverage. Diagnostic sources are removed byte-for-byte; full build/libs and 13 relevant groups ×5 pass again; baseline/original hashes verified.

A subsequent completion-point diagnostic leaves the native refusal intact, calls Recorder::SyncThrough for the full HTILE, then captures it at the refusing reuse. Both runs (35.250/34.698 s) again contain 163840 zero words; they report no pending HTILE writer before/after the call, newer tracked stores (StoredOver=true), and unchanged tracked guest depth bytes. The synchronization call was not observed waiting for a pending writer. Native depth samples after draws and CPU-store atomic exclusion remain unverified; unchanged guest bytes are not proof that the native image was never rasterized.

The exact 17-word public mask kernel decodes to a group/local linear index, 16-byte offset, global DWORD×4 load, four AND-OR operations and DWORD×4 store. Pinned Mesa NIR independently specifies (old & keepMask) | replacement and 16 bytes per invocation. Thus the recorded 640×64 invocations span 655360 bytes when the group-ID/thread input controls match; those controls were not recorded by the earlier diagnostic. The 0xff0 user word is a keep mask, not the resulting HTILE clear word.

An external adaptation of the existing production-kernel GPU test checks 36/36 wave32/64 ×groups1/63/64/639/640/641 ×three-replacement cases, every DWORD and head/tail guards, ×5 runs (0.660–1.550 s). Every input word has bits that must change, avoiding an all-zero no-write false pass. One-workgroup-short and wrong-keep-mask faults each fail ×5 with the expected DWORD mismatch; the correct probe then passes ×5 again. Existing masked-store and VOP3 integer-ALU groups also pass ×5. Diagnostic source bytes and full build/libs restored; 13 relevant groups ×5 pass again; source clean and original/module/exact baseline hashes verified.

Related work reviewed: #2053 9a62ec7e reads changed HTILE at bind and expands guest words; #3816 69a67ca8 matches a different memory-value fill kernel. Neither PR head was built/tested in this round. These proposals are relevant context, not drop-in validated native multisample transitions. The same mask matcher remains in inspected upstream main c5da8233.

Local refresh onto pinned main a672688e (2026-10-12). Preserved the validated fca91606 branch; rebased the local integration, retained adjacent upstream math/debt additions, and consolidated the independently added ColorTarget::arraySlice member. Main's Windows HostPoll build failure was corrected with the exact existing #4021 change; its source/platform/network validation is recorded there. Local integration 9ded7ba36, full build + libs, registration and convention checks pass; the same 13 native multisample groups ×5 and full recorder ×5 pass.

The broader refresh is not a clean full-suite pass: 868 tests = 862 pass, one failure (agc_driver_prepared_shaders_registered_workgroup_sync), five explicit skips; maximum test duration 15.535 s. Of 49 affected groups repeated ×5, 47 pass; synchronous registered-workgroup preparation fails in the group run and all five isolated reruns. An external copy of that test, changing only its error label, identifies the missed expectation as v_readlane_b32 of lane 63 is outside. The deferred preparation group had one heap-corruption exit (0xC0000374), then passes five isolated reruns and the full suite; cause remains unconfirmed. Existing test and library source were not changed to suppress either failure.

Four controlled startup runs (preserved fca / refreshed twice / restored fca, 36.232/36.196/35.916/34.886 s) all stop at the same native multisample depth fast-clear refusal, exit 0xC0000409, without a timeout. No additional startup progress or frames claimed. Original executable/module, converted guest libc, exact 123-file runtime baseline and clean checkout verified after the runs.

Refresh validation follow-up. The registration assertion was a constant-zero fixture; exact two-line correction and evidence preserve its negative check. Existing #4029 production changes now applied locally (274d3f9b2); independent Windows validation records100/100 targeted runs and a full868-test suite of863pass/0fail/5skip, plus build/libs/conventions. Four startup controls (34.368/34.860/34.792/34.475 s) still stop at the same native depth fast-clear refusal, without timeout; exact originals/123-file baseline restored.

Dispatch input controls confirmed on local 274d3f9b2: two guard-preserving captures (35.393/34.909 s) record six user SGPRs / decoded group-X register s6, group IDs (true,false,false), one thread-ID component (v0), no TG-size word, no LDS/scratch, wave64, raw COMPUTE_PGM_RSRC2=0x8c. The refusing target has 640×1×1 groups of 64×1×1 threads, direct/non-partial dispatch. This closes the earlier input-placement caveat for this observed kernel: (s6*64+v0)*16 covers the full655360-byte metadata allocation. The target records single slice, Z_X, XOR0, ITERATE_256/pipe alignment, no stencil plane and no VRS.

Both full pre/completion payloads again contain163840 zero words (same SHA-256 as the earlier captures); metadata has newer tracked-store evidence, guest depth bytes remain tracked unchanged, and no pending writer is observed before/after SyncThrough. This is not proof of native sampled values or CPU-store atomic exclusion. The captured decoded flags also do not independently settle every nonzero HTILE encoding; PAL's TileStencilDisabled layout choice must not be inferred solely from absence of a stencil plane.

Diagnostic source bytes restored; full build/libs and13 relevant groups ×5 pass again. Original/module/converted libc/exact123-file runtime baseline verified and checkout clean.

Completed native depth-clear transition implemented locally (406838ac7, unpushed; pinned maina672 integration). The exact mask kernel must have six user SGPRs, group X in s6, local X in v0, full 64-thread one-dimensional groups and complete HTILE coverage. The request records its metadata generation before dispatch. Reuse requires a newer tracked store, no tracked CPU writes after that generation, no pending recorded writer, unchanged guest depth samples, and a complete metadata range proving the register's zero/one clear. The retained native image is cleared with ordered barriers; cached readers keep the same image/view. DB_STENCIL_INFO.TILE_STENCIL_DISABLE selects depth-only versus depth/stencil metadata independently of whether a stencil image plane exists. Unknown, incomplete, partial/indirect, racing and mixed transitions still throw; CPU atomic exclusion after the last check and console/AMD equivalence remain unverified.

Source-audit clarification: StoredOver accepts CPU or driver stores. The earlier diagnostic's true value alone did not establish writer ownership; that wording is corrected above. This implementation separately checks UnchangedSinceCollected to reject observed CPU writes. Clear layouts follow PAL GetClearValue; coverage/mask arithmetic follow the pinned Mesa kernel linked above.

Full build/libs/registration/conventions pass. 14 relevant groups ×5, full recorder ×5; new GPU tests cover 24/24 D16/D32 ×2/4/8 samples ×two metadata layouts ×zero/one configurations, three raster→clear→cached-fetch cycles each, every sample/component and output guards. There are31 refusal cases including ten new transition cases, plus pure malformed-dispatch/layout controls. Six deliberate faults each fail ×5 for the expected assertion: one-byte-short coverage accepted, missing post-dispatch store proof, disabled CPU-write guards, ignored final metadata word, wrong native clear value, and omitted cached-holder validation. Source byte-restored; full build/libs and14 groups ×5 pass again. Full suite: 864 pass /0 fail /5 skip of869, maximum15.299s. Windows11/RTX5080/WinLibs15.2; no Linux/lavapipe or unchanged-main claim.

Controlled title runs: before36.653s and restored34.425s reproduce the old native depth fast-clear exception (0xC0000409); changed runs reach the60s observation limit (61.332/61.266s including termination) without that exception. This is not a demonstrated boot/frame/menu. A180s observation of the same clean profile, with three successful own-process debugger attachments/detaches, remains active until stopped at181.158s. At45/95/145s the same worker is sampled in CommandBatch::Wait, WindowsMappings::Collect/host import, then MultisampleTextureLayout::Tile; aggregate CPU time grows34.891→75.328→113.328s and log size grows100864→102792→103370 bytes. These show ongoing activity; the snapshots do not establish the dominant cost or explain every wait. No new fatal guard is observed.

Original executable/module, converted guest libc and exact123-file runtime baseline restored/hash-verified after the normal and debugger observations. Sources clean; no pushes/new PRs or proprietary data attached.

Next: measure the newly reachable host-import, readback and multisample-tiling work, then distinguish startup cost from repeated work or a missing synchronization/implementation condition before proposing the next general fix. This canonical report is updated in place.

Addressed and historical findings

The current PR has the corrected standard8 sample7 (7,-7); the old decoder correction needs no further fix. The inherited #374 HTILE issue was corrected and merged.

The historical CMASK CC classification proposal is preserved in fork b4893764; it distinguishes FMASK-clear/color-expanded from a color-register clear using pinned Mesa codes. Sample-preserving readback dd443ad2 remains separate from initial imports/residency/write-back. Broader sampled-color/depth findings: #3036, #3262; FMASK semantics: #3219.

Windows11/RTX5080/WinLibs GCC15.2. No frame/gameplay, console/AMD hardware or Linux/lavapipe claim. Full logs/private captures/probes remain outside the repository. AI-assisted investigation/code/report: Codex. This canonical comment is edited as findings change; no new PR or upstream publication.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105597729 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6105597729). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-11T04:53:02Z. --- ### Latest local integration validation (2026-10-12) **Sonic Unleashed PPSA99902 now reaches the post-opening-movie NOW LOADING screen, then stops at dithered/rounded alpha-to-coverage0x18701** in [fork integration08891d938](https://github.com/Amoenus/AnyPS5/tree/codex/experimental-ppsa99902-native-gpu-snapshots) (`13485ff9f` snapshots + constant-fill recognition/allocation accounting). This is the pinned-main `a672688e` integration with prior color/depth, #4021/#4029, merged #3683 and the independently derived #4141 fixture correction (now merged upstream through #4159); fixed `main-f609` conversion, shader cache disabled. Controlled menu-entry input is verified below. Interactive gameplay, audio, rendering accuracy, console/AMD equivalence and unchanged upstream main remain unverified. #### What changed and why Compatible single-slice 2D/2D-array multisample reads copy the retained color image to an **independent GPU snapshot**, preserving every fragment and raw component before later writes. Ordered barriers and retained source/destination owners protect queued copies; actual image allocation is charged to the recorder's retained-memory budget. Actual CPU reads still use the existing sample-preserving publication path. Unsupported geometry/conversions and uncertain metadata transitions retain explicit failures. Copy/view rules: [Vulkan image copies](https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdCopyImage.html) and [format compatibility](https://docs.vulkan.org/spec/latest/chapters/formats.html#formats-compatibility-classes). No shader-instruction semantics changed. The first snapshot-only experiment exposed a **different clear kernel**, rather than the previously validated 17-word mask kernel. Two guard-preserving captures agree: six user SGPRs, 11 words, 64×1×1 threads; full DCC552960 bytes become `00`, CMASK81920 bytes become `CC`; tracked guest color/FMASK ranges remain unchanged. The captured constant-fill kernel matches [pinned Mesa's fill-memory shader](https://github.com/mihawk-99/PS5_Mesa/blob/0b2d6d1a61d9bbf89cf8beb88a696144f67c61f8/src/amd/vulkan/nir/radv_meta_nir.c#L139-L159): `offset=min((groupX*64+localX)*16,maxOffset)`, replicated DWORD×4 store. The generic matcher clips coverage to both dispatch count and maximum offset. **Dispatch still runs**; native reuse requires its newer completed-store evidence, the expected full uniform clear code, unchanged sample/FMASK ranges, no recorded pending writer, no observed CPU metadata race and no intervening native write. Unknown/partial/indirect cases remain unimplemented. `StoredOver` alone establishes overlap, not full coverage or writer ownership; these are separate checks. CPU atomic exclusion after the final check remains unverified. [#3816](https://github.com/boykopovar/AnyPS5/pull/3816) matches a distinct 9-word memory-value kernel and was inspected, not applied/tested here. #### Validation Windows11 Enterprise26200 / RTX5080 / WinLibs GCC15.2 r7, Release/testing ON. Full build, all122 patched/unpatched modules, registration and conventions pass. **16 relevant groups ×5 and full recorder ×5.** - **96 GPU snapshot configurations**: eight formats ×2/4/8 samples ×2D/one-layer-array ×recorded/direct; exact fragment/components, output guards, immutable earlier snapshot after a later write, queued source lifetime, no sample-byte publication and allocation accounting. - **72 production-recompiler GPU fill configurations**: wave32/64 ×groups1/2/80/540 ×below/exact/above clamp boundary ×three values; every DWORD and head/tail guard checked. Pure matcher tests cover both captured allocations and malformed inputs. - Four published and four unpublished clear cycles per format/sample configuration, **30 refusal cases each**; actual CPU-read publication/padding retained. **14 deliberate faults ×5** reject missing/short copies, missing clear coverage/completion/CPU/write-serial/value guards, missing allocation accounting, disabled clamp/dispatch and incorrect matcher bounds. Sources restored and rebuilt; relevant tests repeated after observers. - **Full suite:867 pass /0 fail /5 explicit skips of872**, slowest15.4859s. New GPU tests take ~0.5–1.4s here. Linux/lavapipe not run for these changes. | Frozen profile | Result | |---|---| | Snapshot-only `13485ff9f`, before / restored | Same metadata refusal,29.130 /30.682s, `0xC0000409` | | Corrected `08891d938`, two normal runs | 60s observation limit,61.168 /61.263s including termination; no fatal diagnostic | A separate180s observer finishes at181.095s: **1895 native snapshot lookups,947 clear imports,zero dirty guest publications**, no fatal diagnostic; eight distinct GPU frame payloads, visually inspected “PRESS START.” These operation counts are **not FPS or presented-frame counts**, and no new performance timing is claimed. The stable pre-snapshot `cfc9b0411` control also reaches the title screen; this validates removing the sampled-lookup CPU round trip while preserving that milestone. Original ELF/module, converted guest libc and exact123-file runtime baseline restored/hash-verified; observer/fault sources byte-restored, full build/libs and16 groups ×5 pass again; checkout clean. The integration is now pushed to the fork as linked below; **no new PR** or proprietary data upload. AI-assisted code/investigation/report: Codex. #### Controlled input and next startup boundary Same production head`08891d938`, **no new production-code changes**. Temporary pad-return transition logging and spaced GPU dumps use the existing`APS5_PAD_INPUT_FILE` facility; physical UI input is ignored in both control and input cases. The no-input180s control (181.075s including termination) stays at PRESS START. The input180s case (181.124s) records returned pad buttons`0x8` and`0x4000`, each released after its300ms pulse: Options advances to the readable autosave notice; Cross advances to the visible NEW GAME menu. Two fresh240s probes repeat this menu entry. [Public port source](https://github.com/Nazky/UnleashedRecomp-Prospero/blob/de5cec4cf7402ec26dabb042cc04547c9e2433e6/UnleashedRecomp/hid/driver/sdl_hid.cpp#L610-L632) maps these masks to Start/A, but the dump's exact source revision is unconfirmed; runtime pad-return logs and observed screen responses supply independent evidence. Selecting NEW GAME shows a dialog whose body text is not visible but whose Cross/Next prompt is visible. A Next press advances through loading to the opening cinematic. The later **480.719s observation captures43 spaced frames**: four verified input pulses, then no further input; frames019/034/042 show later battleship, corridor and Super Sonic/Eggman cinematic scenes. No fatal diagnostic; the movie remains active at the observation limit. This establishes extended cinematic progress, **not interactive gameplay, audio, FPS or rendering accuracy**. Dumps may perturb timing. **Pre-snapshot parent control:** frozen`cfc9b0411` libraries, the same pad-return logging/frame gates and restored empty working saves; three verified1500ms input pulses,481.207s/43 spaced frames, no fatal diagnostic. Its final frame042 shows a fully visible dialog with the Next prompt and no visible body text. The observed absence therefore **predates both13485ff9f and08891d938**. Its underlying cause/purpose remains untraced; no new AnyPS5 defect is claimed. The parent is the earlier local integration, not unchanged current main; input timing differs, so no performance or pixel-exact comparison is claimed. All ten temporarily reverted/observer source files restored byte-for-byte to088; full build/libs and **four relevant groups ×5** pass again (pad, native snapshots, metadata reset, constant fill). Previous17-group ×5 and full872 results above remain attributed to their prior runs on the unchanged production head; no full-suite rerun in this observation round. Original ELF/module, converted guest libc and exact123-file runtime baseline hash-verified. Generated working save files archived privately and pre-test empty saves/config/achievement-marker state restored exactly after both observations. No production-code change in these observations; the validated integration is now published to the fork, with no new PR or proprietary-data upload. #### Fork solution links and refreshed verification Published with the user's renewed authorization: [experimental integration08891d938](https://github.com/Amoenus/AnyPS5/tree/codex/experimental-ppsa99902-native-gpu-snapshots), pinned toa672688e. Focused commit diffs: [completed native depth clears406838ac7](https://github.com/Amoenus/AnyPS5/commit/406838ac70d2d273ca67514e287b53eabb88eda2), [device-staged readback3d5c594c3](https://github.com/Amoenus/AnyPS5/commit/3d5c594c3462c2acce28a1835ba00e5e7e1948d6), [native GPU snapshots13485ff9f](https://github.com/Amoenus/AnyPS5/commit/13485ff9f73ec69ae546ed4fc1470b3750e70dc0), [constant-fill recognition/allocation accounting08891d938](https://github.com/Amoenus/AnyPS5/commit/08891d938125d28cd2bcb45bfe2b320e18ad99b8). These changes depend on the integration's earlier MSAA foundation and validated prerequisites; **they are not standalone current-main patches**. Snapshot-only134 reproduces the documented metadata refusal; use the corrected088 integration for this title. Existing #4021/#4029 and merged #3683 work remains credited to its authors in the history/commit records. [#4159 by MarcZX100](https://github.com/boykopovar/AnyPS5/pull/4159) has now merged the equivalent fixture correction and closed #4141; no additional fixture PR is proposed. Immediately before pushing, exact088 full build/libs/registration/conventions pass; **seven relevant groups ×5**, then **full872:867pass/0fail/5 explicit skips**, maximum15.5141s. Windows11/RTX5080/WinLibs15.2, cache disabled; no new Linux/lavapipe or unchanged-current-main validation. Fork branch head independently verified as08891d938 after push. No new PR. A further480.725s/43-frame movie-control probe repeats normal menu entry and logs an Options/Start pulse and a Cross/A pulse during the visible cinematic, both pressed/released. Later captures remain cinematic (final042: Super Sonic); no fatal diagnostic or verified skip/post-cinematic scene. Sparse captures do not exclude a brief prompt. Original/module/libc/exact123-file runtime and working saves/config/marker restored; no source changes or proprietary upload. #### Movie end, new explicit blocker and measured FPS The longer run is now terminal: **764.735s, exit0xC0000409, not a timeout**,71 private spaced frames. Four verified normal menu pulses, then no further input; final070 shows the post-movie NOW LOADING/control-tutorial screen. It then fails with`dithered or rounded alpha-to-coverage is unsupported (register 0x2dc = 0x00018701)`. [New issue4285](https://github.com/boykopovar/AnyPS5/issues/4285) records this distinct mode, dependencies, exact diagnostic and main-source comparison. A private extension of the existing decoder fixture reproduces the exact DecodeState/precheck refusal **5/5**, retaining disabled/undithered and separate dither/round controls. Test source restored; full build/libs and six relevant groups×5 pass. Main d146 still has the same guard, as did the pre-snapshot parent. This is a documented unsupported mode newly reached by this integration; no attributed regression, whole-current-main startup or interactive-gameplay claim. Original/module/libc/exact123 runtime and empty working data restored/hash-verified. Separate240.734s FPS observation on the unchanged088 frozen observer, same normal menu sequence,19 frames/no fatal. **AnyPS5's two-second window-title counter**, sampled about1.23s, with188 valid title samples; phase windows matched to actual images: | Phase | Median reported FPS | Observed range | |---|---:|---:| | PRESS START | 6.06 | 5.90–6.20 | | Autosave notice | 5.38 | 5.26–5.46 | | NEW GAME menu | 13.15 | 12.82–13.22 | | Opening cinematic | 59.94 | 59.93–59.95 | This counts successful VideoOut presentation calls ([UpdateTitle](https://github.com/Amoenus/AnyPS5/blob/08891d938125d28cd2bcb45bfe2b320e18ad99b8/core/libs/prx/libSceVideoOut/src/DisplayWindow.cpp#L106)), not verified displayed/unique movie frames, simulation rate or gameplay FPS. One instrumented run,3840×2160 display-buffer captures, AnyPS5 shader cache disabled; GPU dumps and title polling may perturb timing. No before/after FPS improvement claimed. Bundled PresentMon produced no usable trace. The metadata observer hit a PID-exit race after the scheduled game stop; persisted samples and terminal game outcome were retained, and original/baseline/working-data restoration independently reverified after the harness completed. No emulator source change. **Next:** independent Windows/RTX5080 validation of [discussion2242](https://github.com/boykopovar/AnyPS5/discussions/2242)/phase-B#4152 as requested. The alpha gap stays explicit while its full draw and exact coverage behavior are investigated through4285; absent dialog body remains untraced. This canonical comment is edited in place. <details> <summary>Previous stable integration and staged-readback measurements</summary> ### Latest local integration validation (2026-10-12) **PPSA99902 reaches the Sonic Unleashed “PRESS START” title screen** in the local, unpushed `cfc9b0411` integration, on pinned main `a672688e` with earlier sampled/color/depth support, validated #4021/#4029 corrections, merged #3683 AMM placement and the corrected #4141 test fixture. The staged-readback measurements below remain attributed to `3d5c594c3`. This is the fixed `main-f609` conversion, Vulkan required and shader cache disabled. There is no input, main-menu navigation, gameplay, rendering-accuracy or console/AMD-equivalence validation here. #### Confirmed readback improvement Resident color samples now gather into a `DeviceBuffer`, then cross to the host with `CopyBuffer`; shader→transfer and transfer→host barriers precede fence wait/invalidation. Every sample/component and the original byte count are retained. Upload/readback shaders are unchanged. Scratch adds a full linear sample payload in device memory; allocation failures throw. General behavior, no title check or sample collapse. Two original and two changed 180s timing observations, followed by a replay of the **exact frozen original timing library**: | Profile | Complete publications | Median readback batch | Median full publication | |---|---:|---:|---:| | Original 1 / 2 | 71 / 71 | 998.203 / 998.103 ms | 1574.664 / 1573.685 ms | | Changed 1 / 2 | 129 / 129 | 12.607 / 12.362 ms | 594.398 / 592.817 ms | | Restored original | 71 | 992.405 ms | 1574.688 ms | These are CPU wall times of the instrumented operations, not GPU timestamps or FPS. Target: 3840×2160, eight samples, eight-byte elements; 530,841,600 linear bytes and 534,773,760 physical color bytes. Incomplete final publications are excluded. The earlier runner-NameError attempt is excluded. Remaining median CPU tiling is ~233ms and color guest-store work ~199ms per publication. Reusable implementation outline in `ReadSamples`: ```cpp DeviceBuffer samples(context, bytes, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT); Buffer readback(context, bytes, VK_BUFFER_USAGE_TRANSFER_DST_BIT); transfer(batch.Handle(), samples.Handle(), true); RecordMemoryBarrier(context, batch.Handle(), VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT); CopyBuffer(context, batch.Handle(), samples.Handle(), 0, readback.Handle(), 0, bytes); RecordMemoryBarrier(context, batch.Handle(), VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT); ``` `bytes` is the existing four-byte-aligned sample count. The private transfer helper takes a `VkBuffer`; the existing producer barrier, submission/wait and host invalidation remain. #### Behavioral and startup evidence Windows11 Enterprise26200 / RTX5080 / WinLibs GCC15.2 r7, Release/testing ON. Full build, all122 patched/unpatched modules, registration and conventions pass. **14 relevant groups ×5**, full recorder ×5; target tests now cover **48/48 configurations**, including full and forced256-byte descriptor ranges, exact sample/component values, metadata, padding, queued writers and reuse. Omitted DMA copy, four-byte-short copy and incorrect chunk starting element each fail for the expected assertion ×5. Fault/diagnostic sources are byte-restored; full build/libs and14 groups ×5 pass again after restoration. **Latest stability full suite: 865pass/0fail/5 explicit skips of870**, maximum15.5673s. Merged [#3683](https://github.com/boykopovar/AnyPS5/pull/3683) is applied as local`cb2c3a7c5`, with upstream credit: placement/markers groups each200 passes; restoring only the old fixed-address calculation fails5/5 occupied-top controls; source restored and rebuilt/restored groups ×5 pass. Local`cfc9b0411` corrects [#4141](https://github.com/boykopovar/AnyPS5/issues/4141): allocator guard gap/nonzero-charge assertion, registered cache test50/50; forced-adjacent/unguarded/separated controls ×5 show assertion/FPE/pass as intended. **All244 library files stayed byte-identical across the test-only correction.** Full build/libs/registration/conventions and14 native groups ×5 pass. Focused one-file local preparation on main`bca7a29d`: `d32ceb3c6`, unpushed; not whole-current-main validation. The earlier869-test changed runs had the two confirmed failures documented above, before these corrections. The existing [#3371 comment](https://github.com/boykopovar/AnyPS5/issues/3371#issuecomment-6108079462) is maintained in place with the AMM verification. The four refreshed normal controls reach60s without a fatal diagnostic; a fresh180s GPU observer still captures PRESS START. Original/module/converted libc/exact123-file baseline verified after all runs; temporary source tags restored byte-for-byte, full build/libs and14 groups ×5 pass again. No Linux/lavapipe, rendering accuracy or whole-upstream-head claim. Normal before/changed1/changed2/restored controls all reach the60s observation limit without a fatal diagnostic. Separate dirty-publication caller observations record **130/130 and122/122** publications from `ShaderResources.cpp:580`, `cachedTexture`; standard `source_location` tags identify the actual requesting call, not an inferred stack. The early GPU dumps show changing intro imagery. A second observer gates dumps until45s after first display-buffer use, then captures every tenth presentation: black at73.916s, and the title prompt in inspected captures at120.243/166.439s. Five late GPU captures have distinct pixel payloads. These are local conditional observations; the readback change is not claimed to have enabled the early intro. Original ELF/module, converted guest libc and **exact123-file runtime baseline** restored/hash-verified; source checkout clean. Images, dumps, logs and probes remain private outside the repository. No push or new PR. **Read/write contract confirmed before changing sampling.** A separate guard-preserving180s trace tags the active graphics draw with RAII: **131/131** dirty publications read eight-sample RGBA16F`0x405fc00000` (534,773,760 physical bytes) while that draw writes a **different** single-sample/eight-byte 3840×2160 target`0x404fc00000` (66,846,720 bytes), with zero range overlap. **65 metadata transitions** are imported with`dirty=0` after existing publication. No fatal diagnostic. This establishes the observed postprocessing relation, not a general absence of feedback. `ImportPublishedClear` currently rejects dirty native images, so simply removing sampled-lookup publication would violate that clear-state contract. The current MSAA color lookup also creates a fresh snapshot; a shared live view would require checking read-before-write/feedback behavior and lifetime. The established `OwnedImage` resource owner and [Vulkan image-copy rules](https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdCopyImage.html) are relevant to preserving every sample on a GPU-only snapshot path. **Next:** implement and test the general native GPU sampling/copy path with complete known-clear transitions, every sample/component, queued producers, snapshot/feedback semantics, ownership and actual CPU-read publication/conflict guards. Current native images lack sampled/transfer-source usage; new view/copy capabilities need explicit queries. Unknown cases still throw. This canonical report is edited in place. AI-assisted code/investigation/report: Codex. </details> <details> <summary>Earlier validation evidence and historical controls</summary> The records below describe earlier checkpoints and retain their original observation limits. The latest section above supersedes historical statements that no frame had been demonstrated. ### Maintained validation report (2026-10-12) Current source reviewed: #419 `c120d995472e2d49b01c7911401aa6675315c881`, on main `a11c8f7f`. Its six commits were also applied without conflicts to our sampled-color/depth integration `7b70443c0`. The resulting `663318a1` is an adapted integration, not an unchanged whole-PR build. #### Confirmed current-head gap: guest-access guard misses tiled sample memory The new guard registers `max(target.bytes, width * height * elementBytes * samples)`, but `DecodeColorBuffer` still supplies a single-sample layout size. This can omit valid texels in multisample tile padding. Concrete counterexample: 65x65, 4-byte elements, 4 fragments, `SW_64KB_R_X`, one mip/slice. Single-sample size is 65,536 bytes; the guard covers 67,600 bytes; the fragment-aware physical footprint is 262,144 bytes. Texel `(x=64,y=0,fragment=1)` lies at byte offset 82,944, outside the guard. Geometry and this address match [pinned AMD PAL/addrlib](https://github.com/GPUOpen-Drivers/pal/tree/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/imported/addrlib). I compiled the exact current PR's registration/refusal functions into a probe, installed that callback using the native `GuestMemory::SetReadGuard`, registered real allocated guest memory, and called native `GuestMemory::Read`. All five original runs returned bytes from that valid sample without refusal. Giving the same guard the fragment-aware full extent refused all five control reads. A separate 18-configuration geometry/address probe (three extents, 4/8-byte elements, 2/4/8 fragments) also passed five repetitions per original/corrected variant. This exercises the extracted guard and real native CPU-read path; it does not run the whole PR's target constructor, GPU rendering or console hardware. Suggested correction: compute the supported target's physical sample-aware footprint and slice stride, and use that extent for guest-access checks; throw on layouts not established. [#2132](https://github.com/boykopovar/AnyPS5/pull/2132) already proposes sample-aware footprints for color fills, so that work should be considered when sharing the calculation. The counterexample is independent of title startup. A local current-base experiment now assigns the complete R_X sample footprint in `DecodeColorBuffer`; other layouts remain refused by the initial-content path. PPSA99902 then reaches the retained initial-import refusal described below. The current upstream PR still has the footprint gap. #### Fresh covered-centroid boundary and initial contents Two fresh PPSA99902 captures at the current boundary contain `PA_SC_AA_CONFIG=0x2030e003`, standard 8x positions including sample7 `(7,-7)`, and `SPI_PS_INPUT_ENA=SPI_PS_INPUT_ADDR=0x2` (perspective-center only). Context/shader/user-config and all 12,288 effective constant-RAM words were captured; saved-context state was not captured. [Pinned GFX10.3 schema](https://github.com/mihawk-99/PS5_Mesa/blob/0b2d6d1a61d9bbf89cf8beb88a696144f67c61f8/src/amd/registers/gfx103.json) names bit29 `COVERED_CENTROID_IS_CENTER`; [RADV](https://github.com/mihawk-99/PS5_Mesa/blob/0b2d6d1a61d9bbf89cf8beb88a696144f67c61f8/src/amd/vulkan/radv_cmd_buffer.c) sets it on GFX10.3+. A bounded local follow-up admits that bit only without active perspective/linear centroid inputs, preserving active-centroid refusals in both precheck and decode. The raw captured draw now passes the coverage check and reaches the DCC MSAA-target refusal in five CPU-only repeats. No title register bit was cleared. Local integration `10103b27f` also explicitly refuses multisample target creation because initial guest sample contents are not imported; it disables that render path and is not completed MSAA rendering. Full build/all 122 patched runtime libraries and conventions passed. Eleven relevant registered groups x5 and five actual full-recorder runs passed for both peer and guarded integrations; the guarded recorder fixture checks initial-content refusal, not GPU guest-access behavior. The guarded full suite: 843 total, 836 passed, five skipped, two already tracked failures ([#3411](https://github.com/boykopovar/AnyPS5/issues/3411), [#3526](https://github.com/boykopovar/AnyPS5/issues/3526)). Two guarded title runs and an AGC-only replacement control reach `DCC over a multisampled color target is unsupported` (30.828/29.822/29.722s). Restoring the peer profile reproduces the coverage refusal (29.795s). All use the same fixed `main-f609` converted executable, Vulkan required/cache off; no timeout; original dump and exact 123-file baseline restored/hash-verified. These are conditional integration controls, not freshly relinked or stock-main startup. #### Refreshed complete metadata at the render refusal Two new guard-preserving captures on integration `10103b27f` confirm CB0 is 3840x2160 RGBA16F, eight samples/fragments, one layer/mip, `SW_64KB_R_X`. The entire source-derived DCC range (552,960 bytes) is zero; the entire CMASK range (81,920 bytes) is `0xCC`. Raw/synchronized payloads and both captures agree; no tracked pending recorder/storage writes, flush or wait was reported. The physical color footprint is 534,773,760 bytes. Color and FMASK were captured only as 64 KiB prefixes; the FMASK prefix is `0x76543210`, not proof of its effective mapping. Against the current native library, ten state probes decode DCC as clear0000, encode all RGBA16F components as zero, and confirm CMASK `CC` is classified as mixed with a retained refusal. Ten changed-DCC controls are rejected. [Pinned Mesa](https://github.com/mihawk-99/PS5_Mesa/blob/0b2d6d1a61d9bbf89cf8beb88a696144f67c61f8/src/amd/common/ac_descriptors.h#L61-L66) defines `CC` as FMASK-clear0/color-expanded; it is not a color-register clear. A separate standalone probe calling the expected CMASK throw aborted across the DLL boundary; cause untraced, so the successful state probes do not validate that exception path. The capture diagnostics were restored byte-for-byte. Two further captures agree on the refusing reader: one-layer, one-mip, eight-sample RGBA16F R_X, 3840×2160, address `0x405fc00000`, full footprint `0x1fe00000`, XOR `0x8000`, DCC `0x40819f4000`. This matches the recorded color target; the stop was incomplete residency coherence. The earlier **local, unpushed experimental integration** `fa08446d6` (on `a01b13ea0`, main `a11c8f7f`) publishes each native color sample into guest R_X memory before guest-memory synchronization or sampled-texture lookup. It preserves tile padding and expands full DCC/CMASK/FMASK ranges; FMASK reimport requires a verified complete identity mapping. Expansion values follow PAL `Gfx9Dcc::GetInitialValue`, `Gfx9Cmask::GetInitialValue` and `Gfx9Fmask::GetPackedExpandedValue` at `c5e800072a32f68b6ccc4422936d96167c6e0728`. Watched guest writes, pending external GPU writes, fills and unsupported transitions still throw. Direct CPU writes racing the final stores are not atomically excluded; eviction publication is incomplete. This remains local validation work, not an unchanged-PR-head test or console-equivalence claim. Full build, all 122 patched/unpatched libraries, registration and conventions pass. Ten relevant groups each pass five runs; each target run exercises **24/24 GPU configurations**. Tests check physical fragments/XOR/padding, real native attachment writes, CPU publication, expanded metadata/reimport, conflict refusals and actual GPU sampled fetches of R32_UINT and RGBA16F/DCC. Five full recorder runs pass. Eight faulty variants are each rejected five times: zeroed samples, damaged padding, incorrect CMASK, incorrect FMASK, omitted dirty tracking, ignored publication conflicts, recursive publication and zeroed readback. Source bytes are restored and full build/tests repeated. Omitting the explicit recorder sync is a **passing control** five times: `CommandBatch` still submits prior work, waits on its fence and reaps completions. Ten full captured-metadata positives pass; ten changed-DCC controls reject. The current FMASK helper matches twelve pinned-PAL geometry cases five times. Full suite: **839 passed / 2 failed / 5 skipped**, same failure names as the previous integration (`windows_exceptions`, `agc_driver_emulated_color_compare`); slowest test 15.442 s. Those historical full suites were not green. Controlled before/after1/after2/restored runs take **30.692/32.268/33.964/30.357 s**, all `0xC0000409`, without timeout. Before/restored reproduce the resident color-texture refusal. Both after runs pass that boundary and stop at **`sample-preserving readback of a resident depth surface is not implemented`**. Source inspection confirms the depth-residency guard prevents sampling stale guest bytes; native multisample depth sampling/readback remains incomplete. All runs use the fixed `main-f609` conversion and identical controls; original ELF/module and exact 123-file baseline hashes are verified after restoration. No frame or gameplay is established. Two temporary depth diagnostic captures now agree on the final reader and resident target: **3840×2160 D32, eight samples, Z_X, slice/mip zero, no XOR**, depth `0x4081c00000`, HTILE `0x4091b00000`. The reader is R32_SFLOAT with R/zero/zero/one components. Full physical depth footprint is **`0xff00000`**, while the `fa08446d6` overlap guard used the single-sample **`0x1fe0000`** range; the last logical sample is at `0xfef9afc`, outside that guard. Current native layout/HTILE helpers match 36 pinned-PAL geometry cases five times (**180 comparisons**). This guard undercount belongs to our local integration, not upstream main. Both full **640 KiB HTILE** captures are byte-identical: **163840 clear-zero words**, including padding, matching the native target's initial clear value. Ten native helper checks pass; changing the final word to unsupported compression or clear-one refuses in twenty controls. Refusals carry the expected runtime-error diagnostic but terminate through the current Windows libc path with `0xC0000409`; they are not caught-exception passes. The second register capture additionally records earlier `depthWrite=1` decode calls, so unchanged clear metadata does **not** establish that the native image was never written. At that capture stage there was no native multisample sampled-view test; arbitrary raw depth import remains unproven. Diagnostic sources are restored byte-for-byte; full build, all 122 patched/unpatched libraries, registration/conventions, ten relevant groups ×5 and full recorder ×5 pass again. Original dump/module and the 123-file baseline hashes are verified. The two diagnostic title runs stop at the unchanged resident-depth guard in 36.445/33.236 s, without timeout. Local, unpushed **`a8eac4dfe`** now corrects the full Z_X depth/stencil ranges used by overlap guards and array-slice strides; other multisampled attachment layouts throw. This is a prerequisite for resident-depth sampling, which remains refused. Full build/libs/registration/conventions pass, ten relevant groups ×5 and full recorder ×5 pass. Eighteen depth/stencil footprint cases run five times; the actual native helper matches **270 pinned-PAL comparisons**. Four old-behavior variants—single-sample depth/stencil guards and depth/stencil strides—each fail five times. Both the library and the separately compiled graphics executable are rebuilt for those controls; the first stale-executable harness observation is preserved and excluded. Sources are restored byte-for-byte. Full suite: **839 passed / 2 failed / 5 skipped**, no new failure names versus `fa08446d6`, slowest 15.521 s; not green. Controlled before/after1/after2/restored runs take **33.314/33.421/32.850/32.426 s**, all stop at the same resident-depth guard without timeout. Original/module and exact baseline hashes are restored and verified after each run. **No startup advancement or native per-sample depth rendering/sampling is established by this correction.** Array stride arithmetic is tested; slice XOR rotation and metadata slice identity remain unverified. Two additional **pre-construction** captures agree: initial depth clear is zero; the full depth/HTILE ranges are mapped and watched; no recorder pending writer overlaps; all 163840 HTILE words are zero. Raw `DB_HTILE_SURFACE=0x00040002` retains pipe alignment and zero VRS encoding. These unsynchronized observations are not atomic against CPU stores and do not establish native per-sample contents after draws. Diagnostic sources were restored and full build/tests repeated. The intermediate **local, unpushed integration `7731aa3d1` was based on pinned main `0a8b1d32`**. The old validated branch is preserved. Rebase dropped the Windows symlink/directory-time changes already merged upstream; the include conflict kept both required headers. Full build/libs/registration/conventions, ten relevant groups ×5 and full recorder ×5 pass. On intermediate main `12c2266`, full suite is **841 passed / 1 failed / 5 skipped**; only `windows_exceptions` fails, including five targeted repeats. sRGB comparison now passes. Later main `0a8b1d32` replaces the failing guest-exception-through-`call_once` test with guest-frame-only coverage and records runtime-DLL unwinding as technical debt. Its registered suite is **842 passed / 0 failed / 5 skipped**, slowest 15.362 s; six upstream-related groups pass five repeats. **All 244 patched/unpatched production-library outputs are byte-identical across this test-only rebase, so the green result does not establish a runtime-unwind fix.** Controlled old/new/new/restored startup runs on the two rebases take **33.295/30.652/33.611/32.680 s** and **32.864/33.267/32.228/32.641 s**. All eight retain the resident-depth refusal and `0xC0000409`, without timeout; fixed `main-f609` conversion, original/module and exact 123-file baseline hashes checked after every restoration. **Those rebases established no startup advancement, native multisample depth sampled-view verification, frame or gameplay.** #### Local native multisample depth sampled views and next boundary Previous validated **local, unpushed integration `2d16b4316` on pinned main `0a8b1d32`** adds native one-layer D16/D32 Z_X depth sampled views. Import synchronizes producers, requires watched complete depth/HTILE ranges and uniform HTILE proving the registered zero/one clear, then retains exact attachment/reader identity. Guest CPU writes, external tracked GPU writes, arrays, stencil, VRS, unsupported raw imports, guest publication and metadata clear/fill transitions still throw. CPU stores racing the final generation check are not atomically excluded. This is adapted local integration work, not a change to #419's head or an unchanged-main test. Full build, all 122 patched/unpatched libraries, registration and conventions pass. Twelve relevant groups ×5 and full recorder ×5 pass. New native GPU tests exercise **12/12 D16/D32 ×2/4/8 samples ×initial-zero/one configurations**, synchronize a queued initial metadata producer, rasterize two rounds of distinct per-sample depth values into the actual attachment, and fetch each sample through the retained sampled view with R/zero/zero/one components. D32 values are exact; D16 is within one normalized step. Full-range CPU read/write and external-write refusals, cache identity, metadata/layout and unwatched-memory controls are tested; a separate group checks 21 refusal cases. Six deliberate faults are caught five times each: omitted HTILE proof, ignored guest generations, ignored reader identity, disabled guest-publication guard, all raster masks selecting sample zero, and fetches selecting sample zero. Sources were restored byte-for-byte, full build/libs and native tests ×5 repeated. Full suite: **844 passed / 0 failed / 5 skipped**, slowest **15.466 s**. Linux/lavapipe and console/AMD semantics remain unverified. Controlled before/after1/after2/restored runs take **33.144/34.708/34.598/32.777 s**, all `0xC0000409`, without timeout. Before/restored reproduce the resident-depth readback refusal; both changed runs pass it and stop at **`guest writes to a resident multisample target or its metadata are not implemented`**. Fixed `main-f609` conversion and identical controls; original ELF/module and exact 123-file runtime baseline restored/hash-verified after every run. This establishes advancement past that conditional startup boundary, **not a frame or gameplay**. Two further guard-preserving captures (33.687/35.076 s) agree on the new boundary: existing 3840×2160 RGBA16F, eight-sample R_X color target `0x405fc00000`, XOR `0x8000`, resident `dirty=false`. The full **552,960-byte DCC** at `0x40819f4000` is zero and full **81,920-byte CMASK** at `0x40819e0000` is `CC`, byte-identical across captures. Both ranges have newer driver-write stamps and `StoredOver=true`, with no newer CPU-write stamps; color and FMASK have no changed tracker blocks at this boundary. At that capture stage, the exact writer and ordering had not yet been traced; the follow-up below resolves the immediate writer. This is a retained local residency-transition refusal; it is not evidence of an upstream bug or a reason to accept stale native samples. Temporary diagnostics are removed byte-for-byte; full build/libs and twelve relevant groups ×5 pass again, baseline/original hashes verified. #### Latest local color metadata reset and HTILE boundary Two follow-up immediate-caller captures map all post-publication CMASK and DCC `MarkWritten` calls to **`BdaResources::markWrittenPages()`**, reached from shader completion/fault checking. The CMASK extent and five DCC chunks cover the complete recorded metadata. The earlier Windows stack walker returned zero usable frames and is excluded as caller evidence. Current **local, unpushed integration `fca91606c` on pinned main `0a8b1d32`** admits a complete supported numeric DCC clear after native color publication. It requires unchanged color/FMASK, full uniform supported DCC/CMASK, watched generations and no pending external writer; it clears the retained native image and marks it for later publication. Unpublished samples, partial/mixed/unknown metadata, sample writes and recognized fill transitions still throw. CPU stores racing the final generation check remain unexcluded. No title-specific production branch or descriptor bypass was added. Full build, all 122 patched/unpatched libraries, registration/conventions, **13 relevant groups ×5** and full recorder ×5 pass. The new reset test checks **24/24 RGBA8/RGBA16F ×2/4/8-sample ×four-clear-code cycles**, actual per-sample GPU values, cached RGBA16F fetches, same-view retention, physical publication/padding, pending-producer refusal and ten negative transition cases per format/sample configuration. Six faults are each caught ×5: ignored unpublished state, ignored sample conflicts, first-byte-only DCC proof, forced zero clear, omitted dirty tracking and omitted generation refresh. An initial fault-harness line-ending anchor failure applied no dirty-tracking mutation; it is recorded and excluded, and that fault was subsequently run successfully. Sources restored byte-for-byte; full build/libs and tests repeated. Full suite: **845 passed /0 failed /5 skipped** of 850, slowest **15.429 s**. Windows11/RTX5080/WinLibs GCC15.2; no Linux/lavapipe or console/AMD equivalence claim. Controlled before/after1/after2/restored runs: **36.083/30.816/33.249/34.784 s**, all `0xC0000409`, no timeout. Before/restored retain the color metadata refusal; both changed runs pass it and stop at **`native multisample depth fast-clear transition is not implemented`**. Same fixed `main-f609` conversion and controls; original ELF/module and exact 123-file runtime baseline restored/hash-verified after every run. These timings do not establish a performance change; no frame or gameplay is established. Two guard-preserving HTILE captures (35.217/34.640 s) agree on the retained **3840×2160 D32, 8-sample** depth target `0x4081c00000`, HTILE `0x4091b00000`. The recognized mask kernel uses **640×1×1 groups, 64×1×1 threads, flags `0x2045`, replacement `0`, keep mask `0xff0`**, with no indirect or partial dispatch. The complete **655360-byte pre-dispatch HTILE** is zero in both captures. These are pre-dispatch contents, not proof of the resulting HTILE or native depth samples. The current matcher checks kernel/user inputs but not dispatch coverage. Diagnostic sources are removed byte-for-byte; full build/libs and 13 relevant groups ×5 pass again; baseline/original hashes verified. A subsequent completion-point diagnostic leaves the native refusal intact, calls `Recorder::SyncThrough` for the full HTILE, then captures it at the refusing reuse. Both runs (35.250/34.698 s) again contain **163840 zero words**; they report no pending HTILE writer before/after the call, newer tracked stores (`StoredOver=true`), and unchanged tracked guest depth bytes. The synchronization call was not observed waiting for a pending writer. Native depth samples after draws and CPU-store atomic exclusion remain unverified; unchanged guest bytes are not proof that the native image was never rasterized. The exact 17-word public mask kernel decodes to a group/local linear index, 16-byte offset, global DWORD×4 load, four AND-OR operations and DWORD×4 store. [Pinned Mesa NIR](https://github.com/mihawk-99/PS5_Mesa/blob/0b2d6d1a61d9bbf89cf8beb88a696144f67c61f8/src/amd/vulkan/nir/radv_meta_nir.c#L810-L833) independently specifies `(old & keepMask) | replacement` and 16 bytes per invocation. Thus the recorded 640×64 invocations span 655360 bytes **when the group-ID/thread input controls match**; those controls were not recorded by the earlier diagnostic. The `0xff0` user word is a keep mask, not the resulting HTILE clear word. An external adaptation of the existing production-kernel GPU test checks **36/36 wave32/64 ×groups1/63/64/639/640/641 ×three-replacement cases**, every DWORD and head/tail guards, ×5 runs (0.660–1.550 s). Every input word has bits that must change, avoiding an all-zero no-write false pass. One-workgroup-short and wrong-keep-mask faults each fail ×5 with the expected DWORD mismatch; the correct probe then passes ×5 again. Existing masked-store and VOP3 integer-ALU groups also pass ×5. Diagnostic source bytes and full build/libs restored; 13 relevant groups ×5 pass again; source clean and original/module/exact baseline hashes verified. Related work reviewed: [#2053](https://github.com/boykopovar/AnyPS5/pull/2053) `9a62ec7e` reads changed HTILE at bind and expands guest words; [#3816](https://github.com/boykopovar/AnyPS5/pull/3816) `69a67ca8` matches a different memory-value fill kernel. Neither PR head was built/tested in this round. These proposals are relevant context, not drop-in validated native multisample transitions. The same mask matcher remains in inspected upstream main `c5da8233`. **Local refresh onto pinned main `a672688e` (2026-10-12).** Preserved the validated `fca91606` branch; rebased the local integration, retained adjacent upstream math/debt additions, and consolidated the independently added `ColorTarget::arraySlice` member. Main's Windows `HostPoll` build failure was corrected with the exact existing [#4021 change](https://github.com/boykopovar/AnyPS5/pull/4021#issuecomment-6114222379); its source/platform/network validation is recorded there. Local integration `9ded7ba36`, full build + `libs`, registration and convention checks pass; the same 13 native multisample groups ×5 and full recorder ×5 pass. The broader refresh is **not a clean full-suite pass**: 868 tests = 862 pass, one failure (`agc_driver_prepared_shaders_registered_workgroup_sync`), five explicit skips; maximum test duration 15.535 s. Of 49 affected groups repeated ×5, 47 pass; synchronous registered-workgroup preparation fails in the group run and all five isolated reruns. An external copy of that test, changing only its error label, identifies the missed expectation as `v_readlane_b32 of lane 63 is outside`. The deferred preparation group had one heap-corruption exit (`0xC0000374`), then passes five isolated reruns and the full suite; cause remains unconfirmed. Existing test and library source were not changed to suppress either failure. Four controlled startup runs (preserved fca / refreshed twice / restored fca, 36.232/36.196/35.916/34.886 s) all stop at the same native multisample depth fast-clear refusal, exit `0xC0000409`, without a timeout. No additional startup progress or frames claimed. Original executable/module, converted guest libc, exact 123-file runtime baseline and clean checkout verified after the runs. **Refresh validation follow-up.** The registration assertion was a constant-zero fixture; [exact two-line correction and evidence](https://github.com/boykopovar/AnyPS5/pull/2261#issuecomment-6114263721) preserve its negative check. Existing #4029 production changes now applied locally (`274d3f9b2`); [independent Windows validation](https://github.com/boykopovar/AnyPS5/pull/4029#issuecomment-6114477614) records100/100 targeted runs and a full868-test suite of863pass/0fail/5skip, plus build/libs/conventions. Four startup controls (34.368/34.860/34.792/34.475 s) still stop at the same native depth fast-clear refusal, without timeout; exact originals/123-file baseline restored. **Dispatch input controls confirmed** on local `274d3f9b2`: two guard-preserving captures (35.393/34.909 s) record six user SGPRs / decoded group-X register `s6`, group IDs `(true,false,false)`, one thread-ID component (`v0`), no TG-size word, no LDS/scratch, wave64, raw `COMPUTE_PGM_RSRC2=0x8c`. The refusing target has 640×1×1 groups of 64×1×1 threads, direct/non-partial dispatch. This closes the earlier input-placement caveat for this observed kernel: `(s6*64+v0)*16` covers the full655360-byte metadata allocation. The target records single slice, Z_X, XOR0, ITERATE_256/pipe alignment, no stencil plane and no VRS. Both full pre/completion payloads again contain163840 zero words (same SHA-256 as the earlier captures); metadata has newer tracked-store evidence, guest depth bytes remain tracked unchanged, and no pending writer is observed before/after `SyncThrough`. This is not proof of native sampled values or CPU-store atomic exclusion. The captured decoded flags also do not independently settle every nonzero HTILE encoding; PAL's `TileStencilDisabled` layout choice must not be inferred solely from absence of a stencil plane. Diagnostic source bytes restored; full build/libs and13 relevant groups ×5 pass again. Original/module/converted libc/exact123-file runtime baseline verified and checkout clean. **Completed native depth-clear transition implemented locally** (`406838ac7`, unpushed; pinned maina672 integration). The exact mask kernel must have six user SGPRs, group X in `s6`, local X in `v0`, full 64-thread one-dimensional groups and complete HTILE coverage. The request records its metadata generation before dispatch. Reuse requires a newer tracked store, no tracked CPU writes after that generation, no pending recorded writer, unchanged guest depth samples, and a complete metadata range proving the register's zero/one clear. The retained native image is cleared with ordered barriers; cached readers keep the same image/view. DB_STENCIL_INFO.TILE_STENCIL_DISABLE selects depth-only versus depth/stencil metadata independently of whether a stencil image plane exists. Unknown, incomplete, partial/indirect, racing and mixed transitions still throw; CPU atomic exclusion after the last check and console/AMD equivalence remain unverified. Source-audit clarification: `StoredOver` accepts CPU **or** driver stores. The earlier diagnostic's true value alone did not establish writer ownership; that wording is corrected above. This implementation separately checks `UnchangedSinceCollected` to reject observed CPU writes. Clear layouts follow [PAL GetClearValue](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/hw/gfxip/gfx9/gfx9MaskRam.cpp#L3320); coverage/mask arithmetic follow the pinned Mesa kernel linked above. Full build/libs/registration/conventions pass. **14 relevant groups ×5**, full recorder ×5; new GPU tests cover **24/24 D16/D32 ×2/4/8 samples ×two metadata layouts ×zero/one configurations**, three raster→clear→cached-fetch cycles each, every sample/component and output guards. There are31 refusal cases including ten new transition cases, plus pure malformed-dispatch/layout controls. Six deliberate faults each fail ×5 for the expected assertion: one-byte-short coverage accepted, missing post-dispatch store proof, disabled CPU-write guards, ignored final metadata word, wrong native clear value, and omitted cached-holder validation. Source byte-restored; full build/libs and14 groups ×5 pass again. Full suite: **864 pass /0 fail /5 skip** of869, maximum15.299s. Windows11/RTX5080/WinLibs15.2; no Linux/lavapipe or unchanged-main claim. Controlled title runs: before36.653s and restored34.425s reproduce the old native depth fast-clear exception (`0xC0000409`); changed runs reach the60s observation limit (61.332/61.266s including termination) without that exception. **This is not a demonstrated boot/frame/menu.** A180s observation of the same clean profile, with three successful own-process debugger attachments/detaches, remains active until stopped at181.158s. At45/95/145s the same worker is sampled in `CommandBatch::Wait`, `WindowsMappings::Collect`/host import, then `MultisampleTextureLayout::Tile`; aggregate CPU time grows34.891→75.328→113.328s and log size grows100864→102792→103370 bytes. These show ongoing activity; the snapshots do not establish the dominant cost or explain every wait. No new fatal guard is observed. Original executable/module, converted guest libc and exact123-file runtime baseline restored/hash-verified after the normal and debugger observations. Sources clean; no pushes/new PRs or proprietary data attached. Next: measure the newly reachable host-import, readback and multisample-tiling work, then distinguish startup cost from repeated work or a missing synchronization/implementation condition before proposing the next general fix. This canonical report is updated in place. #### Addressed and historical findings The current PR has the corrected standard8 sample7 `(7,-7)`; the old decoder correction needs no further fix. The inherited #374 HTILE issue was [corrected and merged](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6106007304). The historical CMASK `CC` classification proposal is preserved in [fork b4893764](https://github.com/Amoenus/AnyPS5/commit/b489376464c997251fcb197fe8e8a5d134b51597); it distinguishes FMASK-clear/color-expanded from a color-register clear using pinned Mesa codes. [Sample-preserving readback dd443ad2](https://github.com/Amoenus/AnyPS5/commit/dd443ad2cd69fda885dadbb8493d4c42f6b55308) remains separate from initial imports/residency/write-back. Broader sampled-color/depth findings: [#3036](https://github.com/boykopovar/AnyPS5/issues/3036), [#3262](https://github.com/boykopovar/AnyPS5/issues/3262); FMASK semantics: [#3219](https://github.com/boykopovar/AnyPS5/issues/3219). Windows11/RTX5080/WinLibs GCC15.2. No frame/gameplay, console/AMD hardware or Linux/lavapipe claim. Full logs/private captures/probes remain outside the repository. AI-assisted investigation/code/report: Codex. This canonical comment is edited as findings change; no new PR or upstream publication. </details>
MichonGoddijn231849 commented 2026-10-11 07:59:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T07:59:35Z.


@Amoenus thanks, fixed in 9a1a0672 (credited): sample 7 of the standard 8x table is (7, -7), with a regression row decoding your two captured PA_SC_AA_SAMPLE_LOCS words as the standard pattern (it fails with the old entry). This PR also picks up #374's HTILE extent fix when it is re-stacked on #374.

COVERED_CENTROID_IS_CENTER and DCC over a multisampled target stay refused in this PR; they need their own handling (centroid inputs, initial MSAA contents and the CMASK 0xC state), as you found.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106913617 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6106913617). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T07:59:35Z. --- @Amoenus thanks, fixed in `9a1a0672` (credited): sample 7 of the standard 8x table is `(7, -7)`, with a regression row decoding your two captured `PA_SC_AA_SAMPLE_LOCS` words as the standard pattern (it fails with the old entry). This PR also picks up #374's HTILE extent fix when it is re-stacked on #374. `COVERED_CENTROID_IS_CENTER` and DCC over a multisampled target stay refused in this PR; they need their own handling (centroid inputs, initial MSAA contents and the CMASK 0xC state), as you found.
adriadam10 commented 2026-10-11 08:40:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T08:40:28Z.

Review: CHANGES_REQUESTED


#374 is merged now, so this needs the rebase you mentioned. Two things before it can land:

  • Rebase onto main. The branch still carries #374's old commits (501ac6951 … b8ae1f4b7); drop them. A merge against current main conflicts in libSceAgcDriver/CMakeLists.txt, BufferFill.cpp, PacketMemory.cpp, DepthSurface.hpp/.cpp, State.hpp/.cpp, Texture.hpp/.cpp and tests/Graphics.cpp. Please rerun the PR's tests after the rebase, not just check that it applies.
  • Guest access to a multisampled colour target throws (oneandonlydean's request of 2026-10-09, which you agreed to on 10-10): a CPU read through write tracking, a DMA copy, and a texture/image read at the target's address, with a test that reads a resolved-only target's memory and expects the throw. This keeps the host-only samples exact-or-throw while the host-only question is open.

Once both are in I'll review the rest on the rebased head (build, ctest, negative check on the new cases).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482595940 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#pullrequestreview-5482595940). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T08:40:28Z. **Review:** CHANGES_REQUESTED --- #374 is merged now, so this needs the rebase you mentioned. Two things before it can land: - **Rebase onto `main`.** The branch still carries #374's old commits (`501ac6951` … `b8ae1f4b7`); drop them. A merge against current `main` conflicts in `libSceAgcDriver/CMakeLists.txt`, `BufferFill.cpp`, `PacketMemory.cpp`, `DepthSurface.hpp/.cpp`, `State.hpp/.cpp`, `Texture.hpp/.cpp` and `tests/Graphics.cpp`. Please rerun the PR's tests after the rebase, not just check that it applies. - **Guest access to a multisampled colour target throws** (oneandonlydean's request of 2026-10-09, which you agreed to on 10-10): a CPU read through write tracking, a DMA copy, and a texture/image read at the target's address, with a test that reads a resolved-only target's memory and expects the throw. This keeps the host-only samples exact-or-throw while the host-only question is open. Once both are in I'll review the rest on the rebased head (build, ctest, negative check on the new cases).
adriadam10 commented 2026-10-11 10:12:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T10:12:12Z.


One thing to add now that #2636 is on main: on GPL devices, graphics pipelines are linked from per-stage libraries cached by libraryKeys (Graphics/src/Pipeline.cpp), and those keys don't include the multisample state. The fragment shader and fragment output libraries are built with rasterizationSamples (and a VkPipelineSampleLocationsStateCreateInfoEXT when the locations are custom), so with this PR a 1x and a 4x pipeline with the same shaders and formats would share libraries. @Raghav314 found it in #2242 while testing this PR on PPSA36082.

Please append the sample count and the sample locations to keys.fragmentShader and keys.fragmentOutput, and add a case to the library-reuse test that draws the same shaders at 1x and 4x and checks they don't share those two libraries. It doesn't affect main today because every pipeline there is 1x.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107943894 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6107943894). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T10:12:12Z. --- One thing to add now that #2636 is on `main`: on GPL devices, graphics pipelines are linked from per-stage libraries cached by `libraryKeys` (`Graphics/src/Pipeline.cpp`), and those keys don't include the multisample state. The fragment shader and fragment output libraries are built with `rasterizationSamples` (and a `VkPipelineSampleLocationsStateCreateInfoEXT` when the locations are custom), so with this PR a 1x and a 4x pipeline with the same shaders and formats would share libraries. @Raghav314 found it in #2242 while testing this PR on PPSA36082. Please append the sample count and the sample locations to `keys.fragmentShader` and `keys.fragmentOutput`, and add a case to the library-reuse test that draws the same shaders at 1x and 4x and checks they don't share those two libraries. It doesn't affect `main` today because every pipeline there is 1x.
exefer commented 2026-10-11 10:29:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by exefer on 2026-10-11T10:29:26Z.


Hit this exact error on Wobbly Life (PPSA29413, Unity) in-tutorial: register 0x2f8 = 0x0030e003, which decodes per your decodeSamples as standard 8x (log2 3, 8 exposed, all set bits in the accepted mask). Bring-up #2211. Looks like #419 covers this draw; leaving the rebase to you.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108084202 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6108084202). Originally posted by [exefer](https://github.com/exefer) on 2026-10-11T10:29:26Z. --- Hit this exact error on Wobbly Life (PPSA29413, Unity) in-tutorial: `register 0x2f8 = 0x0030e003`, which decodes per your `decodeSamples` as standard 8x (log2 3, 8 exposed, all set bits in the accepted mask). Bring-up #2211. Looks like #419 covers this draw; leaving the rebase to you.
MichonGoddijn231849 commented 2026-10-11 12:14:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T12:14:55Z.


@adriadam10 thanks, all three go in with the rebase tonight once main is quiet: #374's commits dropped and the branch rerun on main; guest access to a multisampled colour target (CPU read through write tracking, DMA copy, texture/image read) throws, with a resolved-only test; and the multisample state (sample count, plus the locations when custom) appended to keys.fragmentShader and keys.fragmentOutput, with a library-reuse case drawing the same shaders at 1x and 4x.

@exefer yes, 0x0030e003 is standard 8x and #419 takes it.

@Amoenus thanks for the CMASK model and the COVERED_CENTROID_IS_CENTER analysis. Both are real gaps, but this PR keeps refusing them. The centroid guard (admitted only without active centroid inputs) and the CMASK state split would be best as your own follow-up PRs on top of #419 once it lands, with you as author.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108911390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6108911390). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T12:14:55Z. --- @adriadam10 thanks, all three go in with the rebase tonight once main is quiet: #374's commits dropped and the branch rerun on `main`; guest access to a multisampled colour target (CPU read through write tracking, DMA copy, texture/image read) throws, with a resolved-only test; and the multisample state (sample count, plus the locations when custom) appended to `keys.fragmentShader` and `keys.fragmentOutput`, with a library-reuse case drawing the same shaders at 1x and 4x. @exefer yes, `0x0030e003` is standard 8x and #419 takes it. @Amoenus thanks for the CMASK model and the `COVERED_CENTROID_IS_CENTER` analysis. Both are real gaps, but this PR keeps refusing them. The centroid guard (admitted only without active centroid inputs) and the CMASK state split would be best as your own follow-up PRs on top of #419 once it lands, with you as author.
reyani-dev commented 2026-10-11 13:45:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T13:45:40Z.


A title that stops where this PR applies: ProsperoPuzzles (PPSA99006), on main a11c8f7f (Windows 11, RTX 4070, catalog build with eboot.bin and sce_module/libc.prx unwrapped):

[videoout] presentation failed: color samples, fragments or destination alpha override is unsupported (register 0x31d = 0x00012000)
terminate called after throwing an instance of 'std::runtime_error'

CB_COLOR0_ATTRIB = 0x00012000 is NUM_SAMPLES 2 and NUM_FRAGMENTS 2: a 4x MSAA color target. The title prints this only to its own log (download0/prosperopuzzles/app.log); the console shows only the entry-point line and exit 0xc0000409.

I wanted to run it with this branch, but the head currently conflicts with main (libSceAgcDriver/CMakeLists.txt, BufferFill.cpp, PacketMemory.cpp, TechnicalDebt.md). I'm happy to run ProsperoPuzzles on Windows once it's rebased.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109676009 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6109676009). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T13:45:40Z. --- A title that stops where this PR applies: **ProsperoPuzzles (PPSA99006)**, on `main` a11c8f7f (Windows 11, RTX 4070, catalog build with `eboot.bin` and `sce_module/libc.prx` unwrapped): ``` [videoout] presentation failed: color samples, fragments or destination alpha override is unsupported (register 0x31d = 0x00012000) terminate called after throwing an instance of 'std::runtime_error' ``` `CB_COLOR0_ATTRIB = 0x00012000` is `NUM_SAMPLES` 2 and `NUM_FRAGMENTS` 2: a 4x MSAA color target. The title prints this only to its own log (`download0/prosperopuzzles/app.log`); the console shows only the entry-point line and exit `0xc0000409`. I wanted to run it with this branch, but the head currently conflicts with `main` (`libSceAgcDriver/CMakeLists.txt`, `BufferFill.cpp`, `PacketMemory.cpp`, `TechnicalDebt.md`). I'm happy to run ProsperoPuzzles on Windows once it's rebased.
xXPBSXx commented 2026-10-11 14:30:02 +00:00 (Migrated from github.com)

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


Data point: New Joe & Mac: Caveman Ninja (PPSA02801, Unity) on Windows, current main a11c8f7f7 plus --module-dir Media/Modules --module-dir Media/Plugins. It gets through start-up and aborts on the first presentation with multisampling or coverage conversion is unsupported (register 0x2f8 = 0x00108001), which is the check in State.cpp on context register 0x2f8. I did not test this PR on it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110067916 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6110067916). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T14:30:02Z. --- Data point: New Joe & Mac: Caveman Ninja (PPSA02801, Unity) on Windows, current `main` a11c8f7f7 plus `--module-dir Media/Modules --module-dir Media/Plugins`. It gets through start-up and aborts on the first presentation with `multisampling or coverage conversion is unsupported (register 0x2f8 = 0x00108001)`, which is the check in `State.cpp` on context register 0x2f8. I did not test this PR on it. AI-assisted (Claude Code).
MichonGoddijn231849 commented 2026-10-11 14:52:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T14:52:44Z.


@adriadam10 rebased onto main a11c8f7f7 (head c120d9954). #374's commits are dropped, and the PR's tests were rerun on the rebased head.

Rebase. The conflicts were resolved against main's versions, keeping main's behaviour:

  • The target precheck keeps main's CMASK layout rule (pipe-aligned SW_64KB_Z_X). The 8-byte element limit and the CMASK range check now apply to single-sample targets only.
  • The ATTRIB check keeps main's "destination alpha override" message.
  • The draw-key register list gains the sample-location range (0x2fe, 16 registers), which brings it to 49 entries.
  • The multisampled() fixture in tests/Graphics.cpp sets the CMASK layout bits main now requires, and the fast-clear resolve case uses real CMASK memory.

Guest access to a multisampled colour target throws (c120d9954). Each target registers its guest range when acquired, sized to cover all its samples, and ClearMultisampleTargets drops the ranges. These overlaps throw ... overlaps multisampled color target ..., whose samples are only on the host: guest access to it is not implemented:

  • a CPU read through write tracking (GuestMemory::Read / ReadCommitted, before the GPU-write flush);
  • a DMA_DATA copy from memory;
  • a sampled texture or storage image whose memory overlaps the target.

multisampleGuestAccessTests in tests/Recorder.cpp creates a 4x RGBA8 target and expects the throw from all three paths. It also checks that a read outside the target, and a read after the targets are cleared, still succeed.

GPL libraries keyed by the sample count (e3b870c91). state.samples is appended to keys.fragmentShader and keys.fragmentOutput. Sample locations are not keyed after all: anything other than the standard 2x/4x/8x pattern is refused in decodeSamples, so the count determines them. The library-reuse case draws the same shaders at 4x, expects the fragment libraries to be rebuilt, then goes back to 1x and expects no rebuild. Negative check: with the two key lines removed, that case fails with "a 4x pipeline shared the 1x fragment shader or fragment output library".

Results on the rebased head:

  • agc_driver_graphics, agc_driver_recorder_tests (including --pipeline-library-only) and agc_pipeline_library / _off pass.
  • The full agc_ suite has the same failures as on main. The deferred prepared-shaders and disk-cache tests fail under -j4 and pass alone; the emulated colour-compare sRGB failure fails on main too.
  • check_conventions.py passes.

@AchrafReyani CB_COLOR0_ATTRIB = 0x00012000 (4 samples, 4 fragments) is a target this PR accepts.

@xXPBSXx 0x2f8 = 0x00108001 is 2x with 2 samples exposed, which this PR's decode accepts as long as the title uses the standard 2x sample locations.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110271718 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6110271718). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T14:52:44Z. --- @adriadam10 rebased onto `main` a11c8f7f7 (head `c120d9954`). #374's commits are dropped, and the PR's tests were rerun on the rebased head. **Rebase.** The conflicts were resolved against main's versions, keeping main's behaviour: - The target precheck keeps main's CMASK layout rule (pipe-aligned `SW_64KB_Z_X`). The 8-byte element limit and the CMASK range check now apply to single-sample targets only. - The ATTRIB check keeps main's "destination alpha override" message. - The draw-key register list gains the sample-location range (0x2fe, 16 registers), which brings it to 49 entries. - The `multisampled()` fixture in `tests/Graphics.cpp` sets the CMASK layout bits main now requires, and the fast-clear resolve case uses real CMASK memory. **Guest access to a multisampled colour target throws** (`c120d9954`). Each target registers its guest range when acquired, sized to cover all its samples, and `ClearMultisampleTargets` drops the ranges. These overlaps throw `... overlaps multisampled color target ..., whose samples are only on the host: guest access to it is not implemented`: - a CPU read through write tracking (`GuestMemory::Read` / `ReadCommitted`, before the GPU-write flush); - a `DMA_DATA` copy from memory; - a sampled texture or storage image whose memory overlaps the target. `multisampleGuestAccessTests` in `tests/Recorder.cpp` creates a 4x RGBA8 target and expects the throw from all three paths. It also checks that a read outside the target, and a read after the targets are cleared, still succeed. **GPL libraries keyed by the sample count** (`e3b870c91`). `state.samples` is appended to `keys.fragmentShader` and `keys.fragmentOutput`. Sample locations are not keyed after all: anything other than the standard 2x/4x/8x pattern is refused in `decodeSamples`, so the count determines them. The library-reuse case draws the same shaders at 4x, expects the fragment libraries to be rebuilt, then goes back to 1x and expects no rebuild. Negative check: with the two key lines removed, that case fails with "a 4x pipeline shared the 1x fragment shader or fragment output library". Results on the rebased head: - `agc_driver_graphics`, `agc_driver_recorder_tests` (including `--pipeline-library-only`) and `agc_pipeline_library` / `_off` pass. - The full `agc_` suite has the same failures as on `main`. The deferred prepared-shaders and disk-cache tests fail under `-j4` and pass alone; the emulated colour-compare sRGB failure fails on `main` too. - `check_conventions.py` passes. @AchrafReyani `CB_COLOR0_ATTRIB = 0x00012000` (4 samples, 4 fragments) is a target this PR accepts. @xXPBSXx `0x2f8 = 0x00108001` is 2x with 2 samples exposed, which this PR's decode accepts as long as the title uses the standard 2x sample locations.
xXPBSXx commented 2026-10-11 16:02:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T16:02:21Z.


Static check for New Joe & Mac (PPSA02801), which stops on PA_SC_AA_CONFIG (0x2f8) = 0x00108001 ("multisampling or coverage conversion"). Fields from Linux gc_10_1_0_sh_mask.h: bit 0 is MSAA_NUM_SAMPLES = 1 (2 samples), bit 15 is inside MAX_SAMPLE_DIST (bits 16:13, value 4), bit 20 is MSAA_EXPOSED_SAMPLES = 1. The state check this PR adds masks out 0x7 | 0x1e000 | 0x700000, so 0x00108001 is accepted by that register check; whether the title then passes the rest (2-sample color and depth targets, standard sample locations) I have not run. I only read the diff against a11c8f7f7, so this says the register is covered, not that the title renders.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110906491 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6110906491). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T16:02:21Z. --- Static check for New Joe & Mac (PPSA02801), which stops on `PA_SC_AA_CONFIG` (0x2f8) = `0x00108001` ("multisampling or coverage conversion"). Fields from Linux `gc_10_1_0_sh_mask.h`: bit 0 is `MSAA_NUM_SAMPLES` = 1 (2 samples), bit 15 is inside `MAX_SAMPLE_DIST` (bits 16:13, value 4), bit 20 is `MSAA_EXPOSED_SAMPLES` = 1. The state check this PR adds masks out `0x7 | 0x1e000 | 0x700000`, so `0x00108001` is accepted by that register check; whether the title then passes the rest (2-sample color and depth targets, standard sample locations) I have not run. I only read the diff against `a11c8f7f7`, so this says the register is covered, not that the title renders. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-11 16:12:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T16:12:21Z.


Static check for Resident Evil 4 (PPSA07411), which stops on scan conversion mode is unsupported (register 0x292 = 0x00000003). Register 0x292 is PA_SC_MODE_CNTL_0 (Linux gc_10_1_0_offset.h); 0x3 is MSAA_ENABLE (bit 0) plus VPORT_SCISSOR_ENABLE (bit 1, which State.cpp already handles). In this PR the bit 0 exemption is conditional: zero(cx, 0x292, result.samples > 1 ? ScanModeMask & ~1u : ScanModeMask, ...), and the same condition in the draw-rejection check. So a draw with MSAA_ENABLE set and single-sample targets is still refused with the same message, and a draw with multisampled targets passes. I have not seen RE4's target sample counts (it stops before that), so I can not say which case it is, and I do not know what the hardware does for MSAA_ENABLE=1 with 1-sample targets, so I am not proposing to relax the single-sample case. Read-only check against the PR diff, no run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111001239 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6111001239). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T16:12:21Z. --- Static check for Resident Evil 4 (PPSA07411), which stops on `scan conversion mode is unsupported (register 0x292 = 0x00000003)`. Register 0x292 is `PA_SC_MODE_CNTL_0` (Linux `gc_10_1_0_offset.h`); `0x3` is `MSAA_ENABLE` (bit 0) plus `VPORT_SCISSOR_ENABLE` (bit 1, which `State.cpp` already handles). In this PR the bit 0 exemption is conditional: `zero(cx, 0x292, result.samples > 1 ? ScanModeMask & ~1u : ScanModeMask, ...)`, and the same condition in the draw-rejection check. So a draw with `MSAA_ENABLE` set and single-sample targets is still refused with the same message, and a draw with multisampled targets passes. I have not seen RE4's target sample counts (it stops before that), so I can not say which case it is, and I do not know what the hardware does for `MSAA_ENABLE=1` with 1-sample targets, so I am not proposing to relax the single-sample case. Read-only check against the PR diff, no run. AI-assisted (Claude Code).
reyani-dev commented 2026-10-11 16:12:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T16:12:54Z.


Windows check of the rebased head c120d9954 with ProsperoPuzzles (PPSA99006): Windows 11, RTX 4070, WinLibs GCC 15.2.0 r7, catalog build with eboot.bin and sce_module/libc.prx unwrapped.

The register 0x31d = 0x00012000 stop from my earlier comment is gone. The title now stops on one of this PR's own checks, at the first draw into its 4x target:

[videoout] presentation failed: AGC graphics: a color target's sample count differs from the rasterizer's

Register values at that check (from a local debug print, not part of any branch):

Register Value Meaning
CB_COLOR0_ATTRIB (0x31d) 0x00012000 4 samples, 4 fragments
CB_COLOR0_INFO (0x31c) 0x00008028
PA_SC_AA_CONFIG (0x2f8) 0x00000000 1 sample (MSAA_NUM_SAMPLES = 0)
PA_SC_MODE_CNTL_0 (0x292) 0x00000022 MSAA_ENABLE off
depth target none

So the draw rasterizes at one sample into a 4-sample colour target with no depth. The title renders through blackbearreloaded/ps5-opengl (Mesa gallium on AGC, GL 4.6 core). I haven't found which GL operation emits this draw.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111006529 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6111006529). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T16:12:54Z. --- Windows check of the rebased head `c120d9954` with ProsperoPuzzles (PPSA99006): Windows 11, RTX 4070, WinLibs GCC 15.2.0 r7, catalog build with `eboot.bin` and `sce_module/libc.prx` unwrapped. The `register 0x31d = 0x00012000` stop from my earlier comment is gone. The title now stops on one of this PR's own checks, at the first draw into its 4x target: ``` [videoout] presentation failed: AGC graphics: a color target's sample count differs from the rasterizer's ``` Register values at that check (from a local debug print, not part of any branch): | Register | Value | Meaning | |---|---|---| | `CB_COLOR0_ATTRIB` (0x31d) | `0x00012000` | 4 samples, 4 fragments | | `CB_COLOR0_INFO` (0x31c) | `0x00008028` | | | `PA_SC_AA_CONFIG` (0x2f8) | `0x00000000` | 1 sample (`MSAA_NUM_SAMPLES` = 0) | | `PA_SC_MODE_CNTL_0` (0x292) | `0x00000022` | `MSAA_ENABLE` off | | depth target | none | | So the draw rasterizes at one sample into a 4-sample colour target with no depth. The title renders through blackbearreloaded/ps5-opengl (Mesa gallium on AGC, GL 4.6 core). I haven't found which GL operation emits this draw.
xXPBSXx commented 2026-10-11 17:05:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T17:05:14Z.


Test of this PR on titles, built as main a11c8f7f7 + this PR (6 files merged without conflicts) + #425 (see the note there), Windows, RX/NVIDIA 10de:2702 driver, 60 s per run, no claim about the image:

  • New Joe & Mac: Caveman Ninja (PPSA02801): gets past scan conversion mode (0x292) and multisampling or coverage conversion (0x2f8 = 0x00108001). New first stop, exact line: [videoout] presentation failed: AGC graphics: nonstandard sample locations are unsupported. I have not looked at which registers hold those locations or whether they are really nonstandard for this title.
  • Kena: Bridge of Spirits (PPSA01746): no stop within 60 s (it was still preparing shaders; the earlier PA_CL_VS_OUT_CNTL clip-distance stop from #423 is not reached in that time, so I can not say whether this PR affects it).
  • Resident Evil 4 (PPSA07411): not tested here: on plain main it does not start (33 imports are absent in the audit, e.g. several sce::Json functions and sceHmd2*, covered by branches not in main), so the 0x292 = 0x3 stop could not be reached.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111495439 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6111495439). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T17:05:14Z. --- Test of this PR on titles, built as `main` a11c8f7f7 + this PR (6 files merged without conflicts) + #425 (see the note there), Windows, RX/NVIDIA 10de:2702 driver, 60 s per run, no claim about the image: - **New Joe & Mac: Caveman Ninja (PPSA02801):** gets past `scan conversion mode` (0x292) and `multisampling or coverage conversion` (0x2f8 = `0x00108001`). New first stop, exact line: `[videoout] presentation failed: AGC graphics: nonstandard sample locations are unsupported`. I have not looked at which registers hold those locations or whether they are really nonstandard for this title. - **Kena: Bridge of Spirits (PPSA01746):** no stop within 60 s (it was still preparing shaders; the earlier `PA_CL_VS_OUT_CNTL` clip-distance stop from #423 is not reached in that time, so I can not say whether this PR affects it). - **Resident Evil 4 (PPSA07411):** not tested here: on plain `main` it does not start (33 imports are absent in the audit, e.g. several `sce::Json` functions and `sceHmd2*`, covered by branches not in `main`), so the `0x292 = 0x3` stop could not be reached. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-11 17:19:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T17:19:42Z.


Follow-up on my Kena (PPSA01746) line above (main a11c8f7f7 + this PR + #425): a second run of 100 s instead of 60 s ends with FATAL: unhandled exception 0xc0000005, a write of address 0 at app.exe+0x1c7a46b on a game thread, called from app.exe+0x1c1ba79. It is a crash inside the title's own code (null pointer store), not an AGC error line, and I have not run plain main to check whether this PR or #425 matter for it; the PA_CL_VS_OUT_CNTL clip-distance stop of #423 was not reached either way. So for Kena the PR makes no visible difference in my runs.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111628192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6111628192). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T17:19:42Z. --- Follow-up on my Kena (PPSA01746) line above (`main` a11c8f7f7 + this PR + #425): a second run of 100 s instead of 60 s ends with `FATAL: unhandled exception 0xc0000005`, a write of address 0 at `app.exe+0x1c7a46b` on a game thread, called from `app.exe+0x1c1ba79`. It is a crash inside the title's own code (null pointer store), not an AGC error line, and I have not run plain `main` to check whether this PR or #425 matter for it; the `PA_CL_VS_OUT_CNTL` clip-distance stop of #423 was not reached either way. So for Kena the PR makes no visible difference in my runs. AI-assisted (Claude Code).
billythemenace2 commented 2026-10-11 17:32:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-11T17:32:22Z.


Test of the rebased head c120d9954 with PPSA06888 (Unity), Windows 11, RX 5700 XT (AMD proprietary driver), MinGW GCC. Built as main a11c8f7f7 + this PR + #2169's sample-location commits (567f69eef, 16e0e5a12, and the Pipeline.cpp part of 55cc2824f) + five libSceRudp exports the title needs (separate PR coming). Full relink with that build's relinker.

1. PA_SC_AA_CONFIG = 0x00108001 (2x, 2 exposed, max distance 4) is accepted, as you said for New Joe & Mac.

2. Sample locations. With this PR alone the title stops at nonstandard sample locations are unsupported. All four pixels of PA_SC_AA_SAMPLE_LOCS hold 0x0000c44c: sample 0 at (-4, 4), sample 1 at (4, -4). That is the other diagonal from the standard 2x pattern in this PR's table, which matches Mesa (radv_device.c:975 FILL_SREG(4, 4, -4, -4, ...), radeonsi si_state_msaa.c:77 FILL_SREG(-4, -4, 4, 4, ...)), so the table is right and the title really uses a custom pattern. It is uniform across the quad, so #2169 takes it: with its commits the state decodes as custom locations and the title draws. New Joe & Mac stops on the same check with the same 0x2f8 value; I have not checked its registers, so I can't say whether it uses the same pattern.

3. New stop: the guest-access guard from c120d9954, hit by memory reuse.

AGC graphics: a texture read of 0x22cf41000+0x230000 overlaps multisampled color target 0x22cf50000+0xfd2000 (2 samples), whose samples are only on the host: guest access to it is not implemented

Local debug prints (not in any branch):

  • Before the stop, the title creates seven 1920x1080 2x RGBA8 targets at different addresses (0x226a10000, 0x229c90000, 0x22cf50000, 0x230f10000, 0x243090000, 0x244a50000, 0x2483d0000), all without CMASK.
  • The texture that trips the guard is a single-sample 2D image (descriptor type 9), 1280x431, one mip, format 0x38, starting at 0x22cf41000, 0xF000 bytes before the target. Descriptor words: 022cf410 c3800000 006b813f 90500fac 00000000 00700000 00000000 00000000.

So this isn't a read of the multisampled image. It is a different, smaller resource in memory that a 2x target occupied earlier, which looks like Unity reusing render-texture memory. Guard ranges are only dropped in ClearMultisampleTargets (device teardown), so once a title's allocator hands that memory to something else, every read of it throws.

Suggestion: retire a multisampled target (its guard range and host image) when something else writes its memory, for example a single-sample colour or depth target bound over it, a fill or DMA_DATA write, or a CPU write seen by write tracking, and keep throwing only when the bytes being read were last written by the multisampled target. I have not established which of those wrote the 1280x431 texture here. I can add a print for whichever hook you pick and rerun.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111743077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6111743077). Originally posted by [billythemenace2](https://github.com/billythemenace2) on 2026-10-11T17:32:22Z. --- Test of the rebased head `c120d9954` with PPSA06888 (Unity), Windows 11, RX 5700 XT (AMD proprietary driver), MinGW GCC. Built as `main` a11c8f7f7 + this PR + #2169's sample-location commits (`567f69eef`, `16e0e5a12`, and the `Pipeline.cpp` part of `55cc2824f`) + five `libSceRudp` exports the title needs (separate PR coming). Full relink with that build's relinker. **1. `PA_SC_AA_CONFIG` = `0x00108001`** (2x, 2 exposed, max distance 4) is accepted, as you said for New Joe & Mac. **2. Sample locations.** With this PR alone the title stops at `nonstandard sample locations are unsupported`. All four pixels of `PA_SC_AA_SAMPLE_LOCS` hold `0x0000c44c`: sample 0 at (-4, 4), sample 1 at (4, -4). That is the other diagonal from the standard 2x pattern in this PR's table, which matches Mesa (`radv_device.c:975` `FILL_SREG(4, 4, -4, -4, ...)`, radeonsi `si_state_msaa.c:77` `FILL_SREG(-4, -4, 4, 4, ...)`), so the table is right and the title really uses a custom pattern. It is uniform across the quad, so #2169 takes it: with its commits the state decodes as custom locations and the title draws. New Joe & Mac stops on the same check with the same `0x2f8` value; I have not checked its registers, so I can't say whether it uses the same pattern. **3. New stop: the guest-access guard from `c120d9954`, hit by memory reuse.** ``` AGC graphics: a texture read of 0x22cf41000+0x230000 overlaps multisampled color target 0x22cf50000+0xfd2000 (2 samples), whose samples are only on the host: guest access to it is not implemented ``` Local debug prints (not in any branch): - Before the stop, the title creates seven 1920x1080 2x RGBA8 targets at different addresses (`0x226a10000`, `0x229c90000`, `0x22cf50000`, `0x230f10000`, `0x243090000`, `0x244a50000`, `0x2483d0000`), all without CMASK. - The texture that trips the guard is a single-sample 2D image (descriptor type 9), 1280x431, one mip, format `0x38`, starting at `0x22cf41000`, 0xF000 bytes before the target. Descriptor words: `022cf410 c3800000 006b813f 90500fac 00000000 00700000 00000000 00000000`. So this isn't a read of the multisampled image. It is a different, smaller resource in memory that a 2x target occupied earlier, which looks like Unity reusing render-texture memory. Guard ranges are only dropped in `ClearMultisampleTargets` (device teardown), so once a title's allocator hands that memory to something else, every read of it throws. Suggestion: retire a multisampled target (its guard range and host image) when something else writes its memory, for example a single-sample colour or depth target bound over it, a fill or `DMA_DATA` write, or a CPU write seen by write tracking, and keep throwing only when the bytes being read were last written by the multisampled target. I have not established which of those wrote the 1280x431 texture here. I can add a print for whichever hook you pick and rerun. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-11 20:06:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T20:06:42Z.


Follow-up on New Joe & Mac (PPSA02801), the nonstandard sample locations are unsupported stop, on main 12c226628 + this PR. I printed the failing sample (temporary local trace, not committed): 2 samples, pixel 0, register 0x2fe (PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0) = 0x0000c44c. With the decode used by decodeSamples (low nibble x, high nibble y, both signed, in 1/16 pixel): sample 0 = (-4, +4), sample 1 = (+4, -4). The PR's table for 2 samples is {(4, 4), (-4, -4)}, so the title programs the other diagonal. The trace stops at the first mismatch, so I do not know the other three pixels' values. I make no claim about whether the console's own default for 2x is this diagonal; the PR rejects it correctly as it stands, because Vulkan's standard 2x positions are the PR's table and a different diagonal would need VK_EXT_sample_locations or a mirrored resolve.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113188648 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6113188648). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T20:06:42Z. --- Follow-up on New Joe & Mac (PPSA02801), the `nonstandard sample locations are unsupported` stop, on `main` 12c226628 + this PR. I printed the failing sample (temporary local trace, not committed): 2 samples, pixel 0, register `0x2fe` (`PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0`) = `0x0000c44c`. With the decode used by `decodeSamples` (low nibble x, high nibble y, both signed, in 1/16 pixel): sample 0 = (-4, +4), sample 1 = (+4, -4). The PR's table for 2 samples is {(4, 4), (-4, -4)}, so the title programs the other diagonal. The trace stops at the first mismatch, so I do not know the other three pixels' values. I make no claim about whether the console's own default for 2x is this diagonal; the PR rejects it correctly as it stands, because Vulkan's standard 2x positions are the PR's table and a different diagonal would need `VK_EXT_sample_locations` or a mirrored resolve. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-11 20:24:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T20:24:02Z.


Sources for the sample-location stop of New Joe & Mac (PPSA02801), which programs 2 samples at (-4, +4) and (+4, -4) (see my comment above):

  • Register layout: Linux gc_10_1_0_offset.h has mmPA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 = 0x02fe through mmPA_SC_AA_SAMPLE_LOCS_PIXEL_X1Y1_3 = 0x030d (16 registers, four per pixel); gc_10_1_0_sh_mask.h defines per register eight 4-bit fields S0_X (bits 3:0), S0_Y (7:4), S1_X, S1_Y, ... S3_Y (31:28), which is what decodeSamples reads (signed, 1/16 pixel).
  • A standard table on AMD hardware: Mesa radv_device.c has sample_locs_2x = FILL_SREG(4, 4, -4, -4, 0, 0, 0, 0), the same two points as this PR's StandardLocations2; radv_cmd_buffer.c (around line 2451) also writes these registers from application-provided positions for VK_EXT_sample_locations.
  • So the registers can express the title's mirrored diagonal; whether a host can render with it is what decides support. A host-side path would need VK_EXT_sample_locations (sampleLocationsEnable plus VkSampleLocationEXT per sample, and the device's sampleLocationSampleCounts limit) for the draw, and the guest's resolve then averages samples regardless of position. I did not check the device limits, did not find a shadPS4 or KytyPS5 implementation to cite, and have not seen the title's other three pixels, so this is a pointer to the mechanism, not a claim that it would be correct for this title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113358419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6113358419). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T20:24:02Z. --- Sources for the sample-location stop of New Joe & Mac (PPSA02801), which programs 2 samples at (-4, +4) and (+4, -4) (see my comment above): - Register layout: Linux `gc_10_1_0_offset.h` has `mmPA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 = 0x02fe` through `mmPA_SC_AA_SAMPLE_LOCS_PIXEL_X1Y1_3 = 0x030d` (16 registers, four per pixel); `gc_10_1_0_sh_mask.h` defines per register eight 4-bit fields `S0_X` (bits 3:0), `S0_Y` (7:4), `S1_X`, `S1_Y`, ... `S3_Y` (31:28), which is what `decodeSamples` reads (signed, 1/16 pixel). - A standard table on AMD hardware: Mesa `radv_device.c` has `sample_locs_2x = FILL_SREG(4, 4, -4, -4, 0, 0, 0, 0)`, the same two points as this PR's `StandardLocations2`; `radv_cmd_buffer.c` (around line 2451) also writes these registers from application-provided positions for `VK_EXT_sample_locations`. - So the registers can express the title's mirrored diagonal; whether a host can render with it is what decides support. A host-side path would need `VK_EXT_sample_locations` (`sampleLocationsEnable` plus `VkSampleLocationEXT` per sample, and the device's `sampleLocationSampleCounts` limit) for the draw, and the guest's resolve then averages samples regardless of position. I did not check the device limits, did not find a shadPS4 or KytyPS5 implementation to cite, and have not seen the title's other three pixels, so this is a pointer to the mechanism, not a claim that it would be correct for this title. AI-assisted (Claude Code).
adriadam10 commented 2026-10-11 21:36:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:36:16Z.

Review: APPROVED


Rebased view checked on current main: build + ctest of the touched components pass (690/690), agc_driver_graphics and the guest-access test run, not skipped.

Added as our own commits on your branch:

  • TechnicalDebt.md: your rebase left Host imports and Cube texture descriptors twice (the older text); removed the duplicates.
  • Guest-access guard (MultisampleTarget.cpp): it covered max(single-sample bytes, w*h*element*samples), which misses the tile padding of the later sample planes (Amoenus' 65x65 4x case: texel (64, 0, fragment 1) is at byte 82944, outside the 67600-byte range). It now covers CB bytes * samples at least. The test has a row for that padding and fails with the old formula.
  • multisampleGuestAccessTests only ran in the full recorder binary, which no ctest entry starts. It has a --multisample-only mode and the agc_multisample_guest_access test.
  • TechnicalDebt.md: the guard bound (inferred, not addrlib's exact fragment-aware footprint) and that multisampled targets are never evicted; ARCHITECTURE.md: a bullet on host-only multisampled targets, the guard and the resolve.

Not covered by any test here: an actual MSAA draw and ResolveMultisampleTarget on a GPU (the tests pin decoding, library keys and the guard). The title reports in the thread (Hades II on an RTX 4090, ProsperoPuzzles on Windows) are the evidence for that part; the stops they report next (sample locations of New Joe & Mac / Hades II, the sample-count check of ProsperoPuzzles) are follow-ups.

Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5485066092 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#pullrequestreview-5485066092). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T21:36:16Z. **Review:** APPROVED --- Rebased view checked on current `main`: build + ctest of the touched components pass (690/690), `agc_driver_graphics` and the guest-access test run, not skipped. Added as our own commits on your branch: - `TechnicalDebt.md`: your rebase left `Host imports` and `Cube texture descriptors` twice (the older text); removed the duplicates. - Guest-access guard (`MultisampleTarget.cpp`): it covered `max(single-sample bytes, w*h*element*samples)`, which misses the tile padding of the later sample planes (Amoenus' 65x65 4x case: texel `(64, 0, fragment 1)` is at byte 82944, outside the 67600-byte range). It now covers `CB bytes * samples` at least. The test has a row for that padding and fails with the old formula. - `multisampleGuestAccessTests` only ran in the full recorder binary, which no ctest entry starts. It has a `--multisample-only` mode and the `agc_multisample_guest_access` test. - `TechnicalDebt.md`: the guard bound (inferred, not addrlib's exact fragment-aware footprint) and that multisampled targets are never evicted; `ARCHITECTURE.md`: a bullet on host-only multisampled targets, the guard and the resolve. Not covered by any test here: an actual MSAA draw and `ResolveMultisampleTarget` on a GPU (the tests pin decoding, library keys and the guard). The title reports in the thread (Hades II on an RTX 4090, ProsperoPuzzles on Windows) are the evidence for that part; the stops they report next (sample locations of New Joe & Mac / Hades II, the sample-count check of ProsperoPuzzles) are follow-ups. Merging once CI is green.
adriadam10 commented 2026-10-11 21:50:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:50:07Z.


Rebased again on current main (it conflicted with the new agc_draw_snapshot_cap test registration in libSceAgcDriver/CMakeLists.txt; both tests are kept, no logic changed). Build + ctest of the touched components pass, agc_driver_graphics and agc_multisample_guest_access run, not skipped.

Our commits on your branch are unchanged: duplicate TechnicalDebt lines removed, the guest-access guard covering CB bytes * samples, the guard test registered in ctest, and the TechnicalDebt/ARCHITECTURE notes.

Not covered by any test here: an actual MSAA draw and ResolveMultisampleTarget on a GPU; the title reports in the thread are the evidence for that part.

Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114184483 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6114184483). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T21:50:07Z. --- Rebased again on current `main` (it conflicted with the new `agc_draw_snapshot_cap` test registration in `libSceAgcDriver/CMakeLists.txt`; both tests are kept, no logic changed). Build + ctest of the touched components pass, `agc_driver_graphics` and `agc_multisample_guest_access` run, not skipped. Our commits on your branch are unchanged: duplicate TechnicalDebt lines removed, the guest-access guard covering `CB bytes * samples`, the guard test registered in ctest, and the TechnicalDebt/ARCHITECTURE notes. Not covered by any test here: an actual MSAA draw and `ResolveMultisampleTarget` on a GPU; the title reports in the thread are the evidence for that part. Merging once CI is green.
github-actions[bot] commented 2026-10-11 21:59:50 +00:00 (Migrated from github.com)

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


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
#2076 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L44
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L832-838
#2490 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L44
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L832-838
#2491 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L44
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L832-838
#2904 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L833-836
#3846 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L290-291
#4029 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L4
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114278147 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6114278147). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T21:59:50Z. --- <!-- 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 | |---|---|---|---| | #2076 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L44](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L44)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L832-838](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L832-L838) | | | | #2490 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L44](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L44)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L832-838](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L832-L838) | | | | #2491 | `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp` [L44](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L44)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L832-838](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L832-L838) | | | | #2904 | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L833-836](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L833-L836) | | | | #3846 | `core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp` [L290-291](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp#L290-L291) | | | | #4029 | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L4](https://github.com/boykopovar/AnyPS5/blob/1be2ca2028f1caf4640a765941bfca2fae7d53f2/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L4) | | |
MichonGoddijn231849 commented 2026-10-11 22:15:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T22:15:12Z.


@billythemenace2 thanks, that reading is right: the guard ranges only go away at device teardown, so once Unity hands a former 2x target's memory to another resource, every read of it throws. With #419 merged that is on main now, so I'll do the follow-up PR: a multisampled target is retired (its guard range and host image) when its memory is written as something else, for example a single-sample color or depth target bound over it, a fill or DMA_DATA, or a CPU write the write tracking sees. The guard then throws only for reads of bytes the multisampled target still owns.

It would help to know which of those wrote the 1280x431 texture in PPSA06888. If you can add a print, the cheapest place to start is the single-sample color/depth target setup over the range: that's the hook I'd put first.

The sample-location stops (New Joe & Mac, PPSA06888) are #2169's path, as you found.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114464202 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6114464202). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T22:15:12Z. --- @billythemenace2 thanks, that reading is right: the guard ranges only go away at device teardown, so once Unity hands a former 2x target's memory to another resource, every read of it throws. With #419 merged that is on `main` now, so I'll do the follow-up PR: a multisampled target is retired (its guard range and host image) when its memory is written as something else, for example a single-sample color or depth target bound over it, a fill or `DMA_DATA`, or a CPU write the write tracking sees. The guard then throws only for reads of bytes the multisampled target still owns. It would help to know which of those wrote the 1280x431 texture in PPSA06888. If you can add a print, the cheapest place to start is the single-sample color/depth target setup over the range: that's the hook I'd put first. The sample-location stops (New Joe & Mac, PPSA06888) are #2169's path, as you found.
xXPBSXx commented 2026-10-12 04:47:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T04:47:49Z.


Source for how another PS5 emulator treats the PA_SC_AA_SAMPLE_LOCS_* registers (addition to my comment above on the registers and Mesa): KytyPS5 stores the 16 registers 0x2FE..0x30D (pm4.h) as locations[16] of a context struct (HwCtxSetAaSampleControl in pm4Handlers.cpp, which also takes them as a 20-dword block together with PA_SC_CENTROID_PRIORITY_0/1), and renderer/debug.cpp (AaCheck) does not render with them: for any non-zero location, non-zero centroid priority or sample count it only logs, at most 16 times, warning: unsupported PS5 sample locations use native Vulkan locations: samples=..., exposed=..., max_dist=.... So Kyty's behavior is to ignore the guest locations and use Vulkan's native ones with a warning. That is a precedent, not a statement about what is correct for New Joe & Mac (its 2-sample locations are the mirrored diagonal from my earlier comment); if this PR or a follow-up wanted the same tolerance, it would be a deliberate approximation and belongs in TechnicalDebt.md, not a silent accept. shadPS4 only has the register names in its devtools (gcn_context_regs.cpp), no handling.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117936449 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6117936449). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T04:47:49Z. --- Source for how another PS5 emulator treats the `PA_SC_AA_SAMPLE_LOCS_*` registers (addition to my comment above on the registers and Mesa): KytyPS5 stores the 16 registers `0x2FE..0x30D` (`pm4.h`) as `locations[16]` of a context struct (`HwCtxSetAaSampleControl` in `pm4Handlers.cpp`, which also takes them as a 20-dword block together with `PA_SC_CENTROID_PRIORITY_0/1`), and `renderer/debug.cpp` (`AaCheck`) does not render with them: for any non-zero location, non-zero centroid priority or sample count it only logs, at most 16 times, `warning: unsupported PS5 sample locations use native Vulkan locations: samples=..., exposed=..., max_dist=...`. So Kyty's behavior is to ignore the guest locations and use Vulkan's native ones with a warning. That is a precedent, not a statement about what is correct for New Joe & Mac (its 2-sample locations are the mirrored diagonal from my earlier comment); if this PR or a follow-up wanted the same tolerance, it would be a deliberate approximation and belongs in `TechnicalDebt.md`, not a silent accept. shadPS4 only has the register names in its devtools (`gcn_context_regs.cpp`), no handling. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 05:22:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T05:22:43Z.


Summary of the registers behind nonstandard sample locations are unsupported, with the origin of each statement:

  • PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 .. X1Y1_3 = 0x2fe .. 0x30d (16 registers; four per pixel of the 2x2 quad; each register has four samples as 4-bit signed x/y fields in 1/16 pixel). Origin: Linux gc_10_1_0_offset.h / gc_10_1_0_sh_mask.h (non-PS5). KytyPS5 (pm4.h) uses the same block of 16 starting at 0x2FE.
  • PA_SC_CENTROID_PRIORITY_0/1 = 0x2f5 / 0x2f6 (same Linux headers, 8 four-bit DISTANCE_n fields per register). Mesa radv_cmd_buffer.c (radv_compute_centroid_priority) derives them from the sample locations: it sorts the samples by squared distance from the pixel center and writes the order. They only affect which sample is used for centroid-interpolated inputs, not coverage.
  • Mesa radv_device.c has the standard tables (2x: (4,4), (-4,-4)); the title here programs (-4,+4), (+4,-4).
  • KytyPS5 ignores the guest locations and uses Vulkan's native ones with a log line (renderer/debug.cpp, AaCheck); shadPS4 only names the registers (gcn_context_regs.cpp).

What a minimum treatment could be, as far as these sources support it: (1) keep rejecting unless the 16 location registers equal a standard table, as this PR does; (2) if an approximation is accepted, accept the mirrored 2x pattern only, explicitly, and list in TechnicalDebt.md that the host uses Vulkan's native positions (same trade-off as Kyty), because with equal-weight resolves the sample positions change only where geometry edges fall within the pixel, and with centroid inputs; the sources do not say how visible this is on the console. I would not accept arbitrary locations silently. No code from me.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118272828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6118272828). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T05:22:43Z. --- Summary of the registers behind `nonstandard sample locations are unsupported`, with the origin of each statement: - `PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 .. X1Y1_3` = `0x2fe .. 0x30d` (16 registers; four per pixel of the 2x2 quad; each register has four samples as 4-bit signed x/y fields in 1/16 pixel). Origin: Linux `gc_10_1_0_offset.h` / `gc_10_1_0_sh_mask.h` (non-PS5). KytyPS5 (`pm4.h`) uses the same block of 16 starting at `0x2FE`. - `PA_SC_CENTROID_PRIORITY_0/1` = `0x2f5` / `0x2f6` (same Linux headers, 8 four-bit `DISTANCE_n` fields per register). Mesa `radv_cmd_buffer.c` (`radv_compute_centroid_priority`) derives them from the sample locations: it sorts the samples by squared distance from the pixel center and writes the order. They only affect which sample is used for centroid-interpolated inputs, not coverage. - Mesa `radv_device.c` has the standard tables (2x: (4,4), (-4,-4)); the title here programs (-4,+4), (+4,-4). - KytyPS5 ignores the guest locations and uses Vulkan's native ones with a log line (`renderer/debug.cpp`, `AaCheck`); shadPS4 only names the registers (`gcn_context_regs.cpp`). What a minimum treatment could be, as far as these sources support it: (1) keep rejecting unless the 16 location registers equal a standard table, as this PR does; (2) if an approximation is accepted, accept the mirrored 2x pattern only, explicitly, and list in `TechnicalDebt.md` that the host uses Vulkan's native positions (same trade-off as Kyty), because with equal-weight resolves the sample positions change only where geometry edges fall within the pixel, and with centroid inputs; the sources do not say how visible this is on the console. I would not accept arbitrary locations silently. No code from me. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-12 11:52:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T11:52:16Z.


Update for New Joe & Mac: Caveman Ninja (PPSA02801), the title that stopped on nonstandard sample locations are unsupported in my earlier comment: on current main e7c70a2df + #425 + #4408 + #3840 (plus local diagnostic prints, not committed), relinked with 0 absent imports, Windows, RTX 4080 SUPER, 240 s limit: no stop. The run reached the time limit; apart from my diagnostic lines the log has only the [SAVEDATA:native] memory calls and the usual start-up lines, no presentation failed, no FATAL. The log shows thousands of indexed draws and dword fills, so the title is drawing. I have not looked at the image. The sample-locations stop is therefore gone with the changes that landed after this PR (custom sample locations from #2169 and #4309), at least for this title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6123709525 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6123709525). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T11:52:16Z. --- Update for New Joe & Mac: Caveman Ninja (PPSA02801), the title that stopped on `nonstandard sample locations are unsupported` in my earlier comment: on current `main` e7c70a2df + #425 + #4408 + #3840 (plus local diagnostic prints, not committed), relinked with 0 absent imports, Windows, RTX 4080 SUPER, 240 s limit: **no stop**. The run reached the time limit; apart from my diagnostic lines the log has only the `[SAVEDATA:native]` memory calls and the usual start-up lines, no `presentation failed`, no `FATAL`. The log shows thousands of indexed draws and dword fills, so the title is drawing. I have not looked at the image. The sample-locations stop is therefore gone with the changes that landed after this PR (custom sample locations from #2169 and #4309), at least for this title. AI-assisted (Claude Code).
KingDarkHN commented 2026-10-13 03:54:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by KingDarkHN on 2026-10-13T03:54:31Z.


Following up on the retire-on-write idea from #4199/#1189: I implemented and tested it locally against Fallen Legion (PPSA07645), and wanted to share the results.

Implementation

  • A write guard mirroring the read guard (SetWriteGuard) that runs before every store that flows through storeOwn (the innermost guest store: the game's memory-operation shims and the driver's own writes).
  • The same retire happens for GPU-side writes that bypass storeOwn: DMA_DATA destinations, WRITE_DATA/COPY_DATA stores (ResolveStore) and buffer fills.
  • On overlap, the multisampled target is retired: the host image and its guard are dropped (the samples live host-side; the guest has overwritten the memory, so the target is dead).
  • Added a recorder test: a store over the target's memory retires it, so subsequent CPU reads and the DMA guard no longer refuse.

Result in the game. Fallen Legion aborts on a real macro that reuses a multisampled color target's memory after a resolve (the same 4x 3840x2160 target that #2121's resolve involves). With this change the store now retires that target instead of leaving a stale guard that crashes the next frame:

[agc] multisampled color target 0x2270d0000+0x870000 retired after a guest write of 0x2271561e8+0x4 reused its memory

One observation for the follow-up. The remaining overlapping reads in the title do not have a tracked preceding write: parts of the reuse come from GPU shader stores (or writes that happen before the target/guard exists). Retiring on writes alone therefore does not fully un-hang the game. Since true MSAA sampling/readback is not implemented, refusing those reads only ever aborts the title; letting them read the (now foreign) memory would turn a hard crash into a minor visual artifact while a real read-side test proves the region was repurposed.

Happy to turn the write-guard core + test into a PR if useful, or to adjust the read-side behavior to match what you prefer.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6137866497 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/419#issuecomment-6137866497). Originally posted by [KingDarkHN](https://github.com/KingDarkHN) on 2026-10-13T03:54:31Z. --- Following up on the retire-on-write idea from #4199/#1189: I implemented and tested it locally against Fallen Legion (PPSA07645), and wanted to share the results. **Implementation** - A write guard mirroring the read guard (SetWriteGuard) that runs before every store that flows through `storeOwn` (the innermost guest store: the game's memory-operation shims and the driver's own writes). - The same retire happens for GPU-side writes that bypass `storeOwn`: DMA_DATA destinations, WRITE_DATA/COPY_DATA stores (ResolveStore) and buffer fills. - On overlap, the multisampled target is retired: the host image and its guard are dropped (the samples live host-side; the guest has overwritten the memory, so the target is dead). - Added a recorder test: a store over the target's memory retires it, so subsequent CPU reads and the DMA guard no longer refuse. **Result in the game.** Fallen Legion aborts on a real macro that reuses a multisampled color target's memory after a resolve (the same 4x 3840x2160 target that #2121's resolve involves). With this change the store now retires that target instead of leaving a stale guard that crashes the next frame: ``` [agc] multisampled color target 0x2270d0000+0x870000 retired after a guest write of 0x2271561e8+0x4 reused its memory ``` **One observation for the follow-up.** The remaining overlapping *reads* in the title do not have a tracked preceding write: parts of the reuse come from GPU shader stores (or writes that happen before the target/guard exists). Retiring on writes alone therefore does not fully un-hang the game. Since true MSAA sampling/readback is not implemented, refusing those reads only ever aborts the title; letting them read the (now foreign) memory would turn a hard crash into a minor visual artifact while a real read-side test proves the region was repurposed. Happy to turn the write-guard core + test into a PR if useful, or to adjust the read-side behavior to match what you prefer.
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!419
No description provided.