Skip to content

fix(agc): size HTILE that is not pipe-aligned by its own meta blocks - #21948

Open
JJenkx wants to merge 10 commits into
boykopovar:mainfrom
JJenkx:fix/agc-htile-unaligned-size
Open

JJenkx wants to merge 10 commits into
boykopovar:mainfrom
JJenkx:fix/agc-htile-unaligned-size

Conversation

@JJenkx

@JJenkx JJenkx commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What

HtileMetadataBytes() sized every PS5 HTILE as pipe-aligned: 32 KiB per 1024×512 block. A native multisample depth target whose HTILE is not pipe-aligned (DB_HTILE_SURFACE.PIPE_ALIGNED 0, which the import accepts for depth-only HTILE) then got a range up to several KiB past its real metadata. The import reads that whole range and refuses unless every word is equal. So guest data placed after the HTILE made the import fail.

This sizes HTILE that is not pipe-aligned as 4 KiB per 256×256 block, the meta block AMD addrlib uses when the metadata is not pipe-aligned (Gfx10Lib::GetMetaBlkSize, pipeAlign == FALSE: min(blockSizeLog2, 12), a 4 KiB block of 4-byte words, one per 8×8 tile). For a 1920×1080 target that is 163840 bytes instead of 196608. Pipe-aligned, single-sample and PS4 targets keep their size. TargetHtileBytes and TargetHtileFillCovers pick the layout from the target; the slice offset in State.cpp uses the same size.

The pending-plane flush guard and retirement footprint also use the target-specific size, so a whole unaligned clear flushes its planes and adjacent memory does not retire the depth surface.

Evidence

Curved Space (PPSA02817) stops about 16 s after launch on main with native multisample depth HTILE that is not pipe-aligned holds more than one word. That is an 8-sample 1920×1080 depth-only target. A local diagnostic at the refusal showed:

  • words 0 to 49149 of the 196608-byte range are all 0, the cleared value;
  • words 49150 and 49151 are 1d97fff0 and 00000002. Read as one 64-bit value, that is 0x21d97fff0, the HTILE base 0x21d980000 minus 16.

So the last 8 bytes are a pointer back to just before the HTILE, not HTILE words. The title's HTILE allocation ends before byte 196600, and the pipe-aligned size runs into data after it.

Tested

Review correction and Linux qualification (2026-11-25).

Both requested call sites now use the existing target-specific helpers: NoteDepthMetadataFill uses TargetHtileFillCovers before flushing pending planes, and surfaceFootprintOverlaps uses TargetHtileBytes for the retirement footprint. This also addresses MarcZX10's 2026-11-25 changes-requested review of the same flush guard. The regression replaces one byte immediately after a target's metadata and verifies that its depth surface survives. The clear-order suite now exercises queued/landed writes with both alignment layouts.

Source role Focused result Case types
Prior public head 10e7e0929612 with identical new fixtures (06e39c16e6b1) 91/92; expected retirement-boundary failure 57 CPU / 35 physical GPU
Review repair on the prior head (cd945e65038e) 92/92 57 CPU / 35 physical GPU
Main 4b70bf120169 93/93 57 CPU / 36 physical GPU
Integrated repaired tree, built at 6613a5bbb0e2 93/93 57 CPU / 36 physical GPU

Same Linux machine, RX 6650 XT / RADV Mesa 26.3.1, required physical Vulkan and disabled shader caches. All physical cases show actual Khronos layer 1.4.363 insertion. Zero skips, VUIDs or synchronization-hazard IDs across these arms. Affected AGC outputs and fixture dependencies were built independently; this is not a complete SDK or fresh native-title test.

The retirement case fails on the prior head and passes the repair. The expanded clear-order cases pass the prior head too: they add alignment coverage, not an independent negative control for the flush guard. The prior-head derived receipt corrects the verifier's CPU-only case classification using the captured executable registrations; its raw CTest log and JUnit are unchanged, and that arm was not rerun.

Publication 10599e03bde8 has the identical complete source tree 306c18f40ad4d9d29a487215e14279a8c0ecb62d and parent tuple as built integration 6613a5bbb0e2; only the merge commit metadata/subject differs. The binaries retain their actual built commit identity. Pre-push conventions completed with zero errors; full logs are included. Earlier Windows and native-title evidence below remains pinned to its stated older heads, not this new publication. No FPS claim is made.

Overlap review found complementary layered-depth #24083 and GCN/PS4 multisample #25557 changes. Combining them must preserve per-target HTILE bounds alongside their slice-pitch/plane-layout changes. The scoped review does not claim every stale branch merges cleanly or has been built in composition.

Source patches, four-arm build and test logs, CTest registrations/JUnit, binary provenance and recipes, SHA256 0ee3fa1dbc92f462796985907a70bdd20711cf05e53312433f4b75f50512755f; anonymous download and all 45 payload hashes verified. No game assets, binaries, saves or shader payloads included.

Contributor Windows follow-up on 10e7e09296. Superseabas reports Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 Release, NVIDIA RTX 5070 Ti (621.01) and Ryzen 7 7700X integrated Radeon (1002:164e, Adrenalin 26.10.2). Their local composition merges this head onto main 26508fa3f9 and also includes #26174 and #26179. Main and topic report 36/36 focused checks in two runs on each GPU, with the shared Windows-by-design queued-fill skip explicitly retained and no VUID lines. Required Vulkan, shader-cache disabling and the Khronos layer were requested in their environment. Restoring the wrong pipe-aligned slice fallback makes the new graphics array-stride assertion fail. These are contributor-reported results for that composition, not a new author-run Windows or title/performance result.

Fresh native New Joe & Mac confirmation (2026-11-23).

New Joe & Mac: Caveman Ninja (PPSA02801, 01.000.003), complete extracted assets, pristine saves, same Cross-every-4-seconds schedule from 15 seconds. One independently staged arm per pin, through the shared FIFO on Linux 7.3.5 / RX 6650 XT / RADV Mesa 26.3.1:

Build Observed result
Main 33bdd3d5d836 Aborts at 8.3 seconds: native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store; before the first scripted input
Public head 10e7e0929612 Reviewed native GPU frames at 68.8 and 83.5 seconds show Joe, health HUD/lives, and the opening-stage artwork. Ordinary close requested at 85.6 seconds; native exit 0 at 87.6 seconds

The successful run reports 0 missing functions and 0 failed shaders. Both full SDK/relinker banks contain 830 hash-verified files; the actual mapped patched AGC paths, inodes and hashes match their exact source pins. Private normalized executable/bundled modules, protected original input hashes, bank integrity, overlay unmount, kernel setting and no leftover arm-native processes all pass. The incomplete LIZARD repack was rejected before launch; both arms use the complete PPSA02801-app0 assets.

This directly confirms the earlier AGY title report at refreshed pins. It is a single-pair correctness smoke, with no FPS/speedup, directional movement, combat/progression, audio, console-fidelity or full-playthrough claim. Captures affect timing. These native runs do not enable Khronos validation; the separate focused qualification below supplies the VVL results. Main has only a black pre-abort X11 readback; scene claims use the candidate's native GPU frames.

Raw terminal and relink logs, run reports, input/capture records, full build logs, module provenance, recipes and selected native captures, SHA256 5e26ce32d565b0079b2cf7d16245ef9d60d2663c5ee7e187f16a6214402d9675; downloaded archive and all 51 manifest payload hashes verified. No game/module binaries, assets, saves or shader payloads included.

Earlier-head Linux qualification (2026-11-23).

Head 10e7e0929612 merges main 33bdd3d5d836, preserving its HTILE mip-chain slice stride and mip offset while retaining target-specific sizing when no mip-chain stride is supplied. New CPU assertions cover slice 2 of a 1920×1080 2× MSAA target: 160 KiB per non-pipe-aligned slice and 192 KiB per pipe-aligned slice. Existing mip-chain goldens also pass.

Arm Focused results
Main production code 33bdd3d5d836, test-only adaptation e61f3044a0b2 35/36; only separate-stencil metadata-tail case fails
Published head 10e7e0929612 36/36
Private wrong-fallback variant 35d3860d47fa CPU suite fails the new 160 KiB array-stride assertion, as intended

The baseline backports the candidate native fixture with an API-compatible test-side size calculation; main production code is unchanged. Each full arm runs 35 physical Vulkan cases plus one CPU/mock graphics suite, using frozen source-matched libraries, disabled shader caches, RX 6650 XT/RADV Mesa 26.3.1, Linux 7.3.5, and validation 1.4.363. Actual validation loading is checked per GPU case (73 insertions per arm). No CTest skips, VUIDs or synchronization-hazard IDs. Two optional heap-mirror CPU subchecks are unavailable on both arms; they are not claimed as executed. The negative variant is CPU-only.

These are focused builds and synthetic correctness checks; no new native-title unblock or FPS result is claimed. Default tools/check_conventions.py and whitespace checks pass against refreshed upstream tracking main.

Logs, JUnit, recipes, source deltas/bundles and module provenance, SHA256 a3e156a899ce544ab2f6151c0f48f9a804fa47f375d3c5f61b46822f9f95d053; all 57 manifest payloads verified after downloading the uploaded archive.

Historical Linux retest (2026-11-19, named revisions below).

Retested maintainer head 8a4914c0a6c4 against main 8e158a83d9ed on RX 6650 XT/RADV Mesa 26.2.7, Linux 7.2.14. Same 30 real GPU cases plus graphics CPU suite: main 30/31 with the expected non-pipe-aligned HTILE refusal, PR 31/31; no skip/VUID, validation 1.4.363 loaded. Additional overlap predicate probe: main 6/9, PR 9/9; the three metadata-tail range errors are corrected.

Native Curved Space v01.000: both default-output runs (3840x2160 native captures) render the tutorial arena and close normally at 127 s. With only APS5_OUTPUT_RESOLUTION=1920x1080 changed, main aborts at 16.5 s on ambiguous same-value publication; this head aborts at 12.4 s on a native multisample attachment over a host-written owner of another identity. The older HTILE-specific refusal did not occur in these native runs. No new title-unblock, FPS, general gameplay or audio claim; the differing 1080p refusal still needs investigation. All four source/module/asset/kernel/cleanup guards pass.

Historical evidence and captures (SHA256 08d16fdbe0a23c705bb041f50bbf0c6852bdcd6c0eccaa25896f8299e06e269f). Earlier evidence below remains historical to its named revisions. The later metadata-only correction published head dcc57b6ebb46, with the same source tree as this tested maintainer head 8a4914c0a6c4. The historical revert subject now follows Conventional Commits, and hosted conventions passes. The revert itself and the maintainer-updated merge remain preserved; correction and tree verification.

Linux 7.2, AMD Ryzen 9 7950X, AMD Radeon RX 6650 XT (RADV, Mesa 26.2.7), Release, on main bc8472965506 + this commit.

  • agc_driver_graphics checks the new sizes: 4 KiB per 256×256 block, 163840 bytes for 1920×1080, and a fill covering exactly that range. Pipe-aligned sizes are unchanged.
  • agc_driver_native_depth_separate_stencil now has a depth-only target whose HTILE is not pipe-aligned, with a different byte right after its 4 KiB metadata. It imports. The existing case with a different word inside the metadata still refuses.
  • ctest -j 12 -R "agc|Agc|depth|Depth|htile|Htile|graphics|Graphics": 1878 of 1880 pass. agc_driver_host_write_shadowed_unit and agc_driver_image_table_packed_guards fail on main too; open PRs already mention them.
  • Curved Space (PPSA02817), 2 runs of 125 s with Cross every 15 s: neither stops on the HTILE refusal. Both now stop at 20 and 24 s on native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store (agc: a guest store of the same value can be lost while a native multisample depth publication commits #15600). Main (3894f2e1847 and 1403ec8de74) stopped at about 16 s on the HTILE refusal in all 3 of my earlier runs. Those main runs had fix(agc): start the color masks and viewport control at their reset values #16053 reverted locally, which does not touch depth import.

So this does not make Curved Space playable yet; it moves it to #15600.

Contributor-reported Windows NVIDIA validation from @maskym: RTX 2070 SUPER results. All executed changed tests passed; the queued-fill case was explicitly skipped on that host. Both trees retained the same baseline failures and unavailable Windows test. Khronos validation was loaded and added no VUID errors. This is independent contributor evidence, not a run on our paused Windows host.

Title evidence (peer-reported, AGY on Linux; see comment 7076887816): on main 2fd48dd40c3 with this PR (dcc57b6ebb) merged, New Joe & Mac (PPSA02801) gets past the 8.1 s native MSAA depth abort, which PublishToGuest raises on a 1920x1080 2x MSAA depth target with htilePipeAligned=0 and htileDepthOnly=1. It goes through Classic Modes → Arcade into Stage 1 gameplay (screenshots reviewed), with 0 missing functions and 0 failed shaders.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA02801 New Joe & Mac: Caveman Ninja (PPSA02801) #9091
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.3.1, Linux 7.3.5, Khronos 1.4.363 (new focused qualification); earlier-head contributor Windows and native evidence pinned above
  • AI-assisted: yes

Summary by CodeRabbit

  • Bug Fixes

    • Improved depth-surface metadata sizing and range checks for pipe-aligned and non-pipe-aligned surfaces, including multisampled configurations.
    • Corrected metadata-fill coverage checks so operations extending beyond a surface’s metadata range do not incorrectly affect it.
  • Tests

    • Added coverage for metadata sizes, depth-slice strides, and memory operations across alignment settings.

HtileMetadataBytes sized every PS5 HTILE as pipe-aligned, 32 KiB per
1024x512 block. A native multisample depth target whose HTILE is not
pipe-aligned has 4 KiB meta blocks of 256x256 pixels (AMD addrlib
GetMetaBlkSize with pipeAlign false), so the import read guest data
past the metadata and refused when it was not the clear word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the agc libSceAgc* label Nov 16, 2026
@tablefrogpillow

Copy link
Copy Markdown
Contributor

Cross-gen confirmation on real AMD — the non-pipe-aligned HTILE sizing fix holds across GCN5, RDNA2 and RDNA3. agc_driver_native_multisample_depth, head b015b6b8, Khronos validation 1.4.363, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1:

GPU arch result
RX Vega 56 (RADV VEGA10, gfx900, Wave64) GCN5 Pass — 24/24 cases, 0 VUID
Ryzen 7000 iGPU (RADV RAPHAEL, gfx1036) RDNA2 Pass
RX 7900 GRE (RADV NAVI31, gfx1100) RDNA3 Pass, 0 VUID
lavapipe SW Pass

GCN5 is the interesting gen here — its HTILE layout differs structurally from RDNA, and the TargetHtileBytes / pipeAligned meta-block sizing holds there too: all 24 multisampled-depth cases at samples=2/4/8 across depth formats 124/126 checked (unavailable=0), including "binds over the owner's HTILE left its words alone" and the GPU-buffer-write-over-depth/HTILE cases. Complements your RX 6650 XT run with the older arch + RDNA3.

AI-assisted: yes

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 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 25557 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L604-605, L4469-4470, L4654-4655, L4687-4689
PR 28667 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L5628-5629
PR 28804 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L2599
PR 28938 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp L4470, L4659-4660

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 1395 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 7085 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9897 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10469 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 10492 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14032 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14473 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15570 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 16935 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17022 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17056 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 17611 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 19557 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 20041 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 20153 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22062 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 22251 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22328 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22439 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22514 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 22531 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 22697 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23252 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23258 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23281 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24049 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24083 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 24781 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25489 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 25684 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 26084 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28142 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28176 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28229 core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28250 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28400 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28488 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28586 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28590 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28668 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 28808 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

@JJenkx

JJenkx commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

One more title this changes, found in a regression check of the other native multisample depth titles I have (125 s each, Cross every 15 s, same machine):

Title main (8332b52dbf8, without this PR) this PR (b015b6b844f on bc8472965506)
PPSA25009 — (3894f2e1847: #15600 at 58 s) #15600 at 48 s
PPSA28002 — (3894f2e1847: #15600) #15600 at 50 s
PPSA02801 #15600 at 8.1 s a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented at 10.1 s, 2 of 2 runs

So PPSA02801 no longer stops on #15600 at 8 s, and stops 2 s later on a different refusal that is not implemented. I have not traced why. My guess is that it also has HTILE that is not pipe-aligned, and that the guest stores which made it refuse under #15600 landed in the bytes past its real metadata. I have not shown that, so I am only reporting the change in behaviour, not counting it as progress.

AI-assisted: yes

@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 17, 2026

@MarcZX10 MarcZX10 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.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head: b015b6b844f63fade38b18ba75c27ea76877f66c, base main. No merged-preview check.
  • No build and no tests. This review is static: I read the diff and the head through the reader.
  • Reader calls:
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp 478 500
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp 1385 1425
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/tests/Graphics.cpp 2684 2700
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp 2388 2400
python3 repo_read.py search htilePipeAligned
python3 repo_read.py search HtileMetadataBytes
python3 repo_read.py search HtileFillCovers core/libs/prx/libSceAgcDriver/Graphics
  • Read in full: diff.patch, description.md, commits.md, manifest.json, files.json.
  • Changed files: five, as listed in files.json under reviewed. I read their changed hunks in the diff and the surrounding head code through the reader. I did not read the full text of each file.
  • tests/Graphics.cpp is too large for the review folder. I read its changed lines only (2684–2700).
  • I checked the new size arithmetic by hand: 1920×1080 gives 40 blocks of 4 KiB, which is 163840 bytes.

Results

Check Result Note
Changed hunks, read statically passed No defect found in the changed code
htilePipeAligned set before use passed Set in State.cpp:490, used at State.cpp:530
Pipe-aligned and single-sample sizes unchanged passed TargetHtileBytes keeps the old size
Build and ctest not run No builds in this review
Author's Curved Space runs not run Author-reported only

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • The 4 KiB per 256×256 block rule. The description cites AMD addrlib (Gfx10Lib::GetMetaBlkSize). That source is not in this repository and I did not check it. The hardware claim rests on the author.
  • The author's test run: 1878 of 1880 pass on bc8472965506 plus this commit. Not reproduced.
  • The Curved Space (PPSA02817) runs: author-reported. Not reproduced.
  • core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:1406 is not changed by this PR. It still sizes the color DCC metadata with the pipe-aligned default. I did not check whether a non-pipe-aligned resource can reach it.
  • Other callers of the default size (DepthSurfaceReuse.cpp, NativeDepthBdaClear.cpp, ImageTableReuse.cpp, and other tests) appeared only as search hits. I did not read them.
  • The checklist claim that no other open PR implements the same functions: not checked.
  • files.json lists tests/Graphics.cpp under reviewed, while the manifest marks it too large. I read only its changed lines.

Sources

  • None. No external source was checked.

To get this to a good state

Nothing is required.

Optional:

  • Back the 4 KiB block size with the addrlib source or a hardware capture in the PR.
  • Decide whether MultisampleTarget.cpp:1406 needs the same sizing change, in a follow-up if so.

…or's pipe alignment

The load of a multisampled texture no draw rendered to read its HTILE with
the pipe-aligned size whatever the descriptor's META_PIPE_ALIGNED bit, so an
HTILE that is not pipe aligned was compared together with the bytes after it.

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

JJenkx commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. On MultisampleTarget.cpp:1406: yes, a resource that is not pipe aligned reaches it. The texture descriptor carries the bit (META_PIPE_ALIGNED, word 6 bit 19, decoded as dccPipeAligned), and the load of a multisampled texture no draw rendered to ignored it, so it read the pipe-aligned size. For a 16×16 4x texture that is 0x8000 bytes where the HTILE is 0x1000, so the all-cleared / all-expanded check also compared the bytes after the HTILE and refused a valid one.

Fixed in a3999695e0ff: that load now sizes the HTILE with HtileMetadataBytes(extent, dccPipeAligned). In agc_driver_sample_multisample_target, the test descriptor builder now sets the bit by default (the existing cases are pipe aligned), and a new case expands only the 4 KiB HTILE of a descriptor without the bit, with zeros after it. It loads as uniform, and the same memory as a pipe-aligned descriptor is refused. With main's line the new case fails with HTILE 0x...+0x8000 holds 0x00000000 at +0x1000 after 0xffffffff, which is neither all cleared to 0.0 nor all expanded.

Linux 7.2.14, RX 6650 XT, RADV, Release, on this branch: ctest -R "multisample|htile|depth|agc_driver_graphics|sample_" 150 of 150 pass.

With this, MultisampleTarget.cpp:1406 was the last production caller using the default size. The others you listed (DepthSurfaceReuse.cpp, NativeDepthBdaClear.cpp, ImageTableReuse.cpp, also StencilPlaneMemory.cpp) are tests that size their own pipe-aligned fixtures, so they are unchanged.

AI-assisted: yes

@JJenkx

JJenkx commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Game check of a3999695e0ff (same machine, 125 s runs, Cross every 15 s), since the new commit changes what a sampled multisampled texture reads:

Title this head, 2 runs before
Curved Space (PPSA02817) #15600 refusal (native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store) at 30 s; native multisample stencil plane partial fill transition is not implemented at 24 s the same #15600 refusal at 18–24 s on b015b6b844f and on main; the stencil refusal also appears in 5 earlier runs on other builds, including main
PPSA02801 a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented at 12 s, 2 of 2 the same at 10 s on b015b6b844f

No new refusal and no change in where either title stops.

AI-assisted: yes

@MarcZX10 MarcZX10 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.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional. I read the changed hunks and their callers, but not the full files, and the sizing rule rests on AMD addrlib, which is outside the repository.

What I ran

Head a3999695e0ff6fa34f297b91b6aa8e0b2c3a2cac, base main. I did not build or run the tests. Checks were done by reading the diff and the head through repo_read.py:

python3 repo_read.py search HtileMetadataBytes core/libs/prx/libSceAgcDriver
python3 repo_read.py search htilePipeAligned core/libs/prx/libSceAgcDriver
python3 repo_read.py search dccPipeAligned core/libs/prx/libSceAgcDriver
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp 480 535
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/tests/Graphics.cpp 2686 2700
python3 repo_read.py search metaPipeAligned core/libs/prx/libSceAgcDriver/Graphics

Results

Check Result Note
Build and ctest not run Author reports 1878 of 1880 pass
New size asserts (Graphics.cpp:2694-2695) not run Arithmetic checked by hand: 40 × 4 KiB = 163840; 6 × 32 KiB = 196608
Curved Space runs not run Author-reported only
Descriptor bit 19 decode passed Read at GuestTextureResource.cpp:216 and :355

Findings

Blocking

None.

Non-blocking

None verified.

Sources

Not linked. The sizing claim cites Gfx10Lib::GetMetaBlkSize in AMD addrlib, which is not in this repository.

Not verified

  • The 4 KiB per 256×256 block layout for non-pipe-aligned HTILE. I could not check it against addrlib or real hardware.
  • The author's ctest run and the Curved Space runs. I did not run them.
  • Full-file review. For the seven files in files.json under reviewed, I read the changed hunks and their callers. I did not read the full text in files/.
  • Other callers of HtileMetadataBytes that keep the pipe-aligned default (for example in tests/DepthSurfaceReuse.cpp and tests/execution/NativeMultisampleDepth.cpp). I did not check each one, and I assume they use pipe-aligned fixtures.

To get this to a good state

Nothing is required.

Optional:

  • Cite the addrlib source for the 4 KiB block rule, pinned to a commit, so the layout claim can be checked.
  • Say in the description whether the ctest failures agc_driver_host_write_shadowed_unit and agc_driver_image_table_packed_guards also fail on main at the same base.

@JJenkx

JJenkx commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. On the two optional points:

Source for the 4 KiB / 256×256 rule. Gfx10Lib::GetMetaBlkSize in Mesa's addrlib, pinned to mesa-25.0.0 (4fa244fddfeb): gfx10addrlib.cpp L1313-L1388. For a thin surface with pipeAlign == FALSE it takes metablkSizeLog2 = Min(dataBlkSizeLog2, 12), so 4 KiB for a 64 KiB swizzle (L1324-1327). The block's pixel size is then metablkBitsLog2 = metablkSizeLog2 + compBlkSizeLog2 - elemLog2 - metaBlkSamplesLog2 - metaElemSizeLog2 (L1385-1386). For depth compBlkSizeLog2 = 6 + numSamplesLog2 + elemLog2 (L1307), metaBlkSamplesLog2 = numSamplesLog2 (L1308-1309) and GetMetaElementSizeLog2 is 2 (L5022-5024), so metablkBitsLog2 = 12 + 6 - 2 = 16: 256×256 (L1387-1388), whatever the sample count and element size.

The two ctest failures. Both fail on main too. On main c825105a779e with no PR (same machine, full ctest -j 8, 5998 of 6000 pass), agc_driver_host_write_shadowed_unit and agc_driver_image_table_packed_guards fail, each 3 of 3 when rerun alone. The first is #21900 (fix in #21911), the second is what #21255 changes.

AI-assisted: yes

@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 17, 2026
@domx4q

domx4q commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Ran the tests this PR changes, with the rest of the native depth set, with the Khronos validation layer on Linux and an NVIDIA GPU; the posted runs are AMD only.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada, subgroup 32), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head a3999695e0 merged onto main f0c01bc69d with --no-ff, clean merge. Main baseline is a Release build of f0c01bc69d on the same machine.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^agc_driver_(graphics|native_depth.*|native_multisample_depth.*|sample_multisample_target.*)$' -V
main f0c01bc69d this PR
Result 33 of 33 passed 33 of 33 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 65 65
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

agc_driver_graphics (new HTILE sizes), agc_driver_native_depth_separate_stencil (new depth-only target whose HTILE is not pipe-aligned), agc_driver_native_multisample_depth and agc_driver_sample_multisample_target pass on both sides, as do the other 29 agc_driver_native_depth_* tests. No test skipped, and every device selection picked the RTX 4090.

No new VUID- errors; all focused tests pass on Ada.

AI-assisted: yes (Claude Code)

This reverts commit a399969. With it, PPSA06228 holds at 44 presents
for about 55 s on every run (two of two, warm and cold shader cache),
while the previous head and this PR's base render normally from the start,
so the descriptor's META_PIPE_ALIGNED bit is not a reliable size for the
HTILE that load reads.

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

JJenkx commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

I've reverted my follow-up a3999695e0ff (sizing a sampled multisampled texture's HTILE by its descriptor's META_PIPE_ALIGNED bit) in 0366ff2096ef: it regresses a title. The PR is back to b015b6b844f6's tree, the change to target HTILE sizing that was already reviewed.

What I found. In a six-title regression run of a3999695e0ff (70 s each, Cross every 15 s), five titles ran normally, but PPSA06228 held at 44 presents for about 55 s, in both runs with a cold and a warm shader cache. Then I ran it on three more builds:

build presents at 8 / 14 / 62 s
this PR's base bc8472965506, 2 runs 311 / 671 / 3,221 and 375 / 735 / 3,277
b015b6b844f6 (first commit only) 341 / 701 / 3,308
a3999695e0ff (both commits), 2 runs 44 / 44 / 154 and 44 / 44 / 44

So the second commit causes it. For this title the descriptor bit is evidently not a reliable size for the HTILE that the load reads (the target side takes its alignment from DB_HTILE_SURFACE), so I'd rather not change that path without a title that needs it. Your original question about MultisampleTarget.cpp:1406 stays open: it can see a non-pipe-aligned HTILE, but the bit I used is not the right signal for it.

At 0366ff2096ef (same tree as b015b6b844f6): ctest -R "multisample|htile|depth|agc_driver_graphics|sample_" passes 150 of 150, and PPSA06228 renders normally as above. The earlier Curved Space and PPSA02801 results on b015b6b844f6 stand.

AI-assisted: yes

@MarcZX10 MarcZX10 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.

Reviewed — no blocking findings

No blocking findings in the changed code. The points below are optional, and the review is not complete, so this is a comment, not an approval.

What I ran

  • Head reviewed: 0366ff2096eff312eae0f604016f84aefad9078a (base main).
  • Read the description, commit list, manifest and the diff hunks for the five changed files.
  • Used repo_read.py search on core/libs/prx/libSceAgcDriver to find every caller of the HTILE size helpers, and cat on the depth decode in State.cpp and on the import check in DepthSurface.cpp.
  • No build and no test run in this review.

Results

Check Result Note
Changed hunks, logic passed Read against callers
HTILE helper callers passed One caller outside the diff, see Findings
Build and ctest not run Author reports 1878 of 1880 pass
Curved Space run not run Author reports two runs, not repeated here

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp:98 gives HtileMetadataBytes a default pipeAligned = true. Any new caller that leaves it out gets the old pipe-aligned size without a warning. The sampled multisample path in core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:1406 is such a caller. It is outside this diff, so I have not judged it a defect.

Not verified

  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp: this file is listed as reviewed, but its full text is not in the review folder. I read only the changed hunks from diff.patch, not the whole file, and did not read it through the reader.
  • The 4 KiB-per-256×256 size for non-pipe-aligned HTILE matches the arithmetic in the description (163840 bytes for 1920×1080). I did not check it against AMD addrlib.
  • Whether the sampled multisample path at core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:1406 should use the non-pipe-aligned size. It is not changed here.
  • The new positive test HtileTail and the new size assertions were not run, so no negative control was run either.
  • The Curved Space results and the ctest counts are the author's, not mine.

To get this to a good state

Nothing is required. Optional: make the pipeAligned argument explicit at each call site, or drop the default, so a new caller cannot pick the old size by accident.

@JJenkx

JJenkx commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. On the pipeAligned = true default: the only production caller that relies on it is MultisampleTarget.cpp:1406, and since the revert that one is meant to keep the pipe-aligned size (the descriptor bit I tried there regressed PPSA06228, see the comment above). The other users of the default are about 60 test call sites (NativeMultisampleDepth.cpp, DepthSurfaceReuse.cpp, StencilPlaneMemory.cpp and others), all sizing pipe-aligned fixtures. Removing the default would make every one of them spell out true, which is a broad test edit for a PR whose change is the non-pipe-aligned case, so I'd keep it here and do that as a follow-up if it's wanted.

AI-assisted: yes

@maskym

maskym commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head 0366ff2096, merged alone into main e069a7562f (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. main itself fails to compile one test on Windows at this commit (UploadCacheReadOnlyFlush.cpp:177, setenv; #19899 fixes it), so both trees were built with ninja -k 0.

Validation-layer protocol on main and on this PR (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation 1.4.366, VK_LOADER_DEBUG=error,warn,layer, ctest -R '^(agc|guest_video_out|video_out|pad_sdl)' --parallel 4 -V):

Tree Passed Layer inserted was not found but was requested VUID- set
main 2050/2054 1856 0 none
this PR 2050/2054 1856 0 identical

agc_driver_upload_cache_read_only_flush is Not Run on both trees because of the main build break above. No new validation errors and no new failures. The failures on this PR's tree (agc_driver_stencil_plane_memory, agc_driver_store_over_untracked, agc_driver_msaa_dcc_unwatch) also fail on main here; rerun alone on this PR's tree they pass 0 of 3 times.

The tests this PR adds or changes (agc_address_copy_cap, agc_address_copy_cap_mirror, agc_address_copy_cap_remembered, agc_address_space_unwatched_mirror_import, agc_command_batch_fence_failure, agc_command_state, agc_compute_descriptor_layout_flags, agc_copy_input_failure_lifetime, agc_copy_input_kept_bytes, agc_depth_copy_kept_bytes, agc_descriptor_cache, agc_descriptor_pool_reset_failure, agc_driver_address_space_teardown, agc_driver_alpha_to_coverage_state, agc_driver_covered_centroid_state, agc_driver_depth_bounds_state, agc_driver_dual_source_blend_state, agc_driver_fault_only_template_records, agc_driver_fault_only_template_records_kept, agc_driver_fault_only_template_records_loop_guard, agc_driver_fault_only_template_records_loop_guard_kept, agc_driver_graphics, agc_driver_linear_volume_nonresident, agc_driver_msaa_dcc_state, agc_driver_native_depth_aliased_depth_depth_only, agc_driver_native_depth_aliased_depth_no_stencil, agc_driver_native_depth_aliased_depth_stencil, agc_driver_native_depth_aliased_stencil, agc_driver_native_depth_bare_publication, agc_driver_native_depth_buffer_clear, agc_driver_native_depth_clear_refusals, agc_driver_native_depth_clears, agc_driver_native_depth_covered_owner, agc_driver_native_depth_driver_path, agc_driver_native_depth_expand_gate, agc_driver_native_depth_htile_plane_alias, agc_driver_native_depth_initial_owner, agc_driver_native_depth_overwritten_planes, agc_driver_native_depth_overwritten_published, agc_driver_native_depth_pending_units, agc_driver_native_depth_publication, agc_driver_native_depth_publication_without_htile, agc_driver_native_depth_retirement, agc_driver_native_depth_separate_stencil, agc_driver_native_depth_single_sample_view, agc_driver_native_depth_smaller_extent, agc_driver_native_depth_stencil, agc_driver_native_depth_stencil_view, agc_driver_native_depth_stored_repeat_fill, agc_driver_native_depth_uneven_plane, agc_driver_native_depth_uniform_plane_alias, agc_driver_native_depth_uniform_planes, agc_driver_native_multisample_depth, agc_driver_push_constant_assembly, agc_driver_sample_location_grid_fallback, agc_driver_sample_order_planning, agc_driver_stencil_ref_export_push_budget, agc_driver_undithered_alpha_to_coverage_state, agc_driver_unobserved_provoking_vertex, agc_driver_unused_viewport_depth, agc_graphics_profile_draw, agc_heap_mirror_reference_size, agc_heap_mirror_run_unwatch, agc_heap_mirror_run_unwatch_no_space_cache, agc_heap_mirror_unwatch, agc_heap_mirror_unwatch_no_space_cache, agc_host_import_validity, agc_pipeline_journal, agc_pipeline_journal_extended_paths, agc_pipeline_journal_long_paths, agc_pipeline_journal_replay_priority, agc_pipeline_library_clear_waits_for_build, agc_pipeline_store_fixed_bound, agc_pipeline_store_growth, agc_pipeline_store_lazy_buffer_pool, agc_pipeline_store_replay_growth, agc_pipeline_store_touch, agc_sparse_buffer_holes, agc_sparse_heap_mirror_budget, agc_sparse_heap_mirror_unwatch, agc_sparse_heap_mirror_unwatch_no_space_cache) pass in the full validation-layer run. agc_driver_native_depth_driver_queued_fill is skipped on this machine (skipped, host imports are compared here, not write-watched, and a queued fill's HTILE proof needs a write-watched import), so there is no result for it here. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

The attachment reuse checks from boykopovar#17738 still used the pipe-aligned HTILE size, so a multisampled target that is not pipe-aligned could miss an HTILE clear that covers it. Use TargetHtileFillCovers and TargetHtileBytes there as well.
@oneandonlydean

Copy link
Copy Markdown
Collaborator

I pushed a merge of main and one fix on top. #17738 added attachment reuse checks in DepthSurface.cpp (DepthTargetObligation and the overlap check) that still used the pipe-aligned HTILE size, so a multisampled depth target that is not pipe-aligned could miss an HTILE clear that covers it. They now use TargetHtileFillCovers and TargetHtileBytes. The 138 depth, HTILE and multisample tests pass on Linux. Could you rerun PPSA02817 on the new head?

@JJenkx

JJenkx commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Retested the maintainer-updated head 8a4914c0a6c42b495929fba4b5c812069fccb52f against current main 8e158a83d9edb4d3838c054fe380457926ea536b. I did not change or push the branch.

Focused validation: Linux 7.2.14-arch1-1, GCC 16.2.1 Release, RX 6650 XT / RADV Mesa 26.2.7, Khronos validation 1.4.363. Full SDK and relinker builds completed for both, with optional SPIRV-Tools OFF on both.

  • The same 30 real GPU cases and the per-source graphics CPU suite: main 30/31 pass, with the expected agc_driver_native_depth_separate_stencil HTILE refusal; PR 31/31 pass. No skips or VUIDs. Validation insertion and actual AMD device checked per GPU case; shader caches disabled.
  • The native multisample-depth GPU fixture is identical on both SDKs. It includes the PR's new metadata-tail case; only its include path and test-side expected-size calculation were adapted so it can compile against main's old one-argument helper without changing main production code. Main fails the separate-stencil group before completing the non-pipe-aligned cases; the PR completes them, including the explicit tail case.
  • One additional CPU DepthTargetOverlaps executable run against each frozen SDK: main 6/9, PR 9/9. The three corrections exclude the first byte past the non-pipe-aligned metadata, its former pipe-aligned tail, and the first byte past a small 4 KiB metadata allocation. Pipe-aligned and single-sample ranges stay covered. This directly checks the updated overlap path.

Curved Space PPSA02817 v01.000: one fresh-save/cache run per build/output condition, identical Cross-every-15s/capture schedule. Each whole arm entered the normal host FIFO independently, with private overlay/runtime and frozen SDK. Normal close at 125 s; actual outcomes:

Output condition Main 8e158a83 Updated PR 8a4914c0
Default, native captures 3840x2160 Rendered tutorial arena/ship/rings/Move-Turn HUD in native capture at 123.3 s; exit 0 at 127.4 s Same reached scene in native capture at 123.1 s; exit 0 at 127.2 s
Explicit APS5_OUTPUT_RESOLUTION=1920x1080 Exit 134 at 16.5 s: native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store Exit 134 at 12.4 s: a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented

Both 1080p runs show the logo/splash in the ~10.4 s native capture and stop before any scripted input is actually delivered. Neither native route reproduced the older HTILE multiple-word refusal. The shared GPU fixture still demonstrates that range bug on main.

So this is not a new title-unblock or FPS claim: current main already renders the 4K tutorial route, while the PR still stops on the 1080p route, with a different attachment-reuse guard. More evidence is needed to assign the cause of that differing refusal. The main 1080p publication message is at the branch that still rejects DepthReadCause::Access; merged #15941 covers Reuse, not every access case.

All four mapped AGC hashes match the appropriate frozen patched SDK. Asset/stage/bank/kernel checks, overlay unmount and no-leftover-native checks passed on every arm. No movement/combat, audio, PS5-fidelity or general playability claim. An earlier 110 s window capture still showed loading; the later 123 s native capture shows the arena, which is not a same-time comparison or proof that a capture channel was stale.

Full logs, JUnit, shared fixture, CPU probe, source/module hash proofs and selected native captures — SHA256 08d16fdbe0a23c705bb041f50bbf0c6852bdcd6c0eccaa25896f8299e06e269f, 90 manifest-verified payloads. No game/SDK binaries, shader dumps or other open-PR integration included.

One branch-metadata check remains: tools/check_conventions.py --base origin/main flags the existing commit subject 0366ff2096ef Revert "fix(agc): size a sampled multisampled texture's HTILE by its descriptor's pipe alignment" as non-Conventional Commits. I preserved the maintainer-updated history/head for this retest; I have not rewritten that commit. Description-only checks pass after filling the current-head report.

@github-actions github-actions Bot removed the unblocks title Names a title ID on the Unblocks line label Nov 20, 2026
@JJenkx
JJenkx force-pushed the fix/agc-htile-unaligned-size branch from 8a4914c to dcc57b6 Compare November 20, 2026 20:05
@JJenkx

JJenkx commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the conventions failure by changing the historical revert subject to fix(agc): restore sampled texture HTILE sizing. The branch head is now dcc57b6ebb46.

This changes commit metadata only. The old head 8a4914c0a6c4 and the new head have identical Git trees, as do all three rewritten commits. The main merge, its parent order, both original author/committer records, and the maintainer's reused-depth-attachment correction are preserved. Existing source and native test results therefore still describe exactly the same files; no new runtime result is claimed.

git diff --check upstream/main...HEAD and python3 tools/check_conventions.py --base upstream/main pass against the fetched current main. Hosted checks have been triggered by the push.

AI-assisted: yes

@MarcZX10 MarcZX10 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.

Reviewed — comments

Nothing blocks this review, but the remaining HTILE sizing path should be checked before merge.

What I ran

  • Reviewed head dcc57b6ebb46f7cf29f10ce781e25a07de4331eb using repo_read.py.
  • No tests or builds were run.

Results

Check Result Note
Changed code review passed Core sizing and callers inspected
Tests/build not run No local execution

Findings

Blocking

None.

Non-blocking

  • createFilled still sizes descriptor-backed multisampled texture HTILE with the default pipe-aligned size, even though the descriptor exposes dccPipeAligned. If non-pipe-aligned metadata is supported on this path, it can retain the oversized read and reject valid contents past the HTILE range. Consider sizing from the descriptor’s alignment flag and adding a regression case. Changed reference: core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:4740.

Not verified

  • No tests or build were run; the author-reported validation was not independently reproduced.
  • Read: DepthSurface.hpp, DepthSurface.cpp, State.cpp, Graphics.cpp (changed lines only), and NativeMultisampleDepth.cpp (changed section). Also read the review description, commits, manifest, and diff.
  • files.json was not available in the reader listing; Graphics.cpp was excluded from the prepared full-text folder due to size, but its changed lines were read through the pinned reader. Other excluded files: none listed.

To get this to a good state

Nothing is required. Optional: check whether descriptor-backed multisampled textures can carry non-pipe-aligned HTILE and, if so, use descriptor alignment for its size and cover it with a test.

@JJenkx

JJenkx commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Confirmed the earlier PPSA02801 (New Joe & Mac: Caveman Ninja, 01.000.003) hypothesis on current main (2fd48dd40c3, which now includes #17915) + clean merge of dcc57b6ebb46:

  • Mechanism on main (2fd48dd40c3): reproduces the abort ~8 s after launch (AGC graphics: native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store) when sceKernelAprSubmitCommandBuffer triggers publication of a 1920x1080 2x MSAA depth surface with htilePipeAligned = 0, htileDepthOnly = 1, htileStencil = 0. The guarded HTILE plane covers +0x30000 (196,608 B) and hits an undecided byte at offset = 0x2f000 (past the real 0x28000 / 163,840 B unaligned HTILE size, cur = 0x00, snap = 0x00, host = 0x0f).
  • With dcc57b6ebb46 merged onto 2fd48dd40c3: now that fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915 is on main, PPSA02801 no longer stops at 8 s or 10 s. In a 65 s run (Arch Linux 7.3.5, GCC 16.2.1 Release, AMD Radeon RX 6650 XT / RADV Mesa 26.3.1, scripted Cross presses every 4 s from 15 s) it advances cleanly through CLASSIC MODES -> Arcade into Stage 1 in-game gameplay (verified screenshots showing Joe, HUD, health bar, lives counter, and stage art): 3,633 frames presented in 64.89 s, 56.73 FPS avg (p50 = 16.68 ms, p99 = 17.20 ms), 0 missing functions, 0 failed shaders.

AI-assisted: yes (Antigravity); the diagnostic, build, and runtime observations are from this machine.

@JJenkx

JJenkx commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Windows AMD check of the exact head 10e7e09296: 90/90 in each of 3 runs.

Setup: Windows 11 Enterprise 22621, Ryzen 9 5950X, Radeon RX 6700 XT (AMD driver 26.11.2), WinLibs GCC 15.2 UCRT r7, Release, Ninja, a private detached worktree at this head. ANYPS5_REQUIRE_VULKAN=1, the tests' own registered environment otherwise. Run through the Windows GPU FIFO.

Tests: every CTest entry of the two executables that compile this PR's changed test files, agc_driver_graphics_tests (tests/Graphics.cpp) and agc_driver_native_multisample_depth_tests (tests/execution/NativeMultisampleDepth.cpp): 90 tests, 3 runs, no failure or timeout. One test skips here in every run, as on main on this machine: agc_driver_native_depth_driver_queued_fill (host imports are compared here, not write-watched, and its HTILE proof needs a write-watched import).

AI-assisted: yes.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Two call sites in DepthSurface.cpp that came in with the merge of main still size HTILE as pipe-aligned, so they disagree with the per-target sizing this PR adds (head 10e7e09, from reading the code, not run):

  1. NoteDepthMetadataFill: !HtileFillCovers(target.htileAddress, target.extent, address, bytes) should be !TargetHtileFillCovers(target, address, bytes). As it is, an exact clear of a non-pipe-aligned HTILE skips the pending plane flush that the later clear handling depends on.
  2. surfaceFootprintOverlaps: HtileMetadataBytes(target.extent) should be TargetHtileBytes(target). As it is, the retire footprint is too large.

Could you make both changes?

@MarcZX10 MarcZX10 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.

Reviewed — changes requested

The HTILE sizing changes have one remaining pipe-aligned coverage check that skips flushing pending depth writes for non-pipe-aligned targets.

What I ran

Reviewed head 10e7e0929612baf81c46dd60c12e20056c472987 using the prepared diff and repo_read.py source reads; no tests were run.

Results

Check Result Note
Changed code review failed One missed coverage call site
Tests not run Contributor results are reported in the PR description

Findings

Blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:4912: TargetHtileFillCovers correctly uses the target’s pipe-alignment setting, but NoteDepthMetadataFill still uses the default pipe-aligned HtileFillCovers check before flushing pending plane writes (DepthSurface.cpp:4954). For a complete non-pipe-aligned HTILE fill, that check can fail to recognize coverage, so the pending depth plane is not flushed before the metadata clear is processed. Use the target-aware coverage helper at that call site too.

Non-blocking

None.

Not verified

core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was excluded from the review folder; its changed assertions were inspected in diff.patch, but the full file was not read. No tests were run. Contributor-reported test and title results in description.md were not independently verified.

To get this to a good state

Update the remaining coverage check in NoteDepthMetadataFill to use target-specific HTILE sizing, then rerun the focused depth/HTILE checks.

@JJenkx

JJenkx commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both requested calls in 10599e03bde8: the pending-plane flush guard uses TargetHtileFillCovers, and the retire footprint uses TargetHtileBytes.

Review correction and Linux qualification (2026-11-25).

Both requested call sites now use the existing target-specific helpers: NoteDepthMetadataFill uses TargetHtileFillCovers before flushing pending planes, and surfaceFootprintOverlaps uses TargetHtileBytes for the retirement footprint. This also addresses MarcZX10's 2026-11-25 changes-requested review of the same flush guard. The regression replaces one byte immediately after a target's metadata and verifies that its depth surface survives. The clear-order suite now exercises queued/landed writes with both alignment layouts.

Source role Focused result Case types
Prior public head 10e7e0929612 with identical new fixtures (06e39c16e6b1) 91/92; expected retirement-boundary failure 57 CPU / 35 physical GPU
Review repair on the prior head (cd945e65038e) 92/92 57 CPU / 35 physical GPU
Main 4b70bf120169 93/93 57 CPU / 36 physical GPU
Integrated repaired tree, built at 6613a5bbb0e2 93/93 57 CPU / 36 physical GPU

Same Linux machine, RX 6650 XT / RADV Mesa 26.3.1, required physical Vulkan and disabled shader caches. All physical cases show actual Khronos layer 1.4.363 insertion. Zero skips, VUIDs or synchronization-hazard IDs across these arms. Affected AGC outputs and fixture dependencies were built independently; this is not a complete SDK or fresh native-title test.

The retirement case fails on the prior head and passes the repair. The expanded clear-order cases pass the prior head too: they add alignment coverage, not an independent negative control for the flush guard. The prior-head derived receipt corrects the verifier's CPU-only case classification using the captured executable registrations; its raw CTest log and JUnit are unchanged, and that arm was not rerun.

Publication 10599e03bde8 has the identical complete source tree 306c18f40ad4d9d29a487215e14279a8c0ecb62d and parent tuple as built integration 6613a5bbb0e2; only the merge commit metadata/subject differs. The binaries retain their actual built commit identity. Pre-push conventions completed with zero errors; full logs are included. Earlier Windows and native-title evidence in the PR description remains pinned to its stated older heads, not this new publication. No FPS claim is made.

Overlap review found complementary layered-depth #24083 and GCN/PS4 multisample #25557 changes. Combining them must preserve per-target HTILE bounds alongside their slice-pitch/plane-layout changes. The scoped review does not claim every stale branch merges cleanly or has been built in composition.

Source patches, four-arm build and test logs, CTest registrations/JUnit, binary provenance and recipes, SHA256 0ee3fa1dbc92f462796985907a70bdd20711cf05e53312433f4b75f50512755f; anonymous download and all 45 payload hashes verified. No game assets, binaries, saves or shader payloads included.

AI-assisted: yes

@MarcZX10 MarcZX10 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.

Reviewed — no blocking findings

The inspected changes show no verified blocking defect; no checks were run for this review, so a formal approval is not justified.

What I ran

Reviewed head 10599e03bde84bed728139fd30e71b129c5d5f1e. No commands or tests were run. The description’s reported test results are author-provided and were not independently verified.

Results

Check Result Note
Changed code review passed Target-specific HTILE sizing and call sites inspected
Tests not run Results in the description are author-reported
Negative control not run Not independently verified

Negative control

No negative control was run as part of this review. The description reports a prior-head retirement-boundary failure and a passing repair, but those results were not independently verified.

Findings

Blocking

None verified in the inspected code.

Non-blocking

None.

Sources

The sizing and call-site changes are in DepthSurface.cpp, with the slice offset change in State.cpp.

Not verified

Tests were not run. The full contents of the two test files were not read; only changed hunks and their surrounding code were inspected. Changed files inspected: DepthSurface.hpp, DepthSurface.cpp, State.cpp, tests/Graphics.cpp (changed hunk), and tests/execution/NativeMultisampleDepth.cpp (changed hunks). The full text of the latter two files was excluded from the review folder because of size.

To get this to a good state

Nothing is required. Optional: run the focused AGC graphics and native multisample depth tests on this head.

@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 25, 2026

@Superseabas Superseabas 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.

Follow-up on Windows for head 10599e03bd. My approval of 10e7e09296 missed the two call sites oneandonlydean found: my run showed the new array-slice check guards the slice size, but neither the flush guard nor the retire footprint goes through it.

Setup: Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release full build, run from PowerShell with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. GPUs, each picked with ANYPS5_GPU: NVIDIA GeForce RTX 5070 Ti (621.01) and the Ryzen 7 7700X's integrated AMD Radeon (1002:164e, Adrenalin 26.10.2). Merged onto main c3aae2e8fb (clean merge), built together with #24781 and #24906, which touch other files.

  • agc_driver_graphics, the native depth and native multisample tests and sample_multisample_target: main 37 of 37, and with this PR 37 of 37 in 2 of 2 runs, on both GPUs, including agc_driver_native_depth_clear_supersedes_plane_writes. The only skip, on both sides, is agc_driver_native_depth_driver_queued_fill (Windows by design). No VUID- lines.
  • Red check, not caught: with NoteDepthMetadataFill's pending-plane flush guard back to !HtileFillCovers(target.htileAddress, target.extent, address, bytes), all 37 still pass on the Radeon, including clear_supersedes_plane_writes with pipeAligned=0. Its clear is exactly the 4 KiB non-aligned size, so the old guard should skip the flush there. The write must be superseded by another path in this test, so it doesn't isolate the guard. The fix reads right to me; this is only about what the test pins.

The code: NoteDepthMetadataFill's pending-plane flush now uses TargetHtileFillCovers, and surfaceFootprintOverlaps uses TargetHtileBytes. A search of the head finds no other caller that sizes a target's HTILE from its extent alone; the only remaining HtileFillCovers(..., target.extent, ...) is inside TargetHtileFillCovers itself.

AI-assisted: yes (Claude Code)

@oneandonlydean
oneandonlydean dismissed MarcZX10’s stale review November 25, 2026 15:08

Met at 10599e0. Commit 0d2bc69 (fix(agc): use target HTILE bounds for clear flush and retirement) switched NoteDepthMetadataFill to the target-aware helper: both coverage checks there now call TargetHtileFillCovers (DepthSurface.cpp:4997 and :5034), and the plain HtileFillCovers is only called from inside TargetHtileFillCovers (:4956). cd945e6 adds a test for clear ordering with a non-pipe-aligned HTILE. This head has a PASS (HIGH, gate YES) filed after these commits.

@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 25, 2026
@JJenkx

JJenkx commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Two data points from 2026-11-26 (Linux 7.3.5, RX 6650 XT, RADV Mesa 26.2.7, Release):

AI-assisted: yes

Main's planeMappedUnder/htileUnmapped checks in NoteDepthMetadataFill
are kept with this branch's per-target TargetHtileBytes and
TargetHtileFillCovers; PlaneFault keeps both HtileTail and main's
UnmappedPartialStencilFill.

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

JJenkx commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (69d574e9a2cc) in 190f7f7740ec. It's mergeable again.

Conflicts, all in NoteDepthMetadataFill and the test enum:

  • Main's new planeMappedUnder/htileUnmapped checks are kept. This branch's per-target TargetHtileBytes(target) and TargetHtileFillCovers(target, …) replace the pipe-aligned HtileMetadataBytes(target.extent) and HtileFillCovers(…extent…) in those lines.
  • PlaneFault keeps both HtileTail (this PR) and main's UnmappedPartialStencilFill.
  • The merge brings in no new single-argument (pipe-aligned) HTILE sizing call. The ones in MultisampleTarget.cpp and the DepthSurfaceReuse tests were already on this branch.

Linux/RADV, RX 6650 XT, Mesa 26.3.1, Release, on the merged head:

  • ctest -V -R 'depth|htile|multisample|stencil' with the Khronos validation layer inserted (194 insertions): 151 pass, 0 skipped, with 0 VUID- and 0 SYNC-HAZARD.
  • New Joe & Mac (PPSA02801), 150 s, Cross every 15 s: 2/2 runs exit 0 (57.47 and 57.69 FPS over 100–140 s). Classic Modes menu at 60 s, first jungle stage with HUD at 140 s. Current main 69d574e9a2cc still aborts at 8 s with native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store (run from today).

AI-assisted: yes

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Target-specific HTILE sizing

Layer / File(s) Summary
HTILE sizing policy and tests
core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp, core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
HtileMetadataBytes and HtileFillCovers accept a pipe-alignment setting. New target-level helpers derive HTILE size and fill coverage from target extent, sample count, and pipe alignment. Tests check non-pipe-aligned metadata sizing and depth-slice strides.
Depth-surface range accounting
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp, core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
Depth-surface range checks, surface creation, and fallback slice sizing use target-specific HTILE byte counts. Execution tests cover writes beyond the metadata range and non-pipe-aligned sizing.
HTILE fill and clear handling
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp, core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
Clear matching, fill recognition, and expansion-state invalidation use target-specific HTILE size and coverage. Clear-supersession tests run with both pipe-alignment settings.

Suggested reviewers: birdmarty, chitters2004

Change: Bug fix

Merge Risk: Minimal · up to 190f7

This change sizes HTILE depth metadata for non-pipe-aligned targets by its own 256×256 blocks. That stops the importer from reading past the metadata into adjacent guest data. Pipe-aligned, single-sample and PS4 sizes keep their previous values. I found no remaining merge-blocking risk, and the change is covered by targeted tests.

Security architecture risk: Minimal · up to 190f7

The fix makes depth metadata checks, clears, and retirement use the target’s layout instead of treating neighboring guest data as part of the target. The reviewed change did not establish a new security risk.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected exposure is the emulator’s existing guest-memory and graphics-state path. The layout bit now changes how much memory is treated as HTILE, without adding a guest command or a memory operation to that path.

Trust Boundaries and Controls

  • observed — Native import still rejects unsupported layouts and overlapping depth, stencil, and metadata ranges. The metadata read is bounded by the same span checked for guest-memory accessibility and tracking; clear-value and generation checks remain in place before sampling guards are published.

Resilience and Maintainability Implications

  • observed — The fill transition uses the same whole-range predicate to select pending plane flushes and recognize a complete metadata fill. Partial overlapping fills still take the refusal path; complete fills retain the existing write-generation tracking.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Cppcheck (2.22.0)

Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

Cppcheck interrupted; analysis of this file is incomplete

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 996c819c-2b82-4a36-958b-f67a16ff1c13
Commits

Reviewing files that changed from the base of the PR and between f3392ac and 190f7f7.

Files selected for processing: 5

  • core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@MarcZX10 MarcZX10 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.

Reviewed — comments

The reviewed code supports the target specific HTILE sizing change, but approval is not justified because the full text of two changed test files was excluded from the review bundle and tests were not run.

What I ran

Inspected PR head 190f7f7740ec947d1e9c5b99861ba92cf825786d through repo_read.py; no tests or build commands were run.

Results

Check Result Note
Diff and source inspection passed Reviewed all changed hunks
Tests and build not run No local execution
Full changed test files not run Excluded from review bundle

Findings

Blocking

None verified.

Non-blocking

  • For a formal approval, review the full text of Graphics.cpp and NativeMultisampleDepth.cpp and run the focused checks for the new alignment and retirement cases.

Sources

Reviewed prepared description, commits, manifest, diff, and the included full text of DepthSurface.hpp, DepthSurface.cpp, and State.cpp. Also read the relevant changed ranges in Graphics.cpp and NativeMultisampleDepth.cpp; their full text was excluded because the files were too large for the review folder.

Not verified

The focused checks and build were not run. The full contents of the two excluded test files were not read.

To get this to a good state

Nothing is required. Optional: review the full excluded test files and run the focused checks before seeking approval.

@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 28, 2026
@JJenkx

JJenkx commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

Windows/AMD at this head (190f7f7740ec): 98 of 99 tests pass and 1 skips, 3/3 runs, on an RX 6700 XT. These are the CTests built from the changed test files. The previous AMD check above was at 10e7e09296.

The skip is agc_driver_native_depth_driver_queued_fill, and it is expected on Windows. Its only Windows skip path (read from the source; the run log hides output for passing and skipped tests) is skipped, host imports are compared here, not write-watched, and a queued fill's HTILE proof needs a write-watched import. Host imports are compared rather than write-watched on Windows, so the queued-fill case cannot run here. The rest of the native multisample depth cases, including agc_driver_native_depth_driver_path, pass.

Setup:

  • Windows 11 22621, Ryzen 9 5950X, MinGW-w64 GCC 15.2 UCRT r7, Release.
  • The exact PR head was built (not merged into main).
  • 3 runs through the shared FIFO.

AI-assisted: yes.

@JJenkx

JJenkx commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head recheck at 190f7f7740ec (Linux 7.3.6, RX 6650 XT, RADV Mesa 26.3.1, Release), with the Khronos validation layer inserted:

  • ctest -V -R 'native_depth|native_multisample|^agc_driver_graphics$|depth_fast_clear': 43 of 43 pass, 0 skipped, 0 VUID- and 0 SYNC-HAZARD lines. Current main fc294cbbb539 with the same selection also passes 43 of 43.

On the flush guard that no test pins (from the review above): I tried to write a test that fails with NoteDepthMetadataFill's pending-plane flush guard reverted. I found no test-level way to get pending storage units over the depth plane of a still-active sampled surface:

  • Creating a storage image over the imported plane removes the native depth surface (DepthSurfaceAt is false afterwards), so the fill has no surface to flush for. The HTILE clear then stores 0 of the image's bytes. A direct StorageTexture::FlushPending over the plane stores 32 KiB of them, so the store path itself works.
  • An image created before the import has its units inside the plane stored by the import, as CheckPendingUnitsBeyondPlanes asserts.

So the guard can be reached only in states these tests cannot build. Its condition now uses the same TargetHtileFillCovers as the clear-completion path next to it. I'm leaving it without a dedicated test rather than adding one that passes either way.

AI-assisted: yes

@B-Howell

B-Howell commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Windows test at head 190f7f7740ec: passes, control fails.

Setup: Windows 11 Pro, RTX 4080 SUPER (driver 621.14), WinLibs GCC 15.2.0, Release, Ninja. Head merged onto main ac7ee4bb72a3 (merges cleanly).

  • Built agc_driver_graphics_tests and agc_driver_native_multisample_depth_tests.
  • Ran with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (LunarG 1.4.363.1 layer, Insert instance layer "VK_LAYER_KHRONOS_validation" in the logs, no was not found line):
    • PR: 100 of 100 passed, 3 runs out of 3, including the new HtileTail case (other bytes after its 4 KiB metadata block: imported). 0 VUID-, 0 SYNC-HAZARD.
    • main: the same 100 tests passed, 3 runs out of 3. 0 VUID-, 0 SYNC-HAZARD. The PR adds no validation errors.
  • Control: production files from main do not compile with the new tests (HtileMetadataBytes and HtileFillCovers gained an argument), so I also ran the PR with only the non-pipe-aligned branch of HtileMetadataBytes disabled. agc_driver_graphics and agc_graphics_profile_draw then fail with HTILE that is not pipe-aligned is 4 KiB per 256x256 block, 3 runs out of 3. The native multisample depth tests still pass in that control, because they size the metadata through the same helper, so the tail and retirement cases do not catch a wrong size on their own.
  • tools/check_conventions.py --base origin/main passes. No code comments or title-specific values found.

Did not run New Joe & Mac or Curved Space.

@JJenkx

JJenkx commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Refresh against current main. This PR's head 190f7f7740ec, merged onto main b396d834cb05 with no conflicts (merge commit 800a3caf0fe0), still fixes New Joe & Mac (PPSA02801). Plain main still stops in the same place.

Setup: Arch Linux, RX 6650 XT, RADV Mesa 26.3.1, Release, complete app0 root, Cross pressed every 15 s from 30 s, 150 s runs. The game ran on a private Xvfb display with software present, so these FPS figures can't be compared with earlier desktop runs.

build result
main b396d834cb05 (2 runs: a survey and a fresh run) exit 134 at about 8 s: native multisample depth publication cannot re-import the guest's undecided byte
PR merged onto b396d834cb05, run 1 ran the full 150 s, closed normally at 145 s with exit 0; level 1 gameplay with Joe and the HUD at 140 s; mean 58.3 FPS over 100–140 s
PR merged onto b396d834cb05, run 2 same; mean 48.4 FPS

AI-assisted: yes

@Plyxen Plyxen 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.

I read the diff at 190f7f7740. Windows 11, GCC 15.2, merged into main at cf556db18c3 together with other open PRs (so not an isolated build), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation on an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).

  • the 101 tests of agc_driver_native_multisample_depth_tests and agc_driver_graphics_tests (one skips on both): pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has a VUID- or SYNC-HAZARD line.
  • Control (same tree and tests, the changed files of those PRs put back to main's): these don't compile without the new HtileMetadataBytes parameter, so the control only shows that.

Not checked: a title.

AI-assisted: yes (Claude Code)

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The trial merge onto a1b75b0947 was clean. I checked that slice addressing and metadata-clear coverage both use the compact HTILE footprint for qualifying multisample targets, while TargetHtileBytes preserves the old sizing for single-sample and GCN targets. The slice-2 decode control and the clear-ordering cases exercise different consequences of those changes. Paired graphics validation is pending.

AI-assisted: yes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* 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