Skip to content

fix(agc): reload a sampled depth plane the guest wrote since its surface was bound - #12238

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
XairRrR:fix/agc-sampled-depth-plane-reload
Oct 30, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
XairRrR:fix/agc-sampled-depth-plane-reload

Conversation

@XairRrR

@XairRrR XairRrR commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What

A depth plane with the 64 KiB Z swizzle reloads the units the guest wrote (SyncFromMemory, #7154) when its surface is bound as a depth target. Sampling the plane through the surface (DepthSurfaceTexture, the single-sample Sampled path) skipped that check and read the host image. A title that writes the plane with a buffer copy and samples it before it draws into it again therefore read the depth from before the copy.

PPSA05684 (Uncharted: Legacy of Thieves Collection) does this every frame in Uncharted 4: it copies its depth pre-pass into a second depth target with a buffer_load_format_x / buffer_store_format_x kernel, samples that copy right away to build the half-resolution depth its volumetric fog and dust read, and only later binds the target. The fog used the previous frame's depth, so at the frame rates reached here a dark or light silhouette followed every moving character through fog and dust (the orphanage's closing scene and the prison yard).

Sampling a single-sample plane through its surface now runs the same reload first, so the sampled depth includes the guest's writes collected by then. The debt entry for depth planes in guest memory lists sampling among the points where guest writes are collected.

Tested

Arch Linux 7.2.11-zen, GCC 16.2.1, Ninja, Release, on main 3a2b919, NVIDIA GeForce RTX 4070 Ti SUPER (615.78.08):

  • agc_driver_depth_plane_sampling gains GuestWriteAfterDrawCase. It draws depth 0.25 into a 128x128 D32 plane with the 64 KiB Z swizzle and samples it (0.25), then writes 0.75 into the guest memory under it and samples it again without binding the surface. With DepthSurface.cpp from main it fails: D32 plane the guest wrote after a draw, sampled before its surface is bound again: texel 0 read 0x3e800000, expected 0x3f400000. DrawDepth takes an optional depth swizzle for it.
  • Where guest memory is not write-watched (APS5_NO_WRITE_WATCH=1, or a host without a write watch), the driver cannot see the guest's write. The case then prints guest memory has no write watch: the guest write after a draw is not checked and returns, like the CPU-write cases of agc_driver_depth_plane_partial_store.
  • VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest -V -R '^agc_driver_depth_plane_sampling' on main 3a2b919 and on this branch: 2/2 pass on both, and the layer is inserted in every test. No log reports was not found but was requested by env var VK_INSTANCE_LAYERS, and neither log has a VUID- line. With APS5_NO_WRITE_WATCH=1, the branch also passes 2/2 with no VUID- line.
  • Full ctest -j8 on the first base (main 3ca715e): 2620 of 2621 pass. agc_driver_mesh_barycentric_emulation fails the same way on main on this GPU (the pixel shader did not emulate barycentrics).
  • tools/check_conventions.py --base origin/main passes.
  • Cost: I timed the added SyncFromMemory call in the prison yard fight of PPSA05684, where the fog and dust sample the copied depth plane every frame. It ran 6 to 17 thousand times per 10 s at about 1.1 us each, 7 to 16 ms per 10 s in total, so 0.2 to 0.4 ms of a ~260 ms frame.
  • PPSA05684: the silhouettes in the fog of the orphanage's closing scene and in the dust of the prison yard are gone (checked in game by the user, on a local stack with fix(agc): keep stencil planes coherent with guest memory #12210).

Checklist

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 28, 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.

The targeted test and negative-control evidence are strong, and the one-line reload is placed before the sampled image is consumed. I did not find a separate functional defect in the changed path. This branch is 38 commits behind current main, though; the repository contribution rules require PR branches to stay up to date. Please rebase/update on current main (including resolving the debt-file overlap with #12210 if it is still open), rerun the focused depth-plane test and validation checks on the rebased head, then I can reassess.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@XairRrR thanks, the change is the right one: the sampled path now runs the same SyncFromMemory the bind path runs, behind the same mirrorable gate, and the reload happens only for a plane the guest wrote (the unwritten case is a CollectWrites plus a generation compare). One thing is missing: the extra check now runs on every sample of a large single-sample D32 plane, and the description gives no cost for it. Please add either a profile line or a short frame-time comparison from a scene that samples such a plane many times per frame (for example APS5_PROFILE_DRAW output or APS5_TRACE_SUMMARY_EVERY before and after), or say that the cost was measured as negligible and how. #12210 edits the same debt entry, so whichever lands second needs the one-line rebase you already noted.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

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

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6185 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6300 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6804 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7048 docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7449 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7844 docs/dev/debt/libSceAgcDriver.md
PR 7978 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8223 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8319 docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 9020 docs/dev/debt/libSceAgcDriver.md
PR 9335 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9432 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9700 docs/dev/debt/libSceAgcDriver.md
PR 9748 docs/dev/debt/libSceAgcDriver.md
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9893 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9915 docs/dev/debt/libSceAgcDriver.md
PR 10026 docs/dev/debt/libSceAgcDriver.md
PR 10049 docs/dev/debt/libSceAgcDriver.md
PR 10193 docs/dev/debt/libSceAgcDriver.md
PR 10233 docs/dev/debt/libSceAgcDriver.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 10472 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10492 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 10894 core/libs/prx/libSceAgcDriver/tests/execution/DepthPlaneSampling.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12120 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 12348 docs/dev/debt/libSceAgcDriver.md
PR 12764 docs/dev/debt/libSceAgcDriver.md
PR 12968 docs/dev/debt/libSceAgcDriver.md

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

I found one additional ordering case to address alongside the requested rebase and focused retest.

retireStoringStale(*found);
return nullptr;
}
if (sampled && !stencil && mirrorable(base)) found->SyncFromMemory(mirrorResource(base));

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.

Please preserve a fresh CollectWritesUncached before storing a stale depth plane in FlushDepthPlanes, or add an equivalent uncached check. This path calls SyncFromMemory → WrittenUnits, which uses memoized CollectWrites. GuestMemory.hpp documents that a same-epoch memo can hide a CPU write made after an earlier collect, and that uncached collection exists to avoid stale GPU results overwriting reused memory. If FlushDepthPlanes reaches a memoized range after a guest write, changed can remain empty and StoreDepthPlane can overwrite that update with stale depth. The new test covers a write followed by another sample, but not a pending-plane flush after a collect has already memoized the range. Please retain the fresh walk or add a regression proving this ordering is safe.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed docs agc libSceAgc* labels Oct 28, 2026
@adriadam10 adriadam10 self-assigned this Oct 28, 2026

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The change is the right one: DepthSurface.cpp:2491 runs the same SyncFromMemory behind the same mirrorable gate as the bind path, and the new test pins 0x3f400000 after a guest write, which main would read as 0x3e800000. Two things before it can land:

  • Cost: as @oneandonlydean asked, the check now runs on every sample of a single-sample D32 plane (a CollectWrites plus a generation compare when nothing was written, a unit reload when something was). Please add a profile line or a before/after frame time (APS5_PROFILE_DRAW or APS5_TRACE_SUMMARY_EVERY) from a scene that samples such a plane many times per frame, or say how you measured it as negligible.
  • The ordering case @MarcZX10 raised (memoized CollectWrites hiding a CPU write before FlushDepthPlanes stores a stale plane) is in code this PR does not change: FlushDepthPlanes already calls SyncFromMemory (DepthSurface.cpp:2221) and the new line only adds a second caller. If you can show it is a real problem, it belongs in its own PR; please say in the thread whether the sample path makes it reachable in a way the bind path does not.

The branch also conflicts with main (the Depth planes in guest memory debt entry, which #12210 edits too); we will do that rebase once the cost line is in.

@XairRrR

XairRrR commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on main e4da19a (head 09025dd). main's new FrameCopiesCase uses 0x520000..0x640000 of the test block, so GuestWriteAfterDrawCase moved from 0x600000 to 0x700000. agc_driver_depth_plane_sampling (and _evicting) pass on the rebased head. The debt line conflicts with #12210 only; on the combined tree it resolves to the stencil branch's text with "sample" added to the collect points.

@MarcZX10 on the ordering case: main already does what you ask. #11690 (7486617, "collect fresh CPU writes before depth plane stores") added the CollectWritesUncached over the whole plane right before SyncFromMemory in FlushDepthPlanes (DepthSurface.cpp:2245 on main), so a store never trusts a memoized collect. The line this PR adds only reloads; it never stores. If a memoized collect hid a write there, the sample would read the host plane once more and the next flush would still see the write before storing. So the sample path does not make the store case reachable.

Cost: I timed the added SyncFromMemory call in the prison yard fight of PPSA05684, where the fog and dust sample the copied depth plane every frame: 6 to 17 thousand calls per 10 s, about 1.1 us each, 7 to 16 ms per 10 s in total, so 0.2 to 0.4 ms of a ~260 ms frame. A frame-rate A/B with and without the line did not separate from the run-to-run noise (single 10 s intervals ranged from 17 to 57 presents in both runs).

Rebased on main e4da19a. Arch Linux 7.2.11-zen, GCC 16.2.1, Release, RTX 4070 Ti SUPER (NVIDIA 615.78.08), Khronos validation layers 1.4.363. VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest -R '^(agc|guest_video_out|video_out|guest_process_time)' on main plus #12206, #12207, #12208, #12210 and #12238 rebased: 1145/1145 pass. The loader inserted the layer 1000 times, no log line says it was not found, and the only VUID is VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (18 times), the one maskym's run reports on main (#6782). I did not run main alone on Linux; maskym's paired Windows run above covers that side.

AI-assisted: yes

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 28, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ NVIDIA GPU test: failed

PR head 09025dd merged onto main 319621b · tested 2026-10-28 19:40 UTC · 24 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ❌ 2,653 passed · 42 failed (2 new, 40 also fail on main) · 61 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Vulkan validation ✅ no new validation IDs vs main (1165 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 67.0 s, ⚠️ agc_driver_pipeline_journal 49.8 s, ⚠️ agc_driver_lookup_log_fits_build 43.9 s

Failing tests

Test Result On main 319621b
agc_driver_depth_plane_sampling ❌ failed ✅ passed
agc_driver_depth_plane_sampling_evicting ❌ failed ✅ passed
agc_driver_depth_plane_sampling: Failed (also failed when re-run alone), log excerpt
ctest: Failed

[src/VulkanDevice.cpp:1134 VulkanDevice] VulkanDevice constructor window=(nil)
[src/VulkanDevice.cpp:1143 VulkanDevice] Vulkan loader loaded library=0x60653fb37c30
[src/VulkanDevice.cpp:1183 VulkanDevice] Vulkan instance created instance=0x60653fb38be0
[src/VulkanDevice.cpp:1194 VulkanDevice] Physical device count=1
[src/VulkanDevice.cpp:1227 VulkanDevice] Physical device candidate=0x60654147ce80 name=NVIDIA RTX 2000 Ada Generation api=0x404149 type=2
[src/VulkanDevice.cpp:1274 VulkanDevice] Physical device selected physical=0x60654147ce80 queueFamily=0
[src/VulkanDevice.cpp:1288 VulkanDevice] Selected GPU name=NVIDIA RTX 2000 Ada Generation vendor=0x10de device=0x28b0 subgroup=32
[src/VulkanDevice.cpp:1290 VulkanDevice] Memory heap 0 size=16380.0 MiB flags=0x1
[src/VulkanDevice.cpp:1290 VulkanDevice] Memory heap 1 size=144111.2 MiB flags=0x0
[src/VulkanDevice.cpp:1290 VulkanDevice] Memory heap 2 size=246.0 MiB flags=0x1
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 0 heap=1 flags=0x0
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 1 heap=0 flags=0x1
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 2 heap=1 flags=0x6
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 3 heap=1 flags=0xe
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 4 heap=2 flags=0x7
[src/VulkanDevice.cpp:1382 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
[gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
[src/VulkanDevice.cpp:1759 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
[src/VulkanDevice.cpp:2021 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
VUID-VkDeviceCreateInfo-pNext-pNext(ERROR / SPEC): msgNum: -1876993556 - Validation Error: [ VUID-VkDeviceCreateInfo-pNext-pNext ] | MessageID = 0x901f59ec | vkCreateDevice(): pCreateInfo->pNext chain includes a structure with unknown VkStructureType (1000574000). This error is based on the Valid Usage documentation for version 275 of the Vulkan header.  It is possible that you are using a struct from a private extension or an extension that was added to a later version of the Vulkan header, in which case the use of pCreateInfo->pNext is undefined and may not work correctly with validation enabled. The Vulkan spec states: Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceDeviceMemoryReportCreateInfoEXT, VkDeviceDiagnosticsConfigCreateInfoNV, VkDeviceGroupDeviceCreateInfo, VkDeviceMemoryOverallocationCreateInfoAMD, VkDevicePrivateDataCreateInfo, VkDeviceQueueShaderCoreControlCreateInfoARM, VkPhysicalDevice16BitStorageFeatures, VkPhysicalDevice4444FormatsFeaturesEXT, VkPhysicalDevice8BitStorageFeatures, VkPhysicalDeviceASTCDecodeFeaturesEXT, VkPhysicalDeviceAccelerationStructureFeaturesKHR, VkPhysicalDeviceAddressBindingReportFeaturesEXT, VkPhysicalDeviceAmigoProfilingFeaturesSEC, VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT, VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT, VkPhysicalDeviceBufferDeviceAddressFeatures, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT, VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI, VkPhysicalDeviceCoherentMemoryFeaturesAMD, VkPhysicalDeviceColorWriteEnableFeaturesEXT, VkPhysicalDeviceComputeShaderDerivativesFeaturesNV, VkPhysicalDeviceConditionalRenderingFeaturesEXT, VkPhysicalDeviceCooperativeMatrixFeaturesKHR, VkPhysicalDeviceCooperativeMatrixFeaturesNV, VkPhysicalDeviceCopyMemoryIndirectFeaturesNV, VkPhysicalDeviceCornerSampledImageFeaturesNV, VkPhysicalDeviceCoverageReductionModeFeaturesNV, VkPhysicalDeviceCubicClampFeaturesQCOM, VkPhysicalDeviceCubicWeightsFeaturesQCOM, VkPhysicalDeviceCudaKernelLaunchFeaturesNV, VkPhysicalDeviceCustomBorderColorFeaturesEXT, VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV, VkPhysicalDeviceDepthBiasControlFeaturesEXT, VkPhysicalDeviceDepthClampZeroOneFeaturesEXT, VkPhysicalDeviceDepthClipControlFeaturesEXT, VkPhysicalDeviceDepthClipEnableFeaturesEXT, VkPhysicalDeviceDescriptorBufferFeaturesEXT, VkPhysicalDeviceDescriptorIndexingFeatures, VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV, VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE, VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV, VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT, VkPhysicalDeviceDiagnosticsConfigFeaturesNV, VkPhysicalDeviceDisplacementMicromapFeaturesNV, VkPhysicalDeviceDynamicRenderingFeatures, VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT, VkPhysicalDeviceExclusiveScissorFeaturesNV, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT, VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV, VkPhysicalDeviceExternalFormatResolveFeaturesANDROID, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV, VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX, VkPhysicalDeviceFaultFeaturesEXT, VkPhysicalDeviceFeatures2, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT, VkPhysicalDeviceFragmentDensityMapFeaturesEXT, VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM, VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT, VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV, VkPhysicalDeviceFragmentShadingRateFeaturesKHR, VkPhysicalDeviceFrameBoundaryFeaturesEXT, VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR, VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT, VkPhysicalDeviceHostImageCopyFeaturesEXT, VkPhysicalDeviceHostQueryResetFeatures, VkPhysicalDeviceImage2DViewOf3DFeaturesEXT, VkPhysicalDeviceImageCompressionControlFeaturesEXT, VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT, VkPhysicalDeviceImageProcessing2FeaturesQCOM, VkPhysicalDeviceImageProcessingFeaturesQCOM, VkPhysicalDeviceImageRobustnessFeatures, VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT, VkPhysicalDeviceImageViewMinLodFeaturesEXT, VkPhysicalDeviceImagelessFramebufferFeatures, VkPhysicalDeviceIndexTypeUint8FeaturesEXT, VkPhysicalDeviceInheritedViewportScissorFeaturesNV, VkPhysicalDeviceInlineUniformBlockFeatures, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI, VkPhysicalDeviceLegacyDitheringFeaturesEXT, VkPhysicalDeviceLineRasterizationFeaturesEXT, VkPhysicalDeviceLinearColorAttachmentFeaturesNV, VkPhysicalDeviceMaintenance4Features, VkPhysicalDeviceMaintenance5FeaturesKHR, VkPhysicalDeviceMaintenance6FeaturesKHR, VkPhysicalDeviceMemoryDecompressionFeaturesNV, VkPhysicalDeviceMemoryPriorityFeaturesEXT, VkPhysicalDeviceMeshShaderFeaturesEXT, VkPhysicalDeviceMeshShaderFeaturesNV, VkPhysicalDeviceMultiDrawFeaturesEXT, VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT, VkPhysicalDeviceMultiviewFeatures, VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM, VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM, VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT, VkPhysicalDeviceNestedCommandBufferFeaturesEXT, VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT, VkPhysicalDeviceOpacityMicromapFeaturesEXT, VkPhysicalDeviceOpticalFlowFeaturesNV, VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT, VkPhysicalDevicePerStageDescriptorSetFeaturesNV, VkPhysicalDevicePerformanceQueryFeaturesKHR, VkPhysicalDevicePipelineCreationCacheControlFeatures, VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR, VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT, VkPhysicalDevicePipelinePropertiesFeaturesEXT, VkPhysicalDevicePipelineProtectedAccessFeaturesEXT, VkPhysicalDevicePipelineRobustnessFeaturesEXT, VkPhysicalDevicePortabilitySubsetFeaturesKHR, VkPhysicalDevicePresentBarrierFeaturesNV, VkPhysicalDevicePresentIdFeaturesKHR, VkPhysicalDevicePresentWaitFeaturesKHR, VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT, VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT, VkPhysicalDevicePrivateDataFeatures, VkPhysicalDeviceProtectedMemoryFeatures, VkPhysicalDeviceProvokingVertexFeaturesEXT, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT, VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT, VkPhysicalDeviceRayQueryFeaturesKHR, VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV, VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV, VkPhysicalDeviceRayTracingPipelineFeaturesKHR, VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR, VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG, VkPhysicalDeviceRenderPassStripedFeaturesARM, VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV, VkPhysicalDeviceRobustness2FeaturesEXT, VkPhysicalDeviceSamplerYcbcrConversionFeatures, VkPhysicalDeviceScalarBlockLayoutFeatures, VkPhysicalDeviceSchedulingControlsFeaturesARM, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, VkPhysicalDeviceShaderAtomicInt64Features, VkPhysicalDeviceShaderClockFeaturesKHR, VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM, VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures, VkPhysicalDeviceShaderDrawParametersFeatures, VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD, VkPhysicalDeviceShaderEnqueueFeaturesAMDX, VkPhysicalDeviceShaderFloat16Int8Features, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT, VkPhysicalDeviceShaderImageFootprintFeaturesNV, VkPhysicalDeviceShaderIntegerDotProductFeatures, VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL, VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT, VkPhysicalDeviceShaderObjectFeaturesEXT, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures, VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR, VkPhysicalDeviceShaderTerminateInvocationFeatures, VkPhysicalDeviceShaderTileImageFeaturesEXT, VkPhysicalDeviceShadingRateImageFeaturesNV, VkPhysicalDeviceSubgroupSizeControlFeatures, VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI, VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT, VkPhysicalDeviceSynchronization2Features, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT, VkPhysicalDeviceTextureCompressionASTCHDRFeatures, VkPhysicalDeviceTilePropertiesFeaturesQCOM, VkPhysicalDeviceTimelineSemaphoreFeatures, VkPhysicalDeviceTransformFeedbackFeaturesEXT, VkPhysicalDeviceUniformBufferStandardLayoutFeatures, VkPhysicalDeviceVariablePointersFeatures, VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT, VkPhysicalDeviceVideoMaintenance1FeaturesKHR, VkPhysicalDeviceVulkan11Features, VkPhysicalDeviceVulkan12Features, VkPhysicalDeviceVulkan13Features, VkPhysicalDeviceVulkanMemoryModelFeatures, VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT, VkPhysicalDeviceYcbcrDegammaFeaturesQCOM, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT, or VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-pNext)
    Objects: 0
[src/VulkanDevice.cpp:2174 VulkanDevice] Vulkan device ready device=0x6065414d9180 queue=0x6065416349e0 family=0
[float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ from the emulated flush, 1033 ms)
[gpu] sampled texture cache budget 9668 MiB: device-local heap 0 has a VK_EXT_memory_budget budget of 15732 MiB and uses 2 MiB, 0 MiB of it sampled textures (0 MiB in the cache) and 0 MiB cached storage images; storage image cache budget 7866 MiB
AGC graphics: D32 plane the guest wrote after a draw, sampled before its surface is bound again: texel 0 read 0x3e800000, expected 0x3f400000
agc_driver_depth_plane_sampling_evicting: Failed (also failed when re-run alone), log excerpt
ctest: Failed

[src/VulkanDevice.cpp:1134 VulkanDevice] VulkanDevice constructor window=(nil)
[src/VulkanDevice.cpp:1143 VulkanDevice] Vulkan loader loaded library=0x5ef5a5b27650
[src/VulkanDevice.cpp:1183 VulkanDevice] Vulkan instance created instance=0x5ef5a5b285f0
[src/VulkanDevice.cpp:1194 VulkanDevice] Physical device count=1
[src/VulkanDevice.cpp:1227 VulkanDevice] Physical device candidate=0x5ef5a746bc80 name=NVIDIA RTX 2000 Ada Generation api=0x404149 type=2
[src/VulkanDevice.cpp:1274 VulkanDevice] Physical device selected physical=0x5ef5a746bc80 queueFamily=0
[src/VulkanDevice.cpp:1288 VulkanDevice] Selected GPU name=NVIDIA RTX 2000 Ada Generation vendor=0x10de device=0x28b0 subgroup=32
[src/VulkanDevice.cpp:1290 VulkanDevice] Memory heap 0 size=16380.0 MiB flags=0x1
[src/VulkanDevice.cpp:1290 VulkanDevice] Memory heap 1 size=144111.2 MiB flags=0x0
[src/VulkanDevice.cpp:1290 VulkanDevice] Memory heap 2 size=246.0 MiB flags=0x1
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 0 heap=1 flags=0x0
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 1 heap=0 flags=0x1
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 2 heap=1 flags=0x6
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 3 heap=1 flags=0xe
[src/VulkanDevice.cpp:1291 VulkanDevice] Memory type 4 heap=2 flags=0x7
[src/VulkanDevice.cpp:1382 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
[gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
[src/VulkanDevice.cpp:1759 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
[src/VulkanDevice.cpp:2021 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
VUID-VkDeviceCreateInfo-pNext-pNext(ERROR / SPEC): msgNum: -1876993556 - Validation Error: [ VUID-VkDeviceCreateInfo-pNext-pNext ] | MessageID = 0x901f59ec | vkCreateDevice(): pCreateInfo->pNext chain includes a structure with unknown VkStructureType (1000574000). This error is based on the Valid Usage documentation for version 275 of the Vulkan header.  It is possible that you are using a struct from a private extension or an extension that was added to a later version of the Vulkan header, in which case the use of pCreateInfo->pNext is undefined and may not work correctly with validation enabled. The Vulkan spec states: Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceDeviceMemoryReportCreateInfoEXT, VkDeviceDiagnosticsConfigCreateInfoNV, VkDeviceGroupDeviceCreateInfo, VkDeviceMemoryOverallocationCreateInfoAMD, VkDevicePrivateDataCreateInfo, VkDeviceQueueShaderCoreControlCreateInfoARM, VkPhysicalDevice16BitStorageFeatures, VkPhysicalDevice4444FormatsFeaturesEXT, VkPhysicalDevice8BitStorageFeatures, VkPhysicalDeviceASTCDecodeFeaturesEXT, VkPhysicalDeviceAccelerationStructureFeaturesKHR, VkPhysicalDeviceAddressBindingReportFeaturesEXT, VkPhysicalDeviceAmigoProfilingFeaturesSEC, VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT, VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT, VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT, VkPhysicalDeviceBorderColorSwizzleFeaturesEXT, VkPhysicalDeviceBufferDeviceAddressFeatures, VkPhysicalDeviceBufferDeviceAddressFeaturesEXT, VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI, VkPhysicalDeviceCoherentMemoryFeaturesAMD, VkPhysicalDeviceColorWriteEnableFeaturesEXT, VkPhysicalDeviceComputeShaderDerivativesFeaturesNV, VkPhysicalDeviceConditionalRenderingFeaturesEXT, VkPhysicalDeviceCooperativeMatrixFeaturesKHR, VkPhysicalDeviceCooperativeMatrixFeaturesNV, VkPhysicalDeviceCopyMemoryIndirectFeaturesNV, VkPhysicalDeviceCornerSampledImageFeaturesNV, VkPhysicalDeviceCoverageReductionModeFeaturesNV, VkPhysicalDeviceCubicClampFeaturesQCOM, VkPhysicalDeviceCubicWeightsFeaturesQCOM, VkPhysicalDeviceCudaKernelLaunchFeaturesNV, VkPhysicalDeviceCustomBorderColorFeaturesEXT, VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV, VkPhysicalDeviceDepthBiasControlFeaturesEXT, VkPhysicalDeviceDepthClampZeroOneFeaturesEXT, VkPhysicalDeviceDepthClipControlFeaturesEXT, VkPhysicalDeviceDepthClipEnableFeaturesEXT, VkPhysicalDeviceDescriptorBufferFeaturesEXT, VkPhysicalDeviceDescriptorIndexingFeatures, VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV, VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE, VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV, VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV, VkPhysicalDeviceDeviceMemoryReportFeaturesEXT, VkPhysicalDeviceDiagnosticsConfigFeaturesNV, VkPhysicalDeviceDisplacementMicromapFeaturesNV, VkPhysicalDeviceDynamicRenderingFeatures, VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT, VkPhysicalDeviceExclusiveScissorFeaturesNV, VkPhysicalDeviceExtendedDynamicState2FeaturesEXT, VkPhysicalDeviceExtendedDynamicState3FeaturesEXT, VkPhysicalDeviceExtendedDynamicStateFeaturesEXT, VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV, VkPhysicalDeviceExternalFormatResolveFeaturesANDROID, VkPhysicalDeviceExternalMemoryRDMAFeaturesNV, VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX, VkPhysicalDeviceFaultFeaturesEXT, VkPhysicalDeviceFeatures2, VkPhysicalDeviceFragmentDensityMap2FeaturesEXT, VkPhysicalDeviceFragmentDensityMapFeaturesEXT, VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM, VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR, VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT, VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV, VkPhysicalDeviceFragmentShadingRateFeaturesKHR, VkPhysicalDeviceFrameBoundaryFeaturesEXT, VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR, VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT, VkPhysicalDeviceHostImageCopyFeaturesEXT, VkPhysicalDeviceHostQueryResetFeatures, VkPhysicalDeviceImage2DViewOf3DFeaturesEXT, VkPhysicalDeviceImageCompressionControlFeaturesEXT, VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT, VkPhysicalDeviceImageProcessing2FeaturesQCOM, VkPhysicalDeviceImageProcessingFeaturesQCOM, VkPhysicalDeviceImageRobustnessFeatures, VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT, VkPhysicalDeviceImageViewMinLodFeaturesEXT, VkPhysicalDeviceImagelessFramebufferFeatures, VkPhysicalDeviceIndexTypeUint8FeaturesEXT, VkPhysicalDeviceInheritedViewportScissorFeaturesNV, VkPhysicalDeviceInlineUniformBlockFeatures, VkPhysicalDeviceInvocationMaskFeaturesHUAWEI, VkPhysicalDeviceLegacyDitheringFeaturesEXT, VkPhysicalDeviceLineRasterizationFeaturesEXT, VkPhysicalDeviceLinearColorAttachmentFeaturesNV, VkPhysicalDeviceMaintenance4Features, VkPhysicalDeviceMaintenance5FeaturesKHR, VkPhysicalDeviceMaintenance6FeaturesKHR, VkPhysicalDeviceMemoryDecompressionFeaturesNV, VkPhysicalDeviceMemoryPriorityFeaturesEXT, VkPhysicalDeviceMeshShaderFeaturesEXT, VkPhysicalDeviceMeshShaderFeaturesNV, VkPhysicalDeviceMultiDrawFeaturesEXT, VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT, VkPhysicalDeviceMultiviewFeatures, VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM, VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM, VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT, VkPhysicalDeviceNestedCommandBufferFeaturesEXT, VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT, VkPhysicalDeviceOpacityMicromapFeaturesEXT, VkPhysicalDeviceOpticalFlowFeaturesNV, VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT, VkPhysicalDevicePerStageDescriptorSetFeaturesNV, VkPhysicalDevicePerformanceQueryFeaturesKHR, VkPhysicalDevicePipelineCreationCacheControlFeatures, VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR, VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT, VkPhysicalDevicePipelinePropertiesFeaturesEXT, VkPhysicalDevicePipelineProtectedAccessFeaturesEXT, VkPhysicalDevicePipelineRobustnessFeaturesEXT, VkPhysicalDevicePortabilitySubsetFeaturesKHR, VkPhysicalDevicePresentBarrierFeaturesNV, VkPhysicalDevicePresentIdFeaturesKHR, VkPhysicalDevicePresentWaitFeaturesKHR, VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT, VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT, VkPhysicalDevicePrivateDataFeatures, VkPhysicalDeviceProtectedMemoryFeatures, VkPhysicalDeviceProvokingVertexFeaturesEXT, VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT, VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT, VkPhysicalDeviceRayQueryFeaturesKHR, VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV, VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR, VkPhysicalDeviceRayTracingMotionBlurFeaturesNV, VkPhysicalDeviceRayTracingPipelineFeaturesKHR, VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR, VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG, VkPhysicalDeviceRenderPassStripedFeaturesARM, VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV, VkPhysicalDeviceRobustness2FeaturesEXT, VkPhysicalDeviceSamplerYcbcrConversionFeatures, VkPhysicalDeviceScalarBlockLayoutFeatures, VkPhysicalDeviceSchedulingControlsFeaturesARM, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures, VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT, VkPhysicalDeviceShaderAtomicFloatFeaturesEXT, VkPhysicalDeviceShaderAtomicInt64Features, VkPhysicalDeviceShaderClockFeaturesKHR, VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM, VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures, VkPhysicalDeviceShaderDrawParametersFeatures, VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD, VkPhysicalDeviceShaderEnqueueFeaturesAMDX, VkPhysicalDeviceShaderFloat16Int8Features, VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT, VkPhysicalDeviceShaderImageFootprintFeaturesNV, VkPhysicalDeviceShaderIntegerDotProductFeatures, VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL, VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT, VkPhysicalDeviceShaderObjectFeaturesEXT, VkPhysicalDeviceShaderSMBuiltinsFeaturesNV, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures, VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR, VkPhysicalDeviceShaderTerminateInvocationFeatures, VkPhysicalDeviceShaderTileImageFeaturesEXT, VkPhysicalDeviceShadingRateImageFeaturesNV, VkPhysicalDeviceSubgroupSizeControlFeatures, VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT, VkPhysicalDeviceSubpassShadingFeaturesHUAWEI, VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT, VkPhysicalDeviceSynchronization2Features, VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT, VkPhysicalDeviceTextureCompressionASTCHDRFeatures, VkPhysicalDeviceTilePropertiesFeaturesQCOM, VkPhysicalDeviceTimelineSemaphoreFeatures, VkPhysicalDeviceTransformFeedbackFeaturesEXT, VkPhysicalDeviceUniformBufferStandardLayoutFeatures, VkPhysicalDeviceVariablePointersFeatures, VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR, VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT, VkPhysicalDeviceVideoMaintenance1FeaturesKHR, VkPhysicalDeviceVulkan11Features, VkPhysicalDeviceVulkan12Features, VkPhysicalDeviceVulkan13Features, VkPhysicalDeviceVulkanMemoryModelFeatures, VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR, VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT, VkPhysicalDeviceYcbcrDegammaFeaturesQCOM, VkPhysicalDeviceYcbcrImageArraysFeaturesEXT, or VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkDeviceCreateInfo-pNext-pNext)
    Objects: 0
[src/VulkanDevice.cpp:2174 VulkanDevice] Vulkan device ready device=0x5ef5a74c7f40 queue=0x5ef5a7623860 family=0
[float-controls] f32 denormal flush: hardware (0 of 5472 probe results differ from the emulated flush, 1374 ms)
[gpu] sampled texture cache budget 9657 MiB: device-local heap 0 has a VK_EXT_memory_budget budget of 15719 MiB and uses 2 MiB, 0 MiB of it sampled textures (0 MiB in the cache) and 0 MiB cached storage images; storage image cache budget 7859 MiB
AGC graphics: D32 plane the guest wrote after a draw, sampled before its surface is bound again: texel 0 read 0x3e800000, expected 0x3f400000
Intermittent validation messages (5, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)
agc_driver_depth_clear_hle: VUID-vkCmdBindDescriptorSets-commandBuffer-recording (3x)
agc_driver_depth_clear_hle: VUID-vkCmdBindPipeline-commandBuffer-recording (3x)
agc_driver_depth_clear_hle: VUID-vkCmdDispatch-commandBuffer-recording (3x)
agc_driver_depth_clear_hle: VUID-vkCmdPipelineBarrier-commandBuffer-recording (3x)
agc_driver_depth_clear_hle: VUID-vkCmdPushConstants-commandBuffer-recording (3x)
Failing on main too (40, not counted against this PR)
agc_compute_pipeline_inspection
agc_driver_bc_block_copy
agc_driver_cached_image_multisample_guard
agc_driver_depth_compare_copy
agc_driver_frame_capture_eop
agc_driver_frame_replay
agc_driver_frame_replay_concurrent
agc_driver_frame_replay_shader
agc_driver_frame_replay_shader_host
agc_driver_image_srgb_sample_copy
agc_driver_image_srgb_sample_copy_forced
agc_driver_image_table
agc_driver_image_table_vouch_queued_draws
agc_driver_lookup_log_fits_build
agc_driver_msaa_dcc_clear_2
agc_driver_msaa_dcc_clear_4
agc_driver_msaa_dcc_clear_8
agc_driver_msaa_dcc_compared_import_2
agc_driver_msaa_dcc_compared_import_4
agc_driver_msaa_dcc_compared_import_8
agc_driver_msaa_dcc_srgb_clear_2
agc_driver_msaa_dcc_srgb_clear_4
agc_driver_msaa_dcc_srgb_clear_8
agc_driver_native_depth_bda_clear
agc_driver_native_depth_clear_refusals
agc_driver_native_depth_clears
agc_driver_native_depth_retirement
agc_driver_native_fmask
agc_driver_native_multisample_depth
agc_driver_recorder
agc_driver_resource_cache_lookup_changed
agc_driver_resource_cache_replaced_texture
agc_driver_sampled_cache_budget
agc_driver_sampled_cache_budget_without_storage_image_multisample
agc_driver_staged_clear_sampled_read
agc_driver_staged_clear_sampled_read_draw_pipeline
agc_storage_idle_writeback_race
agc_storage_kept_unit_settle
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (3, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_depth_clear_hle: SEGFAULT in the parallel run
agc_submit_progress: Failed in the parallel run
agc_submit_progress_no_timeline: Failed in the parallel run
Validation IDs already present on main (5 IDs in 690 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (690 tests):agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, and 682 more
VUID-vkCmdCopyImage-srcImage-01548 (8 tests):agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-vkCmdCopyImage-srcImage-01551 (8 tests):agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests):agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test):agc_driver_image_sample_derivatives
Skipped (61)
agc_collect_mapping_history_map: 
agc_collect_mapping_history_ring: 
agc_collect_mapping_history_shared: 
agc_collect_mapping_history_uncached: 
agc_driver_bda_reads_shadowed_results: skipped, unit shadows or host imports are unavailable
agc_driver_bda_reads_shadowed_results_per_build: skipped, unit shadows or host imports are unavailable
agc_driver_depth_plane_cpu_write_after_memo: 
agc_driver_depth_plane_cpu_write_after_page_unwatch: 
agc_driver_depth_plane_cpu_write_after_partial_unwatch: 
agc_driver_depth_plane_guest_layers: skipped, guest memory has no write watch
agc_driver_idle_store_over_unmap: skipped, the surface is not write-watched
agc_driver_image_table_vouched_lookups: skipped, the device reports no host import probe result: it failed at the write watch (0)
agc_driver_large_tracked_snapshot: skipped, guest memory has no write watch
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_linear_target_import_creation: skipped, guest memory is not write-watched
agc_driver_partially_resident_pending_stores: skipped, guest memory has no write watch
agc_driver_partially_resident_snapshot: skipped, guest memory has no write watch
agc_driver_resident_heap_mirror: skipped, no guest write watch: heap mirrors need one
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_unit_shadow: skipped, unit shadows or host imports are unavailable
agc_driver_unit_shadow_budget: skipped, unit shadows or host imports are unavailable
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, unit shadows or host imports are unavailable
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_shared_write_partial_collect: 
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_storage_written_buffer_order: 
agc_unit_shadow: skipped, unit shadows or host imports are unavailable
agc_unit_shadow_completion_store: skipped, unit shadows or host imports are unavailable
agc_write_tracking: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not 
Reproduce
git fetch origin pull/12238/head && git checkout 319621ba2e57 && git merge --no-ff FETCH_HEAD
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --output-on-failure

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. Edited in place on each new push. Full logs are kept on the test machine.

@kyon-eth

Copy link
Copy Markdown
Contributor

@TechLevelZero This is useful additional validation: pinned revisions and hardware, a main comparison, isolated retries, explicit skips, and updating one comment all help reviewers.

One important qualification: the PR adds GuestWriteAfterDrawCase to both failing test selections. Main passing its older version of those tests does not by itself establish a regression introduced by the production change. The report demonstrates that the candidate still fails the new case on this configuration. Please compare the same new test against both main's production code and the candidate, and label the result as a candidate failure rather than an introduced regression until that comparison establishes attribution.

A few changes would make the automation more actionable:

  • Link downloadable full logs and test results; keeping them only on the test machine makes independent diagnosis difficult.
  • Keep inline excerpts to the assertion and relevant diagnostics; the long Vulkan extension enumeration can stay in the artifact.
  • Track intermittent failures separately, even when retries pass. Compare validation diagnostics per test/message as well as by unique VUID, since a previously seen ID can appear in a new context.
  • Pin the full PR SHA in reproduction commands, rather than fetching whichever head exists later. Include the actual retry/timeout/parallel settings used.

For merge throughput, focused baseline/candidate runs with identical test coverage are the highest-value first step; broad runs can supplement them. This report also does not replace the performance evidence requested in this PR, which the author has since supplied. The useful outcome is a reproducible finding an author can act on, rather than an automatic merge verdict.

I reviewed the report, diff and discussion; I did not independently execute these tests. AI-assisted: yes.

@XairRrR

XairRrR commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@TechLevelZero thanks for the run. I reproduced it: with APS5_NO_WRITE_WATCH=1 both tests fail here the same way (texel 0 read 0x3e800000, expected 0x3f400000).

Your container has no write watch: agc_driver_depth_plane_guest_layers and the other write-watch tests skip there. Without one, the driver does not see the guest's CPU write, so SyncFromMemory has nothing to reload. The CPU-write cases of agc_driver_depth_plane_partial_store skip for the same reason.

78c1cb4 makes GuestWriteAfterDrawCase print guest memory has no write watch: the guest write after a draw is not checked and return in that case. The production change is unchanged.

I ran agc_driver_depth_plane_sampling and _evicting with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. Both pass in two configurations, with the layer loaded and no VUID- lines in either:

  • With the write watch, the new case runs. With DepthSurface.cpp from main it still fails.
  • With APS5_NO_WRITE_WATCH=1, the case reports that it is not checked.

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 — changes requested

The new write-watch test and its no-write-watch skip address the reported test-environment issue, and the reported GPU run includes a main-code negative control; before this branch is ready, update it against current main and resolve its declared ordering with #12210.

What I ran

  • Inspected PR head 78c1cb46e4017ab6865fa09df261148882ecfc38, its diff, current main (3a2b91981651569163768854a1fcdc7193b6667b), and the repository branch and AGC testing rules.
  • Checked the current GitHub status checks and ran git diff --check against the merge base.
  • Compared the branch with current main using Git's merge-tree preview. No conflicted merge was reported, but the branch is 233 commits behind and both branches edit the AGC debt file.

Results

Check Result
Windows CI
Raw statuswindows pass
Conventions CI
Raw statusconventions pass
Other hosted jobs
Raw statuslinux skipping; register-context skipping; relinker skipping; relinker-asan skipping; write-watch skipping
Local whitespace check
Raw outputgit diff --check upstream/main...refs/review/pr-12238 — no output; exit status 0
Merge preview
Raw outputmerge-tree-exit=0; preview has edits from both branches in docs/dev/debt/libSceAgcDriver.md

Negative control

The author reports that agc_driver_depth_plane_sampling and _evicting passed with validation enabled on the candidate, and that the added sampling case failed with DepthSurface.cpp from main (0x3e800000, expected 0x3f400000). I have not independently run those GPU tests in this review.

Findings

Blocking

  • The branch is 233 commits behind current main. CONTRIBUTING.md requires branches to be kept up to date. Please update it and rerun the focused AGC tests and checks on the resulting head.
  • The checklist says Depends on: none, but #12210 is still open and both PRs edit docs/dev/debt/libSceAgcDriver.md. Your comment says the combined result requires one branch's debt wording to be retained and “sample” added. The contribution rules require agreement on ordering and a matching Depends on: #12210 (or the agreed reverse order). Please coordinate and declare the agreed order.

Non-blocking

  • A reviewer asked for a cost measurement because this adds a write collection/generation check on sampled depth planes. The latest test report does not include a profile or frame-time comparison. Please add one, or explain with measured evidence why the added work is negligible.

Sources

  • PR diff and checks reviewed at 78c1cb46e4017ab6865fa09df261148882ecfc38.
  • Current base: main at 3a2b91981651569163768854a1fcdc7193b6667b.
  • Contribution rules: CONTRIBUTING.md at 3a2b91981651569163768854a1fcdc7193b6667b.

Not verified

I did not run a local build, focused GPU tests, or console tests. Linux and specialized hosted checks were skipped. The reported GPU results are author-provided and are not a substitute for rerunning them after updating this branch.

To get this to a good state

Agree with #12210 on merge order, set the corresponding dependency on the checklist, update this branch to current main, then rerun and report the required focused tests and validation checks on the new head. Add the requested cost measurement if available.

@XairRrR
XairRrR force-pushed the fix/agc-sampled-depth-plane-reload branch from 78c1cb4 to 29a96bf Compare October 29, 2026 00:51
@XairRrR

XairRrR commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks. Rebased on main 3a2b919 (head 29a96bf), with no conflicts.

I ran the focused tests with the validation layer and ctest -V on main and on the new head, on the same machine:

  • Both pass 2/2, the layer is loaded, no log has a "not found" line, and neither side has a VUID- line.
  • With APS5_NO_WRITE_WATCH=1, the head also passes and reports the new case as not checked.
  • With DepthSurface.cpp from main, the new case still fails.

The description has the updated test list.

Order with #12210: both PRs are mine, and #12210 goes first. The checklist now says Depends on: #12210. Once #12210 is merged, I will rebase this one and keep its stencil wording in the debt entry, with sampling added.

Cost: I measured it in game, in my comment above, and it is now in the description too. The added call runs 6 to 17 thousand times per 10 s at about 1.1 us each, 0.2 to 0.4 ms of a ~260 ms frame.

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.

Re-checked — changes requested

The new sampled-depth reload and write-watch-gated regression address the previous test-scope concern, but this branch is still 36 commits behind current main 52c09d567d2fa453494dd720fcf53a98149468e4. The repository checklist requires a current-main base, and the reported tests are not on the refreshed integration.

What I ran

  • Reviewed exact head 29a96bfc5d1fa648096d68d6a2e4535d20b23bbc against current main.
  • Ran git merge-tree --write-tree and git diff --check.
  • Inspected the production/test diff and checked the author’s reports.

Results

Check Result
Current-main merge preview Clean; current main is not in the branch history
git diff --check Passed
Focused GPU tests Existing reports are against the earlier 3a2b919816 base
Current-main validation run Not reported

Please update onto current main and rerun the focused sampled-depth tests and required validation-layer comparison on that head. I did not run the C++ or GPU tests locally.

@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ NVIDIA GPU test: failed

PR head 29a96bf merged onto main 52c09d5 · tested 2026-10-29 12:21 UTC · 40 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,198 passed · 6 failed (0 new, 5 also fail on main, 1 unstable on main) · 39 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,243 of 2,873 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ❌ 4 new validation ID(s) vs main (855 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) none

New validation errors

This PR changes test files, so each test below was also run on main with only the PR's test changes applied; 0 there means the PR's other changes cause the error.

ID Test main 52c09d5 main + this PR's test changes only PR PR, test re-run alone
VUID-vkCmdCopyImage-srcImage-01548 agc_driver_depth_plane_sampling_evicting 0 0 (the test fails there) 3 6 (in 2 runs)
VUID-vkCmdCopyImage-srcImage-01551 agc_driver_depth_plane_sampling_evicting 0 0 (the test fails there) 3 6 (in 2 runs)
VUID-vkCmdCopyImage-srcImage-01548 agc_driver_depth_plane_sampling 0 0 (the test fails there) 3 6 (in 2 runs)
VUID-vkCmdCopyImage-srcImage-01551 agc_driver_depth_plane_sampling 0 0 (the test fails there) 3 6 (in 2 runs)
agc_driver_depth_plane_sampling_evicting: new validation messages
VUID-vkCmdCopyImage-srcImage-01551(ERROR / SPEC): msgNum: -638843151 - Validation Error: [ VUID-vkCmdCopyImage-srcImage-01551 ] Object 0: handle = 0x5ed782dad8a0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x1290000000129, type = VK_OBJECT_TYPE_IMAGE; Object 2: handle = 0x11d000000011d, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0xd9ec06f1 | vkCmdCopyImage(): pRegions[0].srcSubresource.aspectMask (VK_IMAGE_ASPECT_COLOR_BIT) does not match pRegions[0].dstSubresource.aspectMask (VK_IMAGE_ASPECT_DEPTH_BIT). The Vulkan spec states: If neither srcImage nor dstImage has a multi-planar 
VUID-vkCmdCopyImage-srcImage-01548(ERROR / SPEC): msgNum: 471617033 - Validation Error: [ VUID-vkCmdCopyImage-srcImage-01548 ] Object 0: handle = 0x5ed782dad8a0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x1290000000129, type = VK_OBJECT_TYPE_IMAGE; Object 2: handle = 0x11d000000011d, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x1c1c4e09 | vkCmdCopyImage():  srcImage format (VK_FORMAT_R32_SFLOAT) is different from dstImage format (VK_FORMAT_D32_SFLOAT). The Vulkan spec states: If the VkFormat of each of srcImage and dstImage is not a multi-planar format, the VkFormat of each of 
agc_driver_depth_plane_sampling: new validation messages
VUID-vkCmdCopyImage-srcImage-01551(ERROR / SPEC): msgNum: -638843151 - Validation Error: [ VUID-vkCmdCopyImage-srcImage-01551 ] Object 0: handle = 0x63f99a31e360, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x1290000000129, type = VK_OBJECT_TYPE_IMAGE; Object 2: handle = 0x11d000000011d, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0xd9ec06f1 | vkCmdCopyImage(): pRegions[0].srcSubresource.aspectMask (VK_IMAGE_ASPECT_COLOR_BIT) does not match pRegions[0].dstSubresource.aspectMask (VK_IMAGE_ASPECT_DEPTH_BIT). The Vulkan spec states: If neither srcImage nor dstImage has a multi-planar 
VUID-vkCmdCopyImage-srcImage-01548(ERROR / SPEC): msgNum: 471617033 - Validation Error: [ VUID-vkCmdCopyImage-srcImage-01548 ] Object 0: handle = 0x63f99a31e360, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x1290000000129, type = VK_OBJECT_TYPE_IMAGE; Object 2: handle = 0x11d000000011d, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x1c1c4e09 | vkCmdCopyImage():  srcImage format (VK_FORMAT_R32_SFLOAT) is different from dstImage format (VK_FORMAT_D32_SFLOAT). The Vulkan spec states: If the VkFormat of each of srcImage and dstImage is not a multi-planar format, the VkFormat of each of 
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 3 of the last 5 main runs
Failing on main too (5, not counted against this PR)
agc_compute_pipeline_inspection
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 405 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (405 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alpha_to_coverage, agc_driver_array_layer_target_cpu, agc_driver_bc_block_copy, and 397 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (39)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SD
Reproduce
git fetch origin 29a96bfc5d1fa648096d68d6a2e4535d20b23bbc 52c09d567d2fa453494dd720fcf53a98149468e4
git checkout 52c09d567d2fa453494dd720fcf53a98149468e4 && git merge --no-ff 29a96bfc5d1fa648096d68d6a2e4535d20b23bbc
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1
# the failing tests, on this merge and on main:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc_driver_depth_plane_sampling_evicting|agc_driver_depth_plane_sampling)$' --parallel 1 -V

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

@kyon-eth

Copy link
Copy Markdown
Contributor

@TechLevelZero This is useful: the GPU/driver details, exact revisions, baseline comparison, isolated retries, and failure excerpts give the author something concrete to investigate and can save reviewers time. One wording suggestion: since these failures are in a test added by this PR, “2 new failures” does not by itself establish a regression in existing behavior; “2 PR-only test failures” would be clearer. Linking full logs or artifacts, showing the validation-layer version, and distinguishing environment-dependent skips would also help reproduce the result. A single updated comment per head, as you are doing, should keep the signal high. The remaining question here is whether the failed test reflects a real issue on this GPU or a limitation of the test environment.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
…ace was bound

A depth plane with the 64 KiB Z swizzle reloads the units the guest
wrote (SyncFromMemory) when its surface is bound as a depth target, but
sampling the plane through the surface skipped that check and read the
host image. A title that copies depth into the plane with a buffer copy
and samples it before drawing into it again read the depth from before
the copy.

PPSA05684 copies its depth pre-pass into a second depth target with a
buffer copy kernel and samples that copy at once to build the
half-resolution depth its volumetric fog and dust read; only later does
it bind the target. The fog used the previous frame's depth, so a
silhouette followed every moving character through fog and dust.

Sampling a single-sample plane through its surface now runs the same
reload first. agc_driver_depth_plane_sampling gains a case that draws a
plane, writes the guest memory under it and samples it; it reads the
drawn depth without the change.

AI-assisted: yes
…write-watched

Without a write watch the driver does not see the guest's CPU write to
the depth plane, so GuestWriteAfterDrawCase reports that instead of
failing, as the CPU-write cases of agc_driver_depth_plane_partial_store do.

AI-assisted: yes
@adriadam10
adriadam10 force-pushed the fix/agc-sampled-depth-plane-reload branch from 29a96bf to 83e01b8 Compare October 29, 2026 20:17
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@adriadam10
adriadam10 merged commit 583b274 into boykopovar:main Oct 30, 2026
10 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased onto current main after #12210 landed. The only conflict was the depth-planes entry in docs/dev/debt/libSceAgcDriver.md: we kept main's text and added "sample" to the points where guest writes are collected, no logic changed. The scoped ctest on the rebased head passes (1120 of 1120, including agc_driver_depth_plane_sampling), and the new GuestWriteAfterDrawCase is unchanged; merged.

@Astronaut10

Copy link
Copy Markdown
Contributor

Since this PR, Astro Bot (PPSA21564, 01.007) renders Aerial Garden without its cloud sea and haze: below the ship there is a teal surface where there used to be white cloud (about 2 % of the bottom third of the in-level frames is cloud, against about 80 % before). Crash Site looks unchanged.

Bisect. Frame dumps over the 76 AGC/shader merges between 90c9759d12 and 029463ceb6 (RX 9070 XT, RADV, Linux). The last merge with clouds is #12964 (c70bdcf0b7); the first without is this one (583b274e11). On 3ab5a11d66 + #9858, removing only the if (sampled && !stencil && mirrorable(base)) found->SyncFromMemory(mirrorResource(base)); line brings the clouds back, and frame time does not change.

Cause, confirmed with a build that only tags the stamp sites (no behaviour change):

  • Once per frame, one 1920x1080 D32 plane is reloaded whole at its sampled sync. All 135 of its 64 KiB units are drawn and not yet stored at that point.
  • Every unit's newest stamp comes from a FlushPending (storage refresh) of a colour image that aliases the plane's memory (2432x1368, format 71). That image's results were recorded before the plane was bound.
  • The bind's own SyncFromMemory reloads the few units that really changed and refreshes the mirror. The mirror's Refresh then flushes the older aliased image over the whole plane, after unitGeneration was taken.
  • The draws follow. At the sample, those stamps look like guest writes, so the drawn depth is replaced by the colour image's bytes.
  • No CPU, completion, BDA or record-time stamp touches the plane.

So the reload is right for a real guest write after the draw (your PPSA05684 case), but it orders the driver's own stores by when they are stamped rather than by when their results were recorded.

Possible fix, for every title:

  • Record on each pending image layer the generation it was recorded at, and on each depth unit the generation of its last draw.
  • Let a driver store invalidate a unit only if it was recorded after that draw, the way StorageTexture::StampKeepingNewerResults already treats storage images.
  • Flush overlapping pending images before WrittenUnits in SyncFromMemory.
  • CPU stamps keep today's rule, so GuestWriteAfterDrawCase still passes.

A test for this case: a dispatch writes an image over the plane's memory and its results stay pending; the plane is bound and drawn; the image is stored; the plane is sampled and must return the drawn depth.

I have a patch along these lines in progress and can open it as a PR once it is tested, if this direction works for you.

@Astronaut10

Copy link
Copy Markdown
Contributor

Follow-up to my comment above: the fix is now #15621 ("fix(agc): order driver stores over a depth plane by record order").

  • It keeps your reload. Driver stores (storage image results, direct and copied-back buffer write-backs) now carry the order in which their results were recorded, and they invalidate a depth unit only if they were recorded after that unit's last draw. SyncFromMemory stores pending images over the plane (not its own mirror) before collecting writes. CPU writes keep today's rule.
  • GuestWriteAfterDrawCase still passes. While testing I found that with host imports on (the Linux default here), this suite's write-watch cases (yours included) print "no write watch" and return without checking (the rest of the suite runs), so the PR adds a ctest entry with APS5_NO_HOST_IMPORT=1 that runs them. A new case covers the aliased store; it fails when either half of the change is disabled, and its record-order part calls the new guard directly rather than going through an imported-buffer completion.
  • On current main (086c0686c8), Astro Bot Aerial Garden still renders teal water where its cloud sea is; with the PR the clouds are back and your line stays in place. In Crash Site I saw no obvious difference in frame dumps compared at the same animation phases (on an earlier base). AGC ctest statuses and the validation-layer output are the same as main's.
  • Cost, measured on an earlier base: Aerial Garden about 1.8 % slower than the base and about the same as the base with your line removed, which fits the cost being the restored rendering. A draw profile puts the new code's own cost at about 3 ms per frame of draw-thread time, mostly waiting for the store SyncFromMemory now makes at the depth bind; it did not show on the frame's critical path there.
  • BDA completion stamps are not ordered yet and are left out of this fix; that is noted in the AGC debt file.

I have only run GuestWriteAfterDrawCase, not PPSA05684 itself. If it has a scene you check by eye, I would be glad to know it still looks right with this branch.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants