feat(agc): sample a multisampled color target through its 2D MSAA texture #4820

Merged
nicolasabosch merged 3 commits from upstream-pr/4820 into main 2026-10-14 17:42:29 +00:00
nicolasabosch commented 2026-10-12 22:54:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-12T22:54:30Z.


What

A shader that loads from a 2D multisampled image no longer stops at DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape when the image is a color target that draws rendered on the host. Part of #3036.

  • DescriptorBindingBuilder gives a 2D multisampled image the new shape DescriptorImageShape::Image2DMultisample. Multisampled arrays still throw.
  • DecodeTextureResource decodes T# type 14 as TextureDimension::k2DMsaa. The sample count is 1 << LAST_LEVEL, with BASE_LEVEL 0 and MAX_MIP equal to LAST_LEVEL, as ac_build_gfx10_texture_descriptor writes them (Mesa src/amd/common/ac_descriptors.c, 1e2c42b6). A descriptor that differs throws. The surface decodes with one mip level.
  • A sampled multisampled T# is bound as a view of the multisample target at its address (MultisampleTargetTexture), when the target has the same format, size and sample count. The target's image gets VK_IMAGE_USAGE_SAMPLED_BIT when the device can sample its format at that sample count. Nothing is read from or written to guest memory.
  • These throw: a T# over a target of another size, format or sample count; a T# no draw rendered to; storage access; a target whose CMASK fast clear no draw has applied; a device that cannot sample the format; a lookup outside a recorded draw or dispatch; a draw that samples the target it renders to.
  • A uniform fill of the target's color memory that no draw has applied yet (#2132) is applied before the target is sampled.
  • Resources that sample a multisample target are not kept for reuse, because the lookup records the barrier between the target's writes and the read.

No instruction semantics change: the SPIR-V for image_load on a 2d_msaa image (OpImageFetch with the sample operand) is already on main.

Open pull requests that tools/pr_overlap.py has listed against this one as main moved, none of which implements this: #4767 (FMASK decompress on multisampled targets) changes MultisampleTarget and applies pending CMASK fast clears to the host image, the state this change refuses to sample, so whichever merges second adjusts that check; #4790 (FMASK images from a metadata snapshot) changes the same lookup in ShaderResources.cpp; #4451 adds an adjacent line in CMakeLists.txt.

Not covered, still throwing as before: FMASK, compressed samples, EQAA, multisampled depth, multisampled arrays, and multisampled textures that are not host-rendered targets.

Tested

Windows 11, NVIDIA RTX 4070 Laptop GPU, WinLibs GCC 15.2.0 r7, Release, ANYPS5_ENABLE_SPIRV_TOOLS=ON, at e7cf856f0, which has main e51428bf2 merged in.

  • New agc_driver_sample_multisample_target: draws a triangle into a 16x16 RGBA16F 4x target, then a compute shader loads every sample through the T# with image_load on 2d_msaa. All 1017 samples farther than 1/32 pixel from an edge match the triangle's coverage at SampleLocations(state); the other 7 are only checked to hold the drawn or the cleared color. 14 pixels are partly covered. With the expected sample order rotated by one the test fails. It then fills the target's color memory with half-float ones and every sample loads as (1, 1, 1, 1); without the fill being applied at the lookup that check fails. It also checks the refusals for a T# of 8 samples over the 4x target and for a T# no draw rendered to.
  • agc_multisample_guest_access (extended): the 4x target binds as a sampled texture in its layout, a second lookup returns the same texture, and the refusals for another sample count, another width, no target and storage access.
  • agc_driver_graphics (extended): type 14 decoding, including the T# PPSA99006 passes (021f2000 03800000 804a004a e1b20fac 00000000 00400020 00000000 00000000), and its rejections.
  • Full ctest -j 8: 1029 passed, 8 skipped, 0 failed, out of 1037.
  • At 4e6a15edd (merged with main 30f961266): the sampled lookup skips targets retired when their allocation was unmapped, as attachment acquisition already does since #4474. Reported with a fixture and the one-line correction by Amoenus in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6155263309. agc_multisample_guest_access now samples after each remap: without the line it fails (sampling a multisampled target whose allocation was unmapped did not throw), with it it passes 5 of 5, and a target acquired at the same address is sampled through a new texture. Full ctest -j 8 there: 1103 passed, 8 skipped, 0 failed, out of 1111. The title was not rerun at this commit.
  • PPSA99006 01.000.010 (catalog build, relinked with --windows --to-intel), at e7cf856f0 with main e51428bf2: one 46 s run does not stop. The title's log reports 600 frames (mean 19.98 ms, max 25.07 ms) and 902 present calls with 0 failures. Before #4199 was merged the title stopped at the guard range (a CPU read of 0x21f400000+0x90000 overlaps multisampled color target 0x21f200000+0x240000) after the two lookups of its first 4x canvas.
  • The same title with this branch merged locally into the later main 7e181fcc3: 3 of 3 runs stop before present 300 with buffer descriptor uses an unsupported type. With #4935 merged as well, 3 of 3 runs of 26 s do not stop, and a frame dumped with APS5_DUMP_FRAMES shows the title's menu with its game thumbnails. Why this branch alone stops there was not investigated.
  • With a saved 2048 game in the title's download0, it stops at this change's own refusal, sampling the 91x145 multisampled texture 0x220c00000 of 4 samples, which no draw rendered to, is not implemented: the title clears that canvas (clear-msaa4-color in its log) and samples it without drawing into it.
  • Linux, Intel Xe (ANV), reported by nicolasfalesy in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6138344052 on main 37dd48308: the descriptor shape stop is gone and 3 of 3 runs then stop at image descriptor is incompatible with the static runtime image interface, where the title's resolve shader (image_load on 2d_msaa) is given a T# of type 2D. That stop did not occur in the Windows runs above; not investigated.
  • Windows, AMD Radeon 860M, reported by LeandroLP23 in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6141300068 on main 9ba9ac1c8: ctest -R '^agc_' 461 of 461, and the title runs 60 s at about 13 FPS.
  • The same machine, reported by LeandroLP23 in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6154034024 on main dacd78525, three 60 s runs per build: this branch alone does not stop in any of them (window FPS 11.67 to 12.49); with #4935 as well, 3 of 3 do not stop (24.42 to 25.86).
  • Windows, RTX 3080, reported by babyhuey in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6139786305 on main ea2bbefb: the descriptor shape stop is gone and the title then stops after 7.7 s at runtime image descriptor is invalid, on a T# whose type field is 0; the tests of this change pass 5 of 5 there.
  • The stops after this change differ by machine and main (an unsupported buffer descriptor type here on 7e181fcc3, an invalid image descriptor on the RTX 3080, a 2D T# in the resolve shader on Intel, none on the Radeon 860M on dacd78525). Here the stop goes away with #4935; whether the RTX 3080 and Intel ones do is not known.

Not tested here: Linux, AMD and Intel GPUs, lavapipe, sample counts other than 4, and formats other than RGBA16F in the execution test. The Linux and AMD results above are the reporters' own.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA99006 #4427
  • GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 616.92, Windows 11 (26300). The AMD, RTX 3080 and Intel results above are the reporters' own.
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4835945514 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820). Originally posted by [nicolasabosch](https://github.com/nicolasabosch) on 2026-10-12T22:54:30Z. --- ### What A shader that loads from a 2D multisampled image no longer stops at `DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape` when the image is a color target that draws rendered on the host. Part of #3036. - `DescriptorBindingBuilder` gives a 2D multisampled image the new shape `DescriptorImageShape::Image2DMultisample`. Multisampled arrays still throw. - `DecodeTextureResource` decodes T# type 14 as `TextureDimension::k2DMsaa`. The sample count is `1 << LAST_LEVEL`, with `BASE_LEVEL` 0 and `MAX_MIP` equal to `LAST_LEVEL`, as `ac_build_gfx10_texture_descriptor` writes them (Mesa `src/amd/common/ac_descriptors.c`, `1e2c42b6`). A descriptor that differs throws. The surface decodes with one mip level. - A sampled multisampled T# is bound as a view of the multisample target at its address (`MultisampleTargetTexture`), when the target has the same format, size and sample count. The target's image gets `VK_IMAGE_USAGE_SAMPLED_BIT` when the device can sample its format at that sample count. Nothing is read from or written to guest memory. - These throw: a T# over a target of another size, format or sample count; a T# no draw rendered to; storage access; a target whose CMASK fast clear no draw has applied; a device that cannot sample the format; a lookup outside a recorded draw or dispatch; a draw that samples the target it renders to. - A uniform fill of the target's color memory that no draw has applied yet (#2132) is applied before the target is sampled. - Resources that sample a multisample target are not kept for reuse, because the lookup records the barrier between the target's writes and the read. No instruction semantics change: the SPIR-V for `image_load` on a `2d_msaa` image (`OpImageFetch` with the sample operand) is already on `main`. Open pull requests that `tools/pr_overlap.py` has listed against this one as `main` moved, none of which implements this: #4767 (FMASK decompress on multisampled targets) changes `MultisampleTarget` and applies pending CMASK fast clears to the host image, the state this change refuses to sample, so whichever merges second adjusts that check; #4790 (FMASK images from a metadata snapshot) changes the same lookup in `ShaderResources.cpp`; #4451 adds an adjacent line in `CMakeLists.txt`. Not covered, still throwing as before: FMASK, compressed samples, EQAA, multisampled depth, multisampled arrays, and multisampled textures that are not host-rendered targets. ### Tested Windows 11, NVIDIA RTX 4070 Laptop GPU, WinLibs GCC 15.2.0 r7, Release, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, at `e7cf856f0`, which has `main` `e51428bf2` merged in. - New `agc_driver_sample_multisample_target`: draws a triangle into a 16x16 RGBA16F 4x target, then a compute shader loads every sample through the T# with `image_load` on `2d_msaa`. All 1017 samples farther than 1/32 pixel from an edge match the triangle's coverage at `SampleLocations(state)`; the other 7 are only checked to hold the drawn or the cleared color. 14 pixels are partly covered. With the expected sample order rotated by one the test fails. It then fills the target's color memory with half-float ones and every sample loads as (1, 1, 1, 1); without the fill being applied at the lookup that check fails. It also checks the refusals for a T# of 8 samples over the 4x target and for a T# no draw rendered to. - `agc_multisample_guest_access` (extended): the 4x target binds as a sampled texture in its layout, a second lookup returns the same texture, and the refusals for another sample count, another width, no target and storage access. - `agc_driver_graphics` (extended): type 14 decoding, including the T# PPSA99006 passes (`021f2000 03800000 804a004a e1b20fac 00000000 00400020 00000000 00000000`), and its rejections. - Full `ctest -j 8`: 1029 passed, 8 skipped, 0 failed, out of 1037. - At `4e6a15edd` (merged with `main` `30f961266`): the sampled lookup skips targets retired when their allocation was unmapped, as attachment acquisition already does since #4474. Reported with a fixture and the one-line correction by Amoenus in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6155263309. `agc_multisample_guest_access` now samples after each remap: without the line it fails (`sampling a multisampled target whose allocation was unmapped did not throw`), with it it passes 5 of 5, and a target acquired at the same address is sampled through a new texture. Full `ctest -j 8` there: 1103 passed, 8 skipped, 0 failed, out of 1111. The title was not rerun at this commit. - PPSA99006 01.000.010 (catalog build, relinked with `--windows --to-intel`), at `e7cf856f0` with `main` `e51428bf2`: one 46 s run does not stop. The title's log reports 600 frames (mean 19.98 ms, max 25.07 ms) and 902 present calls with 0 failures. Before #4199 was merged the title stopped at the guard range (`a CPU read of 0x21f400000+0x90000 overlaps multisampled color target 0x21f200000+0x240000`) after the two lookups of its first 4x canvas. - The same title with this branch merged locally into the later `main` `7e181fcc3`: 3 of 3 runs stop before present 300 with `buffer descriptor uses an unsupported type`. With #4935 merged as well, 3 of 3 runs of 26 s do not stop, and a frame dumped with `APS5_DUMP_FRAMES` shows the title's menu with its game thumbnails. Why this branch alone stops there was not investigated. - With a saved 2048 game in the title's `download0`, it stops at this change's own refusal, `sampling the 91x145 multisampled texture 0x220c00000 of 4 samples, which no draw rendered to, is not implemented`: the title clears that canvas (`clear-msaa4-color` in its log) and samples it without drawing into it. - Linux, Intel Xe (ANV), reported by nicolasfalesy in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6138344052 on `main` `37dd48308`: the descriptor shape stop is gone and 3 of 3 runs then stop at `image descriptor is incompatible with the static runtime image interface`, where the title's resolve shader (`image_load` on `2d_msaa`) is given a T# of type 2D. That stop did not occur in the Windows runs above; not investigated. - Windows, AMD Radeon 860M, reported by LeandroLP23 in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6141300068 on `main` `9ba9ac1c8`: `ctest -R '^agc_'` 461 of 461, and the title runs 60 s at about 13 FPS. - The same machine, reported by LeandroLP23 in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6154034024 on `main` `dacd78525`, three 60 s runs per build: this branch alone does not stop in any of them (window FPS 11.67 to 12.49); with #4935 as well, 3 of 3 do not stop (24.42 to 25.86). - Windows, RTX 3080, reported by babyhuey in https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6139786305 on `main` `ea2bbefb`: the descriptor shape stop is gone and the title then stops after 7.7 s at `runtime image descriptor is invalid`, on a T# whose type field is 0; the tests of this change pass 5 of 5 there. - The stops after this change differ by machine and `main` (an unsupported buffer descriptor type here on `7e181fcc3`, an invalid image descriptor on the RTX 3080, a 2D T# in the resolve shader on Intel, none on the Radeon 860M on `dacd78525`). Here the stop goes away with #4935; whether the RTX 3080 and Intel ones do is not known. Not tested here: Linux, AMD and Intel GPUs, lavapipe, sample counts other than 4, and formats other than RGBA16F in the execution test. The Linux and AMD results above are the reporters' own. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA99006 #4427 - [x] GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 616.92, Windows 11 (26300). The AMD, RTX 3080 and Intel results above are the reporters' own. - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nicolasfalesy commented 2026-10-13 04:37:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-13T04:37:57Z.


Tested with ProsperoPuzzles (PPSA99006, catalog release, --to-intel) on Linux (Arch, Intel Xe on Mesa 26.2.2 ANV, Release), this PR (e7cf856f0) merged onto main 37dd48308, 3 runs of 60 s.

  • main: the present thread aborts with DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape (the #3036 stop).
  • With this PR that stop is gone. All 3 runs now abort in the present thread on the next check instead:
[videoout] presentation failed: image descriptor is incompatible with the static runtime image interface: descriptor format 1 decodes to {class 1, dim 3, conversion 0, packed 0, cube 0, depthBits 0, unorm16 0, srgb 0}; modes: {class 1, dim 6, ...} {class 2, dim 6, ...} {class 3, dim 6, ...} ... {class 1, dim 6, conversion 0, packed 156, ...}; T# 021ea000 c0100000 804980ff 91b00204 00000000 00400000 00000000 00000000

So the shader's static interface for this binding is now the 2D MSAA shape (dim 6) in every mode, while the T# the title binds at that draw decodes as dim 3. Whether that T# is a plain 2D view of the MSAA target or a different resource I haven't traced; the full T# is above in case it helps. Happy to rerun on a new head.

Tested with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6138344052 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6138344052). Originally posted by [nicolasfalesy](https://github.com/nicolasfalesy) on 2026-10-13T04:37:57Z. --- Tested with ProsperoPuzzles (PPSA99006, catalog release, `--to-intel`) on Linux (Arch, Intel Xe on Mesa 26.2.2 ANV, Release), this PR (e7cf856f0) merged onto `main` 37dd48308, 3 runs of 60 s. - `main`: the present thread aborts with `DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape` (the #3036 stop). - With this PR that stop is gone. All 3 runs now abort in the present thread on the next check instead: ``` [videoout] presentation failed: image descriptor is incompatible with the static runtime image interface: descriptor format 1 decodes to {class 1, dim 3, conversion 0, packed 0, cube 0, depthBits 0, unorm16 0, srgb 0}; modes: {class 1, dim 6, ...} {class 2, dim 6, ...} {class 3, dim 6, ...} ... {class 1, dim 6, conversion 0, packed 156, ...}; T# 021ea000 c0100000 804980ff 91b00204 00000000 00400000 00000000 00000000 ``` So the shader's static interface for this binding is now the 2D MSAA shape (dim 6) in every mode, while the T# the title binds at that draw decodes as dim 3. Whether that T# is a plain 2D view of the MSAA target or a different resource I haven't traced; the full T# is above in case it helps. Happy to rerun on a new head. Tested with Claude Code assistance.
nicolasabosch commented 2026-10-13 05:28:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-13T05:28:43Z.


@nicolasfalesy thanks for the runs, that is a result I did not have: nothing here was tested on Linux or on Intel.

That stop is a separate one from what this PR changes. The T# in your log (021ea000 c0100000 804980ff 91b00204 ...) is type 9, a plain single-sample 2D texture, and it reaches the title's resolve shader, whose four loads are image_load on 2d_msaa. So the shader's image interface is multisampled in every mode and the recompiler refuses a 2D descriptor for it. I saw the same message once on Windows, early on and with a local guard patch, and not since: the Windows runs listed in the description do not hit it. I have not traced why the two differ, so I can't say whether it is the driver path, the order of the title's draws or the main under it.

What the hardware returns when a 2d_msaa load is given a single-sample T# is an instruction-semantics question, so it needs a source or a hardware measurement and its own change; I have not started one. I added your report to the description so the PR does not read as if the title ran on Linux.

If you rerun, the later main matters: on 7e181fcc3 this branch alone stops earlier for me (buffer descriptor uses an unsupported type), and #4935 is what gets past that on Windows.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6138930001 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6138930001). Originally posted by [nicolasabosch](https://github.com/nicolasabosch) on 2026-10-13T05:28:43Z. --- @nicolasfalesy thanks for the runs, that is a result I did not have: nothing here was tested on Linux or on Intel. That stop is a separate one from what this PR changes. The T# in your log (`021ea000 c0100000 804980ff 91b00204 ...`) is type 9, a plain single-sample 2D texture, and it reaches the title's resolve shader, whose four loads are `image_load` on `2d_msaa`. So the shader's image interface is multisampled in every mode and the recompiler refuses a 2D descriptor for it. I saw the same message once on Windows, early on and with a local guard patch, and not since: the Windows runs listed in the description do not hit it. I have not traced why the two differ, so I can't say whether it is the driver path, the order of the title's draws or the `main` under it. What the hardware returns when a `2d_msaa` load is given a single-sample T# is an instruction-semantics question, so it needs a source or a hardware measurement and its own change; I have not started one. I added your report to the description so the PR does not read as if the title ran on Linux. If you rerun, the later `main` matters: on `7e181fcc3` this branch alone stops earlier for me (`buffer descriptor uses an unsupported type`), and #4935 is what gets past that on Windows. AI-assisted: yes (Claude Code).
babyhuey commented 2026-10-13 06:34:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-13T06:34:44Z.


Windows 11 run (RTX 3080, NVIDIA 591.86, WinLibs GCC 15.2, Release): head e7cf856f merged onto main ea2bbefb (clean merge), ProsperoPuzzles (PPSA99006, catalog release), default flags.

  • main: exits 0xC0000409 after 6.0 s on DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape.
  • With this PR, that throw is gone. It exits 0xC0000409 after 7.7 s on runtime image descriptor is invalid (ResourceMaterializer.cpp:496).
  • The throw doesn't print the descriptor. A temporary local print gave 0e5d8000 00600002 00000033 00005204 00000000 00000000 00000000 00000000. Its type field (dword 3, bits 31:28) is 0, so this doesn't look like the type 9 T# from the Linux run above. I haven't traced which resource slot it comes from.
  • These pass 5/5 (--repeat until-fail:5): agc_driver_sample_multisample_target, agc_multisample_guest_access, agc_driver_graphics, agc_sparse_buffer_holes, agc_descriptor_pool_reset_failure and agc_compute_descriptor_layout_flags. There are no warnings in the 14 files this PR touches.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6139786305 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6139786305). Originally posted by [babyhuey](https://github.com/babyhuey) on 2026-10-13T06:34:44Z. --- Windows 11 run (RTX 3080, NVIDIA 591.86, WinLibs GCC 15.2, Release): head e7cf856f merged onto `main` ea2bbefb (clean merge), ProsperoPuzzles (PPSA99006, catalog release), default flags. - `main`: exits 0xC0000409 after 6.0 s on `DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape`. - With this PR, that throw is gone. It exits 0xC0000409 after 7.7 s on `runtime image descriptor is invalid` (`ResourceMaterializer.cpp:496`). - The throw doesn't print the descriptor. A temporary local print gave `0e5d8000 00600002 00000033 00005204 00000000 00000000 00000000 00000000`. Its type field (dword 3, bits 31:28) is 0, so this doesn't look like the type 9 T# from the Linux run above. I haven't traced which resource slot it comes from. - These pass 5/5 (`--repeat until-fail:5`): `agc_driver_sample_multisample_target`, `agc_multisample_guest_access`, `agc_driver_graphics`, `agc_sparse_buffer_holes`, `agc_descriptor_pool_reset_failure` and `agc_compute_descriptor_layout_flags`. There are no warnings in the 14 files this PR touches.
LeandroLP23 commented 2026-10-13 08:15:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T08:15:20Z.


Ran this on AMD hardware, since the GPU tests in CI run only on lavapipe: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release. Head e7cf856f0 merged onto main 9ba9ac1c8.

  • ctest -R '^agc_' -j 1, test shader cache emptied: 461/461. main is 460/460 on the same machine.
  • ProsperoPuzzles (PPSA99006), relinked with --windows --trap-sdk-syscall-stubs, 60 s run:
    • main: DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape, exit after 15 s.
    • With this PR: runs the full 60 s, window title ProsperoPuzzles | FPS: 13.18.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141300068 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6141300068). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T08:15:20Z. --- Ran this on AMD hardware, since the GPU tests in CI run only on lavapipe: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release. Head `e7cf856f0` merged onto `main` `9ba9ac1c8`. - `ctest -R '^agc_' -j 1`, test shader cache emptied: 461/461. `main` is 460/460 on the same machine. - **ProsperoPuzzles (PPSA99006)**, relinked with `--windows --trap-sdk-syscall-stubs`, 60 s run: - `main`: `DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape`, exit after 15 s. - With this PR: runs the full 60 s, window title `ProsperoPuzzles | FPS: 13.18`. AI-assisted: yes (Claude Code)
nicolasabosch commented 2026-10-13 15:20:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-13T15:20:50Z.


@babyhuey @LeandroLP23 thank you both, and @nicolasfalesy again. The AMD run is the first one on that vendor, and I added all three reports to the description.

A request for @babyhuey and @nicolasfalesy, if you have the time: could you rerun with #4935 merged as well?

The reason is a hypothesis, not something I have verified on your setups. After this PR the title stops in a different place on each machine: runtime image descriptor is invalid with a type 0 T# on the RTX 3080, a type 9 T# reaching the 2d_msaa resolve shader on Intel, and buffer descriptor uses an unsupported type here on main 7e181fcc3. All of them are a descriptor the title hands over that looks wrong. This title's display buffers are slices of two-slice targets, and without #4935 the driver marks the whole array image pending after each draw, including the slice no draw rendered, whose memory is where the title uploads its per-draw data. Stale units of that slice are then stored back over it. That would explain descriptors that differ from run to run, and here the stop goes away with #4935 (3 of 3 runs). If yours go away too it is one bug; if not, they are separate and I was wrong to group them.

@LeandroLP23, the 13 FPS matches what I measured before #4935 (33 to 48 ms per frame on an RTX 4070); with it the title holds 16.7 ms here. An AMD number with #4935 would be useful, but only if it is convenient.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6148925390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6148925390). Originally posted by [nicolasabosch](https://github.com/nicolasabosch) on 2026-10-13T15:20:50Z. --- @babyhuey @LeandroLP23 thank you both, and @nicolasfalesy again. The AMD run is the first one on that vendor, and I added all three reports to the description. A request for @babyhuey and @nicolasfalesy, if you have the time: could you rerun with #4935 merged as well? The reason is a hypothesis, not something I have verified on your setups. After this PR the title stops in a different place on each machine: `runtime image descriptor is invalid` with a type 0 T# on the RTX 3080, a type 9 T# reaching the `2d_msaa` resolve shader on Intel, and `buffer descriptor uses an unsupported type` here on `main` `7e181fcc3`. All of them are a descriptor the title hands over that looks wrong. This title's display buffers are slices of two-slice targets, and without #4935 the driver marks the whole array image pending after each draw, including the slice no draw rendered, whose memory is where the title uploads its per-draw data. Stale units of that slice are then stored back over it. That would explain descriptors that differ from run to run, and here the stop goes away with #4935 (3 of 3 runs). If yours go away too it is one bug; if not, they are separate and I was wrong to group them. @LeandroLP23, the 13 FPS matches what I measured before #4935 (33 to 48 ms per frame on an RTX 4070); with it the title holds 16.7 ms here. An AMD number with #4935 would be useful, but only if it is convenient. AI-assisted: yes (Claude Code).
adriadam10 commented 2026-10-13 15:38:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T15:38:42Z.


Checked the diff, built it merged onto current main and ran the scoped ctest for libSceAgc/libSceAgcDriver: agc_driver_sample_multisample_target, agc_driver_graphics, agc_multisample_guest_access and the recorder tests pass. Without the non-test changes the new tests do not compile (k2DMsaa, samples are missing), so they depend on the change. Refusals (other size/format/sample count, no draw, storage access, arrays) all throw. The Windows results from @babyhuey and @LeandroLP23 cover the vendors we can't run here; merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149277713 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6149277713). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T15:38:42Z. --- Checked the diff, built it merged onto current `main` and ran the scoped ctest for `libSceAgc`/`libSceAgcDriver`: `agc_driver_sample_multisample_target`, `agc_driver_graphics`, `agc_multisample_guest_access` and the recorder tests pass. Without the non-test changes the new tests do not compile (`k2DMsaa`, `samples` are missing), so they depend on the change. Refusals (other size/format/sample count, no draw, storage access, arrays) all throw. The Windows results from @babyhuey and @LeandroLP23 cover the vendors we can't run here; merging once the full Build is green.
LeandroLP23 commented 2026-10-13 15:59:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T15:59:12Z.


@nicolasabosch Thanks. I can't run it right now. If someone else with an AMD GPU can, please go ahead; otherwise I'll post the AMD number with #4935 merged as well later today or tomorrow.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149673794 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6149673794). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T15:59:12Z. --- @nicolasabosch Thanks. I can't run it right now. If someone else with an AMD GPU can, please go ahead; otherwise I'll post the AMD number with #4935 merged as well later today or tomorrow.
LeandroLP23 commented 2026-10-13 19:59:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T19:59:37Z.


@nicolasabosch AMD numbers, same machine as before: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release. Both builds are on main dacd78525. PPSA99006 01.000.010 was relinked with --windows --trap-sdk-syscall-stubs, and every run is 60 s from a fresh run directory, with no save in download0.

Build Runs without a stop Window FPS at 60 s [PPZ] mean, frames 1-600 [PPZ] mean, frames 601-1200
#4820 (e7cf856f0) 3 of 3 12.49, 11.99, 11.67 84.62, 85.76, 83.41 ms not reached
#4820 + #4935 (9d53a588f) 3 of 3 25.86, 24.42, 25.22 41.46, 41.93, 45.43 ms 39.62, 38.81, 40.05 ms (max 84 ms)

With #4935 the frame time roughly halves here, but it stays near 40 ms rather than 16.7 ms. On this machine #4820 alone did not stop in any run: the buffer descriptor uses an unsupported type stop you see on 7e181fcc3 did not appear in these three.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6154034024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6154034024). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T19:59:37Z. --- @nicolasabosch AMD numbers, same machine as before: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release. Both builds are on `main` `dacd78525`. PPSA99006 01.000.010 was relinked with `--windows --trap-sdk-syscall-stubs`, and every run is 60 s from a fresh run directory, with no save in `download0`. | Build | Runs without a stop | Window FPS at 60 s | `[PPZ]` mean, frames 1-600 | `[PPZ]` mean, frames 601-1200 | |---|---|---|---|---| | #4820 (`e7cf856f0`) | 3 of 3 | 12.49, 11.99, 11.67 | 84.62, 85.76, 83.41 ms | not reached | | #4820 + #4935 (`9d53a588f`) | 3 of 3 | 25.86, 24.42, 25.22 | 41.46, 41.93, 45.43 ms | 39.62, 38.81, 40.05 ms (max 84 ms) | With #4935 the frame time roughly halves here, but it stays near 40 ms rather than 16.7 ms. On this machine #4820 alone did not stop in any run: the `buffer descriptor uses an unsupported type` stop you see on `7e181fcc3` did not appear in these three. AI-assisted: yes (Claude Code)
Amoenus commented 2026-10-13 21:10:25 +00:00 (Migrated from github.com)

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


Opened downstream #5496 with Depends on: #4820; #5524 is its allocation-retirement follow-up. Your color/type14/shader interface remains a separate prerequisite.

Update 2026-10-14 UTC: Your current head84f636494 incorporates the inactive-owner filter below and adds recorder checks for unmapped/remapped sampled textures. In adapted composition cb8397d65, main23be plus our native-depth stack and pinned/adapted #4820/#5111, `ctest -R '^agc_multisample_guest_access

With #4474 now merged, your sampled lookup at exact e7cf856 lacks the inactive-owner filter used by attachment acquisition. The failing fixture reproduces both cases 5/5 on NVIDIA and5/5 on AMD:

  1. Fully remove the registered allocation after creating/sampling its color image: the guard is retired, but sampled lookup still returns that owner instead of the current no-draw refusal.
  2. Re-register the same address, acquire a new attachment and clear it to ones: lookup samples the retained old image. Observed diagnostic:
Color retirement sample=0 expected=1 actual=(0,0,0,0)

The one-line proposed correction skips inactive owners at the start of the sampled lookup loop. Both cases pass5/5 on each GPU afterward, including fresh view identity, all60 RGBA sample values, held-old zeroes/fresh ones and output guards.

if (!target->active->load(std::memory_order_acquire)) continue;

Exact scope: main bf8dc610e665a7547d027418e31ddcbb3261b3e0 + exact #4820 + our downstream #5496/#5524 validation composition, plus the color-only fixture. No depth owner is created in either new case. Before/after production differs by that single line; the test is unchanged. This is composed validation, not a standalone test of your unchanged branch. Full Windows Release build/libs and conventions/whitespace pass. Five existing NVIDIA groups ×5 (color sampling, graphics, native-depth sampling/retirement, host-import retirement) and color sampling ×5 on AMD pass, no skips. NVIDIA RTX5080/610.62 and AMD Radeon(TM) Graphics/32.0.21036.18, Windows11 Enterprise26200; Vulkan required, shader cache disabled.

To replay the fixture at either linked commit, build agc_driver_native_multisample_depth_tests and run it with --color-retirement and --color-remap (Windows uses build/tests/...exe with the normal unpatched-library PATH). The Remove operation uses the real allocation registry; the fixture's host memory remains allocated until cleanup. No title consequence, physical host-unmap, concurrency, Linux/lavapipe or console result is claimed.

#5445's proposed uniform guest-color import changes the no-resident contract: after it lands, the first case may legitimately import fresh uniform data. The second case's new-content assertion remains necessary. Reporting the tested correction here avoids a duplicate PR. AI-assisted: Codex. --repeat until-fail:20 --timeout 30 --parallel 1` passes20/20, no skips, maximum0.245314s. Source stays clean/pinned. These are the current public recorder guest-access controls; the older native pixel before/after cases below retain their original pin and were not rerun here. No unchanged-head title or new pixel-readback claim. The proposed correction is incorporated in your branch; no duplicate PR is needed.

Retired color lookup: historical baseline and incorporated correction

With #4474 now merged, your sampled lookup at exact e7cf856 lacks the inactive-owner filter used by attachment acquisition. The failing fixture reproduces both cases 5/5 on NVIDIA and5/5 on AMD:

  1. Fully remove the registered allocation after creating/sampling its color image: the guard is retired, but sampled lookup still returns that owner instead of the current no-draw refusal.
  2. Re-register the same address, acquire a new attachment and clear it to ones: lookup samples the retained old image. Observed diagnostic:
Color retirement sample=0 expected=1 actual=(0,0,0,0)

The one-line proposed correction skips inactive owners at the start of the sampled lookup loop. Both cases pass5/5 on each GPU afterward, including fresh view identity, all60 RGBA sample values, held-old zeroes/fresh ones and output guards.

if (!target->active->load(std::memory_order_acquire)) continue;

Exact scope: main bf8dc610e665a7547d027418e31ddcbb3261b3e0 + exact #4820 + our downstream #5496/#5524 validation composition, plus the color-only fixture. No depth owner is created in either new case. Before/after production differs by that single line; the test is unchanged. This is composed validation, not a standalone test of your unchanged branch. Full Windows Release build/libs and conventions/whitespace pass. Five existing NVIDIA groups ×5 (color sampling, graphics, native-depth sampling/retirement, host-import retirement) and color sampling ×5 on AMD pass, no skips. NVIDIA RTX5080/610.62 and AMD Radeon(TM) Graphics/32.0.21036.18, Windows11 Enterprise26200; Vulkan required, shader cache disabled.

To replay the fixture at either linked commit, build agc_driver_native_multisample_depth_tests and run it with --color-retirement and --color-remap (Windows uses build/tests/...exe with the normal unpatched-library PATH). The Remove operation uses the real allocation registry; the fixture's host memory remains allocated until cleanup. No title consequence, physical host-unmap, concurrency, Linux/lavapipe or console result is claimed.

#5445's proposed uniform guest-color import changes the no-resident contract: after it lands, the first case may legitimately import fresh uniform data. The second case's new-content assertion remains necessary. Reporting the tested correction here avoids a duplicate PR. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6155263309 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6155263309). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-13T21:10:25Z. --- Opened downstream #5496 with **Depends on: #4820**; #5524 is its allocation-retirement follow-up. Your color/type14/shader interface remains a separate prerequisite. **Update 2026-10-14 UTC:** [Your current head84f636494](https://github.com/nicolasabosch/AnyPS5/commit/84f6364944ca938f938b79f29f35271e2c1009de) incorporates the inactive-owner filter below and adds recorder checks for unmapped/remapped sampled textures. In [adapted composition cb8397d65](https://github.com/Amoenus/AnyPS5/commit/cb8397d65454236eb5fe075bff58da9bb8a877c3), main23be plus our native-depth stack and pinned/adapted #4820/#5111, `ctest -R '^agc_multisample_guest_access With #4474 now merged, [your sampled lookup at exact e7cf856](https://github.com/nicolasabosch/AnyPS5/blob/e7cf856f08e5e74f4e73e3cf7c0b152f4b1ef247/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L383) lacks the inactive-owner filter used by attachment acquisition. The [failing fixture](https://github.com/Amoenus/AnyPS5/commit/b4b916154dd148b0676f8834b698a440bb53be69) reproduces both cases **5/5 on NVIDIA and5/5 on AMD**: 1. Fully remove the registered allocation after creating/sampling its color image: the guard is retired, but sampled lookup still returns that owner instead of the current no-draw refusal. 2. Re-register the same address, acquire a new attachment and clear it to ones: lookup samples the retained old image. Observed diagnostic: ```text Color retirement sample=0 expected=1 actual=(0,0,0,0) ``` The [one-line proposed correction](https://github.com/Amoenus/AnyPS5/commit/17022cad44a126a190a116b0af22d0d09a473d7e) skips inactive owners at the start of the sampled lookup loop. **Both cases pass5/5 on each GPU** afterward, including fresh view identity, all60 RGBA sample values, held-old zeroes/fresh ones and output guards. ```cpp if (!target->active->load(std::memory_order_acquire)) continue; ``` **Exact scope:** main `bf8dc610e665a7547d027418e31ddcbb3261b3e0` + exact #4820 + our downstream #5496/#5524 validation composition, plus the color-only fixture. No depth owner is created in either new case. Before/after production differs by that single line; the test is unchanged. This is composed validation, not a standalone test of your unchanged branch. Full Windows Release build/libs and conventions/whitespace pass. Five existing NVIDIA groups ×5 (color sampling, graphics, native-depth sampling/retirement, host-import retirement) and color sampling ×5 on AMD pass, no skips. NVIDIA RTX5080/610.62 and AMD Radeon(TM) Graphics/32.0.21036.18, Windows11 Enterprise26200; Vulkan required, shader cache disabled. To replay the fixture at either linked commit, build `agc_driver_native_multisample_depth_tests` and run it with `--color-retirement` and `--color-remap` (Windows uses `build/tests/...exe` with the normal unpatched-library PATH). The Remove operation uses the real allocation registry; the fixture's host memory remains allocated until cleanup. No title consequence, physical host-unmap, concurrency, Linux/lavapipe or console result is claimed. #5445's proposed uniform guest-color import changes the no-resident contract: after it lands, the first case may legitimately import fresh uniform data. The second case's new-content assertion remains necessary. Reporting the tested correction here avoids a duplicate PR. AI-assisted: Codex. --repeat until-fail:20 --timeout 30 --parallel 1` passes20/20, no skips, maximum0.245314s. Source stays clean/pinned. These are the current public recorder guest-access controls; the older native pixel before/after cases below retain their original pin and were not rerun here. No unchanged-head title or new pixel-readback claim. The proposed correction is incorporated in your branch; no duplicate PR is needed. ### Retired color lookup: historical baseline and incorporated correction With #4474 now merged, [your sampled lookup at exact e7cf856](https://github.com/nicolasabosch/AnyPS5/blob/e7cf856f08e5e74f4e73e3cf7c0b152f4b1ef247/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L383) lacks the inactive-owner filter used by attachment acquisition. The [failing fixture](https://github.com/Amoenus/AnyPS5/commit/b4b916154dd148b0676f8834b698a440bb53be69) reproduces both cases **5/5 on NVIDIA and5/5 on AMD**: 1. Fully remove the registered allocation after creating/sampling its color image: the guard is retired, but sampled lookup still returns that owner instead of the current no-draw refusal. 2. Re-register the same address, acquire a new attachment and clear it to ones: lookup samples the retained old image. Observed diagnostic: ```text Color retirement sample=0 expected=1 actual=(0,0,0,0) ``` The [one-line proposed correction](https://github.com/Amoenus/AnyPS5/commit/17022cad44a126a190a116b0af22d0d09a473d7e) skips inactive owners at the start of the sampled lookup loop. **Both cases pass5/5 on each GPU** afterward, including fresh view identity, all60 RGBA sample values, held-old zeroes/fresh ones and output guards. ```cpp if (!target->active->load(std::memory_order_acquire)) continue; ``` **Exact scope:** main `bf8dc610e665a7547d027418e31ddcbb3261b3e0` + exact #4820 + our downstream #5496/#5524 validation composition, plus the color-only fixture. No depth owner is created in either new case. Before/after production differs by that single line; the test is unchanged. This is composed validation, not a standalone test of your unchanged branch. Full Windows Release build/libs and conventions/whitespace pass. Five existing NVIDIA groups ×5 (color sampling, graphics, native-depth sampling/retirement, host-import retirement) and color sampling ×5 on AMD pass, no skips. NVIDIA RTX5080/610.62 and AMD Radeon(TM) Graphics/32.0.21036.18, Windows11 Enterprise26200; Vulkan required, shader cache disabled. To replay the fixture at either linked commit, build `agc_driver_native_multisample_depth_tests` and run it with `--color-retirement` and `--color-remap` (Windows uses `build/tests/...exe` with the normal unpatched-library PATH). The Remove operation uses the real allocation registry; the fixture's host memory remains allocated until cleanup. No title consequence, physical host-unmap, concurrency, Linux/lavapipe or console result is claimed. #5445's proposed uniform guest-color import changes the no-resident contract: after it lands, the first case may legitimately import fresh uniform data. The second case's new-content assertion remains necessary. Reporting the tested correction here avoids a duplicate PR. AI-assisted: Codex.
nicolasabosch commented 2026-10-13 21:45:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-13T21:45:21Z.


@LeandroLP23 thank you, that is exactly the comparison I was missing, and it corrects two things I wrote.

  • The 16.7 ms I reported is one machine (RTX 4070 Laptop). On the 860M #4935 halves the frame time but it stays near 40 ms, so #4935 does not by itself get this title to 60 FPS everywhere. I have not measured what limits it there: it may be the integrated GPU with 3840x2160 targets, or another wait in the driver. If you ever have the time, a trace would tell them apart (APS5_TRACE_FRAMES=300:600 with APS5_TRACE_DIR set); no obligation.
  • #4820 alone did not stop in any of your runs on dacd78525, while it stops 3 of 3 here on 7e181fcc3. So the stop I see is not something #4820 always hits on a recent main, and my grouping of the three stops under one cause is weaker than I made it sound. It stays an unverified hypothesis until the RTX 3080 and Intel reruns say otherwise.

I added your numbers to the descriptions of this PR and of #4935.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6155856109 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6155856109). Originally posted by [nicolasabosch](https://github.com/nicolasabosch) on 2026-10-13T21:45:21Z. --- @LeandroLP23 thank you, that is exactly the comparison I was missing, and it corrects two things I wrote. - The 16.7 ms I reported is one machine (RTX 4070 Laptop). On the 860M #4935 halves the frame time but it stays near 40 ms, so #4935 does not by itself get this title to 60 FPS everywhere. I have not measured what limits it there: it may be the integrated GPU with 3840x2160 targets, or another wait in the driver. If you ever have the time, a trace would tell them apart (`APS5_TRACE_FRAMES=300:600` with `APS5_TRACE_DIR` set); no obligation. - #4820 alone did not stop in any of your runs on `dacd78525`, while it stops 3 of 3 here on `7e181fcc3`. So the stop I see is not something #4820 always hits on a recent `main`, and my grouping of the three stops under one cause is weaker than I made it sound. It stays an unverified hypothesis until the RTX 3080 and Intel reruns say otherwise. I added your numbers to the descriptions of this PR and of #4935. AI-assisted: yes (Claude Code).
LeandroLP23 commented 2026-10-13 22:18:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T22:18:12Z.


@nicolasabosch Here is the trace you asked for. Same setup as my last run (Radeon 860M, driver 32.0.13058.8001, Windows 11 26300), with #4820 (e7cf856f0) and #4935 (9d53a588f) merged onto main 665ad7da7. PPSA99006 ran 60 s from a fresh run directory, with APS5_TRACE_FRAMES=300:600.

frames 300:600: 600 presents, frame p50 38.7 / p90 41.9 / p99 47.5 / max 52.0 ms, GPU busy 21.1 ms per present. The title's own log gives the same picture: frames 1-600 mean 41.6 ms, frames 601-1200 mean 39.9 ms.

thread busy wait (ms per frame) largest
queue worker 0x0 10.4 (27 %) 27.9 (71 %), Driver.WorkerWait.idle_and_completion_poll Driver.Packet 10.3, of it Driver.Draw 10.0
presenter 0.8 24.8, of it Driver.Present.render_fence_wait 18.5 Driver.Present 25.6

How I read it (unverified):

  • The GPU sets the floor. At 21.1 ms of GPU work per present on 3840x2160 targets, the 860M cannot reach 16.7 ms even with perfect overlap.
  • The rest looks like serialization, not one driver wait. The worker records for about 10 ms and spends 71 % of the frame idle, waiting for the next submission. The presenter waits 18.5 ms for the render fence. Roughly 10 ms of recording, plus 21 ms of GPU, plus the present, adds up to the ~39 ms frame. So the next frame's recording does not seem to overlap the previous frame's GPU work, either because the title waits for the flip or because the driver orders it that way.
  • In the slowest frames (48-52 ms), the presenter's acquire_image reaches 21 ms, and the render fence wait goes up to 34 ms.

The trace dropped events (trace_dropped: true), so the per-slice totals are lower bounds. Trace and summary: https://github.com/LeandroLP23/AnyPS5/tree/trace-4820/ppsa99006-860m

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156400094 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6156400094). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T22:18:12Z. --- @nicolasabosch Here is the trace you asked for. Same setup as my last run (Radeon 860M, driver 32.0.13058.8001, Windows 11 26300), with #4820 (`e7cf856f0`) and #4935 (`9d53a588f`) merged onto `main` `665ad7da7`. PPSA99006 ran 60 s from a fresh run directory, with `APS5_TRACE_FRAMES=300:600`. **frames 300:600**: 600 presents, frame p50 38.7 / p90 41.9 / p99 47.5 / max 52.0 ms, GPU busy 21.1 ms per present. The title's own log gives the same picture: frames 1-600 mean 41.6 ms, frames 601-1200 mean 39.9 ms. | thread | busy | wait (ms per frame) | largest | |---|---|---|---| | queue worker 0x0 | 10.4 (27 %) | 27.9 (71 %), `Driver.WorkerWait.idle_and_completion_poll` | `Driver.Packet` 10.3, of it `Driver.Draw` 10.0 | | presenter | 0.8 | 24.8, of it `Driver.Present.render_fence_wait` 18.5 | `Driver.Present` 25.6 | How I read it (unverified): - **The GPU sets the floor.** At 21.1 ms of GPU work per present on 3840x2160 targets, the 860M cannot reach 16.7 ms even with perfect overlap. - **The rest looks like serialization, not one driver wait.** The worker records for about 10 ms and spends 71 % of the frame idle, waiting for the next submission. The presenter waits 18.5 ms for the render fence. Roughly 10 ms of recording, plus 21 ms of GPU, plus the present, adds up to the ~39 ms frame. So the next frame's recording does not seem to overlap the previous frame's GPU work, either because the title waits for the flip or because the driver orders it that way. - In the slowest frames (48-52 ms), the presenter's `acquire_image` reaches 21 ms, and the render fence wait goes up to 34 ms. The trace dropped events (`trace_dropped: true`), so the per-slice totals are lower bounds. Trace and summary: https://github.com/LeandroLP23/AnyPS5/tree/trace-4820/ppsa99006-860m AI-assisted: yes (Claude Code)
nicolasabosch commented 2026-10-13 22:20:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-13T22:20:45Z.


@LeandroLP23 thank you for the trace, that answers the question I left open.

The same counters from my runs with both PRs (RTX 4070 Laptop, main 7e181fcc3, APS5_TRACE_FRAMES=300:600, three runs), next to yours:

Radeon 860M RTX 4070 Laptop
Frame p50 / p99 / max 38.7 / 47.5 / 52.0 ms 16.67 to 16.69 / 17.31 to 17.32 / 17.56 to 17.87 ms
GPU busy per present 21.1 ms 4.1 to 4.2 ms
Draw work per frame 10.0 ms 3.9 to 4.0 ms

So I agree with your first point: at 21.1 ms of GPU work per present the 860M is GPU-bound on this title, and 16.7 ms is not reachable there whatever the driver does on the CPU side.

Your second point I can neither confirm nor rule out from here. Recording plus GPU work is about 8 ms on this machine, so a frame fits in the refresh interval whether or not the next frame's recording overlaps the previous frame's GPU work, and my traces would look the same either way. Whether that ordering comes from the title waiting for the flip or from the driver is not something I have looked at. If it is the driver it is a separate change from this PR and from #4935.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156446375 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6156446375). Originally posted by [nicolasabosch](https://github.com/nicolasabosch) on 2026-10-13T22:20:45Z. --- @LeandroLP23 thank you for the trace, that answers the question I left open. The same counters from my runs with both PRs (RTX 4070 Laptop, `main` `7e181fcc3`, `APS5_TRACE_FRAMES=300:600`, three runs), next to yours: | | Radeon 860M | RTX 4070 Laptop | |---|---|---| | Frame p50 / p99 / max | 38.7 / 47.5 / 52.0 ms | 16.67 to 16.69 / 17.31 to 17.32 / 17.56 to 17.87 ms | | GPU busy per present | 21.1 ms | 4.1 to 4.2 ms | | Draw work per frame | 10.0 ms | 3.9 to 4.0 ms | So I agree with your first point: at 21.1 ms of GPU work per present the 860M is GPU-bound on this title, and 16.7 ms is not reachable there whatever the driver does on the CPU side. Your second point I can neither confirm nor rule out from here. Recording plus GPU work is about 8 ms on this machine, so a frame fits in the refresh interval whether or not the next frame's recording overlaps the previous frame's GPU work, and my traces would look the same either way. Whether that ordering comes from the title waiting for the flip or from the driver is not something I have looked at. If it is the driver it is a separate change from this PR and from #4935. AI-assisted: yes (Claude Code).
nicolasabosch commented 2026-10-13 23:27:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-10-13T23:27:15Z.


@Amoenus thank you for the fixture and the correction. It is applied in 4e6a15edd: the sampled lookup now skips targets whose allocation was unmapped, the same check attachment acquisition has since #4474.

I reproduced it here before applying it, with main 30f961266 merged: agc_multisample_guest_access now samples after each remap, and without the line it fails (sampling a multisampled target whose allocation was unmapped did not throw); with it it passes 5 of 5 on an RTX 4070 Laptop, and a target acquired at the same address is sampled through a new texture. I did not run your fixture itself. Full ctest -j 8: 1103 passed, 8 skipped, 0 failed, out of 1111.

Noted on #5445: once it lands, the lookup after a remap may import uniform memory instead of refusing, so that assertion of the test changes there and the new-contents one stays.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157358174 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6157358174). Originally posted by [nicolasabosch](https://github.com/nicolasabosch) on 2026-10-13T23:27:15Z. --- @Amoenus thank you for the fixture and the correction. It is applied in `4e6a15edd`: the sampled lookup now skips targets whose allocation was unmapped, the same check attachment acquisition has since #4474. I reproduced it here before applying it, with `main` `30f961266` merged: `agc_multisample_guest_access` now samples after each remap, and without the line it fails (`sampling a multisampled target whose allocation was unmapped did not throw`); with it it passes 5 of 5 on an RTX 4070 Laptop, and a target acquired at the same address is sampled through a new texture. I did not run your fixture itself. Full `ctest -j 8`: 1103 passed, 8 skipped, 0 failed, out of 1111. Noted on #5445: once it lands, the lookup after a remap may import uniform memory instead of refusing, so that assertion of the test changes there and the new-contents one stays. AI-assisted: yes (Claude Code).
dantdmdarealguy commented 2026-10-14 04:11:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-14T04:11:40Z.


Windows 11 Pro, Intel Core i9-14900K, 128 GB, NVIDIA GeForce RTX 5080 (driver 32.0.16.1714), WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON. Head 4e6a15eddd and its merge base 30f961266a, each built in the same build directory. ProsperoPuzzles (PPSA99006 01.000.010, catalog release), eboot.bin and sce_module/libc.prx unwrapped, relinked from each build with relinker --windows --registry, original eboot.bin kept in app0, fresh run directory per build.

Tests

  • Head: agc_driver_sample_multisample_target, agc_multisample_guest_access, agc_driver_graphics and patched_libraries pass 3 of 3 (--repeat until-fail:3). agc_driver_sample_multisample_target with ANYPS5_REQUIRE_VULKAN=1 selects NVIDIA GeForce RTX 5080 vendor=0x10de device=0x2c02 subgroup=32 and prints its pass line, so it did not skip.
  • Head: ctest -R "^agc_": 485 of 486 pass, 1 skipped (agc_driver_stencil_ref_export), 0 failed.
  • Base: agc_multisample_guest_access, agc_driver_graphics and patched_libraries pass; agc_driver_sample_multisample_target doesn't exist there.
  • The incremental head build has no warnings. tools/check_conventions.py --base 30f961266a and tools/check_test_registration.py pass.

ProsperoPuzzles, 60 s runs

  • Base, 3 of 3 runs exit 0xC0000409 after 6.7 to 7.2 s:
    what():  DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape
    
  • Head, 3 of 3 runs last the full 60 s with no exception, then close with exit 0 on WM_CLOSE. The menu draws all 50 game cards with their thumbnails. Window title FPS at 57 s: 33.31, 31.86, 38.47; the title's overlay shows 39 FPS.
  • Head, a fourth run: Cross (Return) opens 2048 and four slides play at 59.95 FPS. In a fifth run with that save in download0, Cross resumes the saved game (score 1,560, 151 moves) at 60 FPS. Neither run threw. The which no draw rendered to refusal from the description, seen there with a saved 2048 game, did not occur here.
  • The head logs have no failed, not implemented or error lines.

Screenshots on the head (the base exits before the first screenshot at 15 s):

Menu at 57 s, 2048 after the slides, resumed save

Menu at 57 s

2048 after four slides

Resumed save

Verdict: works on Windows with an RTX 5080. The stop is gone, and the title runs and plays without #4935 on this base.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6160708615 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6160708615). Originally posted by [dantdmdarealguy](https://github.com/dantdmdarealguy) on 2026-10-14T04:11:40Z. --- Windows 11 Pro, Intel Core i9-14900K, 128 GB, NVIDIA GeForce RTX 5080 (driver 32.0.16.1714), WinLibs GCC 15.2.0, Release, `BUILD_TESTING=ON`. Head `4e6a15eddd` and its merge base `30f961266a`, each built in the same build directory. ProsperoPuzzles (PPSA99006 01.000.010, catalog release), `eboot.bin` and `sce_module/libc.prx` unwrapped, relinked from each build with `relinker --windows --registry`, original `eboot.bin` kept in `app0`, fresh run directory per build. **Tests** - Head: `agc_driver_sample_multisample_target`, `agc_multisample_guest_access`, `agc_driver_graphics` and `patched_libraries` pass 3 of 3 (`--repeat until-fail:3`). `agc_driver_sample_multisample_target` with `ANYPS5_REQUIRE_VULKAN=1` selects `NVIDIA GeForce RTX 5080 vendor=0x10de device=0x2c02 subgroup=32` and prints its pass line, so it did not skip. - Head: `ctest -R "^agc_"`: 485 of 486 pass, 1 skipped (`agc_driver_stencil_ref_export`), 0 failed. - Base: `agc_multisample_guest_access`, `agc_driver_graphics` and `patched_libraries` pass; `agc_driver_sample_multisample_target` doesn't exist there. - The incremental head build has no warnings. `tools/check_conventions.py --base 30f961266a` and `tools/check_test_registration.py` pass. **ProsperoPuzzles, 60 s runs** - Base, 3 of 3 runs exit `0xC0000409` after 6.7 to 7.2 s: ``` what(): DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape ``` - Head, 3 of 3 runs last the full 60 s with no exception, then close with exit 0 on WM_CLOSE. The menu draws all 50 game cards with their thumbnails. Window title FPS at 57 s: 33.31, 31.86, 38.47; the title's overlay shows 39 FPS. - Head, a fourth run: Cross (Return) opens 2048 and four slides play at 59.95 FPS. In a fifth run with that save in `download0`, Cross resumes the saved game (score 1,560, 151 moves) at 60 FPS. Neither run threw. The `which no draw rendered to` refusal from the description, seen there with a saved 2048 game, did not occur here. - The head logs have no `failed`, `not implemented` or error lines. Screenshots on the head (the base exits before the first screenshot at 15 s): <details><summary>Menu at 57 s, 2048 after the slides, resumed save</summary> ![Menu at 57 s](https://raw.githubusercontent.com/dantdmdarealguy/AnyPS5/pr-assets/pr4820/menu-57s.png) ![2048 after four slides](https://raw.githubusercontent.com/dantdmdarealguy/AnyPS5/pr-assets/pr4820/2048-after-slides.png) ![Resumed save](https://raw.githubusercontent.com/dantdmdarealguy/AnyPS5/pr-assets/pr4820/2048-resumed-save.png) </details> Verdict: works on Windows with an RTX 5080. The stop is gone, and the title runs and plays without #4935 on this base.
oneandonlydean commented 2026-10-14 11:03:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T11:03:34Z.


Rebased onto main: kept your multisample sampling next to the recent MSAA fill and alpha-to-coverage changes; build and agc tests pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166886361 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6166886361). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T11:03:34Z. --- Rebased onto main: kept your multisample sampling next to the recent MSAA fill and alpha-to-coverage changes; build and agc tests pass.
github-actions[bot] commented 2026-10-14 11:04:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T11:04:40Z.


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
#4767 core/libs/prx/libSceAgcDriver/Graphics/include/MultisampleTarget.hpp L51
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L382
#5939 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L166-167
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166904705 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6166904705). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T11:04:40Z. --- <!-- 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 | |---|---|---|---| | #4767 | `core/libs/prx/libSceAgcDriver/Graphics/include/MultisampleTarget.hpp` [L51](https://github.com/boykopovar/AnyPS5/blob/c2b55c66fb9f939792a3ed6255ebb2f6a2d00797/core/libs/prx/libSceAgcDriver/Graphics/include/MultisampleTarget.hpp#L51)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp` [L382](https://github.com/boykopovar/AnyPS5/blob/c2b55c66fb9f939792a3ed6255ebb2f6a2d00797/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L382) | | | | #5939 | `core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp` [L166-167](https://github.com/boykopovar/AnyPS5/blob/c2b55c66fb9f939792a3ed6255ebb2f6a2d00797/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L166-L167) | | |
johnohhh1 commented 2026-10-14 23:37:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-14T23:37:19Z.


Independent Linux/RTX 5070 title validation after this PR merged. I compared the exact merge 8b8bfe0b6e69c0ccdf4fdb932a8c807df5b24783 with its first parent 38c0bfa33a85541dd35a219aaaeadf49d4bc9c31, without other pending PRs.

Ubuntu 26.04.1 x86-64, GCC 15.2.0, bundled Release build with testing/SPIR-V Tools enabled; NVIDIA GeForce RTX 5070, driver 595.99.02.

Title: ProsperoPuzzles, PPSA99006, content version 01.000.010, developer release. Package SHA-256: 9c7c7b57a885b1ecbd694ee32f7f68847ae909d99600b4c6a73c06605affd313. Both builds used the same unwrapped homebrew inputs, fresh conversions and separately staged matching system libraries.

  • Before: aborts with SIGABRT after 2.25 s, before any presented frame: DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape.
  • After, menu: lasts the full 45 s without that exception; captured frames show the game library and thumbnails.
  • After, 2048: another 45 s run accepts Cross plus four directional moves. The captured board shows score 8 and four moves; the title writes its save/stat files.
  • After, resume: a 30 s relaunch logs launch game=g2048 resumed=1 and restores that board. The final board PNG and save/stat file hashes match those from the played run. These bounded game runs were deliberately stopped with SIGINT and returned 0.
  • Full builds pass on both revisions. All 10 selected baseline suites and 11 selected merge suites pass without skips, including the added agc_driver_sample_multisample_target. Serial CTest, Vulkan required, explicit NVIDIA ICD/device, 30-second per-test maximum; longest selected test is 5.02 s. Conventions, whitespace and test-registration checks pass.

This verifies Linux title progress and the sampled MSAA regressions at the recorded merge, not all 50 puzzles or later main. SDL dummy audio was used; audible output was not tested. Project shader cache was disabled, NVIDIA driver caching stayed at defaults, and no performance comparison or native PS5 measurement is claimed.

AI-assisted testing/report: Codex. The implementation and its original author are unchanged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180872984 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4820#issuecomment-6180872984). Originally posted by [johnohhh1](https://github.com/johnohhh1) on 2026-10-14T23:37:19Z. --- Independent Linux/RTX 5070 title validation after this PR merged. I compared the exact merge `8b8bfe0b6e69c0ccdf4fdb932a8c807df5b24783` with its first parent `38c0bfa33a85541dd35a219aaaeadf49d4bc9c31`, without other pending PRs. Ubuntu 26.04.1 x86-64, GCC 15.2.0, bundled Release build with testing/SPIR-V Tools enabled; NVIDIA GeForce RTX 5070, driver 595.99.02. **Title:** ProsperoPuzzles, PPSA99006, content version 01.000.010, [developer release](https://github.com/blackbearreloaded/ProsperoPuzzles/releases/tag/01.000.010). Package SHA-256: `9c7c7b57a885b1ecbd694ee32f7f68847ae909d99600b4c6a73c06605affd313`. Both builds used the same unwrapped homebrew inputs, fresh conversions and separately staged matching system libraries. - **Before:** aborts with SIGABRT after 2.25 s, before any presented frame: `DescriptorBindingBuilder::Populate multisampled image resources have no descriptor image shape`. - **After, menu:** lasts the full 45 s without that exception; captured frames show the game library and thumbnails. - **After, 2048:** another 45 s run accepts Cross plus four directional moves. The captured board shows score 8 and four moves; the title writes its save/stat files. - **After, resume:** a 30 s relaunch logs `launch game=g2048 resumed=1` and restores that board. The final board PNG and save/stat file hashes match those from the played run. These bounded game runs were deliberately stopped with SIGINT and returned 0. - Full builds pass on both revisions. All 10 selected baseline suites and 11 selected merge suites pass without skips, including the added `agc_driver_sample_multisample_target`. Serial CTest, Vulkan required, explicit NVIDIA ICD/device, 30-second per-test maximum; longest selected test is 5.02 s. Conventions, whitespace and test-registration checks pass. This verifies Linux title progress and the sampled MSAA regressions at the recorded merge, not all 50 puzzles or later main. SDL dummy audio was used; audible output was not tested. Project shader cache was disabled, NVIDIA driver caching stayed at defaults, and no performance comparison or native PS5 measurement is claimed. AI-assisted testing/report: Codex. The implementation and its original author are unchanged.
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!4820
No description provided.