Skip to content

fix(agc): publish and retire native depth owners under an initial multisampled colour import - #17956

Merged
oneandonlydean merged 9 commits into
boykopovar:mainfrom
hugodearaujo:fix/agc-colour-import-retires-depth-owner
Nov 24, 2026
Merged

oneandonlydean merged 9 commits into
boykopovar:mainfrom
hugodearaujo:fix/agc-colour-import-retires-depth-owner

Conversation

@hugodearaujo

@hugodearaujo hugodearaujo commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Assassin's Creed Mirage (PPSA13960) binds new 4-sample colour targets over the memory of 4-sample D32S8 depth owners without HTILE that it drew and that were then published and kept. With #17915, the next stop at the end of the prologue cinematic is:

AGC graphics: initial multisample color contents overlap resident native depth

Why it stops. Before a multisampled colour target's first draw, PrepareMultisampleTargetForDraw_nid_no_patch imports its initial contents from guest memory (#15986, #16086). Its preflight requireUnowned refuses when any active native depth guard overlaps the colour footprint. It doesn't publish or retire anything (#15986's non-mutating preflight). So a kept owner, published with no guest byte taken and kept by #15941, stops the import even though its samples are already in guest memory. A host-written owner stops it too.

In our runs the colour footprint covered the owner's depth plane (a 1720x968 x4 B10G11R11 target over a 1720x968 x4 owner) or part of its stencil plane (a 960x540 x4 R16F target over a 960x540 x4 owner's stencil plane).

The change (MultisampleTarget.cpp, the start of the import):

  • The check for another multisampled colour owner (initial multisample color contents overlap another native owner) runs first, on its own. If another colour target owns the bytes, the import still refuses there, before any depth owner is touched.
  • Next, the check that the footprint is mapped (initial multisample color contents are not fully mapped), moved up from after the publication. A footprint that runs into unmapped memory refuses before any depth owner is published or retired.
  • Then RequireNoResidentDepthRead_nid_no_patch(target.address, bytes, std::nullopt, true, DepthReadCause::Attachment) runs over the colour footprint. That publishes every host-written depth owner under the footprint and, since the cause is Attachment (fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915), retires every owner over it once it's published, kept or not. One call covers all of an owner's planes: each plane, HTILE included, has its own guard with the owner's shared state, and the footprint is tested against all of them.
  • requireUnowned then runs as before, at the same three points.

Why here, and why it's legal. The publication refuses while a multisampled colour target is being acquired (HoldsMultisampleTargetsLock()). At this point the targets lock isn't held: the import takes it only in a scoped block before, and again after the capture. The draw path (Draw.cpp) calls the import without it too. The publication takes the GPU mutex, which is recursive and already held by the draw, and the surface and depth guard locks, in the same order as the depth attachment's reads. No colour guard lock is held across it.

Why Attachment and not Reuse. Reuse retires only an owner whose publication took a guest byte, so a kept owner, the title's case, would stay active and the import would still stop. A colour target is a new owner of the same bytes, which is what Attachment means in #17915; two active owners of the same bytes can't coexist. For undecided bytes, both causes take the guest's byte, which #15941's debt entry already lists for "colour target" reuse.

What the import then reads. Its capture runs after the publication, through the read guard and FlushGpuWrites. So it holds the published samples, or the bytes a kept owner already published, or the results of storage writes still pending over a kept owner's plane. On the console the colour target reads whatever bytes are there; that this matches is inferred, not measured on a PS5.

What still refuses. Everything that refuses inside the publication, before the retirement: a written owner the publication can't handle (D16/D32-only, an unapplied clear, a sampling refusal), pending storage writes over a written owner's plane, and a resident colour alias over a plane. The owner then stays resident and no colour target is created. Publication inside a GPU completion, or with the targets lock held, can't be reached from this point.

Other effects.

Two existing expectations change accordingly:

The debt entries for the initial colour contents and for D32S8 guest publication say this.

Tested

Linux 7.2.14, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests; and lavapipe (LLVM 23.1.4) for the new and changed tests.

New test, agc_driver_native_depth_colour_import (--colour-over-owner), at 2, 4 and 8 samples:

  • The fixture. A D32S8 owner without HTILE (120x68) is imported over uniform planes and drawn (per-sample depth, stencil 0x40 + sample). Then an R32F colour target (R8 over the stencil plane) of the same extent, samples and XOR is prepared for its first draw.

  • What each passing mode checks:

    • no depth guard is left over the memory, the owner is inactive and a colour target exists;
    • guest memory equals a model of every step, byte for byte;
    • every sample of the colour target, read by a compute fetch, equals the guest bytes at its R_X layout offset;
    • the owner is released at the next depth creation.
  • The modes:

    • (0) a kept owner (published by a CPU read), colour over its depth plane;
    • (1) the same over its stencil plane;
    • (2) a host-written owner: the import publishes it first;
    • (3) a never-written owner;
    • (4) a held sampled view of the owner: not released, DepthSurfaceHolds refuses it, and the view still holds the owner's samples;
    • (5) a kept owner with storage writes pending over its plane: retired without a publication, and the colour target holds the storage results;
    • (6) a written owner with storage writes pending: refuses with native multisample depth publication over pending storage image writes is not implemented;
    • (7) another colour owner over the bytes: refuses with initial multisample color contents overlap another native owner, and the depth owner is untouched;
    • (8) a written D32 owner with HTILE: refuses with sample-preserving guest publication of native multisample depth is not implemented for this owner;
    • (9) a kept owner under a colour target twice its height, whose footprint past the owner's planes is unmapped: refuses with initial multisample color contents are not fully mapped.

    In 6-9 the owner stays resident, guest memory is unchanged and no colour target is created.

  • The harness. This mode creates the test's device the way main's sample-import modes do, with shaderStorageImageMultisample and shaderStorageImageWriteWithoutFormat, which the non-uniform upload needs (feat(agc): upload nonuniform initial multisample draw contents #16086). The mode skips without them, as in test(agc): skip the multisample target checks without formatless multisampled storage writes #17152.

Red on the base without the change (#17915's head + the tests only), each mode on its own (a local harness, not in this PR), on lavapipe, where every mode fails at its first sample count (4):

  • all nine modes fail. Modes 0-5 fail with AGC graphics: initial multisample color contents overlap resident native depth. Modes 6-8 fail because the base refuses with that message instead of the one the mode expects, for example multisample target refusal did not match initial multisample color contents overlap another native owner: AGC graphics: initial multisample color contents overlap resident native depth;
  • the two changed expectations fail too: --aliased-depth depth-only|stencil|no-stencil on the same mismatch, and --initial-uniform_refusals with initial color capture did not refuse a resident depth owner it cannot publish;
  • on RADV, the same 13 failures with the same messages, each at its first sample count (2).

Green with it. Lavapipe: the new test (18 cases), the four --aliased-depth/--aliased-stencil tests and the seven native_color_initial tests pass, 12 of 12. RADV: below.

Mutations (lavapipe):

  • Reuse instead of Attachment: modes 0, 1, 2, 4 and 5 fail with AGC graphics: initial multisample color contents overlap resident native depth. Mode 3 passes through the existing never-written rule, and 6-8 pass.
  • The publication before the colour-owner check: mode 7 fails with a colour import refused over another colour owner retired the depth owner.
  • The mapping check after the publication (the order before this PR's second commit), on RADV: mode 9 fails at 2 samples with a colour import refused over an unmapped tail retired the kept depth owner or imported; modes 0-8 pass.

Validation layer, paired, same machine (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V -R "native_color_initial|native_depth|native_multisample|depth_storage|depth_surface|agc_storage_|multisample_guest|repeat_storage_guard|cached_image|storage_flush_ordering|storage_one_slice|storage_read_during|storage_write_back|msaa_address_on_plane"):

Conventions. tools/check_conventions.py --base e7c3bfd130 passes on both (exit 0).

Runs by others.

  • Windows, by JJenkx (comment): this PR at c2f6018794 merged onto main 5c26d4f, a clean merge. Windows 11 Enterprise 22621, AMD Radeon RX 6700 XT (driver 32.0.21045.16010), WinLibs GCC 15.2 UCRT, Release. agc_driver_native_multisample_depth, agc_driver_sample_multisample_target, agc_driver_native_depth_other_identity, agc_driver_native_depth_overwritten_planes and agc_driver_native_depth_colour_import pass 3 of 3 each, none skipped.
  • NVIDIA, by Doorriiaann (comment): RTX 3070, driver 610.57.04, Debian 13 (kernel 6.12.115), GCC 13.3.0, Release, validation layer 1.4.335, with the ctest -V -R pattern above, 3 runs on each side.
  • RADV, by blawesom (comment): this PR at 839a783bf7, Linux, AMD Radeon RX 9070 XT (RADV, Mesa 26.2.5), GCC 16.2.1, Release, validation layer 1.4.363, ctest -R agc_driver. 1121 of 1122 pass; the one failure, agc_driver_tessellation (a segfault), is one they report on unmodified main too. No VUID- line, and check_conventions passes.
  • NVIDIA at the current head, by Doorriiaann (comment): RTX 3070, NVIDIA 610.57.04, Debian 13, GCC 13.3.0, Release, validation layer 1.4.335, b5e79ef455 against its merge base main 6db6a3e, 3 runs each, ctest -R '(native_color_initial|native_depth|native_multisample|depth_storage|depth_surface|^agc_storage_|sample_multisample_target)'. agc_driver_native_depth_colour_import and agc_driver_native_depth_other_identity pass 3 of 3, and the other 73 matching tests pass 219 of 219 on both sides. Every run selects the RTX 3070, the layer is inserted in every Vulkan test's log, and no log has a VUID- line.
  • My Friend Peppa Pig (PPSA03706), by vojenfr (comment): Linux, RTX 5070 Ti, NVIDIA 620.70.06, GCC 14.2, Release, main 1bdf1d5e46 with this PR at 839a783bf7 merged locally. main stops after about 90 s, at the first scene change after the intro, on native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store, and main + fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 alone stops at the same place (89 s). With this PR the title ran through at least four more scene changes, 179 s and 5,233 frames, to a clean exit.
  • Windows, NVIDIA and AMD, by Superseabas (review): b5e79ef455 merged onto main 11f95ea8f6 (with fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915), Windows 11 Home, WinLibs GCC 16.2.0, Release, validation layer, RTX 5070 Ti (621.01) and a Ryzen 7 7700X's integrated Radeon (Adrenalin 26.10.2). ^(agc_driver_native_depth.*|agc_driver_native_multisample.*|agc_driver_sample_multisample_target.*|agc_shader_memory.*)$: main 35 of 35, this PR 36 of 36 in 3 of 3 runs on both GPUs; the only skip is agc_driver_native_depth_driver_queued_fill on both sides; no VUID- line. Without the Attachment read before requireUnowned, agc_driver_native_depth_colour_import fails on the Radeon with the title's stop.

On current main. #17915 is merged, so the diff against main is now this change alone: MultisampleTarget.cpp, NativeMultisampleDepth.cpp, SampleMultisampleTarget.cpp, the test CMake file and the debt doc. DepthSurface.hpp and DepthSurface.cpp come from main unchanged. The head, c3ac3b0f62, merges main bfcd717 into b5e79ef455. The code and test lines are the same as in b5e79ef455's own diff over #17915. Git merged the debt doc without a conflict but kept two copies of the D32S8 publication entry, main's (#21719) and this change's. The merge keeps one, whose sentence now reads "Only a reuse taking a guest byte, a new depth or multisampled colour target or a guest write retires the owner." It builds, and the validation command with agc_storage_write_back_scratch left out gives 89 tests: 87 pass and the same 2 skip. On main bfcd717 the same command gives 88 tests: 86 pass and the same 2 skip. Neither log has a VUID- line or "was not found but was requested". check_conventions passes, with the debt-length warning that entry already has on main.

The title. Assassin's Creed Mirage (PPSA13960): title, New Game, Assassin, Full Synchronization Off, 720 s per run, interleaved, 5 runs per side.

Checklist

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

JJenkx commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Windows GPU check of head c2f6018794, merged onto main 5c26d4f13c (dc6c1355ff, clean merge). Run through the Windows FIFO, job 66fd84d002af425eb40a37dc91fb2e6b, exit 0 with cleanup verified.

Setup: Windows 11 Enterprise 22621, AMD Radeon RX 6700 XT (driver 32.0.21045.16010), WinLibs GCC 15.2 UCRT, Release, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1.

These five tests pass in 3 of 3 runs each, 15 of 15, none skipped:

  • agc_driver_native_multisample_depth
  • agc_driver_sample_multisample_target
  • agc_driver_native_depth_other_identity
  • agc_driver_native_depth_overwritten_planes
  • agc_driver_native_depth_colour_import

All test and .prx hashes matched the prepared build when the job started. With Vulkan hidden, all five report Skipped, so this run is the Windows coverage.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 10, 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 6995 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L1884-1886
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L1884-1886
PR 10492 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake L70
PR 10497 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake L70

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 4448 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 docs/dev/debt/libSceAgcDriver.md
PR 9915 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9950 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10359 docs/dev/debt/libSceAgcDriver.md
PR 10743 docs/dev/debt/libSceAgcDriver.md
PR 11551 docs/dev/debt/libSceAgcDriver.md
PR 11825 docs/dev/debt/libSceAgcDriver.md
PR 12792 docs/dev/debt/libSceAgcDriver.md
PR 12840 docs/dev/debt/libSceAgcDriver.md
PR 13589 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 14944 docs/dev/debt/libSceAgcDriver.md
PR 14964 docs/dev/debt/libSceAgcDriver.md
PR 15136 docs/dev/debt/libSceAgcDriver.md
PR 15621 docs/dev/debt/libSceAgcDriver.md
PR 15845 docs/dev/debt/libSceAgcDriver.md
PR 16260 docs/dev/debt/libSceAgcDriver.md
PR 19610 docs/dev/debt/libSceAgcDriver.md
PR 20084 docs/dev/debt/libSceAgcDriver.md
PR 21649 docs/dev/debt/libSceAgcDriver.md
PR 22062 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
docs/dev/debt/libSceAgcDriver.md
PR 22434 docs/dev/debt/libSceAgcDriver.md
PR 22647 docs/dev/debt/libSceAgcDriver.md
PR 23252 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
PR 24049 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp

@JJenkx

JJenkx commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Game-level data point on Windows from Asterix & Obelix Slap Them All! (PPSA08576). It stops on the native multisample depth publication Require that this PR changes.

Setup: RX 6700 XT, Windows 11 Enterprise 22621. Each run is a single 240 s boot through the shared FIFO, with scripted X presses. Only core/libs/libs was swapped into the same relinked run directory; app.exe, inputs and caches were the same for all three.

libs exit stops at message
main 017bd95f5f 0xc0000409 (abort) 13.9 s native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store
#15941 (d4583e9ccd merged onto that main) 0xc0000409 19.8 s same
#17956 (c2f6018794 merged onto that main) 0xc0000409 51.7 s same

With #17956, the window was still black at the 45 s screenshot, and the title bar read FPS: 59.94 (645). No Vulkan validation messages appeared in any run.

Limits:

Evidence is kept locally under evidence/PPSA08576/{main-017bd95f5f,cand-15941,cand-17956}.

AI-assisted: yes.

@JJenkx

JJenkx commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Follow-up on my Asterix (PPSA08576) data point. I ran one more boot with a local diagnostic build of this PR: c2f6018794 merged onto main 017bd95f5f, with a single fprintf added just before the Require(cause != DepthReadCause::Access, ...) in PublishToGuest. The access string comes from RequireNoMultisampleTarget. Nothing else changed.

It logged exactly one line, then aborted with the same message at 13.4 s:

access=a texture read read=0x220030000+0x220000 cause=0 (Access) plane=1 planeAddr=0x216468000 planeBytes=0x30000 offset=0x2f000 current=0 plane=0 result=15 extent=1920x1080 samples=2

What this shows:

  • The caller is a texture read (ShaderResources.cpp RequireNoMultisampleTarget(..., "a texture read")), which takes the default DepthReadCause::Access, so this PR's relaxation doesn't cover it.
  • The failing byte is in publication plane 1. That plane's 0x30000 bytes fit an HTILE allocation for 1920x1080 (0x1fa40 bytes of words, padded), not a 2-sample stencil plane.
  • The offset 0x2f000 is past the end of the HTILE words, so the byte is in the allocation padding. The guest wrote 0 there, the captured plane also held 0, and the expanded result had 15.
  • The texture read range 0x220030000+0x220000 doesn't overlap the plane at 0x216468000. The check is reached because publishing the owner publishes every plane, not just the one being read.

Correction to my earlier comment: this run stopped at 13.4 s, close to the 13.9 s main baseline. So the 51.7 s from the earlier single #17956 run was most likely run-to-run variance, not progress.

The diagnostic patch and logs are kept locally under evidence/PPSA08576/diag-17956. Main libraries were restored afterwards and checked byte-for-byte.

AI-assisted: yes.

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

@JJenkx Thanks for tracking it down to the call. As you found, that read is a texture read, which passes DepthReadCause::Access. Neither this PR nor #17915 changes Access, and main stops there too, so this is a separate issue.

I think the 15 comes from the HTILE expansion, not from the guest:

  • For 1920x1080, HtileMetadataBytes covers whole 1024x512 blocks, 2x3 of them, so 0x30000 bytes. That also holds words for tiles past the extent.
  • The publication runs expandedHtileWord over every word of that range.
  • A word the title never wrote stays 0 in guest memory and in the capture, but expands to 0xfffff00f (0xfffc000f with a depth-only HTILE). The first byte of either is 15.
  • The guest's 0 then differs from the result while matching the snapshot, so the byte is undecided, and an Access read throws.

The expansion should probably leave words of tiles outside the extent as the guest holds them. That belongs in its own fix on main's publication (#13021), not in this PR.

@Doorriiaann

Copy link
Copy Markdown
Contributor

An NVIDIA run, since the PR has AMD and lavapipe results only: RTX 3070 (8 GB), driver 610.57.04, Debian 13, kernel 6.12.115, GCC 13.3.0 Release, validation layer 1.4.335, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, the ctest -V -R pattern from Tested, 3 runs each.

merge-base df5829dca2 (main) this PR c2f6018794
tests 70, all passed 3/3 73, all passed 3/3 (the 70, agc_driver_native_depth_colour_import, and #17915's other_identity and #16363's overwritten_planes)
VUID- lines / layer not found 0 / 0 0 / 0
  • agc_driver_native_depth_colour_import passes all nine modes at 2, 4 and 8 samples here (27 cases), and the four aliased tests and the seven native_color_initial tests pass.

  • Negative control: this PR's NativeMultisampleDepth.cpp, SampleMultisampleTarget.cpp and the CMake file on 2b61bc285e (fix(agc): retire a published native depth owner when a depth target of another identity binds its planes #17915's head, without the change), 2 runs: the same five tests fail as in your list, with the same messages:

    • agc_driver_native_depth_colour_import: initial multisample color contents overlap resident native depth;
    • agc_driver_native_depth_aliased_depth_depth_only, _stencil and _no_stencil: multisample target refusal did not match initial multisample color contents overlap another native owner;
    • agc_driver_native_color_initial_uniform_refusals: initial color capture did not refuse a resident depth owner it cannot publish.

    agc_driver_native_depth_aliased_stencil and the other six native_color_initial tests pass there.

AI-assisted: yes

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

@JJenkx Thanks for the Windows run. I've added it to Tested. If you run it again, the other tests whose expectations this PR changes are the three agc_driver_native_depth_aliased_depth_* tests and agc_driver_native_color_initial_uniform_refusals.

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

@Doorriiaann Thanks for the NVIDIA run and the negative control. They match the RADV and lavapipe results: all nine modes pass at 2, 4 and 8 samples, and on #17915's head the same five tests fail with the same messages. I've added your run to Tested.

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

#16363 and #16365 are merged, so I merged main c548802 into this branch (365e1afd5d, no force-push), the same way as in #17915: in DepthSurface.cpp the merge keeps #16365's GuestHoldsSamples() and #15941's bool PublishToGuest(DepthReadCause cause);, and in the test files each test is kept once, unchanged from its side. Apart from where the --overwritten-planes case sits in main(), nothing differs from this branch's head that doesn't come from main.

With the validation layer, the same command as before (73 tests): 71 pass, agc_driver_native_depth_colour_import, agc_driver_native_depth_other_identity, agc_driver_native_color_initial_uniform_refusals and #16365's agc_driver_native_depth_single_sample_view among them, and the same 2 skip. The log has no VUID- line. check_conventions passes.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 10, 2026
@hugodearaujo

Copy link
Copy Markdown
Contributor Author

#16364 is merged, so I merged main 946133f into this branch (0bb255f8b0, no force-push), the same way as in #17915. The test files keep #16364's test and this PR's tests, each unchanged from its side. The debt entry keeps this PR's text with #16364's "pending storage units over a plane", shortened the same way to stay within 1000 characters (it has 999). That entry is the only line that differs from this branch's head without coming from main.

With the validation layer, the same command as before (74 tests): 72 pass, agc_driver_native_depth_colour_import, agc_driver_native_depth_other_identity and #16364's agc_driver_native_depth_pending_units among them, and the same 2 skip. The log has no VUID- line. As in #17915, I ran it on the merge before shortening the entry; the pushed commit differs only in that line. check_conventions passes.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 10, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 10, 2026
@hugodearaujo

Copy link
Copy Markdown
Contributor Author

#15941 merged main with #16301 (7ce55ad00e), so I merged that head and then main 3339e01 into this branch (839a783bf7, no force-push), the same way as in #17915. The --publication handler keeps #16301's colour-alias loop, then this PR's reuse line. The native D32S8 debt entry has #15941's exact wording with this PR's sentence, "Only a reuse taking a guest byte or a new depth or multisampled colour target retires the owner.", and #16301's new colour-alias entry follows it. The entry has 1012 characters, so check_conventions warns about its length, as it does for #15941's 1010.

Against #15941's head, the merge changes only this PR's files, with the same lines as this PR's own commits, apart from that entry's wording.

With the validation layer, the same command as before (75 tests): 73 pass, agc_driver_native_depth_colour_import, agc_driver_native_depth_other_identity and agc_driver_native_depth_publication with #16301's alias cases among them, and the same 2 skip. The log has no VUID- line. check_conventions passes with that one warning.

… into fix/agc-colour-import-retires-depth-owner
…fore publishing the depth owners under it

The import published and retired every native depth owner under the colour footprint and only then checked that the footprint is mapped, so a footprint running into unmapped memory retired a kept owner and still refused. The mapping check now runs first; the new case covers a footprint whose tail past a kept owner is unmapped.
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 19, 2026
@hugodearaujo

Copy link
Copy Markdown
Contributor Author

Merged #17915's head b0beb53d75 (which merges main 6db6a3e), and added b5e79ef for @MarcZX10's finding. The initial colour import now checks that the footprint is mapped before it publishes or retires any depth owner under it.

  • The new mode 9 of agc_driver_native_depth_colour_import covers a footprint whose tail past a kept owner is unmapped. It fails with the old order (a colour import refused over an unmapped tail retired the kept depth owner or imported) and passes with the new one.
  • The capture compare stays after the publication, since the snapshot has to read the samples the publication just wrote.
  • On the RX 9070 XT with the validation layer, the focused depth set gives 85 tests, all passing except the same 2 skips as on main, with no VUID- line.

@vojenfr thanks for the PPSA03706 run and the backtrace. They're in the description, and the title is in Unblocks. @malekaifa thanks for the PPSA09806 report; a run of this head would show whether it gets past that refusal there too.

@Doorriiaann

Copy link
Copy Markdown
Contributor

NVIDIA run of the new head b5e79ef: the two new native depth tests pass and nothing in the selection regresses.

Setup: RTX 3070 8 GB, NVIDIA 610.57.04, Ryzen 5 5600X, Debian 13 (kernel 6.12.115), GCC 13.3.0 Release, validation layer 1.4.335. Base is the merge-base 6db6a3e, head is b5e79ef. ANYPS5_GPU=NVIDIA ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest -R '(native_color_initial|native_depth|native_multisample|depth_storage|depth_surface|^agc_storage_|sample_multisample_target)' -V, 3 runs each.

base this PR
agc_driver_native_depth_colour_import, agc_driver_native_depth_other_identity (new) 3/3 pass
the other 73 matching tests (agc_driver_native_*, agc_storage_*, depth storage and surface, agc_driver_sample_multisample_target) 219/219 pass 219/219 pass

Every run selects the RTX 3070; every Vulkan test's log shows the layer inserted, none reports it missing, and no log has a VUID- line.

AI-assisted: yes

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

@Doorriiaann thanks for the RTX 3070 run of the new head. It's in the description under Runs by others.

@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 19, 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

Reviewed head b5e79ef455f9f624df7bc385bac268a4c27354a5 using the pinned repo_read.py reader. I did not run build or test commands; this review environment provides read-only access.

Results

Check Result Note
Changed-file review passed All seven changed files were read.
Build and tests not run Results in the PR description are author-reported.
Negative control not run The PR description reports base and mutation failures.

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not independently reproduce the reported tests, mutation checks, or console behavior. All seven changed files listed in the manifest were included and read; no changed files were listed as excluded. The review-folder listing did not provide files.json.

To get this to a good state

Nothing is required.

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

Windows check of head b5e79ef455 with GCC 16 on an NVIDIA and an AMD GPU, merged onto main 11f95ea8f6, which now includes #17915 (clean merge). The Windows runs listed so far are an RX 6700 XT on an older head; this adds NVIDIA on Windows and the current head.

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). This was built together with #21763, which touches other files.

  • ^(agc_driver_native_depth.*|agc_driver_native_multisample.*|agc_driver_sample_multisample_target.*|agc_shader_memory.*)$: main 35 of 35, and with this PR 36 of 36 in 3 of 3 runs, on both GPUs. The new one is agc_driver_native_depth_colour_import. The only skip, on both sides, is agc_driver_native_depth_driver_queued_fill, which skips on Windows by design. No VUID- lines.
  • Red check: without the new RequireNoResidentDepthRead_nid_no_patch(…, DepthReadCause::Attachment) call before requireUnowned, agc_driver_native_depth_colour_import fails on the Radeon with the title's stop, AGC graphics: initial multisample color contents overlap resident native depth.

The reordering reads right to me. Another colour owner still refuses first, and an unmapped footprint now refuses before any depth owner is published or retired. The publication runs where the targets lock isn't held.

AI-assisted: yes (Claude Code)

@malekaifa malekaifa 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 exact head b5e79ef455f9f624df7bc385bac268a4c27354a5. The production change distinguishes attachment-driven depth publication from ordinary access/reuse, publishes and retires overlapping native depth before initial multisample colour capture, and checks the colour footprint is fully guest-mapped before publication. The added regressions cover another identity and colour-over-owner ordering. Exact-head Windows validation from Superseabas passed the focused depth selection on NVIDIA and AMD with validation enabled; MarcZX10 found no blocking source issue. I have not rerun the requested PPSA09806 title on this exact head, so that title-specific confirmation remains unverified rather than a blocker. AI-assisted: yes

@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 23, 2026
@malekaifa

Copy link
Copy Markdown
Contributor

@hugodearaujo Current head b5e79ef455f9 now reports mergeable=false / mergeable_state=dirty against current main. The exact-head source review and Windows NVIDIA/AMD validation remain useful, but GitHub cannot integrate this head as-is. Please rebase/resolve the current-main conflict while preserving the reviewed seven-file patch, then let hosted checks rerun naturally. I will compare the post-rebase changed-file blobs against b5e79ef455f9 so we can retain prior review/test evidence where the patch is unchanged. AI-assisted: yes

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

@malekaifa merged main bfcd717 (head c3ac3b0f62). #17915 is in main now, so the diff against main has five files instead of seven: DepthSurface.hpp and DepthSurface.cpp were #17915's and now come from main unchanged.

The lines in the other five files match b5e79ef455's own diff over #17915, except for one debt sentence. Git merged docs/dev/debt/libSceAgcDriver.md without a conflict but kept two copies of the D32S8 publication entry: main's from #21719 and this PR's. The merge keeps a single entry that covers both: "Only a reuse taking a guest byte, a new depth or multisampled colour target or a guest write retires the owner."

On the RX 9070 XT with the validation layer, the focused depth set gives 89 tests, all passing except the 2 skips main has too, with no VUID- line.

@Superseabas thanks for the Windows runs on both GPUs and for the red check. They're in the description.

@github-actions github-actions Bot added review queue Next in the maintainer review queue: checks pass, no open change request, no conflict and removed needs rebase Conflicts with main, rebase needed labels Nov 23, 2026

@malekaifa malekaifa 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-reviewed exact head c3ac3b0f62842c19e3fcb6c8bb141b1d993a2869 after the current-main merge. git range-diff shows the two still-relevant branch commits (67cb2b1877a0, b5e79ef455f9) unchanged; the removed old commit is now upstream via #17915. The PR delta correspondingly shrank from seven files to five. The merge-resolved debt entry preserves the reviewed publication/retirement wording without the duplicate main entry, and git diff --check is clean. Hosted Windows/conventions/eligibility/report/portability/PR/labels checks are green, and the author reports the focused RX 9070 XT depth set at 89 tests with only the same two skips as main and 0 VUIDs. No new blocker found. AI-assisted: yes

@oneandonlydean
oneandonlydean merged commit e6e2952 into boykopovar:main Nov 24, 2026
14 of 16 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 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants