test(agc): clamp the array window test's layer to the slices its view covers #8969
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8969"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Chuk49 on 2026-10-21T07:50:44Z.
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)Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-21T21:56:35Z.
Review: COMMENTED
A run on a device with
maxImageArrayLayers2048, 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,maxImageArrayLayers2048) and lavapipe (Mesa 26.0.3, LLVM 21.1.8, also 2048). Head0ad445efdapplied ontomain0c6a5bd59(3-way, clean).ANYPS5_NO_SHADER_CACHE=1,-j1 --timeout 60.agc_driver_image_array_window_past_layer_limitmainOn both devices the test passes on
mainand with this PR: the limit is 2048, so the secondRunis refused and the first is served from its viewed slices (-Vshowsa 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 onmaxImageArrayLayers2048 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.