Repository navigation
test(agc): clamp the array window test's layer to the slices its view covers - #8969
Conversation
… covers The second run views slices 0 through 8102. A device whose maxImageArrayLayers is above 8102, such as RADV, accepts that view instead of refusing it, and then samples the layer the coordinate selects. The expected texel still clamped the layer to the three-slice window of the first run, so a sample at layer 5 read 107/255 where the test wanted layer 2's 147/255.
jotitadev
left a comment
There was a problem hiding this comment.
A run on a device with maxImageArrayLayers 2048, the case the description notes was not covered.
Machine: Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. NVIDIA GeForce RTX 3070 (driver 595.99.02, maxImageArrayLayers 2048) and lavapipe (Mesa 26.0.3, LLVM 21.1.8, also 2048). Head 0ad445efd applied onto main 0c6a5bd59 (3-way, clean). ANYPS5_NO_SHADER_CACHE=1, -j1 --timeout 60.
agc_driver_image_array_window_past_layer_limit |
RTX 3070 | lavapipe |
|---|---|---|
main |
pass | pass |
| this PR | pass | pass |
On both devices the test passes on main and with this PR: the limit is 2048, so the second Run is refused and the first is served from its viewed slices (-V shows a window of a 1D array past maxImageArrayLayers was sampled and loaded from its viewed layers). The expectation change only moves the clamp for the covered-slice window, which these devices do not reach, so there is no behaviour difference here. This confirms the change is safe on maxImageArrayLayers 2048 hardware; the red-to-green it fixes still needs a device with a higher limit (RADV), as the description says.
Not run: a device with a limit above 8102, Windows, the Khronos validation layer (not installed on this host).
GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3), Ubuntu 26.04
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Checked the expectation change: with base 8100 the clamp is still 2 (expected values unchanged), and with base 0 on a device that accepts the 8103-slice view the clamp now follows the slices the view covers, matching the 107 RADV returns. Devices that refuse the view are unaffected, as confirmed by @jotitadev on RTX 3070 and lavapipe. The one red test in the Build run ( |
What
agc_driver_image_array_window_past_layer_limit(from #6772) fails on RADV, 3 of 3 runs:The failure is in the test's expectation, not in the driver.
The second
Run(*device, 0)views slices 0 through 8102 of the 1D array. On a device whosemaxImageArrayLayersis 2048 (NVIDIA, lavapipe),ArrayLayerWindowrefuses that view and the test accepts the refusal. RADV's limit is higher than 8102: the driver creates the full array (layers=8103in the log) and the dispatch runs.The expected texel still clamps the layer coordinate to
Layers - 1, which only fits the three-slice window of the first run. Thread 7 samples layer 5.0. The view covers it, so the hardware returns layer 5, which is (5·8+0)·9+3 mod 256 = 107. The test expected layer 2 instead: (2·8+0)·9+3 = 147.The expectation now clamps to the slices the view covers,
LastArray - baseArray:On RADV, neither run reaches
ArrayLayerWindow's past-limit branch: the first run is served by the viewed-slice window. So that branch is still covered only on devices with a lower limit.Tested
Arch Linux (Omarchy), kernel 7.2.5, GCC 16.2.1, Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON, basemain71401e331.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -j1 -V -R 'image_array_window|array_layer|layer_limit'. That is 2 tests:agc_driver_image_array_window_past_layer_limitandagc_driver_array_layer_target. Three runs each:mainmain:agc_driver_image_array_window_past_layer_limitfails every time, with the message above.sampled array view ... slices 8100..8102 served from its viewed slices; the second is alayers=8103texture.VK_LAYER_KHRONOS_validationin both tests of every run (VK_LOADER_DEBUG=layer). No log containswas not found but was requested by env var VK_INSTANCE_LAYERS, and neither side logs aVUID-line.Not run on a device with
maxImageArrayLayers2048. The change cannot alter that path: the refusal is caught before the expectation is checked.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)