fix(tests): allocate 64 KiB dispatch block dynamically #6829

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/6829 into main
MarcZX10 commented 2026-10-16 13:33:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T13:33:13Z.


What

Replace the test's static alignas(65536) argument block with a dynamically allocated 64 KiB-aligned guest block. MinGW's PE/COFF object format limits section alignment to 8192 bytes, so the existing declaration prevents this test from compiling on Windows.

The helper uses VirtualAlloc on Windows and std::aligned_alloc elsewhere, registers the allocation with GuestAllocations, and unregisters/frees it through RAII.

Closes #6716.

Tested

  • git diff --check passes.
  • python3 tools/check_conventions.py --base upstream/main passes locally.
  • The issue reporter reports the updated test builds and passes on Windows 11 with MinGW GCC 15.2.0 and an RTX 3080.
  • I attempted to build the test on Linux, but compilation stops in unchanged SrtDescriptorEvaluation.cpp:183 (read.read->Flags<MemoryFlags>()) with GCC 12 before reaching this test. No GPU test run was possible here.

Checklist

  • Based on current main; no duplicate PR implements this fix
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • No unimplemented paths or silent stubs changed
  • No notes, investigation files or images added
  • No new third-party code
  • Generic test portability fix
  • Depends on: none
  • Unblocks: none
  • GPUs tested: none locally; issue reporter's Windows run used an RTX 3080
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4889128113 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6829). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T13:33:13Z. --- ### What Replace the test's static `alignas(65536)` argument block with a dynamically allocated 64 KiB-aligned guest block. MinGW's PE/COFF object format limits section alignment to 8192 bytes, so the existing declaration prevents this test from compiling on Windows. The helper uses `VirtualAlloc` on Windows and `std::aligned_alloc` elsewhere, registers the allocation with `GuestAllocations`, and unregisters/frees it through RAII. Closes #6716. ### Tested - `git diff --check` passes. - `python3 tools/check_conventions.py --base upstream/main` passes locally. - The issue reporter reports the updated test builds and passes on Windows 11 with MinGW GCC 15.2.0 and an RTX 3080. - I attempted to build the test on Linux, but compilation stops in unchanged `SrtDescriptorEvaluation.cpp:183` (`read.read->Flags<MemoryFlags>()`) with GCC 12 before reaching this test. No GPU test run was possible here. ### Checklist - [x] Based on current `main`; no duplicate PR implements this fix - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] No unimplemented paths or silent stubs changed - [x] No notes, investigation files or images added - [x] No new third-party code - [x] Generic test portability fix - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: none locally; issue reporter's Windows run used an RTX 3080 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-16 14:39:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T14:39:36Z.


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 6452 core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp L25
PR 6482 core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp L25

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6484 core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6217898062 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6829#issuecomment-6217898062). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T14:39:36Z. --- <!-- 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 6452](https://www.github.com/boykopovar/AnyPS5/pull/6452) | `core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp` [L25](https://github.com/boykopovar/AnyPS5/blob/93e54cedd3dd49eabf1c589f020b54758e0b6461/core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp#L25) | | | | [PR 6482](https://www.github.com/boykopovar/AnyPS5/pull/6482) | `core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp` [L25](https://github.com/boykopovar/AnyPS5/blob/93e54cedd3dd49eabf1c589f020b54758e0b6461/core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp#L25) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6484](https://www.github.com/boykopovar/AnyPS5/pull/6484) | `core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp` |
jotitadev commented 2026-10-16 16:24:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T16:24:49Z.

Review: COMMENTED


The description has no GPU run of the changed test, so here is one on Linux. It cannot show the Windows stack fix itself, only that the test still builds and passes with the 64 KiB block allocated dynamically.

Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. Head 633078d1e merged into main 452494439 (clean merge). It builds with GCC 15.2. The SrtDescriptorEvaluation.cpp error from GCC 12 does not occur here.

  • agc_driver_gpu_indirect_arguments_misaligned_writer_ahead: passes 3/3 on the RTX 3070 and 2/2 on lavapipe, each ending with gpu indirect arguments misaligned writer ahead test passed (not a skip).

Not run: Windows, where the stack overflow happens.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5550649959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6829#pullrequestreview-5550649959). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-16T16:24:49Z. **Review:** COMMENTED --- The description has no GPU run of the changed test, so here is one on Linux. It cannot show the Windows stack fix itself, only that the test still builds and passes with the 64 KiB block allocated dynamically. **Machine:** NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04, i7-8700, GCC 15.2, Release, `BUILD_TESTING=ON`. Head `633078d1e` merged into `main` `452494439` (clean merge). It builds with GCC 15.2. The `SrtDescriptorEvaluation.cpp` error from GCC 12 does not occur here. - `agc_driver_gpu_indirect_arguments_misaligned_writer_ahead`: passes 3/3 on the RTX 3070 and 2/2 on lavapipe, each ending with `gpu indirect arguments misaligned writer ahead test passed` (not a skip). Not run: Windows, where the stack overflow happens. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04 Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-16 17:37:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:37:47Z.


Thanks for running the changed test on both the RTX 3070 and lavapipe, and for keeping the Windows-specific limitation explicit. The 3/3 and 2/2 device runs confirm the dynamically allocated block still exercises and passes the test on Linux; the Windows runner remains the evidence for the original alignment issue.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221196067 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6829#issuecomment-6221196067). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T17:37:47Z. --- Thanks for running the changed test on both the RTX 3070 and lavapipe, and for keeping the Windows-specific limitation explicit. The 3/3 and 2/2 device runs confirm the dynamically allocated block still exercises and passes the test on Linux; the Windows runner remains the evidence for the original alignment issue.
oneandonlydean commented 2026-10-17 00:10:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T00:10:29Z.


Closing in favour of #6452, which fixes the same MinGW alignment failure with a static aligned span and has Windows runs on three GPUs; this is the dynamic-allocation approach that #6726 was already closed for on the 16th.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227130373 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6829#issuecomment-6227130373). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T00:10:29Z. --- Closing in favour of #6452, which fixes the same MinGW alignment failure with a static aligned span and has Windows runs on three GPUs; this is the dynamic-allocation approach that #6726 was already closed for on the 16th.

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!6829
No description provided.