fix(agc): align the layer-window test texels at run time so Windows builds #9304

Closed
kanza-cm wants to merge 1 commit from upstream-pr/9304 into main
kanza-cm commented 2026-10-21 17:52:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kanza-cm on 2026-10-21T17:52:50Z.


What

alignas(65536) on a namespace-scope object asks COFF for a section alignment above its 8192-byte maximum, so the Windows build of agc_driver_image_array_window_past_layer_limit_tests fails with requested alignment '65536' exceeds object file maximum 8192, and the full build stops there.

Keep the storage at 4 KiB section alignment and round its texel pointer up to 64 KiB inside a buffer with 64 KiB of slack, which is how the other execution tests obtain the guest tiling alignment (CmaskFastClear.cpp, DcdKeyPresync.cpp). The texels stay 64 KiB aligned; only the storage declaration changes.

Tested

  • Windows 11, NVIDIA GeForce RTX 3070 Laptop GPU, driver 32.0.16.1078, WinLibs GCC 15.2.0 (the toolchain docs/dev/BUILD.md names), Release, -DANYPS5_RELINKER_ONLY=OFF -DBUILD_TESTING=ON.
  • Before: cmake --build build stops at 3352/6158 with the alignment error. After: the full build completes.
  • agc_driver_image_array_window_past_layer_limit passes (1.72 s) on the GPU above.
  • Full ctest: 1858 of 1861 pass. The three failures (agc_driver_sample_order, agc_driver_sample_order_grid_reference, agc_driver_sample_order_recipe_depth_locations) are depth and sample-location assertions in executables that do not include this file; I will report them separately.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py reports no overlap.
  • Windows CI does not compile this file: the workflow passes -DANYPS5_AGC_EXECUTION_TESTS=F16ToF32Unpack;F64FmaSubnormals;RegistrationPrepareShutdown, which builds a skip stub for every other execution test. The default developer build compiles all of them, so the break only appears there, on a machine with Vulkan present.
  • Not tested on AMD or Intel GPUs, nor on Linux; the change is to test storage only.

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 3070 Laptop GPU, driver 32.0.16.1078, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4955974008 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9304). Originally posted by [kanza-cm](https://github.com/kanza-cm) on 2026-10-21T17:52:50Z. --- ### What `alignas(65536)` on a namespace-scope object asks COFF for a section alignment above its 8192-byte maximum, so the Windows build of `agc_driver_image_array_window_past_layer_limit_tests` fails with `requested alignment '65536' exceeds object file maximum 8192`, and the full build stops there. Keep the storage at 4 KiB section alignment and round its texel pointer up to 64 KiB inside a buffer with 64 KiB of slack, which is how the other execution tests obtain the guest tiling alignment (`CmaskFastClear.cpp`, `DcdKeyPresync.cpp`). The texels stay 64 KiB aligned; only the storage declaration changes. ### Tested - Windows 11, NVIDIA GeForce RTX 3070 Laptop GPU, driver 32.0.16.1078, WinLibs GCC 15.2.0 (the toolchain `docs/dev/BUILD.md` names), Release, `-DANYPS5_RELINKER_ONLY=OFF -DBUILD_TESTING=ON`. - Before: `cmake --build build` stops at 3352/6158 with the alignment error. After: the full build completes. - `agc_driver_image_array_window_past_layer_limit` passes (1.72 s) on the GPU above. - Full `ctest`: 1858 of 1861 pass. The three failures (`agc_driver_sample_order`, `agc_driver_sample_order_grid_reference`, `agc_driver_sample_order_recipe_depth_locations`) are depth and sample-location assertions in executables that do not include this file; I will report them separately. - `tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py` reports no overlap. - Windows CI does not compile this file: the workflow passes `-DANYPS5_AGC_EXECUTION_TESTS=F16ToF32Unpack;F64FmaSubnormals;RegistrationPrepareShutdown`, which builds a skip stub for every other execution test. The default developer build compiles all of them, so the break only appears there, on a machine with Vulkan present. - Not tested on AMD or Intel GPUs, nor on Linux; the change is to test storage only. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU, driver 32.0.16.1078, Windows 11 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-21 18:15:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T18:15:52Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 8310 core/libs/prx/libSceAgcDriver/tests/execution/ImageArrayWindowPastLayerLimit.cpp L33, L65
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323231924 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9304#issuecomment-6323231924). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T18:15:52Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 8310](https://www.github.com/boykopovar/AnyPS5/pull/8310) | `core/libs/prx/libSceAgcDriver/tests/execution/ImageArrayWindowPastLayerLimit.cpp` [L33](https://github.com/boykopovar/AnyPS5/blob/95d17687aed6bad81082d9bbef01cb1d9c0a384c/core/libs/prx/libSceAgcDriver/tests/execution/ImageArrayWindowPastLayerLimit.cpp#L33), [L65](https://github.com/boykopovar/AnyPS5/blob/95d17687aed6bad81082d9bbef01cb1d9c0a384c/core/libs/prx/libSceAgcDriver/tests/execution/ImageArrayWindowPastLayerLimit.cpp#L65) | | |
kanza-cm commented 2026-10-21 18:50:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kanza-cm on 2026-10-21T18:50:41Z.


Duplicate of #8310, which fixes the same line with the same run-time alignment. I missed it when opening this one: the overlap check needs gh, which was not installed at the time. Closing this in favour of #8310; the reproduction below is still useful, so it goes on that pull request instead.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323918693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9304#issuecomment-6323918693). Originally posted by [kanza-cm](https://github.com/kanza-cm) on 2026-10-21T18:50:41Z. --- Duplicate of #8310, which fixes the same line with the same run-time alignment. I missed it when opening this one: the overlap check needs `gh`, which was not installed at the time. Closing this in favour of #8310; the reproduction below is still useful, so it goes on that pull request instead.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9304
No description provided.