fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15941"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-11-05T01:51:54Z.
What
Since #9533, a multisampled D32S8 target whose stencil has its own plane and whose HTILE is depth-only is imported as a native target. #9533 was merged together with #9717, in
a4b76b2c0a.Four titles that ran before that merge stop on
main. JJenkx bisected each one toa4b76b2c0a: Curved Space (PPSA02817, #8691), NINJA GAIDEN: Ragebound (PPSA28002, #8671), Blue Prince (PPSA25009) and New Joe & Mac: Caveman Ninja (PPSA02801, #9091). Onmainthey stop with:What reaches the publication. JJenkx traced it in all four (#8671). Each title reuses the memory of a host-written native target for something new:
Why it stops. Building the new resource publishes the old target's planes to the guest (#13021).
a native multisample depth attachment over the planes of a host-written owner of another identity is not implemented.The change:
DepthReadCause::Access, the default, orDepthReadCause::Reuse.Reusemarks resources built over the memory:Draw.cpp's vertex and index buffer reads; the two storage-image accesses inShaderResources.cpp, which also cover the colour-target lookup fromrefreshResidentTarget; and a new depth surface's three planes.Access: CPU reads, DMA copies, texture reads, shader buffer accesses, dispatch-written ranges and the native sampling path.mainrefuses an undecided byte, aReusepublication takes the guest's byte. Every byte the publication can decide is decided as before:Reusepublication that took a guest byte, undecided or stored, retires the old owner: its guards are removed and it is marked inactive. The publication leaves it no longer host-written, soreleaseRetiredretires and frees it at the next depth-surface creation (#15300).Reusepublication that took no guest byte keeps the owner, as anAccesspublication does. A new depth attachment of another identity over a kept owner still meets the second refusal, as onmain.Why the guest's byte. Before #9533 these targets were not native, so a resource built over their memory read the guest's bytes everywhere.
mainis, sincemainstops. It keeps the host's bytes everywhere the publication can decide them.What isn't proven. The untouched bytes on a page the title wrote are inferred, not proven. The write tracking can't tell a byte the title never touched from one it stored with the same value.
Tested
Linux, on a cloud machine: Ubuntu 24.04, GCC 13.3, CI's configure flags, lavapipe (Mesa 25.2.8, LLVM 20.1.2). The tests ran as an unprivileged user with
ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx.New cases in
agc_driver_native_depth_publication(CheckReusePublication):The fixture: a 4-sample D32S8 target with a separate stencil plane and a depth-only HTILE. The host draws depth and stencil, then one CPU store leaves the rest of the stencil plane's first page undecided.
Red on
mainacf7ac208a, green here. Onmainall four fail with the refusal above.The checks: the guest's bytes on the undecided page, the host's bytes elsewhere in the plane, every depth sample, and the old owner retired. A rebind of its identity takes a fresh import. In (3) the new surface imports.
The same on both:
For the review (
9452ca6e35): (9) a vertex buffer read markedReuse, with nothing undecided and no guest store, publishes the host's bytes and keeps the owner: a rebind keeps its view and serial, and a sampled read samples it. It fails on 091068b618's code (below).The existing tests, 49 in all: the native depth, write-tracking, guest memory and multisample tests (
ctest -R 'native_depth|native_multisample|depth_publication|write_track|guest_memory|multisample' --repeat until-fail:3).mainand here: 47 pass and 2 skip, ×3. The skips areagc_driver_multisample_centered_linesandagc_driver_native_depth_bda_clear, which skip themselves on lavapipe.Mutations:
Reusefails (4)-(8).d4583e9ccd, withReusenever retiring (replacedforced to false),agc_driver_native_depth_publicationfails on GitHub's Linux runner withguest writes over native multisample depth are not implemented(run).Checks:
tools/check_test_registration.py buildandtools/check_conventions.py --base origin/mainpass.The red/green is from the cloud run (lavapipe, CI flags). The GitHub ×10 runs the branch only, because
mainlacksDepthReadCause. Case (9)'s red and green are on GitHub's runners, against091068b618(below).On today's
main: the four commits were rebased onto9ab6a281eawith the same lines. GitHub's runners, ×10 on that tree (run), the same tests: on Linux, 52 tests, 50 pass and 2 skip; on Windows, 53 tests, 8 pass and 45 skip. The libc and libkernel suites pass on both.With #15300, #15301 and #15855: the branch merged with
main9f35c937daand #15855 (since merged), the same tests, ×10 on GitHub's runners (run): on Linux, 52 tests, 50 pass and 2 skip; on Windows, 53 tests, 8 pass and 45 skip. The libc and libkernel suites pass on both.Merged with
main0747011f67, asa3600e57f7(run). The one conflict was inNativeMultisampleDepth.cpp, where #15446 (merged) addsCheckStoredRepeatFillat the place this PR addsCheckReusePublication. The merge keeps both, #15446's first, and this PR's own lines are unchanged. The same tests, ×10 on GitHub's runners: on Linux, 53 tests, 51 pass and 2 skip, withagc_driver_native_depth_publicationand #15446's newagc_driver_native_depth_stored_repeat_fillamong the passes; on Windows, 54 tests, 8 pass and 46 skip. The libc and libkernel suites pass on both.9ab6a281eaabove, and the runs that say "this head", are on7d377e40ba, the head before these merges. Their results still apply, sincea3600e57f7andab7598d803add onlymainto it, with the conflicts resolved as described.Merged with
main9e47f0c3ac, asab7598d803(run). The one conflict was inDraw.cpp, where #14051 (merged) movedprepareDraw's index-bufferRequireNoMultisampleTargetcheck into the record-time stage. The merge takes #14051's move and puts this PR'sDepthReadCause::Reuseon the moved line. This PR's other lines are unchanged. Thatmainalso has #14084 (merged), which changesDepthSurface.cppandNativeMultisampleDepth.cppand merged without a conflict.agc_driver_native_depth_initial_owneramong the passes; on Windows, 56 tests, 9 pass and 47 skip. The libc and libkernel suites pass on both.agctest, once, on both runners (run), since the merge moved one of this PR's lines. On Windows, 1,456 tests: 426 pass and 1,030 skip. On Linux, 1,417 tests: 1,328 pass, 88 skip and 1 fails,agc_driver_pipeline_journal, at the 120 s timeout (120.06 s).main's own tree on 11-06 (run).Merged with
maindd7c8de5de, ase2ab111fbf(run). The one conflict was inNativeMultisampleDepth.cpp, wheremain(#15443 and #15750) adds a blank line at the place this PR addsCheckReusePublication. The merge keeps this PR's lines, which are unchanged. The same tests, ×10 on GitHub's runners: on Linux, 57 tests, 55 pass and 2 skip; on Windows, 58 tests, 9 pass and 49 skip. The libc and libkernel suites pass on both.For oneandonlydean's and Superseabas's review (review, Superseabas's run), three commits on that merge:
091068b618drops the pass that retired a reused owner at once. The guard loop already marks it inactive and the publication leaves it no longer host-written, soreleaseRetiredretires and frees it at the next depth-surface creation. Every owner lookup checksactive, and a native multisampled owner has no stale planes forretireto clear:MarkAllStaleruns only formirrorabletargets, which have one sample. Alone, ×3 on GitHub's runners (run), the 21native_depthtests: on Linux, 20 pass and 1 skips (agc_driver_native_depth_bda_clear); on Windows, all 21 skip.9452ca6e35retires an owner onReuseonly when its publication took a guest byte, undecided or stored:PublishToGuestreturns whether it did, andRequireNoResidentDepthRead_nid_no_patchmarks only those owners inactive. It adds case (9).d4583e9ccdsays so in the debt entry.native_depth|write_track|guest_memory|multisamplewithagc_driver_graphics: with 091068b618's implementation,agc_driver_native_depth_publicationfails on Linux at case (9), witha depth read of a host-written native owner retired or re-imported it. With the fix, on Linux, 58 tests, 56 pass and 2 skip; on Windows, 59 tests, 10 pass and 49 skip, since the runner has no Vulkan device. The libc and libkernel suites pass on both.Merged with
main356bf9296b, as05cb62a9a6(run). The conflicts were two, both inDepthSurface.cpp, with #16363 (merged): it addsProveOverwrite()beforePublishToGuest's declaration, andproveOverwrittenPlanes()with a first line inRequireNoResidentDepthRead_nid_no_patch. The merge keeps both, with this PR's signatures, and this PR's own lines are unchanged.agc_driver_native_depth_overwritten_planes, ×10 on GitHub's runners: on Linux, 62 tests, 60 pass and 2 skip; on Windows, 65 tests, 12 pass and 53 skip. The suites: libc and libkernel run 350 and 349 tests on Linux with 0 failed, and 380 and 376 on Windows, where only the verify harness'sguest_kernel_resident_fmem_exportandguest_kernel_resident_fmem_export_patchedfail.main: each of cases (0) to (3) alone, withmain356bf9296b's implementation and this PR's test (its threeDepthReadCause::Reusearguments dropped, sincemain's call sites pass none), failsagc_driver_native_depth_publicationon GitHub's Linux runner with the refusal above (0, 1, 2, 3). The Windows runner skips it. The green is the ×10 above.agctest, once, on both runners (run). On Windows, 1,568 tests: 473 pass and 1,095 skip. On Linux, 1,525 tests: 1,431 pass, 93 skip and 1 fails,agc_driver_frame_replay_rewind_copy, withno memory delta was read while 1 submissions waited for the CPU. It is intermittent onmaintoo. Repeating the frame-replay tests until a failure, up to 20 times, on GitHub's Linux runner, it failed with the same line on the 3rd run on this merge (run) and on the 4th on an unchanged copy ofmain356bf9296b(run). The other 40 frame-replay tests passed every run on both, and this PR doesn't touch frame replay.Merged with
maineb3839d4f3, as84d53ab953(run). The conflicts were two. InDepthSurface.cpp, #16365 (merged) addsGuestHoldsSamples()beforePublishToGuest's declaration, and the merge keeps it with this PR'sbool PublishToGuest(DepthReadCause cause). In the debt file, #16364 (merged) changes the publication entry's "pending storage-image writes" to "pending storage-image units over a plane". The merge keeps this PR's entry, with its "a kept plane holding the host's bytes" shortened to "a kept plane of host bytes", but writes #16364's change as "pending storage writes over a plane". oneandonlydean's docs commit392f9f30d4, on top of the merge, restoresmain's "pending storage-image units over a plane" in the entry. This PR's own code and test lines are unchanged. #16375 (merged) also changesDepthSurface.cppand merges clean, andmainadds no call toPublishToGuestorRequireNoResidentDepthRead_nid_no_patch.agc_driver_native_depth_single_sample_view, #16364'sagc_driver_native_depth_pending_unitsand #16375'sagc_driver_raw_pointer_store_pending_inlineandagc_driver_raw_pointer_store_pending_items, ×10 on GitHub's runners: on Linux, 66 tests, 64 pass and 2 skip; on Windows, 69 tests, 12 pass and 57 skip. The suites: libc and libkernel run 351 and 349 tests on Linux with 0 failed, and 381 and 376 on Windows, where only the verify harness'sguest_kernel_resident_fmem_exportandguest_kernel_resident_fmem_export_patchedfail.Merged with
main78ad708701, as7ce55ad00e(run). The conflicts were three, all with #16301 (merged), which publishes over a colour alias its owner took in and retires that alias after the planes commit. InDepthSurface.cpp, the merge keeps #16301's twoRetireMultisampleColorTargetcalls at the end ofPublishToGuest, before this PR'sreturnof whether the publication took a guest byte. InNativeMultisampleDepth.cpp, it keeps #16301's alias cases and this PR's reuse cases. In the debt file, this PR's publication entry takes #16301's one-word change ("other resident colour aliases") and keeps oneandonlydean's "units" fix from392f9f30d4, and #16301's new entry follows it unchanged. This PR's own code and test lines are unchanged. #16301's cases publish through CPU reads, whose cause staysAccess, so this PR doesn't change what they check. #16116 (merged) also changesDepthSurface.cppand merges clean.agc_driver_native_depth_publication: on Linux, 66 tests, 64 pass and 2 skip (agc_driver_multisample_centered_linesandagc_driver_native_depth_bda_clear, as before); on Windows, 69 tests, 12 pass and 57 skip. The suites: libc and libkernel run 354 and 349 tests on Linux with 0 failed, and 384 and 376 on Windows, where only the verify harness'sguest_kernel_resident_fmem_exportandguest_kernel_resident_fmem_export_patchedfail.agctest, once (run): Linux: 1,531 run, 1,438 pass, 93 skip, 0 fail. Windows: 1,574 run, 474 pass, 1,100 skip, 0 fail.Merged with
main0f4538fa02, as58f6485059(×10). The conflicts were three. InDepthSurface.cpp, hugodearaujo's #17890 (merged) addsPublishedUnderStorage()beforePublishToGuest's declaration, and the merge keeps it with this PR'sbool PublishToGuest(DepthReadCause cause). InShaderResources.cpp, Sam-mon7's #15059 (merged) sizes the two storage-image accesses withSurfaceGuestBytes(viewed)in place ofDescribeSurface(viewed).guestBytes, and the merge keeps that line, with this PR'sDepthReadCause::Reuseargument on the line after it. This PR's own lines are unchanged.agc_driver_native_depth_overwritten_publishedand theagc_shader_memorytests, ×10 on GitHub's runners: on Linux, 70 tests, 68 pass and 2 skip; on Windows, 76 tests, 18 pass and 58 skip (no Vulkan device). #17890's new case callsRequireNoMultisampleTargetwithout a cause, so it takes this PR's defaultAccess.guest_freebsd_clocksaborted on Linux after 0.10 s, andguest_timed_wait_cpuexceeded its overshoot limits on Windows (sceKernelUsleep(100 us)'s P99 overshoot at 6,880, 5,211 and 4,399 µs, against a limit of 2,900 µs). This PR changes no libkernel file. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners._putenv_stest fix (#19899) on top, becausemain's Windows test build breaks without it ("'setenv' was not declared" inUploadCacheReadOnlyFlush.cpp, from #18037); it isn't on this branch.58f6485059(job) has one failure among 4,581 tests:agc_graphics_profile_draw, at 30.17 s, onDepthSurfaceReuse.cpp:743's Require ("a partially resident depth plane with an unmapped page must be refused"), on an AMD EPYC 7763 host. That is the redmain's Windows job has had since 14 Nov (for example job 132502166258 onmain3e63c9f68f, also an EPYC 7763, whereagc_driver_graphicsfails on the same Require). oneandonlydean's #20134, merged as06b90cc1af, invalidates the guest page cache in those depth fixtures for it. This PR doesn't changeDepthSurfaceReuse.cpp.Merged with
main769d303b59, as416bc9ad90(×10). The one conflict was in the debt file's publication entry, where arthur-paraibano's #19846 (merged) changes "D16/D32-only owners" to "D16 and HTILE D32 owners". The merge keeps this PR's entry with #19846's change. This PR's own code and test lines are unchanged.agc_driver_multisample_centered_linesandagc_driver_native_depth_bda_clear), withagc_driver_native_depth_publication, which runs this PR's reuse cases, passing 10 of 10; on Windows, 78 tests, 18 pass and 60 skip (no Vulkan device).guest_thermal_sensorsreached its 20 s timeout. This PR changes no libkernel file, and the same test passed in the suites of #7395's merge withmain328cbf673e(run), whose thermal sensor code is the same as769d303b59's. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners._putenv_stest fix on top; it isn't on this branch.Merged with
mainbb95654123, asc71026cc1f(×10). The one conflict was inprepareDrawInputs's vertex range loop inDraw.cpp, where talha-devp's #20368 (merged) adds two arguments to theInPlaceDrawInputcall on the line after this PR'sRequireNoMultisampleTarget(begin, bytes, "a vertex buffer read", DepthReadCause::Reuse). The merge keeps both lines as each side has them: this PR's check, then #20368's call. This PR's own code and test lines are unchanged.agc_draw_inputtests, ×10 on GitHub's runners: on Linux, 78 tests, 73 pass and 5 skip (agc_driver_multisample_centered_linesandagc_driver_native_depth_bda_clear, andagc_draw_input_mirrors,agc_draw_input_mirrors_offandagc_draw_input_reuse, which skip without/dev/udmabuf), withagc_driver_native_depth_publicationand #20368's changedagc_draw_inputs_copiedandagc_draw_inputs_in_place_driverpassing 10 of 10; on Windows, 84 tests, 19 pass and 65 skip (no Vulkan device).APS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners._putenv_stest fix on top; it isn't on this branch.Windows with the validation layer, run by Superseabas (comment):
ab7598d803merged ontomainef9ab2ea44(clean), WinLibs GCC 16.2.0, Release,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, on an NVIDIA GeForce RTX 5070 Ti (driver 621.01) and the Ryzen 7 7700X's integrated AMD Radeon (driver 26.10.2). The full^agcsuite, 1,474 tests, gives 1,473 passes on each GPU with and without this PR; the one failure on each is the same onmain(agc_driver_quad_pixel_maskon the RTX, #14341, andagc_driver_sample_order_grid_referenceon the Radeon, #9503). NoVUID-lines.agc_driver_native_depth_publicationpasses on both GPUs.The same machines on
d4583e9ccd, run by Superseabas, who approved (review): merged ontomain6541a1f0fc(clean), with the same setup and GPUs, since GitHub's Windows runner skips these tests.^agcsuite, 1,527 tests: 1,526 pass on each GPU with and without this PR. The one failure on each is the same as above, and there are noVUID-or missing-layer lines.agc_driver_native_depth_publicationpasses 3 of 3 on each GPU, and the 24agc_driver_native_depth_tests pass on both, with_driver_queued_fillskipping.DecidedVertexRead, aReuseread with nothing undecided, keeps the owner on both GPUs: the rebind returns the same view with no new surface, and sampling works.Reuseretires every ever-written owner, failsDecidedVertexRead; withReusenever retiring, the test fails withguest writes over native multisample depth are not implemented.7ce55ad00eon Linux and Windows, run by milescoviello (comment):agc_driver_native_multisample_depth, the fixture's default mode, passed 3 of 3 on this head and on its merge base78ad708701, on Linux (Ubuntu 26.04.1, NVIDIA GeForce RTX 4070 Ti, driver 615.71.09, GCC 15.2, Release) and on a Windows 11 VM (NVIDIA GeForce GT 1030, driver 582.78, WinLibs GCC 15.2 UCRT, Release). That mode doesn't run the publication cases, so this PR's reuse cases aren't among them.Windows with the validation layer, run by magnub (comment):
7ce55ad00emerged intomainc7ac238e7cas CI merges it (98585ec586), against thatmain, withtools/vulkan_validation_gate.py, on an NVIDIA GeForce RTX 4090 (driver 621.14), Windows 11 Home 26100, WinLibs GCC 15.2.0 r7, Release,VK_LAYER_KHRONOS_validation1.4.363.agc_driver_native_depth_*tests ofagc_driver_native_multisample_depth_tests,agc_driver_native_depth_publication's reuse cases included, 3 runs per build: all 150 runs pass, the loader inserts the layer in every run, and neither side has aVUID-,SYNC-HAZARDorUNASSIGNED-message.agc_driver_native_depth_driver_queued_fillis left out, since it skips on Windows.Linux with the validation layer, run by domx4q (comment): this head
c71026cc1fmerged ontomainf0c01bc69d(clean), against thatmain, on an NVIDIA GeForce RTX 4090 (driver 620.70.06, Vulkan 1.4.357), Arch Linux (kernel 7.3.4), GCC 16.2.1, Release,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation1.4.363.1, with the tests matchingnative_depth|native_multisample|depth_publication|write_track|guest_memory|multisample.mainand with this PR, none skips, and every test selected the RTX 4090.agc_driver_native_depth_publication, which runs this PR's reuse cases, passes, as doagc_driver_native_depth_publication_without_htileandagc_driver_native_multisample_depth.VUID-line. Apart from addresses, the two logs print the same lines.Windows 11 Pro (10.0.26200), NVIDIA GeForce RTX 5080 (driver 610.88) and the Ryzen 7 9800X3D's integrated AMD Radeon Graphics (driver 2026.04.17), run by Lyrnc (comment): this head
c71026cc1fmerged ontomain6286d36449(clean), WinLibs GCC 15.2.0, Ninja, Release,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, the GPU picked withANYPS5_GPU, no validation layer.native_depth|native_multisample_depth,agc_driver_native_depth_publicationamong them: 31 of 31 pass in each of 3 runs on each GPU.^agc_|^shader|^video_out|^guest_videoon the RTX 5080, 2,081 tests: 2 fail, and they report both failing onmainon that card too:agc_driver_stencil_plane_memory(#22427, with #22508 open for it) andagc_driver_msaa_dcc_unwatch(#22931, with #22950 open for it).GitHub's Linux and Windows runners, ×10, on
acf7ac208a(run). The tests matchingnative_depth|write_track|guest_memory|multisample:agc_driver_native_depth_publicationpassed 10 of 10.agc_write_trackingtests and threeguest_memorytests run and pass.Validation layers (CONTRIBUTING's AGC rule; run).
VK_LAYER_KHRONOS_validationran on GitHub's Linux runner, withmain's tree and this branch each running the 35 tests matchingnative_depth|multisample.VUID-VkDeviceCreateInfo-pNext-pNext, onmainand here. This change adds none.The titles, run by JJenkx on this head merged onto
mainc4469b60da: Linux 7.2.11, AMD Radeon RX 6650 XT (RADV, Mesa 26.2.6), Release,APS5_PLAYGO_UNLISTED_CHUNKS=installed, 125 s with Cross every 15 s from 30 s. On thatmaineach title stops with the refusal above. With this PR each one gets past it and runs to the scheduled close, exit 0:main. Here it runs 122 s, and the story intro plays at 60 s.main. Here it runs 121 s, and the "Keep Going?" campaign screen is rendered at 60 s.main. Here it runs 123 s, and at 60 s the "Classic Modes" menu, opened with Cross, is shown.AMD Radeon RX 570 (RADV POLARIS10, GFX8), run by ryanc2112 (comment): this head merged onto
main7ad9749ed0, Mesa 26.2.5, Release, withVK_LAYER_KHRONOS_validation.agc_driver_native_depth_*tests, 3 runs each: on GFX8, 11 of them fail onmain,agc_driver_native_depth_publicationamong them, because the sample shadow lacks depth-attachment usage; #15750 fixes that. This PR alone gives the same 6 passes and 11 failures asmain. With #15750, all 17 pass onmain, and with this PR added all 17 still pass, the newCheckReusePublicationcases included. None of these runs reports aVUID-error.main, once each: the same results asmain, with 1,313 passing, the same 14 failing and 40 skipped, and the same 26pAttachments-00605validation errors on both sides (#11990). The 14 failures are known GFX8 or driver issues: the 11 above (#15750),agc_driver_f32_fma_denormal_mode2(#15316),agc_driver_tessellation(#5444) andagc_driver_sample_order_recipe_depth_locations(#9759).The same GPU on
d4583e9ccd, run by ryanc2112 (comment): merged ontomain0dd2fffe35(clean), which has #15750 and #15688's two- and three-plane D32S8 layout, SteamOS 3.8.28, GCC 16.2.1, Release, withVK_LAYER_KHRONOS_validationloaded.agc_driver_native_depth_*tests, 3 runs each: 23 of 23 pass onmainand with this PR, the reuse cases included, with noVUID-errors.main, with noVUID-errors. The failures are known:agc_driver_f32_fma_denormal_mode2(#15316),agc_driver_tessellation(#5444) andagc_driver_sample_order_recipe_depth_locations(#9759).Windows 11 Pro (10.0.26200), NVIDIA GeForce RTX 4070 (driver 32.0.16.1692) and AMD Radeon Graphics
1002:13c0(RDNA 2 integrated, driver 32.0.21043.5001), run by AlfaRojo (comment): this head merged ontomain3cb1cd29ec(clean), WinLibs GCC 15.2.0 r7 UCRT, Release,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, no validation layer.agc_driver_native_depth_publicationpassed 3 of 3. Of the 18 tests matchingnative_depth|native_multisample, 17 pass and 1 skips. The skip isCheckDepthTarget's HTILE write-coverage assertion, whichmainalso skips on these GPUs.DepthReadCauseto build.Windows 11 (build 26200), NVIDIA GeForce RTX 5090 (driver 617.42), run by klosixgaming-arch (comment): this head merged onto
maine88dbd3af7with #9947 (2a234fd995), which SAMURAI MAIDEN needs to get past a long-path stop 8 s in and which only touches file paths. Both titles were reconverted with this tree's relinker. Each run is 110 s from boot, with no input.2a234fd995), it stops about 28 s in onnative multisample depth publication cannot distinguish an unwritten byte from a same-value guest store. Here, 1 run has no error for the full 110 s. The stop came at the same point in every run before, so they read one clean run as a clear change.APS5_PLAYGO_UNLISTED_CHUNKS=absent: 1 of 4 runs onmain1c8c0efc8cstopped about 40 s in with the same message, from a compute shader (details). Here, 4 of 4 runs have no error for the full 110 s. They call this weaker evidence, since the stop showed up in 1 of 4 runs, on an oldermain.agc_driver_native_*tests in theagc_driver_native_multisample_depth_teststarget pass (16 passed,agc_driver_native_depth_driver_queued_fillskipped). Three otheragc_driver_native_*tests weren't rebuilt in their build, so those results don't count.SAMURAI MAIDEN (PPSA04132), further, run by birdmarty on this head
7d377e40ba(#7265): Windows, Intel Core i9-9900K, AMD Radeon RX 6800.main56374036ad(#7265), it stops during Unity's asset loading on the refusal above.compute shader 0x233579900: AGC graphics: native multisample depth publication cannot distinguish ...). At the same transitions they also seeAGC graphics: guest writes over native multisample depth are not implemented. Across their runs, a loading screen gives either line or passes. AReusepublication takes the guest's undecided bytes instead of refusing, so these refusals come from reads this PR leaves asAccess.CRI Server Managerthread (app.exe+0xc96561, a read of address 0).New Joe & Mac: Caveman Ninja (PPSA02801) on Windows, run by xXPBSXx (comment):
d4583e9ccdmerged intomain697b66b1e4a, an NVIDIA GeForce RTX 4080 SUPER, one run.native multisample depth publication cannot distinguish an unwritten byte from a same-value guest store. The second refusal didn't appear.Access(CPU reads, DMA copies, texture reads, shader buffer accesses, dispatch-written ranges and the native sampling path), so on that machine the title reads the old target's memory in one of those ways. The log line doesn't say which.mainon that machine, so whether it stops at the same point there isn't known.Asterix & Obelix Slap Them All! (PPSA08576) on Windows, run by JJenkx (comment, correction):
d4583e9ccdmerged ontomain017bd95f5f, an AMD Radeon RX 6700 XT, one 240 s run per build, onlycore/libs/libsswapped.mainand 19.8 s here. A later run with #17956's libraries stopped at 13.4 s, so JJenkx reads these differences as run-to-run variance, not progress.DepthReadCause::Access, one of the reads this PR leaves asAccess.Arcade Game Zone (PPSA19015) on Linux, run by edubox (comment, full report in #8562):
main71ce478956with #17863, #18037 and #18319, with and without7ce55ad00e, an NVIDIA GeForce RTX 4080 SUPER (driver 620.70.06), CachyOS, GCC 16.2.1, Release.[gpu] driver failureand an abort.Spirit of the North: Enhanced Edition (PPSA02306) on Windows, run by JJenkx (comment):
main5bc74bb293and7ce55ad00emerged onto it (82fab69fa8), an AMD Radeon RX 6700 XT, 3 runs per build, alternated, with only the libraries differing.guest writes over native multisample depth are not implemented(#18281), and 1 reaches the 330 s cap.Peppa Pig: World Adventures (PPSA09806) on Windows, run by HabibUrRehmanBhattii (#19981): this head,
58f6485059, an NVIDIA GeForce RTX 4070, one run.main3f6cc968ba(report), on a tree with local AGC and shader edits they describe as unrelated, it stopped at 30.8 s on the refusal above, and an earlier run stopped oninitial multisample color contents overlap resident native depth.initial multisample color contents overlap resident native depth, the refusal of a multisampled colour target's initial import that hugodearaujo's #17956 changes.Pending: Blue Prince (PPSA25009, #9189) hasn't been run on this branch yet. It's the title whose intro renders only with the guest's byte (above), so a run of it would check the byte this PR takes.
Overlap
DepthSurface.hpp,DepthSurface.cpp(prepareDepthSampling) andNativeMultisampleDepth.cpp, and merged with this branch without a conflict.cachedStorageTexturepublishes it. With this PR, that storage access is a reuse. If its publication took a guest byte, the owner is already inactive with its guards removed, and #15707's release, which checksactive, skips it; if not, the owner stays and #15707 releases it as before. They differ where a storage view overlaps an owner without covering a plane and the publication took a guest byte: #15707 keeps that owner, and this PR retires it.NativeMultisampleDepth.cpp, and keeping both sides resolves that file. The rest merges clean.native multisample depth plane without HTILE does not hold one depth value in [0, 1].PublishToGuest's declaration, and #16363 adds a helper and a first line toRequireNoResidentDepthRead_nid_no_patch, whose signature this PR extends. #16364 rewords the debt entry. Keeping both sides resolves all three, with this PR's signatures, as the merges ofmainin05cb62a9a6(#16363) and84d53ab953(#16364 and #16365) do.PublishToGuest, and reclaims a D32 owner once its publication has completed and its sampled views are released.df36ea5802, it conflicts with this PR inPublishToGuest's signature, where this PR adds the cause and #10469 adds its format check, and at the end ofPublishToGuest, where #10469 makes a published HTILE D32 owner inactive and this PR returns whether the publication took a guest byte. Keeping both sides resolves them, with #10469's lines before thereturn(git merge-treeonmain9c0d96916c).66a2da10bcand7a318d5d26, and keeping both sides resolves them too.NativeMultisampleDepth.cpp. Keeping both sides resolves them. JJenkx's Resident Evil Village (PPSA01556) run in #16501 stops at the same next check with this PR merged as without it.mainbb86118e0f, which has #19846's publication of bare D32 owners, it no longer carries #9950's D32 publication (comment). Merge order: either (its thread). Whichever of the two lands second adds the cause below.bd6552b5e9, which still keepsGuestHoldsSamples()for #17890'sPublishedUnderStorage(), the two merge without a textual conflict (git merge-tree,416bc9ad90withbd6552b5e9). The merged tree still doesn't build untilPublishForGuestRead()passes the cause, as below.PublishForGuestRead()callsPublishToGuest(), which takes a cause with this PR and returns whether it took a guest byte, so that call passesDepthReadCause::Accessand drops the result. AnAccesspublication leaves the owner resident, asPublishForGuestReadexpects. Without the argument the merged tree doesn't build.NativeMultisampleDepth.cpp, rewords this PR's debt entry by one word and adds an entry after it, and retires the colour aliases at the end ofPublishToGuest, where this PR now returns whether the publication took a guest byte. Keeping both sides resolves them, with #16301's lines before thereturn, as the merge ofmainin7ce55ad00edoes.publishDepthGuards(removed != 0)in place of theanyDepthGuard()store. Since091068b618, this PR's guard removal at the end ofRequireNoResidentDepthRead_nid_no_patchand #16116 merge clean, as the merge ofmainin7ce55ad00eshows.RequireNoResidentDepthRead_nid_no_patchcalls on a new depth surface's planes, which this PR marksReuse, into itsrequireNativePlanesFree, called for each new surface and each layered slice. Merge order: this PR goes first, and #7256 then putsDepthReadCause::Reuseon those three calls in their new place, as this PR's merge did on #14051's moved index-buffer line (proposed in its thread, no objection).RequireNoMultisampleTargetmerge order agreed in its thread no longer applies.NativeMultisampleDepth.cpp. The merges ofmainina3600e57f7(#15446) ande2ab111fbf(#15443) keep both sides.releaseRetiredfree a native multisample surface once it's inactive and no longer host-written. Before it, a retired multisample owner stayed listed. After a reuse publication that took a guest byte the old owner is both, so #15300 frees it; since091068b618that is where it is retired. #15301 (Prophet069, merged) changes the sampled depth shadow's allocation inDepthSurface.cpp, away from this PR's hunks. The branch merges clean with both and with #15855, and withmainacac7c8541.DepthSurface.cppand the AGC debt file. Its stencil baseline runs only for surfaces whose stencil plane can be mirrored, which are single-sample, so this PR's multisample reuse path doesn't reach it. It leavesretireStencilunchanged. It merged with this branch without a conflict.PublishedUnderStorage()sits beforePublishToGuest's declaration, and the merge ofmainin58f6485059keeps both (see Tested). Its release looks only at active owners, so an owner this PR's reuse publication retired isn't one it meets.SurfaceGuestBytes, including the two storage-image accesses this PR marksReuse. The merge in58f6485059keeps both (see Tested).InPlaceDrawInputcall inprepareDrawInputs's vertex range loop, the line after the vertex bufferRequireNoMultisampleTargetcall this PR marksReuse. The two lines conflicted as text, and the merge ofmaininc71026cc1fkeeps both (see Tested): the check still runs before the in-place bind, and #20368 adds no depth read of its own.StoreUnchangedSinceLastCollect), so its host-changed bytes are published where the read threw before. It changes the sameelsebranch ofPublishToGuest's byte loop as this PR, and both rewrite the debt entry, so the two conflict inDepthSurface.cppand the debt file (git merge-tree,c71026cc1fwith #22062's7a78b2aabd).Require, resolves the code: In the debt entry, this PR's "A written page's byte" becomes "A CPU-stored page's byte", and #22062's "one inside an import window is overwritten" follows the list of reads that throw. With both, a reuse over a page only an import window touched publishes the host's bytes, as #22062's reads do, since no CPU store reached it.bd8f8b7465),agc_driver_native_depth_publication, which runs this PR's reuse cases and #22062'sImportSameValueandImportThenSameDepth, andagc_write_trackingpass 3 of 3 on GitHub's Linux runner (run); on Windows,agc_write_trackingpasses 3 of 3 and the publication test skips (no Vulkan device).main; if #22062 goes first, this PR's merge ofmaindoes.APS5_DIRECT_DRAWS. It movesprepareDrawInputs's pixel-kill check intorequireUncountedKills(state), on the line after the index bufferRequireNoMultisampleTargetcall this PR marksReuse, so the two conflict in that one hunk ofGraphics/src/Draw.cpp(git merge-treeonmain291a878fd2, with #22647's85c9eed5d1). Keeping both lines resolves it.takePreparedInputsadds index and vertex bufferRequireNoMultisampleTargetcalls for the same reads.causedefaults toDepthReadCause::Access, so with both PRs they build, but they would treat a multisample depth owner under those ranges as an access whereprepareDrawInputstakes it as a reuse. Whichever of the two lands second also passesDepthReadCause::Reuseon those two calls, so both paths treat the reads alike.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Accessread, in xXPBSXx's one Windows run; SAMURAI MAIDEN (PPSA04132, #7265) past the refusal during asset loading, to the menu, the talk-event scenes and 3D gameplay, with the same refusal still at some later loading screens (birdmarty's run above); Arcade Game Zone (PPSA19015, #8562) past the refusal, through a 150 s run to the front end and a mini-game (edubox's run above); Peppa Pig: World Adventures (PPSA09806, #19981) past the refusal, to 44.7 s, where it stops on another refusal (HabibUrRehmanBhattii's run above); Blue Prince (PPSA25009, #9189) not run yetab7598d803andd4583e9ccd); NVIDIA GeForce RTX 4080 SUPER (Windows; xXPBSXx's title run); NVIDIA GeForce RTX 4070 Ti (Linux) and GeForce GT 1030 (Windows 11 VM; milescoviello, the default native multisample depth test); NVIDIA GeForce RTX 4090 (Windows 11, with the validation layer; magnub); NVIDIA GeForce RTX 4080 SUPER (Linux; edubox's title run); AMD Radeon RX 6700 XT (Windows; JJenkx's title runs); NVIDIA GeForce RTX 4070 (Windows; HabibUrRehmanBhattii's title run); NVIDIA GeForce RTX 4090 (Arch Linux, driver 620.70.06, with the validation layer; domx4q); NVIDIA GeForce RTX 5080 (driver 610.88) and the Ryzen 7 9800X3D's integrated AMD Radeon (Windows 11 Pro; Lyrnc)Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-09T17:51:53Z.
Review: APPROVED
Re-test of head
d4583e9ccdon Windows with real Vulkan devices, merged ontomain6541a1f0fc(clean merge), since GitHub's Windows runner skips these tests. All three points from my earlier comment are settled here.Setup: as before. Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 r3, Release, an RTX 5070 Ti (driver 621.01) and the Ryzen 7 7700X's integrated Radeon (AMD 26.10.2),
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.Full
^agcsuite (1,527 tests,-j 8):mainThe one failure on each GPU is the same with and without this PR:
agc_driver_quad_pixel_maskon the RTX (#14341) andagc_driver_sample_order_grid_referenceon the Radeon (#9503). NoVUID-lines and no missing-layer lines.agc_driver_native_depth_publicationpasses 3 of 3 on each GPU, and the 24agc_driver_native_depth_tests pass on both, with_driver_queued_fillskipping.tools/check_conventions.py --base upstream/mainpasses.The case I raised.
DecidedVertexReadis the sequence from my probe: aReuseread with nothing undecided. It now keeps the owner, the rebind returns the same view with no new surface, and sampling works on both GPUs, as it did withAccess.Mutations,
agc_driver_native_depth_publication, one run per GPU, same on both:Reuseretires every ever-written owner, failsDecidedVertexReadwitha depth read of a host-written native owner retired or re-imported it.Reusenever retiring, the test fails withguest writes over native multisample depth are not implemented.So both directions of the retirement are covered on real Windows hardware, matching your lavapipe runs. Dropping the final
retire(*surface)loop changes no result here.Not run: any title.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T07:09:56Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
c71026cc1fddf38d5ca65d54a86e9e941fc258f7, basemain, PR #15941.diff.patchandfiles.json.PublishToGuest,RequireNoResidentDepthRead_nid_no_patch,DepthSurfaceViewWithStencilWriteIntentandreleaseRetiredthroughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp:4666: the same-identity rebind is checked before the undecided store at line 4686. After the store, the case only checks a CPU-read refusal (line 4690), so no test covers a rebind over undecided bytes. The code does not publish in that case:DepthSurface.cpp:4076runs the Reuse publication (lines 4083 to 4085) only whencreated. This is a coverage gap, not a found defect.core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:1531: the storage access is nowReuseand runs beforeDepthSurfaceStorageat line 1532, which is unchanged. If a storage view targets the owner's own planes and has undecided bytes, the owner is retired before that lookup. TheStorageTexturecase uses a separate linear alias over the stencil page, so this path is not tested.Sources
github.com/boykopovar/AnyPS5@c71026cc1f/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp (L3257-L3261)github.com/boykopovar/AnyPS5@c71026cc1f/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp (L3835-L3840)github.com/boykopovar/AnyPS5@c71026cc1f/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp (L4073-L4085)github.com/boykopovar/AnyPS5@c71026cc1f/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp (L3137-L3144)Not verified
ShaderResources.cppis in the reviewed list but its full text is not in the review folder (too large), so only its changed hunks were read. Nothing was excluded by rule. Because of this the verdict isCOMMENT, notAPPROVE.To get this to a good state
Nothing is required.
Optional: see the two non-blocking points above.