Skip to content

fix(agc): decode PS4 texture bases, linear-aligned targets and thin-tiled 3D textures - #9891

Merged
oneandonlydean merged 21 commits into
boykopovar:mainfrom
savvaniss:fix/ps4-cusa03312-surfaces
Nov 3, 2026
Merged

oneandonlydean merged 21 commits into
boykopovar:mainfrom
savvaniss:fix/ps4-cusa03312-surfaces

Conversation

@savvaniss

@savvaniss savvaniss commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

The AGC half of Get-fix#1, moved upstream as Get-fix asked. #9431, which this was stacked on, is merged, and this branch has main merged in. These are four PS4 surface fixes found while bringing up Risk and Monopoly Plus from CUSA03312 on #6977's branch. The shader half is in its own pull request on main, #9889.

  1. Display buffers presented before they are drawn. PresentDisplayBuffer uploaded a tiled display buffer with no resident image through GpuColorTransfer, in the PS5 render-target layout. That layout needs 64 KiB alignment and doesn't know GCN tiling. Risk flips its 32 KiB-aligned 1920x1080 buffers before drawing into them, and failed with "null or misaligned address". A GCN-tiled buffer with no resident image now goes through ReadDisplayBuffer, which decodes the GCN layout and checks the buffer's own 4 KiB alignment.
  2. T# base address. In a GCN T#, word 1 bits 6-7 are MTYPE_L2, so the base is 38 bits (shadPS4's resource.h: base_address : 38; mtype_l2 : 2). DecodeTextureResource read 40 bits. So MTYPE_L2 = 1 set address bit 46, and a storage texture failed with "storage texture has no committed guest pages". IsNullTextureResource reads the base the same way now, so a zero base with MTYPE_L2 set is null.
  3. Linear-aligned color targets. Tile mode index 8 used the PS5 linear layout, which pads the pitch to 256 bytes. GCN pads a linear-aligned pitch to max(8, 64 / bytes per element) elements, as AddrLib's SiLib::HwlGetPitchAlignmentLinear does and as feat(libSceAgcDriver): draw PS4 (GCN) command buffers #9431's PS4 texture layout already does. ColorTileMode::GcnLinear carries that alignment.
    • main has resident linear targets since this was written. They keep taking only PS5 Linear targets, so a GCN linear-aligned target is still copied in and out as before. Making it resident is separate work.
    • main now draws a DB depth copy through the normal draw path, and RunDepthCopyPass is gone. So the linear check this PR changed there went with it. A depth copy into a GCN linear-aligned target is drawn like any other draw into a linear target that is not resident.
  4. PS4 3D textures in thin tile modes. A thin-tiled volume is laid out like a layered surface whose level n holds max(1, depth >> n) slices, padded to a power of two with POW2_PAD. That is how ac_surface and AddrLib's PostComputeMipLevel count them. It becomes one 3D image of its depth, and thick modes still throw. The debt entry for thick and layered surfaces says so.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT (driver 32.0.31041.1004), ANYPS5_GPU=AMD, ctest -V with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.

Merge of main de83e8f270, 31 Oct. Head 341659473d. The only conflict was in docs/dev/debt/libSceAgcDriver.md: both sides kept, with main's layer bank text as its own debt entry to stay under the length limit. On the merge before that debt split: agc_driver_graphics, agc_driver_gcn_detile and agc_driver_gcn_display_present pass, 3 of 3 on the RX 9070 XT, no VUID- line. Not rerun: the other tests, Linux (main changed no struct under the size guards in this merge), games.

Merge of main cc26ab4438, 1 Nov. Head 825f9b3f7c. Two conflicts. main moved the AGC test registrations into tests/cmake, and tools/agc_test_split.py resolve moved this branch's decoder_png link to agc_driver_gcn_display_present_tests.cmake. In docs/dev/debt/libSceAgcDriver.md the merge keeps main's tiling and 2D PRT entries and this branch's thick and array layer bank entries. agc_driver_graphics, agc_driver_gcn_detile and agc_driver_gcn_display_present pass, 3 of 3 on the RX 9070 XT under the validation layer, no VUID- line. Not rerun: the other tests, Linux, games.

Merge of main 1e658521a0, 3 Nov. Head 9b9288abc8 (on ca0255b639). The only conflict was in docs/dev/debt/libSceAgcDriver.md: the merge keeps this branch's thick and layered, array layer bank and resident-image flip entries, and main's render-target entry with its new PS4 depth-target sentence. FormatVersion stays main's 52 (this branch does not change it) and no size guard changes. On the RX 9070 XT (driver 32.0.31041.1004, Windows, Release) with ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: agc_driver, agc_driver_graphics, agc_driver_flip, agc_shader_memory, agc_driver_gcn_detile and agc_driver_gcn_display_present pass, 6 of 6, every Selected GPU line names the RX 9070 XT and there is no VUID- line. tools/check_conventions.py --base origin/main passes. Not rerun: the rest of the suite, Linux, and the game.

Base. #9431 is merged, so this branch is main plus this PR's own changes. Tests ran on main 5b913d40c6 and on this branch with that main merged in. The final merge of main fd41cca5d9 touches no AGC, VideoOut or shader file.

Results.

tree passed skipped VUID- lines
main 5b913d40c6 65 of 65 video_out_hdr_probe (the monitor reports HDR) 0
this branch 66 of 66 the same 0
  • The one extra test is the new agc_driver_gcn_display_present.
  • The set:
    • agc_driver, agc_driver_pm4, agc_driver_graphics, agc_driver_register_key, agc_driver_gcn_detile, agc_driver_gcn_buffer_format_lookup and agc_driver_pattern_buffer_fill;
    • agc_driver_flip, the video_out_flip_* modes, video_out_hdr_present, video_out_hdr_probe, linear_display_buffer, agc_display_buffer_dcc, agc_host_hdr and agc_screenshot;
    • agc_gcn_decode, texture_format_lookup, agc_driver_resource_cache_replaced_texture and agc_depth_copy_kept_bytes;
    • the agc_driver_pipeline_journal and agc_pipeline_journal* tests, and the agc_driver_depth_* tests.
  • Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS, and every Selected GPU line names the RX 9070 XT.
  • The video_out_flip_* tests ran on a real window here. None of them skipped.

Revert checks. One part at a time on this branch, each rebuilt and run with the same environment. The first group is agc_driver_gcn_display_present; the rest are agc_driver_graphics or agc_driver_gcn_detile.

part removed failure
1, the early return as it was on the HDR10 swapchain: "an HDR10 presentation through the scaler needs the HDR10 scaler and dumps on the CPU"
1, the early return as it was, APS5_FORCE_SDR=1 "SDR presentation of the 8-bit buffer: the screenshot was not written"
1, no ensureHdrScaler for a GCN flip the same HDR10 message
1, no frame dump for a GCN flip "SDR presentation of the 8-bit buffer: no frame dump within one level of the expected pixels (closest differs by 256, 0 dumps)"
1, no CPU decode for a GCN flip "AGC driver: null or misaligned address"
1, DisplayBuffer.cpp as on main "SDR presentation of the 8-bit buffer: no frame dump within one level of the expected pixels (closest differs by 255, 3 dumps)"
2, the 40-bit mask in the decode "a PS4 T# took MTYPE_L2 above its 38-bit base as address bits"
2, the 40-bit mask in IsNullTextureResource "a PS4 T# with a zero base and MTYPE_L2 set was not classified as null"
3, ColorTargetLayout.cpp as on main "unsupported color tile mode"
4, a PS4 volume refused again "PS4 3D and multisampled textures are not implemented", in both tests
4, a PS4 volume as a depth-1 image "PS4 volume in tile mode 15: the surface is not one 3D image of its depth, stored level by level"

agc_driver_gcn_display_present (new).

  • It presents a 32 KiB-aligned GCN buffer on a real window through the driver's present entry point. VideoOut on main can't register a tiled PS4 buffer yet (feat(libSceGnmDriver): build PS4 command buffers and submit them #9432 does that), so video_out_flip_ps4 can't reach this path.
  • It checks the frame dump and the screenshot pixel by pixel, against values computed from the fill pattern and not from the decode.
  • It runs an 8-bit buffer and a PQ buffer on SDR, and a PQ buffer on a real HDR10 swapchain (format 64, color space 1000104008). The test sets the display's HDR state itself, and needs a surface that offers HDR10. It prints that HDR10 was not exercised if the surface doesn't, and skips without a display or Vulkan.

agc_driver_gcn_detile (new case).

  • A 6-slice volume with three levels, in Thin1D, Display1D, Display2D and Thin2D, with and without POW2_PAD.
  • It runs the GPU detiler over each level's 6, 3 and 1 slices and compares every element.
  • Before that, it checks where each level starts: level 1 after the 6 level 0 slices, level 2 after 3 level 1 slices (4 with POW2_PAD), and the end of the surface after the one level 2 slice. The element comparison alone can't catch a wrong slice count, because the fixture places slices with the same geometry.
  • It then creates the 3D Texture, so the validation layer sees the image and its per-level copies. The test doesn't read that image back (it has no transfer-source usage) and doesn't sample it.

Linux. WSL Ubuntu, g++ 15.2.0, cmake 4.2.3, Unix Makefiles, Release, -j 4, on the Linux filesystem, at this branch before the last main merge and a debt-only edit. The size guards are active there, so sizeof(State) == 920 and sizeof(ShaderStages) == 164 were evaluated. Built without errors: all of libSceAgcDriver, including Graphics/src/PipelineJournal.cpp and core/shader/recompiler/ShaderDiskCache.cpp, and agc_driver_graphics_tests, agc_driver_gcn_detile_tests and agc_driver_gcn_display_present_tests.

  • The tree has no X11 or audio development packages and I did not install any, so SDL's XRandR and audio configure checks were downgraded to messages in the throwaway copy's CMakeLists.txt. No source file changed.
  • agc_driver_graphics and agc_driver_gcn_detile passed there on Mesa's llvmpipe (software Vulkan, no validation layer). agc_driver_gcn_display_present skipped: SDL has no Vulkan video driver in that build.
  • No other Linux test ran.

CUSA03312. Each fix removed a stop in Risk or Monopoly Plus on ps4/limbo-gpu at 93eeee0141 (#6977's head then), with Get-fix#2 and local stand-ins for sceGnmDrawInitDefaultHardwareState200 and sceGnmUpdate*Shader (Get-fix#1 has the details). Not rerun on this base: the titles also need #9432.

Other people's runs. On head 375f5630ba, @ycbuzi ran the tests on an RTX 4070 SUPER, a GTX 1650 SUPER and an AMD RDNA2 iGPU, and @DealPotato ran them on an RTX 4070 with the flip tests on a real display. @DealPotato also took inFAMOUS Second Son (CUSA00004) past its "storage texture has no committed guest pages" stop through the T# base change.

Conventions. tools/check_conventions.py --base origin/main passes.

Overlap. tools/pr_overlap.py --branch fix/ps4-cusa03312-surfaces, against main fd41cca5d9, lists three pull requests:

It could not compare 109 others that conflict with main themselves.

#9673 is not listed. Its DisplayBuffer.cpp hunk is byte-identical to the one here, and a simulated merge in either order shows no conflict in that file. Both histories carry #9431's old head, so the simulated merge does report one line of State.cpp: case 8u, which takes this PR's GcnLinear.

Allocation lookup, 2 Nov. Head ca0255b639, on a100474e12. main's TextureResourceAllocationAddress read 40 bits of the T# base, so a PS4 T# with MTYPE_L2 (word 1 bits 6-7) set looked up the allocation of an address above bit 46; descriptorBaseAddress now applies the same 38-bit mask as descriptorBase under GCN guest shaders. agc_driver_graphics checks that the lookup address of the MTYPE_L2 T# equals its decoded base, and fails with the fix removed ("a PS4 T# with MTYPE_L2 set looked up its allocation at an address other than its 38-bit base"). Run on Windows 11 Pro 26300 with ANYPS5_GPU=AMD, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: agc_driver_graphics and agc_shader_memory pass, no VUID- line (neither opens a Vulkan device). Not rerun: the display-present tests, Linux, CUSA03312. check_conventions.py passes.

Level offsets, 3 Nov. Head cebb30f132, on 9b9288abc8. As @RNK123 suggested, the volume case now checks the level offsets above. On the RX 9070 XT (AMD driver 26.8.1, Windows, Release) with ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, agc_driver_gcn_detile passes 3 of 3, with no VUID- line. Each of four TextureTiling.cpp mutations fails it 3 of 3 at its own check, and the fixture without this commit passes all four: six slices kept at levels 1 and 2, no POW2_PAD rounding, level 0 rounded too, and guestBytes counting six last-level slices. check_conventions.py passes. Not rerun: the other tests, Linux, CUSA03312.

Checklist

  • Based on current main; no other open PR implements the same functions (main merged in; the one-line decode fix is shared with fix(libSceAgcDriver): decode PS4 tiled scanouts in their own layout on the CPU path #9673, as asked on this pull request)
  • 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
  • Fixes: none
  • Unblocks: CUSA03312 Hasbro Family Fun Pack (CUSA03312) #7198
  • GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

savvaniss and others added 5 commits October 22, 2026 23:19
…nt through the GCN decode

PresentDisplayBuffer presents a tiled display buffer from its resident
image when a draw rendered it. Otherwise it uploaded the buffer with
GpuColorTransfer in the PS5 render-target layout, which needs 64 KiB
alignment and does not know GCN tiling. A PS4 title that flips a buffer
before drawing into it, with its buffers 32 KiB aligned, failed with
"null or misaligned address". A GCN-tiled buffer without a resident
image is now read through ReadDisplayBuffer, which decodes the GCN
layout and checks the buffer's own 4 KiB alignment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a GCN T#, word 0 and bits 0-5 of word 1 hold the 256-byte base
address; bits 6-7 of word 1 are MTYPE_L2 (shadPS4's resource.h:
base_address : 38, mtype_l2 : 2). The decode read 40 bits, so a T# with
MTYPE_L2 set addressed bit 46 (0x4002_xxxx_xxxx), which no guest page
backs: "storage texture has no committed guest pages".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…GCN pitch alignment

A PS4 color target with tile mode index 8 (ARRAY_LINEAR_ALIGNED) used
the PS5 linear layout, which pads the pitch to 256 bytes. GCN aligns a
linear-aligned pitch to max(8, 64 / bytes per element) elements, as
AddrLib's SiLib::HwlGetPitchAlignmentLinear does for a surface that is
not interleaved and as this driver's PS4 texture layout already does. A
320-element 16-bit target failed "PS4 color target pitch or slice is not
padded the way its tile mode pads them", and its rows would have been
addressed 384 elements apart. ColorTileMode::GcnLinear has that pitch
alignment and is linear and GCN everywhere else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A thin-tiled PS4 volume is stored like a layered surface whose level n
holds max(1, depth >> n) slices, padded to a power of two with POW2_PAD.
It becomes one 3D image of its depth; thick modes still throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A GCN T# whose MIN_LOD sets the two bits above its 38-bit base decodes
to the base alone, and GCN linear-aligned color targets pad a row to
max(8, 64 / element bytes) elements while PS5 linear targets keep 256
bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MarcZX10

Copy link
Copy Markdown
Contributor

The test report explicitly says fix 1 has no automated coverage. Could you add a focused display-buffer test for PresentDisplayBuffer/DisplayBufferSize using a GCN tiled descriptor with 4 KiB alignment and no resident image, verifying the GCN detile/read path is selected and the pitched layout is accepted? Please also retain negative cases for an actually misaligned address and an unsupported GCN mode. The existing title run is useful, but without that case a later refactor could route these pre-draw flips back through the PS5 GpuColorTransfer layout without any regression test catching it.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

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
PR 9674 core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp L567-569
docs/dev/debt/libSceAgcDriver.md L114-115
PR 14085 docs/dev/debt/libSceAgcDriver.md L114-115
PR 14248 docs/dev/debt/libSceAgcDriver.md L113-114

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 2434 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6804 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7275 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7464 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7668 core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8004 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8246 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8707 docs/dev/debt/libSceAgcDriver.md
PR 9020 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9318 core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9335 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9672 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9673 core/libs/prx/libSceAgcDriver/Execution/src/DisplayBuffer.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9675 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9700 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9915 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9950 docs/dev/debt/libSceAgcDriver.md
PR 10049 docs/dev/debt/libSceAgcDriver.md
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10233 core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 10256 docs/dev/debt/libSceAgcDriver.md
PR 10359 docs/dev/debt/libSceAgcDriver.md
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 10743 docs/dev/debt/libSceAgcDriver.md
PR 10867 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11351 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11452 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/include/ColorTargetLayout.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ColorTargetLayout.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 11998 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12120 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12125 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 12565 docs/dev/debt/libSceAgcDriver.md
PR 12567 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12828 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13599 docs/dev/debt/libSceAgcDriver.md
PR 13646 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13707 docs/dev/debt/libSceAgcDriver.md
PR 13796 core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13920 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13963 docs/dev/debt/libSceAgcDriver.md
PR 13994 docs/dev/debt/libSceAgcDriver.md
PR 14005 docs/dev/debt/libSceAgcDriver.md
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 14212 docs/dev/debt/libSceAgcDriver.md
PR 14217 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 14218 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 14302 docs/dev/debt/libSceAgcDriver.md
PR 14311 docs/dev/debt/libSceAgcDriver.md
PR 14344 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14561 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14621 docs/dev/debt/libSceAgcDriver.md
PR 14943 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14976 docs/dev/debt/libSceAgcDriver.md
PR 15059 core/libs/prx/libSceAgcDriver/Graphics/include/TextureTiling.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp

@ntamas94

Copy link
Copy Markdown
Contributor

@savvaniss, a dependency note for 822a9ea (present a PS4 display buffer that is not resident through the GCN decode): with it, every GCN-tiled flip that finds no resident image goes through ReadDisplayBuffer, and on #9431 DecodeDisplayBuffer's 4-byte loop still computes the offset for any non-linear buffer with the PS5 64 KiB formula (DisplayBuffer.cpp lines 198-199 at this PR's head), so a DisplayTilingGcn buffer decodes scrambled there. #9673 makes that loop go through texelOffset, which knows the GCN layout, with a test that checks every pixel of a 1920x1024 GCN buffer. Could this PR list Depends on: #9673, or carry that change itself? Either way works for me; #9673 also records the 116 ms cost of that decode, which this path will now pay on each such flip.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@savvaniss I checked @ntamas94's note against this head and it holds. With 822a9ea, a GCN-tiled flip that has no resident image goes through ReadDisplayBuffer (unless passthrough is on), and that calls DecodeDisplayBuffer. Its 4-byte loop still computes the offset itself and only knows the linear and 64 KiB layouts (DisplayBuffer.cpp lines 198-199), so a DisplayTilingGcn buffer is read with the wrong formula and the picture comes out scrambled. The half-float loop, DisplayBufferTexels and DisplayBufferOffset already go through texelOffset, so only this loop is affected.

Before this commit those flips failed with "null or misaligned address". With it they present a wrong picture without any error, so I'd rather not merge it before the decode is fixed. #9673 is that fix, and it merges cleanly with this branch. Could you add Depends on: #9673 to the description? Carrying its one-line change here works too, if you prefer.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@savvaniss This PR now conflicts with main in core/libs/prx/libSceAgcDriver/Graphics/include/GuestTextureResource.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp. Main’s texture metadata and color-metadata pass changes overlap this PR’s PS4 layouts and depth-copy path. Could you reconcile the PS4 layout rules and depth-copy integration with the current metadata passes?

GuestTextureResource keeps this branch's gcnPitch, gcnPow2Pad and
gcnLinearGeneral and main's fmaskCmaskAddress. layeredDepthStorage drops
the layer-pitch refusal, since main's LayeredDepthStorage now places each
layer at GuestLayerOffset, and keeps this branch's refusal of level-major
PS4 surfaces, whose layers GuestLayerOffset does not place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in main 07da04f through the boykopovar#9431 merge offered as
Get-fix#22. main replaced the DB depth copy compute pass
(RunDepthCopyPass) with a draw through the normal path, so this branch's
linear check in it goes with it: a depth copy into a GcnLinear target is
now drawn like any other draw into a linear target that is not resident.
The texture tiling test keeps both sides' includes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@savvaniss

Copy link
Copy Markdown
Contributor Author

@oneandonlydean merged, no rebase. The head is now 375f5630ba: main 07da04f947 merged into #9431's head (offered to Get-fix as Get-fix#22), then merged into this branch.

  • GuestTextureResource.hpp and DepthSurface.cpp come from feat(libSceAgcDriver): draw PS4 (GCN) command buffers #9431. Its merge keeps both sides' texture fields and main's removal of the layered-depth pitch refusal, and keeps feat(libSceAgcDriver): draw PS4 (GCN) command buffers #9431's refusal of level-major PS4 surfaces.
  • Draw.cpp: main replaced the DB depth copy compute pass with a draw through the normal path, so RunDepthCopyPass and this PR's linear check in it are gone. The depth copy now goes through the same linear checks as any other draw: a GCN linear-aligned target is still not resident.
  • main's metadata passes don't test the tile mode. The four checks this PR changes keep ColorTileModeIsLinear: comp-to-single, the resident-target test, metadataPassResident and CB resolve.
  • tests/TextureTiling.cpp keeps both sides' includes.

On the RX 9070 XT with the validation layer, 50 AGC, depth, texture and VideoOut flip tests:

  • 49 of 50 pass here and 48 of 49 on main.
  • agc_driver_depth_plane_partial_store fails the same way on both.
  • No VUID- lines.

The three revert checks still fail with the same messages on the new base. The body has the details, and #9879 is a new overlap on the resident-target lines.

AI-assisted: yes (Claude Code)

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@savvaniss The metadata and depth-copy merge points are answered, but the display-decoder dependency is still open. The current four-byte DecodeDisplayBuffer loop still uses the PS5 tiling formula for DisplayTilingGcn, while this PR sends nonresident GCN flips through it. Please carry the #9673 fix or add Depends on: #9673 as requested in comment 6353541175. #9431 also remains an open prerequisite; the compatibility merge offered to its author does not by itself establish its landing or full qualification.

@TechLevelZero

TechLevelZero commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 825f9b3 merged onto main f2d874c · tested 2026-11-01 22:29 UTC · 21 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,498 passed · 5 failed (0 new, 4 also fail on main, 1 unstable on main) · 47 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,550 of 3,168 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (937 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_graphics_maps_fallback 31.3 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
Failing on main too (4, not counted against this PR)
agc_driver_dcc_keys_first_write
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_gcn_display_present
Validation IDs already present on main (5 IDs in 483 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (483 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 475 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (47)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_pipeline_binary_vulkan: skipped, the device lacks VK_KHR_pipeline_binary
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in curre
Reproduce
git fetch origin 825f9b3f7c84adccac75290d2c6cacde483337c4 f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff 825f9b3f7c84adccac75290d2c6cacde483337c4
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi savvaniss, main moved today and this PR no longer merges cleanly. core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp conflicts in the PS4 color-target decode, which main changed through #7555, #8395 and #9717, and the AgcDriver debt doc conflicts too.

Could you merge main into this branch and resolve them, keeping what those PRs added? A merge commit is fine; no need to rebase or force-push. Once it's pushed we'll re-review the merge.

This branch and main both contain 26d651d, so a default merge uses a
virtual base and reports conflicts in GuestTextureResource.hpp,
TextureTiling.hpp/.cpp, TextureDetiler.cpp and State.cpp that neither side
made. Merged against main's last merge base cc26ab4 instead: no conflicts,
and the result differs from main by exactly this branch's own changes.
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi XairRrR,

Could you take another look at #9891? Head 0520548b40 (a merge of current main 24238c4cb1 into the author's 825f9b3f7c) merges cleanly with main. Your four blocking points, at this head:

  1. Conflicts with main: resolved. feat(libSceAgcDriver): draw PS4 (GCN) command buffers #9431 has merged, and the diff against main is now only this PR's 16 files (+485/-31).
  2. Linux build: the PR no longer changes State or ShaderStages. PipelineJournal.cpp:44-45 asserts main's sizes (928 and 164). The NVIDIA GPU job on Linux built and passed the previous head 825f9b3f7c, which has the same own changes as this one.
  3. Non-resident GCN flip and HDR10: the early return is gone. VulkanDevice.cpp:3644-3645 decodes the PS4 buffer and passes the pixels to the common present(...) call, so the HDR10 scaler, frame dumps and screenshots apply. The new tests/execution/GcnDisplayPresent.cpp checks the flip through that path, including HDR, screenshot and frame dump output. One honest caveat: agc_driver_gcn_display_present was skipped with "no display" in our local build of this head and in the NVIDIA GPU job (offscreen SDL), so the author's machine is the only place it has run so far.
  4. Display decode for GCN buffers: carried here, so this PR does not depend on fix(libSceAgcDriver): decode PS4 tiled scanouts in their own layout on the CPU path #9673. DecodeDisplayBuffer now uses texelOffset (DisplayBuffer.cpp:196), which handles DisplayTilingGcn from line 55, instead of the linear/64 KiB formula.

Our local build of this head: the 43 focused tests pass (the two display-present entries skip as above).

GuestTextureResource.cpp: main moved the 40-bit base read into
descriptorBaseAddress(words); this branch reads it as descriptorBase(words),
which masks 38 bits under GCN guest shaders. Keep this branch's
descriptorBase(words) << 8u at that site. Main's new
TextureResourceAllocationAddress still uses the 40-bit descriptorBaseAddress.
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi savvaniss,

We merged current main into #9891 again (only GuestTextureResource.cpp conflicted). Main now reads the texture base through descriptorBaseAddress(words), which always masks 40 bits. At the conflicting site we kept this branch's descriptorBase(words) << 8u, so the PS4 T# 38-bit mask under GCN guest shaders still applies there.

One thing to check: main also added TextureResourceAllocationAddress(), which takes the base from the 40-bit descriptorBaseAddress() even when GcnGuestShaders() is set. If a PS4 T# can have bits 38-39 set, that path would read a different address than the one this branch computes. It's main's code, so we left it as is. Could you say whether it should use descriptorBase() too, perhaps as a follow-up in this PR?

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head a100474 merged onto main 1d91f29 · tested 2026-11-02 16:37 UTC · 20 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,675 passed · 6 failed (0 new, 3 also fail on main, 3 unstable on main) · 46 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,727 of 3,544 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (984 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_graphics_maps_fallback 34.0 s, ⚠️ agc_driver_graphics 31.8 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 3 of the last 10 main runs
agc_submit_progress: failed in 8 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 7 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_gcn_display_present
Validation IDs already present on main (4 IDs in 512 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (512 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 504 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
Skipped (46)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped
Reproduce
git fetch origin a100474e12868fc1ca5c4019a1e454bb2bf53bab 1d91f2966d0eef82a021628a7aa8e78e615ac807
git checkout 1d91f2966d0eef82a021628a7aa8e78e615ac807 && git merge --no-ff a100474e12868fc1ca5c4019a1e454bb2bf53bab
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

…t base

TextureResourceAllocationAddress read 40 bits of the T# base, so a PS4
T# with MTYPE_L2 set looked up the allocation of an address above bit 46.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@savvaniss

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Yes, it should. Bits 6-7 of word 1 are MTYPE_L2 on a PS4 T#, so with them set TextureResourceAllocationAddress looked up an address above bit 46 and ImageAllocationIdentity found no allocation. ca0255b639 applies the 38-bit mask in descriptorBaseAddress under GCN guest shaders, which TextureResourceAllocationAddress uses, and adds a check to agc_driver_graphics that the lookup address of the MTYPE_L2 T# equals its decoded base. That check fails without the fix. agc_driver_graphics and agc_shader_memory pass on Windows (AMD, validation layer on, no VUID- line). Linux was not rerun.

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — approved

All four blocking findings from my last review are resolved. Since then, current main was merged in, the non-resident GCN flip goes through the common present tail, #9673's 4-byte decode fix is carried here, IsNullTextureResource and TextureResourceAllocationAddress read the 38-bit PS4 base, and GcnDetile.cpp gained a thin-mode 3D case.

What changed since my last review

My last review was of 375f5630ba. Since then:

  • main was merged in several times. #9431 is now on main, so the diff against main is only this PR's 16 files.
  • New commits:
    • 574321b323: DecodeDisplayBuffer's 4-byte loop uses texelOffset.
    • 145e53d6c2: the early return is gone, and a new agc_driver_gcn_display_present test was added.
    • 83ca6990ae: IsNullTextureResource reads the base through a shared helper.
    • 63cc6f846c: a volume case in GcnDetile.cpp.
    • 393648d082: debt text.
    • ca0255b639: 38-bit mask in descriptorBaseAddress, used by TextureResourceAllocationAddress, with a check in agc_driver_graphics.
  • The author replied point by point (2026-10-30). They did not extend video_out_flip_ps4 because VideoOut on main cannot register a tiled PS4 buffer yet. That reason is valid. The new test calls the driver's present entry point instead.

What I ran

  • PR head ca0255b639dc987f8b9a6a347646b7868a4f6346, main a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8, merged tree e5f2fcc260cc0adbd7d99e94b417b57246b8bfd0.
  • Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU.
git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...ca0255b639dc987f8b9a6a347646b7868a4f6346
python3 tools/check_conventions.py --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j4 -V -R '^(agc_driver_graphics|agc_driver_gcn_detile|agc_driver_gcn_display_present|agc_shader_memory)$'
# negative control 1: only the 38-bit mask in descriptorBaseAddress put back to 0xffffffffffull
ninja -C build agc_driver_graphics_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_graphics$'
# negative control 2: Graphics/src/TextureTiling.cpp and Graphics/include/TextureTiling.hpp from main
git show a4eca2a056:<path> > <path>
ninja -C build agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
# restore from the merged tree, rebuild, rerun with the validation layer
git show e5f2fcc260:<path> > <path>
git status --porcelain     # empty
ninja -C build agc_driver_graphics_tests agc_driver_gcn_detile_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ... ctest --test-dir build -V -R '^(agc_driver_graphics|agc_driver_gcn_detile)$'
Check Result
Merge into main clean (script)
git diff --check clean
check_conventions.py All conventions checks passed.
Build on Linux/GCC 14, including PipelineJournal.cpp, whose size guards assert State == 928 and ShaderStages == 164 passes
Script's selected test run 2136 ran, 0 new failures, 0 timeouts. 7 known failures also fail on main. 2 main_sync_renames_* tests that fail on main pass here.
agc_driver_graphics, agc_driver_gcn_detile, agc_shader_memory with the validation layer pass
agc_driver_gcn_display_present skipped (SDL offscreen, no Vulkan surface)
VUID- lines / was not found but was requested 0 / 0. The loader log shows VK_LAYER_KHRONOS_validation inserted for the instance and the device.
Negative controls
# 40-bit mask back in descriptorBaseAddress only
1/1 Test #1585: agc_driver_graphics ..............***Failed   34.12 sec
AGC graphics: a PS4 T# with MTYPE_L2 set looked up its allocation at an address other than its 38-bit base

# TextureTiling.cpp/.hpp as on main
1/1 Test #1027: agc_driver_gcn_detile ............***Failed    3.97 sec
AGC graphics: PS4 3D and multisampled textures are not implemented

Previous findings

  • Blocking 1, conflicts with main: Resolved. The script merged the head into a4eca2a056 with no conflict.
  • Blocking 2, Linux build fails on the PipelineJournal.cpp size guards: Resolved. The PR no longer changes State or ShaderStages. The merged tree builds with GCC 14/libstdc++ on x86-64, where the guards at core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:44-45 are active.
  • Blocking 3, the early return skips ensureHdrScaler, frame dumps and screenshots: Resolved. I checked this by reading the code. The decoded pixels are produced at core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:3650 and passed to the common present(...). That call comes after the dump and screenshot handling and after ensureHdrScaler at VulkanDevice.cpp:3642. The overlay plane is now passed too. The runtime check in agc_driver_gcn_display_present (SDR and HDR10) skipped here, so that run is author-reported.
  • Blocking 4, DecodeDisplayBuffer uses the PS5 formula for GCN buffers: Resolved. The 4-byte loop now uses texelOffset(buffer, x, y, 4u) (core/libs/prx/libSceAgcDriver/Execution/src/DisplayBuffer.cpp:196), like the half-float loop.
  • Non-blocking 1, "MIN_LOD" in the test message: Resolved. It now says MTYPE_L2.
  • Non-blocking 2, IsNullTextureResource reads 40 bits: Resolved. It uses descriptorBase(words), and a test pins the zero-base MTYPE_L2 case.
  • Non-blocking 3, the debt entry contradicts itself: Resolved. It now opens with "thick modes (GB_TILE_MODE 15 and 19 to 26) throw".
  • Non-blocking 4, no GPU test of a PS4 volume: Resolved. detileVolume in tests/execution/GcnDetile.cpp detiles the 6/3/1 slices in four thin modes, with and without POW2_PAD, then creates the 3D Texture. It fails with volumes refused again (negative control 2).

New findings

Blocking

None.

Non-blocking

  1. Two identical base helpers. After ca0255b639, descriptorBaseAddress (core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71-75) and descriptorBase (GuestTextureResource.cpp:139-141) apply the same GCN/PS5 mask. The only difference is the << 8. DecodeTextureResource calls descriptorBase(words) << 8u (GuestTextureResource.cpp:175), which is exactly descriptorBaseAddress(words). Keeping one helper would stop the decode and the allocation lookup from drifting apart again, which is the bug the last commit fixed. Suggested fix: drop descriptorBase, use descriptorBaseAddress at line 175, and use descriptorBaseAddress(words) == 0 in IsNullTextureResource.

Not verified

  • agc_driver_gcn_display_present skipped here (SDL offscreen, no Vulkan surface). It also skipped in the NVIDIA bot's runs and in the other local run reported on this PR. The SDR/HDR10 presentation, frame-dump and screenshot checks have only run on the author's RX 9070 XT.
  • The script did not compare validation output with main: its main baseline (0278ca9831) has no validation run yet. I ran agc_driver_graphics and agc_driver_gcn_detile with the layer and saw 0 VUID- lines, so there is nothing new to compare. I did not run the layer on main myself.
  • agc_driver_graphics took about 34 s here, with and without the layer. That is over the 30 s rule. The NVIDIA bot reported it at 31-32 s on earlier heads. This PR adds only a few CPU checks to it, so I don't count the time against the PR, but I did not time it on main on this machine.
  • No title was run; the titles also need #9432.

@github-actions github-actions Bot added the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 2, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head ca0255b merged onto main 1d91f29 · tested 2026-11-02 20:08 UTC · 27 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,675 passed · 6 failed (0 new, 3 also fail on main, 3 unstable on main) · 46 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,727 of 3,544 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (984 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_lazy_resolved_abi_switch_set 35.7 s, ⚠️ agc_driver_graphics_maps_fallback 34.4 s, ⚠️ agc_driver_graphics 33.3 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_job_manager_compute_capacity: failed in 1 of the last 10 main runs
agc_driver_pipeline_journal: failed in 3 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 7 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_gcn_display_present
Validation IDs already present on main (4 IDs in 512 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (512 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 504 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
Skipped (46)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped
Reproduce
git fetch origin ca0255b639dc987f8b9a6a347646b7868a4f6346 1d91f2966d0eef82a021628a7aa8e78e615ac807
git checkout 1d91f2966d0eef82a021628a7aa8e78e615ac807 && git merge --no-ff ca0255b639dc987f8b9a6a347646b7868a4f6346
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@RNK123

RNK123 commented Nov 3, 2026

Copy link
Copy Markdown

On RX 9060 XT / RADV, the focused GCN detile fixture passed on both trees, including the candidate's 3D volume cases; a supplemental offset assertion found a limitation in that fixture's sensitivity to a deliberate layout mutation.

  • Main f6232fcfda70644495273f6b8dd88cf0603463d6, head ca0255b639dc987f8b9a6a347646b7868a4f6346, merge tree a290847798aefa4f81996941959f6d1de42d3d61.
  • agc_driver_gcn_detile: 3/3 passes on main and 3/3 on the merged candidate; the candidate fixture adds four 3D tile modes with and without power-of-two padding. No test or subcase skipped.
  • Control on the merged stack: changing GcnLevelSlices to keep six slices at mip levels 1 and 2 still let the original fixture pass 3/3. The fixture writes and reads using the computed geometry, so that observation alone does not independently validate its offsets.
  • I temporarily added a fixture assertion that mip 2 starts after three level-1 slices, or four when padded. This augmented fixture passes 3/3 with the candidate, fails 3/3 at the added offset assertion with the same mutation, and passes 3/3 after restoration. The fixture was unchanged between those three augmented phases. The failure is a host-side layout assertion, not a numerical GPU mismatch; the mutation is not evidence of a bug in the unmodified PR.
  • CachyOS Linux 7.3.1-1-cachyos, GCC 16.2.1, Release, SPIRV-Tools OFF; Radeon RX 9060 XT (1002:7590), RADV GFX1200, Mesa 26.2.5-arch3.1, Vulkan device API 1.4.354, loader and Khronos validation layer 1.4.363. GPU selection and validation-layer insertion were logged; no VUID- or SYNC-HAZARD- appeared. An unrelated LSFG implicit layer failed to load on both trees; Khronos loaded successfully.
  • No display/HDR, game, PS5 hardware, full suite or performance was tested. The added assertion checks the intended slice-count arithmetic; it is not an independent measurement of PS4 hardware layout.
Reproduction
cmake --build build-main --target agc_driver_gcn_detile_tests -j 4
export ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1
export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer
export VK_LAYER_PATH="$HOME/.local/share/anyps5-tester/vk-layers/usr/share/vulkan/explicit_layer.d"
ctest --test-dir build-main -R '^agc_driver_gcn_detile$' --timeout 120 -V

Run three times on each tree. For the control, on the merged stack make GcnLevelSlices return the original slice count for levels 0–2 and repeat. For the supplemental check, assert that mips[2].tiledOffset == mips[1].tiledOffset + mips[1].tiledSize * (pow2Pad ? 4u : 3u) for the six-slice fixture, then compare candidate, mutated and restored source with that same assertion.

AI-assisted independent hardware test run (gpt-6.1-terra, medium).

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed review queue Next in the maintainer review queue: checks pass, no open change request, no conflict labels Nov 3, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 3, 2026
The volume fixture wrote and read through the computed geometry, so a wrong
slice count per level still passed. Check that level 1 starts after the six
level 0 slices, level 2 after three level 1 slices (four with POW2_PAD), and
that the surface ends after the one level 2 slice. Suggested by RNK123.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@savvaniss

Copy link
Copy Markdown
Contributor Author

@RNK123 thanks, you're right: the volume fixture placed slices with the same geometry it was checking, so the per-level slice count went untested. I added your assertion in cebb30f132, along with two more:

  • level 1 starts after the 6 level 0 slices;
  • level 2 starts after 3 level 1 slices, or 4 with POW2_PAD (yours);
  • the surface ends after the one level 2 slice (guestBytes).

Each check fails on its own mutation of TextureTiling.cpp, and the fixture before this commit passes all four.

Mutation With the new checks (3 runs) Fixture before this commit (1 run)
GcnLevelSlices keeps all 6 slices at levels 1 and 2 (your control) fails 3 of 3: "level 2 does not start after 3 level 1 slices" passes
No POW2_PAD rounding (return levelSlices;) fails 3 of 3, with POW2_PAD: "level 2 does not start after 4 level 1 slices" passes
Level 0 rounded with POW2_PAD too (if (!volume) return slices;) fails 3 of 3, with POW2_PAD: "level 1 does not start after the 6 level 0 slices" passes
guestBytes counts 6 slices for the last level fails 3 of 3: "the surface does not end after the one level 2 slice" passes
  • Without mutations: with the new checks, agc_driver_gcn_detile passes 3 of 3 before the mutations and 3 of 3 after restoring the source, with no VUID- or SYNC-HAZARD lines.
  • One VUID- while unwinding: the second and third mutations fail on the second volume, after a complete first one. In those runs the layer also reports one VUID-vkEndCommandBuffer-commandBuffer-00059. The first and fourth fail on the first volume, and those runs report none. So it comes from the exception path after a finished volume, not from these checks. I haven't looked further.
  • Setup: head 9b9288abc8 (it includes main 1e658521a0) plus the new commit, on Windows 11 Pro 26300 with WinLibs GCC 15.2.0, Release. RX 9070 XT, AMD driver 26.8.1, environment ANYPS5_GPU=AMD ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Every run loaded the layer and selected the RX 9070 XT.
  • Scope: like yours, these checks test the slice-count arithmetic against the ac_surface and AddrLib rule. They are not a measurement of PS4 hardware layout.

AI-assisted: yes (Claude Code)

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — approved

Since my last review, main 1e658521a0 was merged in (9b9288abc8) and a test-only commit (cebb30f132) was pushed. The merged tree builds, the focused tests pass and the negative control still fails. The one new VUID- the script flagged comes from main, not from this PR.

What changed since my last review

My last review was of ca0255b639. Since then:

  • 9b9288abc8 merges main 1e658521a0. The PR's eleven own commits are unchanged (delta.patch shows them all as =). The only conflict was in docs/dev/debt/libSceAgcDriver.md. The resolution keeps both sides: this branch's thick-and-layered, array-layer-bank and non-resident-flip entries, and main's render-target entry with its PS4 depth-target sentence.

  • cebb30f132 (test only, after RNK123's comment) adds three asserts to detileVolume in tests/execution/GcnDetile.cpp:

    • level 1 starts after the 6 level 0 slices;
    • level 2 starts after 3 level 1 slices, or 4 with POW2_PAD;
    • guestBytes ends after the one level 2 slice.

    The script built and tested 9b9288abc8, so this commit is not in the tree I ran (see Not verified). I read its diff. The asserts are host-side and check what the commit message says. GcnDetile.cpp is a test file, so no debt doc change is needed.

What I ran

PR head 9b9288abc84fafb1530018d7c6a26ae8895dc0f2, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree 0afca9fbedbfef7aa5655089829115b4ec2b32e5. Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6), no GPU.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...9b9288abc84fafb1530018d7c6a26ae8895dc0f2
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
# where the new VUID in agc_driver_image_gather_volume comes from
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest --test-dir build -V -R '^agc_driver_image_gather_volume$'
# restore the PR's 10 production files from main (DisplayBuffer.cpp, VulkanDevice.cpp, ColorTargetLayout.hpp/.cpp,
# TextureTiling.hpp/.cpp, ColorTargetTransfer.cpp, Draw.cpp, GuestTextureResource.cpp, State.cpp)
git show 086c0686c8:<path> > <path>
ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests agc_driver_gcn_detile_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ... ctest --test-dir build -V -R '^agc_driver_image_gather_volume$'
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
# restore the merged tree
git show 0afca9fbed:<path> > <path>
git status --porcelain     # empty
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests agc_driver_image_gather_volume_tests agc_driver_graphics_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j4 -V -R '^(agc_driver_gcn_detile|agc_driver_graphics|agc_driver_gcn_display_present)$'
Check Result
Merge into main clean (script)
git diff --check clean
check_conventions.py All conventions checks passed.
Build (script) passes
Script's selected tests 2239 ran, 0 new failures, 0 timeouts. 7 known failures also fail on main.
Script's validation comparison 783 tests, layer loaded in 782, none missing. One test with new VUID- lines: agc_driver_image_gather_volume, marked "test not run on main".
agc_driver_image_gather_volume with the PR's production files restored from main the same 4 VkSamplerCreateInfo VUIDs, so they come from main
agc_driver_gcn_detile, agc_driver_graphics with the layer (merged tree) pass, 0 Validation Error, layer inserted for the instance and the device
agc_driver_gcn_display_present skipped (SDL offscreen, no Vulkan surface)
The gather-volume VUIDs come from main

agc_driver_image_gather_volume arrived on main with #9183 (0bf0563442), after the script's validation baseline 1e658521a0. That is why the script marks it "test not run on main". With the PR's production files restored from main:

1/1 Test #1237: agc_driver_image_gather_volume ...   Passed    9.60 sec
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeU-01079 ]
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeU-parameter ]
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeV-parameter ]
Validation Error: [ VUID-VkSamplerCreateInfo-addressModeW-parameter ]

These are the same four IDs as on the merged tree, so they are not counted against this PR.

Negative control (PR production files from main)
1/1 Test #1194: agc_driver_gcn_detile ............***Failed    4.05 sec
AGC graphics: PS4 3D and multisampled textures are not implemented

Previous findings

  • Non-blocking 1, two identical base helpers: Still open. descriptorBaseAddress (core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71) and descriptorBase (GuestTextureResource.cpp:139) still apply the same mask. DecodeTextureResource still uses descriptorBase(words) << 8u at line 183. This does not block the merge, but a single helper would keep the decode and the allocation lookup from drifting apart.

All earlier blocking findings stay resolved: the merge is clean, the build passes, the common present tail is used, and the GCN decode goes through texelOffset.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • cebb30f132 was not built or run here. The script's tree is the merge of 9b9288abc8. That commit only adds three host-side asserts to GcnDetile.cpp, and I read them. The author reports that agc_driver_gcn_detile passes 3/3 with them on an RX 9070 XT, and that each of four TextureTiling.cpp mutations fails one of them. That evidence is author-reported.
  • agc_driver_gcn_display_present skipped again (no Vulkan surface under SDL offscreen). The SDR/HDR10 presentation, frame-dump and screenshot checks have only been run by the author.
  • agc_driver_graphics took 35.5 s here with the layer, over the 30 s rule, as in my previous review. The PR adds only a few CPU checks to it, and I did not time it on main.
  • No title was run; the titles also need #9432.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 9b9288a merged onto main 1e65852 · tested 2026-11-03 19:50 UTC · 22 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,766 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 49 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,820 of 3,818 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (936 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 4 of the last 10 main runs
agc_driver_submit_progress: failed in 5 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_gcn_display_present
Validation IDs already present on main (4 IDs in 517 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (517 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 509 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (49)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not av
Reproduce
git fetch origin 9b9288abc84fafb1530018d7c6a26ae8895dc0f2 1e658521a0a599872612bb91949311e2956b5283
git checkout 1e658521a0a599872612bb91949311e2956b5283 && git merge --no-ff 9b9288abc84fafb1530018d7c6a26ae8895dc0f2
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — approved

The only change since my last review is the test-only commit cebb30f132, which adds level-offset asserts to the PS4 volume case of agc_driver_gcn_detile. It is now in the merged tree. It builds, passes with the validation layer and fails under a slice-count mutation. There is one non-blocking issue: when the second volume of a mode fails, the test crashes while unwinding instead of printing its message.

What changed since my last review

I last reviewed 9b9288abc8. The script built and tested that commit, without cebb30f132, so last time I only read this commit's diff. delta.patch shows the PR's 11 earlier commits unchanged (=). The only new commit is cebb30f132, which adds three host-side asserts to detileVolume (core/libs/prx/libSceAgcDriver/tests/execution/GcnDetile.cpp:98-100). The description gained a "Level offsets, 3 Nov." paragraph. There are no new author replies to my review.

What I ran

PR head cebb30f1323bc3a57657d9147aa8e6d03c86014e, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree dbde32d139517db378e52d9fdb7e44e1319e1c84. Debian 13 VM, 32 vCPU (Xeon Gold 6136), GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6), no GPU.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...cebb30f1323bc3a57657d9147aa8e6d03c86014e
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests agc_driver_graphics_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R '^agc_driver_gcn_detile$'
# mutation A, in TextureTiling.cpp GcnLevelSlices: "if (!volume || level == 0) return slices;" -> "return slices;"
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
git show dbde32d139:core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
# mutation B: "return pow2Pad ? std::bit_ceil(levelSlices) : levelSlices;" -> "return levelSlices;"
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_gcn_detile$'
ANYPS5_REQUIRE_VULKAN=1 build/tests/agc_driver_gcn_detile_tests
git show dbde32d139:core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
git status --porcelain     # empty
ninja -C build -j32 -l32 agc_driver_gcn_detile_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^agc_driver_gcn_detile$'
Check Result
Merge into main clean (script)
git diff --check clean
check_conventions.py All conventions checks passed.
Build (script, and the two test targets here) passes
Script's selected tests 2239 ran: 0 new failures, 0 timeouts, 7 known failures that also fail on main
Script's validation comparison 783 tests, layer loaded in 782, missing in none. The only new VUID- lines are in agc_driver_image_gather_volume, marked "test not run on main". Last time I showed they come from main (#9183): the same four VkSamplerCreateInfo IDs appear with this PR's production files restored from main. Nothing in this push touches that path.
agc_driver_gcn_detile with the layer passes in 5.8 s. 0 VUID-/Validation Error lines. The layer was inserted for both the instance and the device.
Mutation A (all slices kept at levels 1 and 2) fails: PS4 volume in tile mode 15: level 2 does not start after 3 level 1 slices
Mutation B (no POW2_PAD rounding) fails, but with exit 139 (SEGFAULT) and no message, see the non-blocking finding
Restored tree git status --porcelain is empty, and agc_driver_gcn_detile passes again

Negative control

The commit adds test asserts only. Restoring the PR's production files from main still fails the volume case with "PS4 3D and multisampled textures are not implemented", as in my last review. The new asserts target the slice count per level, so I also mutated GcnLevelSlices in two ways (table above). Both mutations make the test fail. The author's report that the fixture without this commit passes these mutations matches RNK123's control. I did not repeat that run.

Previous findings

  • Non-blocking: two identical base helpers. Still open. descriptorBaseAddress (core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:71) and descriptorBase (GuestTextureResource.cpp:139) still apply the same mask. DecodeTextureResource uses descriptorBase(words) << 8u at line 183. This does not block the merge.
  • Not verified last time: cebb30f132 was not built or run. Resolved. It is now built and run here (see Results).

New findings

Blocking

None.

Non-blocking

  1. A failure on the second volume of a mode crashes the test instead of reporting it (core/libs/prx/libSceAgcDriver/tests/execution/GcnDetile.cpp:171-173).
    • What happens: with mutation B, the POW2_PAD=false volume completes. The POW2_PAD=true volume then throws at line 99. Unwinding ends in a segfault (exit 139) before main's catch prints the message, so ctest shows only (SEGFAULT). The author saw VUID-vkEndCommandBuffer-commandBuffer-00059 on the same path on Windows.
    • Why it happens: the device->WaitIdle() the PR added at line 173 runs only on the success path. The previous volume's Texture uploads can still be in flight when the exception unwinds detiler and the device.
    • Why it matters: the test still fails, so a regression is not missed, but it is harder to diagnose.
    • Suggested fix: call context/device wait-idle at the end of detileVolume, or in main's catch before the device is reset.

Not verified

  • agc_driver_gcn_display_present was not re-run. This push changes nothing on its path, and without a Vulkan surface (SDL offscreen) it skipped here before.
  • I ran no other hardware vendor. The RX 9070 XT runs of this commit are author-reported, and RNK123 ran the fixture on RADV.
  • I ran no title.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head cebb30f merged onto main 1e65852 · tested 2026-11-03 20:24 UTC · 38 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,751 passed · 10 failed (0 new, 9 also fail on main, 1 unstable on main) · 59 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,820 of 3,818 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (936 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_image_sample_unnormalized 46.7 s, ⚠️ agc_driver_lazy_resolved_abi 39.4 s, ⚠️ agc_shader_sampler_limits 38.5 s, ⚠️ agc_driver_stream_copy 36.4 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 7 of the last 9 main runs
Failing on main too (9, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
agc_driver_store_over_untracked
agc_driver_submit_progress
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_gcn_display_present
Validation IDs already present on main (4 IDs in 517 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (517 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 509 more
VUID-vkCmdCopyImage-srcImage-01548 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (59)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is
Reproduce
git fetch origin cebb30f1323bc3a57657d9147aa8e6d03c86014e 1e658521a0a599872612bb91949311e2956b5283
git checkout 1e658521a0a599872612bb91949311e2956b5283 && git merge --no-ff cebb30f1323bc3a57657d9147aa8e6d03c86014e
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head cebb30f merged onto main 1e65852 · tested 2026-11-03 20:32 UTC · 27 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,767 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 49 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,820 of 3,818 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (936 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 4 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_gcn_display_present
Validation IDs already present on main (4 IDs in 517 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (517 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 509 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (49)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not av
Reproduce
git fetch origin cebb30f1323bc3a57657d9147aa8e6d03c86014e 1e658521a0a599872612bb91949311e2956b5283
git checkout 1e658521a0a599872612bb91949311e2956b5283 && git merge --no-ff cebb30f1323bc3a57657d9147aa8e6d03c86014e
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@github-actions github-actions Bot added the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 3, 2026
@oneandonlydean
oneandonlydean merged commit 49021a4 into boykopovar:main Nov 3, 2026
12 of 13 checks passed
@github-actions github-actions Bot removed the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants