Skip to content

test(agc): read the sample order tests' depth through a sampled copy - #9056

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/sample-order-test-depth-read
Oct 24, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
milescoviello:fix/sample-order-test-depth-read

Conversation

@milescoviello

@milescoviello milescoviello commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Three of the sample order tests #6683 added fail on main on an RTX 4070 Ti with the 595.99.02 Linux driver: agc_driver_sample_order, agc_driver_sample_order_grid_reference and agc_driver_sample_order_recipe_depth_locations. They read back depth other than what was drawn:

  • 2x scene with the standard locations: the slopes did not leave depth both at and below the clear value
  • the composite of uniform renders: the slopes did not leave depth both at and below the clear value
  • pixel (0,0)'s locations in every pixel: the clear between the recorded draw and its replay left depth other than the clear value

The reads are the cause, not the reorder. The tests read a depth surface by binding DepthSurfaceOrderTarget(...).view, the surface's own view, as a sampled image. A multisampled depth surface sampled through a shadow image (#7318) is created without VK_IMAGE_USAGE_SAMPLED_BIT. So that descriptor is invalid: the Khronos layer reports VUID-VkWriteDescriptorSet-descriptorType-00337 18 times over these tests. What such a read returns is up to the driver, and this one returns other depth.

The reorder pass itself doesn't do this: SampleOrder.cpp copies the depth plane into an image of its own with sampled usage and samples the copy. The tests now do the same through a new ReadDepth:

  • copy the surface's depth aspect into a test Image of the same format and sample count, with DepthUsage, in GENERAL (no layout change on the surface);
  • read the copy's depth view with the existing ReadTarget.

Both reads go through it: the scene read in RenderCheckerboard and the recipe test's read. Only the test changes.

Tested

  • Rebased onto main d2e42c3 as 53949c0775 (commit unchanged, git range-diff). On the RTX 4070 Ti (615.71.09, Ubuntu 26.04.1, GCC 15.2, Release), 3 runs each: main fails sample_order, _grid_reference and _recipe_depth_locations; this head passes all 4 sample_order tests, alone and with fix(agc): give a depth stencil copy's layout barrier both aspects #9057 (7333de6aee).
  • Earlier rebase onto main 8499ea5, with no conflicts, as head 0fd624d93b (git range-diff shows the commit unchanged). The 4 sample_order tests pass 3 of 3 on the RTX 4070 Ti (615.71.09, Ubuntu 26.04.1), and conventions are clean. The runs below are from earlier heads with the same change. A full ctest -j 4 of main da54c65 on the same machine passes 1832 of 1835 tests, and the three failures are the ones this PR fixes.

Ubuntu 24.04, GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02, on main 275e896.

  • The 4 tests matching sample_order: on main, agc_driver_sample_order_planning passes and the three above fail, every run (2 of 2 on b6fe513, and again under the layer on 275e896). With this change all 4 pass, 3 of 3.

  • Under lavapipe (llvmpipe, LLVM 20.1.2) they pass with and without the change; the grid reference and recipe tests skip there, as on main.

  • Khronos validation layer 1.4.363 over the same 4:

  • AMD, Windows: @DavidSamir ran it together with fix(agc): give a depth stencil copy's layout barrier both aspects #9057 on a Radeon 680M (driver 32.0.21030.2001, Windows 11) under the 1.4.363 layer, on main 27fabb6.

    • agc_driver_sample_order and agc_driver_sample_order_recipe_depth_locations fail on main there too, and pass with both PRs. 03320 and 00337 are gone.
    • agc_driver_sample_order_grid_reference still fails on that device, with VK_ERROR_DEVICE_LOST and one VUID-VkSubmitInfo-pSignalSemaphores-03242. That is a separate problem, not narrowed down yet.
  • NVIDIA, Windows: @gdols ran it on an RTX 3080 (driver 616.92, Windows 11) on main 2f161d4. On main the full suite has 1838 passed, 17 skipped and 3 failed: these tests, with the same messages. With this PR and fix(agc): give a depth stencil copy's layout barrier both aspects #9057, agc_driver_sample_order, _recipe_depth_locations and _planning pass 3 of 3, and _grid_reference skips (that device doesn't keep depth drawn at custom sample locations).

  • main alone, Windows: @Amoenus ran grid_reference and recipe_depth_locations on an RTX 5080 (610.62) and an AMD gfx1036 under the 1.4.363 layer, 3 times each. Both fail on both GPUs, with 00337 messages on both (gfx1036 loses the device in grid_reference, as on the 680M). These runs are without this PR.

  • NVIDIA, Windows: @MaxLikesCode ran it on an RTX 4090 (driver 617.42, Windows 11), merged onto main 2c4b116, 3 runs without and 3 with the 1.4.363 layer:

    • main: sample_order, _grid_reference and _recipe_depth_locations fail 6 of 6, with 00337 ×18 and 03320 ×6 per layer run.
    • With this PR: sample_order, _recipe_depth_locations and _planning pass 6 of 6, and _grid_reference skips (as on the 3080). Only the 6 03320 remain; with fix(agc): give a depth stencil copy's layout barrier both aspects #9057 too, no VUID is left. No run lost the device.
  • @EagleBearerYS (fix(agc): keep the guest's sample order where pixel (0,0)'s locations stand in for a 2x2 grid #6683's author) reviewed it and ran it with fix(agc): give a depth stencil copy's layout barrier both aspects #9057 on GitHub's runners. Under lavapipe, agc_driver_sample_order, _planning, agc_driver_pixel_sample_iteration and agc_driver_sample_location_grid_fallback pass 3 runs in a row. On Windows without a GPU, they skip or pass.

  • NVIDIA and Intel, Windows: @akkadbakkad89 ran it on an RTX 3070 (driver 617.42) and an Intel UHD Graphics 630 in the same machine, on main 1698d1e.

    • RTX 3070: main fails the three tests with the messages above. With this PR, sample_order, _recipe_depth_locations and _planning pass, and _grid_reference skips, as on the 3080.
    • UHD 630: sample_order and _recipe_depth_locations fail the same way on main and with this PR, for other reasons: a stencil read on the depth-pass case, and a device with only 1x1 sample location grids. This PR doesn't change those.
  • NVIDIA, Windows: @SnekPolylepis ran it on an RTX 4080 (driver 617.42, Windows 11, WinLibs GCC 15.2.0), merged onto main 8c26eac. main fails sample_order, _grid_reference and _recipe_depth_locations. With this PR, sample_order, _recipe_depth_locations and _planning pass, and _grid_reference skips, as on the 3070 and 3080.

  • Older layer, lavapipe: @xXPBSXx ran all 483 built agc_driver_*_tests under the Ubuntu 24.04 layer package (1.3.275) on main 950388b. main reports 00337 only from agc_driver_sample_order; with this change that test passes with no 00337, and only fix(agc): give a depth stencil copy's layout barrier both aspects #9057's 03320 remains. One run.

  • AMD, Windows: @JJenkx ran it on a Radeon RX 6700 XT (driver 26.10.1, Windows 11), merged onto main a6dcea9 together with fix(shader): index tessellation attributes at a constant address with constants #8884 (tessellation only), 10 runs each. sample_order and _recipe_depth_locations fail 10 of 10 on main and pass 10 of 10 with this PR. _grid_reference fails 10 of 10 on both, with the device lost on submit before anything is read back (GPU fault, read invalid at 0x200000000), as on the 680M and gfx1036.

  • NVIDIA, Windows: @lost9409 ran it on an RTX 5070 Ti (driver 610.88, Windows 11), on main a6dcea9 with test(agc): align the array window test's texels at run time #8310's alignment fix. On main, sample_order, _grid_reference and _recipe_depth_locations fail, in the full suite and run alone. With this PR's SampleOrder.cpp, sample_order, _recipe_depth_locations and _planning pass, and _grid_reference skips, as on the 3080, 3070 and 4090.

  • NVIDIA and AMD, Windows: @wachi35676 ran it with #9057 on an RTX 5070 Ti (driver 617.42) and an AMD Radeon iGPU 1002:13c0 (gfx1036, driver 32.0.21042.62), Windows 11, on main a6dcea9, 3 runs each. sample_order and _recipe_depth_locations fail 3 of 3 on main on both and pass 3 of 3 with the two PRs. On the iGPU, main reads garbage depth through the invalid 00337 descriptor rather than zeros, which this PR also fixes. _grid_reference skips on the 5070 Ti. On the iGPU it still loses the device, but with APS5_NO_GPL=1 it passes 3 of 3, so that loss is in AMD's graphics pipeline library path, not here (AGC: agc_driver_sample_order_grid_reference loses the device on AMD's Windows driver with graphics pipeline libraries, passes with APS5_NO_GPL=1 #9507).

  • AMD, Windows: @LeandroLP23 ran it on a Radeon 860M (RDNA 3.5, 1002:1114, driver 32.0.13058.8001, Windows 11, WinLibs GCC 15.2.0) merged onto main e7f46f5, 3 runs per case with the AMD shader cache emptied: sample_order and _recipe_depth_locations fail on main and pass with this PR (also with fix(agc): give a depth stencil copy's layout barrier both aspects #9057 and fix(agc): bind the sample order depth set after its pipeline #9503). _grid_reference's depth checks all pass with it; it still fails on 42 color samples of the exact path, off by one or two steps in one channel, the same color difference @SoRadGaming saw on RDNA 4, which is outside this PR.

  • NVIDIA and AMD, Windows: @Amoenus ran it after #9057 merged, this head merged onto main a23f8fc, on an RTX 5080 (610.62) and a Radeon gfx1036 (32.0.21036.18) under the Khronos layer: sample_order and _recipe_depth_locations pass 3 of 3 on both, _planning 3 of 3, and 00337 is gone. _grid_reference skips its custom-depth comparison on NVIDIA and still loses the device on AMD, as it does on main in their earlier runs (AGC: agc_driver_sample_order_grid_reference loses the device on AMD's Windows driver with graphics pipeline libraries, passes with APS5_NO_GPL=1 #9507, which fix(agc): bind the sample order depth set after its pipeline #9503 addresses).

  • Newer NVIDIA driver: the same RTX 4070 Ti on NVIDIA 615.71.09 (Ubuntu 26.04.1, kernel 7.0, GCC 15.2). In a full ctest of main 38d3c08, the same three tests fail with the same three messages; nothing else in AGC fails. With this PR, all 4 sample order tests pass 3 of 3.

  • lavapipe on the current host (Mesa 26.0.8-1ubuntu0.3, LLVM 21.1.8, Ubuntu 26.04.1), this PR merged onto main a6dcea9: the 4 sample_order tests pass 3 of 3, and so do they on the RTX 4070 Ti (615.71.09) in the same build.

  • AMD, Windows: @brummilab ran it on a Radeon RX 6600 XT (Navi 23, driver 32.0.21045.16010, Windows 11, WinLibs GCC 15.2.0), merged onto main 60465af, 3 runs: sample_order and _recipe_depth_locations fail on main and pass with this PR. _grid_reference still fails with this PR alone (read invalid at 0x200000000, Vulkan result -4) and passes together with fix(agc): bind the sample order depth set after its pipeline #9503.

  • NVIDIA and AMD, Linux, under the validation layer: @TechLevelZero ran it merged onto main 6cd36e6. On an NVIDIA A800 (610.57.04), across the 246 tests tools/select_tests.py selects, main fails the three tests and reports 18 VUID-VkWriteDescriptorSet-descriptorType-00337. With this PR, sample_order and _recipe_depth_locations pass, _grid_reference skips (77) because the A800 does not keep depth drawn at custom sample locations, and 00337 drops to 0. On a Radeon RX 9070 XT and a gfx1036 iGPU (RADV, Mesa 26.0.8), the three pass on both sides and the PR removes every 00337 (6, 14 and 12 on main).

Not tested: Intel on Linux.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: AGC: agc_driver_sample_order tests read a depth target as all zeros on an NVIDIA Windows device and pass on Intel #9313
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04, and driver 615.71.09, Ubuntu 26.04.1; lavapipe (llvmpipe), Mesa 26.0.8, LLVM 21.1.8, Ubuntu 26.04.1; lavapipe (llvmpipe, LLVM 20.1.2, Vulkan 1.4.318), Ubuntu 24.04, Mesa version not recorded; AMD Radeon 680M, driver 32.0.21030.2001, Windows 11 (@DavidSamir); NVIDIA GeForce RTX 3080, driver 616.92, Windows 11 (@gdols); NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 (@MaxLikesCode); NVIDIA GeForce RTX 3070, driver 617.42, and Intel UHD Graphics 630, driver 31.0.101.2140, Windows 11 (@akkadbakkad89); NVIDIA GeForce RTX 4080, driver 617.42, Windows 11 (@SnekPolylepis); AMD Radeon RX 6700 XT, driver 26.10.1, Windows 11 (@JJenkx); NVIDIA GeForce RTX 5070 Ti, driver 610.88, Windows 11 (@lost9409); NVIDIA GeForce RTX 5070 Ti, driver 617.42, and AMD Radeon iGPU 1002:13c0 (gfx1036), driver 32.0.21042.62, Windows 11 (@wachi35676); NVIDIA GeForce RTX 5080, driver 610.62, and AMD Radeon Graphics (gfx1036), driver 32.0.21036.18, Windows 11 (@Amoenus; main earlier, this PR after fix(agc): give a depth stencil copy's layout barrier both aspects #9057); lavapipe (llvmpipe), WSL2 Ubuntu 24.04, layer 1.3.275 (@xXPBSXx; no Mesa version given); GitHub runners (lavapipe; Windows without a GPU) (@EagleBearerYS); AMD Radeon RX 9070 XT (RDNA 4), Adrenalin 26.8.1, Windows 11 (@SoRadGaming); AMD Radeon 860M (RDNA 3.5), driver 32.0.13058.8001, Windows 11 (@LeandroLP23)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@DavidSamir

Copy link
Copy Markdown
Contributor

Independent AMD run of this PR together with #9057, under the validation layer.

Setup: Windows 11 Pro 26200, AMD Radeon 680M (RDNA 2 iGPU; no shaderStorageImageMultisample; largest sample location grid 2x2 at every count), AMD driver 32.0.21030.2001, WinLibs GCC 15.2.0 r7, Release, VK_LAYER_KHRONOS_validation (SDK 1.4.363), ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1. main is 27fabb6b7; the PR side is main + #9056 + #9057, both merged locally and cleanly. ctest -R '^agc_driver_sample_order' -V -j1.

Test main + #9056 + #9057
agc_driver_sample_order fails passes
agc_driver_sample_order_recipe_depth_locations fails: the clear between the recorded draw and its replay left depth other than the clear value passes
agc_driver_sample_order_grid_reference fails still fails: vkQueueSubmit recorder: Vulkan result -4

Validation errors:

  • main: VUID-VkImageMemoryBarrier-image-03320 x6 (a D32_SFLOAT_S8_UINT barrier with only the depth aspect), VUID-VkWriteDescriptorSet-descriptorType-00337 x7 (a sampled-image descriptor over a depth image without SAMPLED usage) and VUID-VkSubmitInfo-pSignalSemaphores-03242 x1.
  • With both PRs, 03320 and 00337 are gone. One VUID-VkSubmitInfo-pSignalSemaphores-03242 remains, in grid_reference (signal value (28) ... must be greater than current timeline semaphore ... value (18446744073709551615)), next to the -4 (VK_ERROR_DEVICE_LOST).

So on this device the two PRs fix two of the three tests, and grid_reference loses the device. I haven't narrowed down the device loss yet.

AI-assisted: yes

@EagleBearerYS

Copy link
Copy Markdown
Contributor

Read against main: this is right. Thanks for the fix to our #6683's tests.

  • The tests read depth by binding DepthSurfaceOrderTarget(...).view, the surface's own view, as a SAMPLED_IMAGE. When the device can make feat(agc): sample multisampled depth through a shadow image #7318's sampled shadow (useSampleShadow in DepthSurface.cpp), the surface image is created with attachment and transfer usage only, and SAMPLED goes on the shadow. So that descriptor breaks VUID-VkWriteDescriptorSet-descriptorType-00337, as you found.
  • ReadDepth reads the way the reorder pass does. It makes a copy of the same format and sample count with DepthUsage, the same usage the pass's depthSampleable check requires before it runs. Its first barrier names both aspects when the format has stencil, so it doesn't bring 03320 into the tests. It copies the depth aspect in GENERAL after a full barrier, and ReadTarget opens with its own full barrier, so the copy's write is visible to the read.
  • Checked here, with this PR and fix(agc): give a depth stencil copy's layout barrier both aspects #9057 merged on main 275e896 (run):
    • On GitHub's Linux runner (lavapipe), agc_driver_sample_order, agc_driver_sample_order_planning, agc_driver_pixel_sample_iteration and agc_driver_sample_location_grid_fallback pass 3 runs in a row. The grid-reference and recipe tests skip there, as you saw.
    • On Windows, without a GPU, 4 of those 6 skip and 2 pass.
    • The runners have no validation layer, so the failures on the 4070 Ti and the 00337 count aren't reproduced here.

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @DavidSamir and @EagleBearerYS. Both are in the Tested section now.

@DavidSamir, good to see the 680M fails the same two tests on main and passes them with these PRs. About grid_reference losing the device there: the 03242 next to it reads the timeline semaphore as 18446744073709551615, which is what a lost device reports. So I read that VUID as a consequence of the loss, not its cause. The loss is something separate from these two PRs: the 4070 Ti never loses the device in that test, and on main it fails earlier, on the read. I don't have an AMD GPU here. If you get a VK_EXT_device_fault report or the last submission before the loss, I'll gladly look at it.

AI-assisted: yes (Claude Code)

@gdols

gdols commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Windows result on NVIDIA. Windows 11 Pro 26300, GeForce RTX 3080, driver 616.92 (32.0.16.1692), Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7, Release, main 2f161d4 with #8310 applied so every AGC execution test builds.

  • main, full ctest with ANYPS5_REQUIRE_VULKAN=1: 1855 of 1858 pass. The three failures are the ones listed here, with the same messages.
  • main + this PR + fix(agc): give a depth stencil copy's layout barrier both aspects #9057, ctest -R sample_order --repeat until-fail:3 with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1: agc_driver_sample_order, agc_driver_sample_order_recipe_depth_locations and agc_driver_sample_order_planning pass 3 of 3. agc_driver_sample_order_grid_reference skips: the device does not keep depth drawn at custom sample locations (0 of 3005 sloped samples).
  • Not run under the validation layer.

AI-assisted: yes

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @gdols, that makes three devices where main fails these tests and this PR fixes them, and the first Windows NVIDIA one. I added it to the Tested section and the GPU line.

AI-assisted: yes (Claude Code)

@gdols

gdols commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Correction to my comment above: ctest's summary counts skipped tests as passed. The full run on main was 1838 passed, 17 skipped and 3 failed (the three here). The skips: 13 video_out_flip_* tests (no Vulkan under the SDL offscreen driver they run with), guest_video_out_wqhd_detection_no_vulkan (it hides the Vulkan driver), 2 udmabuf imports (Linux only) and agc_driver_stencil_ref_export (no VK_EXT_shader_stencil_export).

Under the validation layer, same machine. Vulkan SDK 1.4.363.0; VK_LOADER_DEBUG=layer shows VK_LAYER_KHRONOS_validation inserted as instance and device layer in every test that opens a device, and no log reports was not found but was requested by env var VK_INSTANCE_LAYERS. ctest -R sample_order -V with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1 (agc_driver_sample_order_planning opens no device):

Each message names its VUID twice, in the header and in the spec link, so counting the lines that contain each VUID gives 18 and 6, the counts in the description. If those were counted that way, the devices agree.

AI-assisted: yes

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks for the correction, @gdols. The Tested section now says 1838 passed, 17 skipped and 3 failed.

AI-assisted: yes (Claude Code)

@Amoenus

Amoenus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up after #9057 merged — 24 October 2026

Plain main a23f8fc9fba12b7ea4ffa4d91f85573a02587a51 still fails all three sample-order GPU groups on both physical devices, one fresh process per group/device. #9057 is already present; every group reports VUID-VkWriteDescriptorSet-descriptorType-00337. AMD grid-reference also reports timeline 03242 and device loss. The same failure set/VUID identifiers appears on our separately pinned Sonic composition; it is not introduced by its extra-mip changes.

I then merged @milescoviello's unchanged #9056 head 53949c0775e544f698ccfa6d30a36ffbf117e877 into that plain main as validation composition 3aac9d2dad. Only the test's SampleOrder.cpp differs from main; no production fix or replacement PR is added.

Group with #9056 RTX 5080 Radeon Graphics
default sample-order passes 3/3 passes 3/3
recipe depth locations passes 3/3 passes 3/3
grid-reference 1 skip, not a pass fails 3/3, device loss remains

CPU sample-order planning passes 3/3. Total 15 passes (12 GPU/3 CPU), one GPU skip, three GPU failures. The 00337 error is absent from every patched run. Passing groups and the NVIDIA skip have zero validation warnings/errors/VUIDs. NVIDIA's legal depth read reaches the existing skip: the composite holds guest-location depth in 0/3005 samples. AMD grid-reference still ends at vkQueueSubmit recorder: Vulkan result -4, with 03242 and device-fault read invalid at 0x200000000 in all three runs. The accompanying timeline diagnostic does not establish the device-loss cause. This is partial validation of #9056, not a green result for the entire family or an explanation of #9759's distinct recipe mismatch.

Exact pins, outcomes and full synthetic logs. Windows11 Enterprise26200, WinLibsGCC15.2r7/UCRT Release, SPIRV-Tools; NVIDIA610.62 and AMD32.0.21036.18. Actual adapters and loaded Khronos1.4.363 verified, required Vulkan, app shader cache/journal disabled, serial verbose CTest; driver caches/implicit layers unchanged. No timeouts; maximum1.982s across these baseline/patch checks. Stopped runner attempts and their completed outcomes are retained; skips are not counted as passes. No full-suite, title, performance or console claim.

The test-only change follows Vulkan's sampled-image usage requirement. AI-assisted validation/reporting: yes (Codex); author responsible.

Earlier confirmations at their original pins

Current-main confirmation — 2026-10-22 maintenance

Literal, unmodified main a6dcea9279b53b3a39c13695eac66f7c8b5b503c, matching selected library/native-fixture rebuild: the two sample-order depth groups still fail on both physical GPUs, one fresh process per group/device. agc_driver_multisample_readback, agc_driver_sample_multisample_target and agc_driver_multisample_retirement pass on each device: 6 positive controls, 4 failed tests. All finish below 30 s; no whole-test skips or timeouts.

  • RTX 5080: grid-reference composite-location assertion; recipe-depth clear/replay assertion. Eight validation-error message headers, all VUID-VkWriteDescriptorSet-descriptorType-00337.
  • Radeon Graphics/gfx1036: grid-reference ends with vkQueueSubmit recorder: Vulkan result -4; recipe-depth has the same clear/replay assertion. Six 00337 headers plus one VUID-VkSubmitInfo-pSignalSemaphores-03242. The timeline diagnostic accompanies device loss; this does not establish its cause.

Windows 11 Enterprise 26200 / WinLibs GCC 15.2 r7 UCRT Release, SPIRV-Tools ON; NVIDIA 610.62 and AMD 32.0.21036.18. Required Vulkan, disabled application shader cache/pipeline journal, Khronos 1.4.363 actually loaded and actual adapters verified in verbose serial CTest. Zero validation warnings. Driver caches and existing implicit layers were left as found. Message headers are counted once, separately from repeated specification links.

This confirms the main-side failures persist; it does not validate the proposed #9056/#9057 fixes. Our own PR refreshes retain these controls rather than folding in either foreign fix. Earlier repeated results remain at their original pins below.

Earlier current-main reproduction at its recorded pin

Independent main-only Windows confirmation while refreshing our MSAA PR stack. No fix result is claimed here.

Unmodified main 745b3946294a9d79e1177a289482768d6ab88c9a, WinLibs GCC 15.2 r7/UCRT Release, Windows 11 Enterprise 26200, SPIRV-Tools ON. Three planned fresh serial processes per selected fixture and GPU, 30 s bounds; Vulkan required, AnyPS5 cache/journal disabled, actual adapter and Khronos 1.4.363 insertion confirmed in every GPU log. Driver caches remain uncontrolled.

Physical GPU grid_reference recipe_depth_locations
RTX 5080 (10de:2c02), 610.62 /32.0.16.1062 fails 3/3: composite slopes assertion fails 3/3: clear/replay depth assertion
Radeon Graphics/gfx1036 (1002:13c0), 32.0.21036.18 fails 3/3: vkQueueSubmit recorder: Vulkan result -4 fails 3/3: clear/replay depth assertion

Counted validation-message headers, not both header and spec-link occurrences: NVIDIA has 24 00337 messages across these six processes. AMD has 18 00337 plus three 03242 messages across its six; the latter accompanies the device loss and does not establish its cause. No skips/timeouts. We did not run the default agc_driver_sample_order group, so these counts cover only the two named groups.

The existing readback, sampled-MSAA-target and retirement controls each pass once per GPU with the same required-device/layer setup and no validation errors. These failures are retained as main failures when comparing our refresh; this is not a reason to fold your correction into our production PRs or open a duplicate. Raw logs retained. No title/performance result. AI-assisted: yes (Codex); author responsible.

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @Amoenus, that adds an RTX 5080 and a gfx1036 to the devices where main fails these tests with 00337. I noted it in the Tested section as a main-only run.

AI-assisted: yes (Claude Code)

@MaxLikesCode

Copy link
Copy Markdown
Contributor

RTX 4090 (Ada) on Windows, head d930f7c08 merged onto main 2c4b116da (clean), alone and together with #9057 (78254bef6).

NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. ctest --test-dir build -R '^agc_driver_sample_order' -V with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, 3 runs without and 3 with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan-ValidationLayers vulkan-sdk-1.4.363.0, implicit layers disabled). The loader log shows the layer inserted, and no log has was not found but was requested by env var VK_INSTANCE_LAYERS.

Build sample_order _grid_reference _recipe_depth_locations _planning VUID- per validation run
main fails 6 of 6 fails 6 of 6 fails 6 of 6 passes 6 of 6 18 × 00337, 6 × 03320
main + #9056 passes 6 of 6 skips 6 of 6 passes 6 of 6 passes 6 of 6 6 × 03320
main + #9056 + #9057 passes 6 of 6 skips 6 of 6 passes 6 of 6 passes 6 of 6 none

On main the failures are the three messages in the description. _grid_reference skips as on the 3080: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so the device doesn't keep depth drawn at custom sample locations. This device reports maxSampleLocationGridSize 1x1 at every sample count and no shaderStorageImageMultisample. No run lost the device.

AI-assisted: yes (Claude Code)

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @MaxLikesCode. The RTX 4090 run matches the others: main fails the three tests with 00337 ×18, this PR passes them (_grid_reference skips as on the 3080), and with #9057 no VUID is left. I added it to the Tested sections and GPU lines here and on #9057.

AI-assisted: yes (Claude Code)

@akkadbakkad89

Copy link
Copy Markdown
Contributor

Independent Windows run on the same GPU family as #9313 (data only).

Environment: Windows 11, NVIDIA GeForce RTX 3070 (driver 617.42) + Intel UHD Graphics 630 (driver 31.0.101.2140), WinLibs GCC 15.2, Release, main 1698d1ea6a. The patch was applied as the file-level diff of d930f7c08 onto that main. ctest -R "^agc_driver_sample_order" with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (the layer is not installed on this machine — no VUID- lines and no "was not found but was requested" in the logs, so this run adds no validation-layer evidence).

RTX 3070 (vendor=0x10de device=0x2484):

  • main: agc_driver_sample_order, _grid_reference and _recipe_depth_locations all fail with the exact messages from AGC: agc_driver_sample_order tests read a depth target as all zeros on an NVIDIA Windows device and pass on Intel #9313 (the slopes did not leave depth both at and below the clear value, the clear between the recorded draw and its replay left depth other than the clear value). _planning not run.
  • With this change: agc_driver_sample_order pass, _recipe_depth_locations pass, _planning pass, _grid_reference skips — "the device does not keep depth drawn at custom sample locations at those locations", the same device-capability skip reported for the RTX 3080.

Intel UHD 630 (vendor=0x8086 device=0x9bc5): agc_driver_sample_order and _recipe_depth_locations fail identically on main and with this change — different failure modes from the depth-read issue: sample_order fails at "the 2x depth format 130 through a depth pass exporting stencil" (stencil byte reads 0x00, expected 0x62), and the recipe test reports "the device reads depth drawn at custom sample locations back at other locations" (this device advertises only 1x1 sample-location grids and lacks shaderStorageImageMultisample). Pre-existing capability failures, not moved by this PR. _grid_reference skips on both; _planning passes.

Net: this fixes the NVIDIA read on the 3070 exactly as on the 3080/4090 — #9313's report should close with it. The UHD 630 failures are a separate device-capability gap worth their own tracking if not already covered.

AI-assisted: yes (Devin).

@milescoviello

Copy link
Copy Markdown
Contributor Author

Thanks @akkadbakkad89. The RTX 3070 result matches the 3080 and 4090, and it is the device in #9313, so this PR now says Fixes #9313. I added both GPUs to the Tested section. The UHD 630 failures are separate, as you say: they fail the same way on main, from the stencil read and the 1x1 sample location grid.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the fix error Closes an issue (Fixes #N) label Oct 21, 2026
The sample order tests read a reordered depth surface by binding the
surface's own view as a sampled image. A multisampled depth surface that
is sampled through a shadow image is created without
VK_IMAGE_USAGE_SAMPLED_BIT, so that descriptor is invalid
(VUID-VkWriteDescriptorSet-descriptorType-00337). The tests now copy the
depth plane into an image of their own with sampled usage, as the
reorder pass itself does, and read that copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milescoviello
milescoviello force-pushed the fix/sample-order-test-depth-read branch from 0fd624d to 53949c0 Compare October 23, 2026 18:56
@milescoviello

Copy link
Copy Markdown
Contributor Author

@MarcZX10 refreshed as you asked: rebased onto main d2e42c3 as 53949c0775. The commit is unchanged (git range-diff), and SampleOrder.cpp still hasn't changed on main.

On that head, Linux (Ubuntu 26.04.1, GCC 15.2, Release, RTX 4070 Ti, NVIDIA 615.71.09), the four ^agc_driver_sample_order tests, 3 runs each:

build result
main d2e42c3 sample_order, _grid_reference and _recipe_depth_locations fail, 3 of 3
this PR (53949c0775) 4 of 4 pass, 3 of 3
#9057 alone (7333de6aee) sample_order, _grid_reference and _recipe_depth_locations fail, 3 of 3
this PR + #9057 4 of 4 pass, 3 of 3

#9057 is rebased onto the same main too.

AI-assisted: yes (Claude Code)

@LeandroLP23

LeandroLP23 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RDNA 3.5 data point under AMD's Windows driver, for #9313 and #9507. Radeon 860M (1002:1114), driver 32.0.13058.8001, Windows 11 26300, WinLibs GCC 15.2.0, Release, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, no validation layer (not installed here). Merged with main e7f46f5c89, each case built with libs and the sample-order and graphics test targets. Three runs per case, with %LOCALAPPDATA%\AMD\VkCache emptied before each run (backed up and restored afterwards):

Test main + #9056 (53949c0775) + #9056, #9057 (7333de6aee), #9503 (ba1a4d0cd6)
agc_driver_sample_order fail 3/3 pass 3/3 pass 3/3
agc_driver_sample_order_recipe_depth_locations fail 3/3 pass 3/3 pass 3/3
agc_driver_sample_order_grid_reference fail 3/3 fail 3/3, different message fail 3/3, same as with #9056
agc_driver_sample_order_planning pass 3/3 pass 3/3 pass 3/3

On main the failures are the depth ones from #9313 (the slopes did not leave depth both at and below the clear value). With #9056 the depth checks of --grid-reference all pass: every one of the 3,005 sloped depth samples holds the slope's depth at the guest's locations, on the exact path and on the device's 2x2 grid alike. What fails now is the color comparison of the exact path against the reference:

2x checkerboard at 64x32: the device's 2x2 grid differs from the composite of four uniform renders in 0 samples and from the exact path in 42 samples
color with the samples put in the guest's order: sample 1 of pixel (33, 1) is 0x3bb1c000 0x3f7b6000 0x3f800000 0x3f800000, the reference's is 0x3bb1c000 0x3f7b8000 0x3f800000 0x3f800000
color with the samples put in the guest's order: sample 0 of pixel (34, 1) is 0x3c6c4000 0x3f7b0000 0x00000000 0x00000000, the reference's is 0x3c6c4000 0x3f7ae000 0x00000000 0x00000000
color with the samples put in the guest's order: sample 1 of pixel (33, 2) is 0x3c856000 0x3f722000 0x3f800000 0x3f800000, the reference's is 0x3c856000 0x3f720000 0x3f800000 0x3f800000
color with the samples put in the guest's order: sample 0 of pixel (34, 2) is 0x3d312000 0x3f712000 0x00000000 0x00000000, the reference's is 0x3d312000 0x3f716000 0x00000000 0x00000000
2x checkerboard at 64x32: the exact path differs from the reference in 42 color and 0 depth samples; pixel (0,0)'s locations alone differ in 1552 samples
AGC graphics: the exact path did not render the checkerboard bit for bit like the reference

The differences are in the second channel only, by one or two steps of the stored value, on pixels at x = 33 and 34 next to the checkerboard's middle. So it looks like interpolation at the custom locations differing slightly between the exact path and the reference on this device. The device also logs the device lacks shaderStorageImageMultisample at 2 samples. #9057 and #9503 don't change anything on this device. The device loss of #9507, which #9503 fixes, doesn't happen on this device on main either.

AI-assisted: yes (Claude Code)

@milescoviello

Copy link
Copy Markdown
Contributor Author

@LeandroLP23 thanks, that's the first RDNA 3.5 run, and with AMD's shader cache emptied each time. It matches what this PR is for: sample_order and _recipe_depth_locations fail on main and pass with it, and every sloped depth sample of --grid-reference now holds. The 42 color samples that still differ by a step or two in one channel next to the checkerboard's middle are the same difference @SoRadGaming reported on RDNA 4, so it looks like AMD interpolating at custom sample locations slightly differently from the reference, not this change. I added your run to the description and the GPU list.

AI-assisted: yes (Claude Code)

@Amoenus

Amoenus commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Windows follow-up after #9057 merged: your unchanged 53949c0775 merged onto main a23f8fc9fb as 3aac9d2dad. Default sample-order and recipe-depth groups pass 3/3 each on both RTX5080 and Radeon Graphics, with CPU planning3/3. 00337 is absent throughout. Grid-reference remains qualified separately: NVIDIA skips its unsupported custom-depth comparison; AMD still loses the device3/3 with 03242/an invalid read at0x200000000. Thus15passes,1skip,3failures; no blanket approval of all groups. Full existing #9313 report contains exact environment, pins, logs and limits. Only your test file differs from main; original authorship retained, no production changes. AI-assisted validation/reporting: yes (Codex).

@milescoviello

Copy link
Copy Markdown
Contributor Author

@Amoenus thank you for running it again after #9057 landed, on both GPUs and under the layer. That's the result this PR is for: the two depth groups pass on NVIDIA and AMD and the 00337 descriptor errors are gone. The AMD device loss in _grid_reference is the one your earlier main-only runs already showed (#9507), and #9503 is the fix for it, so I've kept it outside this PR. Your run is in the Tested section now.

AI-assisted: yes (Claude Code)

@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 24, 2026 10:21

Dismissing a stale review: the requested changes were addressed after it (new head and/or updated description with the asked-for runs) and the merge queue blocks on it. Please request changes again if anything is still open.

@brummilab

Copy link
Copy Markdown

Tested on an AMD Radeon RX 6600 XT (Navi 23, 0x73ff), AMD driver 32.0.21045.16010, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, merged onto main 60465af (head 53949c077), 3 runs: sample_order and _recipe_depth_locations fail on main (2x scene with the standard locations: sample 0 of pixel (0, 0) holds depth 1075959298965006122069398516662272.000000; the clear between the recorded draw and its replay left depth other than the clear value) and pass with this PR. _grid_reference still fails with this PR alone (read invalid at 0x200000000, Vulkan result -4) and passes together with #9503; full table in #9503. Not run with the validation layer.

AI-assisted: yes

@TechLevelZero

Copy link
Copy Markdown
Contributor

Tested on Linux with NVIDIA and two RADV devices, with the validation layer: the 00337 errors are gone on all three GPUs, the NVIDIA failures are fixed, and nothing new appears.

NVIDIA A800 80GB PCIe, NVIDIA 610.57.04, RHEL 10.2 (Ubuntu 26.04 container, GCC 15), ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
Head 53949c077 merged onto main 6cd36e651. These are the 246 tests tools/select_tests.py selects for the PR, run on main and on the merge with ctest -V. The validation layer loaded on both.

Test main PR
agc_driver_sample_order Failed: "2x scene with the standard locations: the slopes did not leave depth both at and below the clear value" Passed
agc_driver_sample_order_grid_reference Failed: "the composite of uniform renders: the slopes did not leave depth both at and below the clear value" Skipped (77)
agc_driver_sample_order_recipe_depth_locations Failed: "pixel (0,0)'s locations in every pixel: the clear between the recorded draw and its replay left depth other than the clear value" Passed
VUID-VkWriteDescriptorSet-descriptorType-00337 18 0

With the PR, _grid_reference skips because the A800 does not keep depth drawn at custom sample locations at those locations:

the composite of uniform renders: of 3005 sloped depth samples, 0 hold the slope's depth at the guest's sample locations (0 of 1499 on even rows, 0 of 1506 on odd rows) and 3005 at the standard 2x locations
the exact path: of 3005 sloped depth samples, 1499 hold the slope's depth at the guest's sample locations (1499 of 1499 on even rows, 0 of 1506 on odd rows) and 0 at the standard 2x locations
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

The device reports its largest 2-sample location grid as 2x4 pixels.

No other test changes. pr_overlap_encoding fails on both sides because the container's checkout isn't a git repository for that test (fatal: not a git repository).

AMD Radeon RX 9070 XT (RADV GFX1201) and AMD Ryzen 7 9700X integrated graphics (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.0.8, Fedora 44 Linux 7.2.7 (Ubuntu 26.04 container)
The three tests run directly with the same environment, main at 6cd36e651:

Test main PR
agc_driver_sample_order passes, 6 × 00337 passes, no VUIDs
agc_driver_sample_order --grid-reference passes, 14 × 00337 passes, no VUIDs
agc_driver_sample_order --recipe-depth-locations passes, 12 × 00337 passes, no VUIDs

Same on both GPUs: all three pass on both sides (39 swap round trips, 6 shader remap checks and 3 scene checks for the default case), and the PR removes every 00337.

@milescoviello

Copy link
Copy Markdown
Contributor Author

@brummilab @TechLevelZero thank you, both runs are now in the Tested section. The A800 skip of _grid_reference is the test's own check for devices that don't keep depth at custom sample locations, so that's the expected result there, and the RX 6600 XT result matches the other runs where _grid_reference needs #9503 as well.

AI-assisted: yes (Claude Code)

@adriadam10
adriadam10 merged commit 1e740a2 into boykopovar:main Oct 24, 2026
18 checks passed
JJenkx added a commit to JJenkx/AnyPS5 that referenced this pull request Oct 29, 2026
The sample order depth pass bound its descriptor set before the render
pass's first pipeline, then bound each pipeline in the draw. On AMD's
Windows driver (Radeon RX 6700 XT, 26.10.1) the pixel shader of that
draw then read its image descriptor from address 0x200000000: Radeon GPU
Detective puts the page fault on the s_load_dwordx8 of the set's first
image in the sample order pixel shader, and the device is lost, so
agc_driver_sample_order_grid_reference fails on vkQueueSubmit (-4)
before anything is read back.

The set is now bound after each pipeline. With that,
agc_driver_sample_order_grid_reference reaches its depth checks; with
boykopovar#9056's test change as well, it and the other two sample order tests
pass 10 of 10 runs on that device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JJenkx added a commit to JJenkx/AnyPS5 that referenced this pull request Oct 30, 2026
The sample order depth pass bound its descriptor set before the render
pass's first pipeline, then bound each pipeline in the draw. On AMD's
Windows driver (Radeon RX 6700 XT, 26.10.1) the pixel shader of that
draw then read its image descriptor from address 0x200000000: Radeon GPU
Detective puts the page fault on the s_load_dwordx8 of the set's first
image in the sample order pixel shader, and the device is lost, so
agc_driver_sample_order_grid_reference fails on vkQueueSubmit (-4)
before anything is read back.

The set is now bound after each pipeline. With that,
agc_driver_sample_order_grid_reference reaches its depth checks; with
boykopovar#9056's test change as well, it and the other two sample order tests
pass 10 of 10 runs on that device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* fix error Closes an issue (Fixes #N)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AGC: agc_driver_sample_order tests read a depth target as all zeros on an NVIDIA Windows device and pass on Intel