Skip to content

test(agc): align the array window test's texels at run time - #8310

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:fix/agc-array-window-texel-alignment
Oct 22, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
dantdmdarealguy:fix/agc-array-window-texel-alignment

Conversation

@dantdmdarealguy

Copy link
Copy Markdown
Contributor

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_TESTS empty, the default) stops on main e9a5a0c84 (still present on d14a186f4), because the required WinLibs GCC 15.2.0 r7 rejects the test's 64 KiB aligned static array:

FAILED: core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_image_array_window_past_layer_limit_tests.dir/tests/execution/ImageArrayWindowPastLayerLimit.cpp.obj
X:/.../tests/execution/ImageArrayWindowPastLayerLimit.cpp:33:52: error: requested alignment '65536' exceeds object file maximum 8192
   33 | alignas(65536) std::array<std::uint8_t, 4u << 20u> Texels{};
ninja: build stopped: subcommand failed.

Windows CI builds only three execution tests, so it does not catch this. The fix is the one #6452 made for #6716: Texels is now a 64 KiB aligned 4 MiB span inside a static array 64 KiB - 1 bytes larger, and main checks 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.

  • main e9a5a0c84: 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$" with ANYPS5_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 with ANYPS5_GPU=Intel. Each run prints a window of a 1D array past maxImageArrayLayers was sampled and loaded from its viewed layers.
  • Same test with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.0 layer, loaded via VK_ADD_LAYER_PATH; VK_LOADER_DEBUG=layer shows it inserted), ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and ctest -V: passes with 0 VUID- and no was not found but was requested by env var VK_INSTANCE_LAYERS. main has 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 is agc_driver_pass_input_hazard, which also fails on main and is fixed by fix(agc): require the pass-input barrier only for an in-place read #7954.
  • patched_libraries: 352 patched libraries loaded, 0 failed. The full build and the libs target build with no warnings. tools/check_test_registration.py, tools/check_conventions.py --base origin/main and tools/pr_overlap.py --branch pass.

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: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 32.0.16.1742, Windows 11 Pro; Intel UHD Graphics 770, driver 32.0.101.7092, Windows 11 Pro
  • AI-assisted: yes, some AI assistance was used

WinLibs GCC 15.2.0 rejects the alignas(65536) static array that agc_driver_image_array_window_past_layer_limit added in boykopovar#6772 (requested alignment '65536' exceeds object file maximum 8192), which stops a Windows build with every AGC execution test. Take a 64 KiB aligned 4 MiB span of a larger static array instead, as boykopovar#6452 did for the indirect arguments block, and check its alignment at start.
@Amoenus

Amoenus commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

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 01e5f8f199168a5da99b1e846fd70fcf715b986f plus your exact ca55e46f98ad85861dd7567abad0c028274daca1 prerequisite:

Fixture AMD Radeon Graphics NVIDIA RTX 5080
Original expectation 3/3 reproduce the assertion failure 3/3 pass
Selected-view expectation 3/3 pass, including the full view 3/3 pass, retaining the over-limit refusal

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.

@wachi35676

Copy link
Copy Markdown
Contributor

Reproduced the break and the fix on Windows 11, WinLibs GCC 15.2.0 (MinGW), Release, BUILD_TESTING=ON.

  • main 56b299c3a: ImageArrayWindowPastLayerLimit.cpp:33:52: error: requested alignment '65536' exceeds object file maximum 8192, so a full Windows build stops there.
  • With this PR merged: the target compiles and the full build completes. agc_driver_image_array_window_past_layer_limit (ANYPS5_REQUIRE_VULKAN=1):

AI-assisted: yes (Claude Code); results above were run on this machine.

@screamm

screamm commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

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 head ca55e46f9.

  • Main: building the agc_driver_image_array_window_past_layer_limit_tests target stops at ImageArrayWindowPastLayerLimit.cpp:33:52: error: requested alignment '65536' exceeds object file maximum 8192.
  • With this PR merged onto main: the target builds and links, and ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_image_array_window_past_layer_limit$' --repeat until-fail:3 -j1 --timeout 300 passes 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 in main passed, and prints a window of a 1D array past maxImageArrayLayers was sampled and loaded from its viewed layers.
  • tools/check_conventions.py --base origin/main and git diff --check pass.

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

@harisibrar1

Copy link
Copy Markdown

@oneandonlydean this was closed without a merge or a comment, but main (c61d20f) still has alignas(65536) at ImageArrayWindowPastLayerLimit.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?

@dantdmdarealguy

Copy link
Copy Markdown
Contributor Author

@oneandonlydean I think this may have been closed by mistake: there was no comment, and main still has alignas(65536) at ImageArrayWindowPastLayerLimit.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?

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@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_limit passes with nothing else failing.

@oneandonlydean
oneandonlydean merged commit 4a17c71 into boykopovar:main Oct 22, 2026
22 checks passed
milescoviello added a commit to milescoviello/AnyPS5 that referenced this pull request Oct 22, 2026
The test declared its depth plane alignas(65536). WinLibs GCC 15.2
rejects static objects aligned above 8192 bytes ("requested alignment
'65536' exceeds object file maximum 8192"), so agc_driver_depth_copy_draw
did not build on Windows. The plane is now a 64 KiB aligned span inside
a larger array, as boykopovar#8310 does for the array window test, and the test
checks the alignment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milescoviello added a commit to milescoviello/AnyPS5 that referenced this pull request Oct 23, 2026
The test declared its depth plane alignas(65536). WinLibs GCC 15.2
rejects static objects aligned above 8192 bytes ("requested alignment
'65536' exceeds object file maximum 8192"), so agc_driver_depth_copy_draw
did not build on Windows. The plane is now a 64 KiB aligned span inside
a larger array, as boykopovar#8310 does for the array window test, and the test
checks the alignment.

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*

Projects

None yet

Development

Successfully merging this pull request may close these issues.