test(agc): align the array window test's texels at run time #8310
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8310"
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 dantdmdarealguy on 2026-10-20T09:41:44Z.
What
Restores the Windows build of
agc_driver_image_array_window_past_layer_limit, which #6772 added. A Windows build with every AGC execution test (ANYPS5_AGC_EXECUTION_TESTSempty, the default) stops onmaine9a5a0c84(still present ond14a186f4), because the required WinLibs GCC 15.2.0 r7 rejects the test's 64 KiB aligned static array:Windows CI builds only three execution tests, so it does not catch this. The fix is the one #6452 made for #6716:
Texelsis now a 64 KiB aligned 4 MiB span inside a static array 64 KiB - 1 bytes larger, andmainchecks the alignment before opening the device. The texture descriptor, shader, layers and expected texels are unchanged, and no driver code changes.Tested
Windows 11 Pro, Intel Core i9-14900K, 128 GB RAM, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, every execution test built.maine9a5a0c84: building the test's object fails with the error above. With this change it builds and links.ctest -R "^agc_driver_image_array_window_past_layer_limit$"withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: 5 of 5 pass on the RTX 5080 (0.39-0.51 s), and 3 of 3 pass on the Intel UHD Graphics 770 withANYPS5_GPU=Intel. Each run printsa window of a 1D array past maxImageArrayLayers was sampled and loaded from its viewed layers.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Vulkan SDK 1.4.363.0 layer, loaded viaVK_ADD_LAYER_PATH;VK_LOADER_DEBUG=layershows it inserted),ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V: passes with 0VUID-and nowas not found but was requested by env var VK_INSTANCE_LAYERS.mainhas no run to compare, because the test does not build there.ctest -R "^agc_|video_out|pad_"with--parallel 2: 853 of 854 pass. The one failure isagc_driver_pass_input_hazard, which also fails onmainand is fixed by #7954.patched_libraries: 352 patched libraries loaded, 0 failed. The full build and thelibstarget build with no warnings.tools/check_test_registration.py,tools/check_conventions.py --base origin/mainandtools/pr_overlap.py --branchpass.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 Amoenus on 2026-10-20T10:22:13Z.
Your exact allocation correction restores the supported WinLibs GCC 15.2.0 r7 build here. Our full Windows integration also builds successfully.
The separate AMD expectation correction is now proposed as #8361, depending on this PR. It replaces the fixed three-layer sampling bound with the selected view's bound,
LastArray - baseArray. AMD accepts the base-zero 8,103-layer view, where coordinate 5 correctly reads layer 5 (107/255), while the old fixture expects layer 2 (147/255). The narrow view starting at 8100 keeps its three-layer bound.The final paired check uses upstream production main
01e5f8f199168a5da99b1e846fd70fcf715b986fplus your exactca55e46f98ad85861dd7567abad0c028274daca1prerequisite:All twelve runs verified the actual adapter and inserted Khronos validation device layer, with required Vulkan, shader cache disabled, and zero Vulkan errors/warnings/VUIDs. Windows 11 Enterprise 26200; RTX 5080 driver 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics 32.0.21036.18. Exact fork composition pins and the Vulkan 1.4.363 reference are in #8361. These final results are independent of our broader Sonic runtime composition.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-20T12:28:17Z.
Reproduced the break and the fix on Windows 11, WinLibs GCC 15.2.0 (MinGW), Release,
BUILD_TESTING=ON.main56b299c3a:ImageArrayWindowPastLayerLimit.cpp:33:52: error: requested alignment '65536' exceeds object file maximum 8192, so a full Windows build stops there.agc_driver_image_array_window_past_layer_limit(ANYPS5_REQUIRE_VULKAN=1):1002:13c0, AMD proprietary 2.0.353): fails 3/3 withimage_sample_lz on a window of a 1D array past maxImageArrayLayers: thread 7 component 0 is 107.000000/255, expected 147/255. That's the expectation #8361 corrects. With #8361 merged on top, it passes 3/3 on both GPUs.AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-20T13:21:49Z.
Second independent run, this time with the test executed. Amoenus already confirmed the build on an RTX 5080.
Host: Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 driver 596.21, Ryzen 7 5700X, WinLibs MinGW-w64 GCC 15.2 r7, Release,
BUILD_TESTING=ON, execution tests at their default.Main
d50ec76da, PR headca55e46f9.agc_driver_image_array_window_past_layer_limit_teststarget stops atImageArrayWindowPastLayerLimit.cpp:33:52: error: requested alignment '65536' exceeds object file maximum 8192.ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_image_array_window_past_layer_limit$' --repeat until-fail:3 -j1 --timeout 300passes 3 of 3 on the RTX 4070. Each run reaches the device (Selected GPU name=NVIDIA GeForce RTX 4070), so the new 64 KiB alignment check inmainpassed, and printsa window of a 1D array past maxImageArrayLayers was sampled and loaded from its viewed layers.tools/check_conventions.py --base origin/mainandgit diff --checkpass.Not checked: Vulkan validation layers, the rest of the test suite, title runs, a full GPU pass, Linux. I did not force a misaligned array to see the new check fire.
Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-21T05:01:00Z.
Third host — the build fix verified on the supported toolchain, plus a new GPU datapoint.
Host: Windows 11 Pro 10.0.26300, Intel Core i7-10700, NVIDIA GeForce RTX 3070 driver 617.42, WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT POSIX SEH, Release, BUILD_TESTING=ON.
main2185dbf92with this PR'sImageArrayWindowPastLayerLimit.cppapplied.ImageArrayWindowPastLayerLimit.cpp:33:52: error: requested alignment '65536' exceeds object file maximum 8192, full Windows build stops there — reproduced.ANYPS5_REQUIRE_VULKAN=1,ctest -R '^agc_driver_image_array_window_past_layer_limit$' -j1): reaches the device (Selected GPU name=NVIDIA GeForce RTX 3070), passes the write-watch preamble, then fails deterministically (2/2 runs) withstd::bad_allocraised insidenvoglv64.dllon a driver worker thread (vulkan-1.dll -> nvoglv64.dllin the stack candidates). 19 GB host RAM free at the time, so not memory pressure.So on this card/driver the array-window path dies in the NVIDIA runtime before any sample comparison — different outcome from the 4070/5070 Ti passes. If it helps narrow it:
maxImageArrayLayers = 2048here too. Happy to retest with any instrumentation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:10:01Z.
Thanks for the 3070 datapoint. Looking at the test, the initial
Run(*device)exercises the three-layer view at base 8100; the laterRun(*device, 0)deliberately probes the full 8103-layer view and only treats the emulator’s explicit over-limit refusal as expected. Since your report says the test reaches the sample test before failing, can you confirm whether thestd::bad_alloccomes from that second call? If so, this may expose a separate guard gap: the emulator should reject the over-limit view before handing it to the Vulkan driver, instead of relying on a driver allocation failure.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T05:20:44Z.
Cross-reference for the RTX 3070 result: on an AMD RX 6700 XT (Windows 11 22621, AMD driver 26.8.1, WinLibs GCC 15.2 UCRT r7, Release) with this PR applied,
agc_driver_image_array_window_past_layer_limitpasses, both calls included (fullctest1747/1747 onmain44e3389c8with this PR and #8361; details on #8361). So thestd::bad_allocinsidenvoglv64.dllis specific to the NVIDIA driver path on the same test. That fits @MarcZX10's reading: an over-limit view that one driver tolerates and another fails to allocate.Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-21T06:24:03Z.
Another AMD driver version, on an RDNA 2 iGPU. Windows 11 Pro 26200, AMD Radeon 680M (
1002:1681, Ryzen 7 6800H), AMD driver 32.0.21030.2001 (Vulkan 1.4.315,maxImageArrayLayers = 8192), WinLibs GCC 15.2.0 r7, Release.main1ff5c8ac5.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, each run from a renamed copy of the executable.mainImageArrayWindowPastLayerLimit.cpp:33:52: error: requested alignment '65536' exceeds object file maximum 8192main+ this PR (ca55e46f9)thread 7 component 0 is 107.000000/255, expected 147/255main+ this PR + #8361 (7d2acdb16)VK_LAYER_KHRONOS_validation(SDK 1.4.363) with 0VUID-linesThe 107/255 failure comes from the second call,
Run(*device, 0). Thread 7 asks for layer 5.0, and 107 is layer 5's texel. WithmaxImageArrayLayers = 8192, the 8103-layer view is legal on this device, so the GPU samples layer 5 correctly. That is what #8361 corrects, not something this PR has to handle. This PR fixes the Windows build as described.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by kanza-cm on 2026-10-21T18:50:45Z.
Independent confirmation that the break is still on current
maind34da5d69(2026-10-21): a default Windows build (WinLibs GCC 15.2.0 r7,-DBUILD_TESTING=ON, every AGC execution test) stops atImageArrayWindowPastLayerLimit.cpp:33with the samerequested alignment '65536' exceeds object file maximum 8192. Windows CI does not see it because it passes-DANYPS5_AGC_EXECUTION_TESTS=F16ToF32Unpack;F64FmaSubnormals;RegistrationPrepareShutdown.I had opened #9304 for this before finding yours, then closed it as a duplicate. With the same kind of change (4 KiB section alignment, pointer rounded up to 64 KiB) the target builds and
agc_driver_image_array_window_past_layer_limitpasses on an NVIDIA GeForce RTX 3070 Laptop (driver 32.0.16.1078), which adds a second GPU vendor to the run in your description.Imported from boykopovar/AnyPS5. Originally posted by lost9409 on 2026-10-21T23:18:13Z.
Confirmed on Windows 11 Pro (build 26200), NVIDIA GeForce RTX 5070 Ti, driver 610.88, using WinLibs GCC 15.2.0 r7, CMake 4.3.1 and Ninja 1.13.2.
On base commit
a6dcea9279, the full build failed with:requested alignment '65536' exceeds object file maximum 8192
After applying only ImageArrayWindowPastLayerLimit.cpp from this PR at commit
ca55e46f98, the full build completed successfully.agc_driver_image_array_window_past_layer_limit passed in 0.59 seconds with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1. The log confirms the RTX 5070 Ti was selected.
The full test suite was not run, and Vulkan validation layers were not enabled for this run.
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T01:49:56Z.
Review: APPROVED
Verified on Windows 11, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, full build of maina6dcea927with every execution test built:requested alignment '65536' exceeds object file maximum 8192. It's the only failing step of the 6,171 in the full build. CI doesn't catch it becauseANYPS5_AGC_EXECUTION_TESTSbuilds the other execution tests asExecutionTestNotBuilt.cppunless they're selected.agc_driver_image_array_window_past_layer_limit_testscompiles and links.GpuIndirectArgumentsMisalignedWriterAhead.cpp(#6716), and the newRequirechecks the 64 KiB alignment.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T04:17:59Z.
@oneandonlydean this was closed without a merge or a comment, but main (
c61d20f54) still hasalignas(65536)atImageArrayWindowPastLayerLimit.cpp:33, so a full Windows build with every execution test still stops there, as confirmed above. Was it closed in favour of another fix, or could it be reopened?Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-22T04:35:12Z.
@oneandonlydean I think this may have been closed by mistake: there was no comment, and
mainstill hasalignas(65536)atImageArrayWindowPastLayerLimit.cpp:33, so a full Windows build with the execution tests still stops at that object (requested alignment '65536' exceeds object file maximum 8192). The branch still merges cleanly. GitHub won't let me reopen it after a maintainer close; could you reopen it, or let me know if a different fix is planned?Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T05:16:36Z.
@harisibrar1 @dantdmdarealguy thanks both, and sorry: it was closed by mistake. It's reopened and back in review. I'm running the full workflow on this head now and will merge it if Linux
agc_driver_image_array_window_past_layer_limitpasses with nothing else failing.