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

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/6726 into main
MarcZX10 commented 2026-10-16 07:41:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T07:41:11Z.


What

Fixes #6716. The execution test declares a static 64 KiB guest block with alignas(65536), which exceeds PE/COFF's 8192-byte object alignment limit and prevents MinGW from compiling it. Allocate the block with VirtualAlloc on Windows and std::aligned_alloc elsewhere; register and release it with the guest-allocation tracker and platform allocator.

Tested

  • Linux GCC 12.2: the modified test translation unit compiled as C++20.
  • MinGW GCC 12: the original translation unit reproduces the reported 65536 vs 8192 alignment error; the modified translation unit passes -fsyntax-only.
  • python3 tools/check_conventions.py --base upstream/main passed.
  • python3 tools/pr_overlap.py --branch codex/fix-mingw-misaligned-dispatch-test reported no overlap.
  • git diff --check passed.
  • The full test executable and CTest were not run: the full build stops in unchanged SrtDescriptorEvaluation.cpp:183, where GCC 12 rejects a dependent Flags<MemoryFlags>() expression.

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; silent stubs are listed in technical debt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a; this is a test-allocation change, and the GPU test was not run
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4885125865 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6726). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T07:41:11Z. --- ### What Fixes #6716. The execution test declares a static 64 KiB guest block with `alignas(65536)`, which exceeds PE/COFF's 8192-byte object alignment limit and prevents MinGW from compiling it. Allocate the block with `VirtualAlloc` on Windows and `std::aligned_alloc` elsewhere; register and release it with the guest-allocation tracker and platform allocator. ### Tested - Linux GCC 12.2: the modified test translation unit compiled as C++20. - MinGW GCC 12: the original translation unit reproduces the reported `65536` vs `8192` alignment error; the modified translation unit passes `-fsyntax-only`. - `python3 tools/check_conventions.py --base upstream/main` passed. - `python3 tools/pr_overlap.py --branch codex/fix-mingw-misaligned-dispatch-test` reported no overlap. - `git diff --check` passed. - The full test executable and CTest were not run: the full build stops in unchanged `SrtDescriptorEvaluation.cpp:183`, where GCC 12 rejects a dependent `Flags<MemoryFlags>()` expression. ### 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; silent stubs are listed in technical debt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a; this is a test-allocation change, and the GPU test was not run - [x] AI-assisted: yes
MarcZX10 commented 2026-10-16 08:11:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T08:11:16Z.


I found the earlier open PR #6452, which fixes this same MinGW alignment failure in the same test file. Both approaches remove the unsupported static alignas(65536): #6452 uses a static backing span with a runtime alignment check and reports repeated Windows runs on multiple GPUs; #6726 uses VirtualAlloc / aligned_alloc and reports translation-unit checks, with the full executable not run. To avoid parallel fixes, could you coordinate with the #6452 author/maintainers on whether to close this PR in favor of #6452 or consolidate any needed changes? I have not compared the implementations beyond their reported behavior and validation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211087102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6726#issuecomment-6211087102). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T08:11:16Z. --- I found the earlier open PR #6452, which fixes this same MinGW alignment failure in the same test file. Both approaches remove the unsupported static `alignas(65536)`: #6452 uses a static backing span with a runtime alignment check and reports repeated Windows runs on multiple GPUs; #6726 uses `VirtualAlloc` / `aligned_alloc` and reports translation-unit checks, with the full executable not run. To avoid parallel fixes, could you coordinate with the #6452 author/maintainers on whether to close this PR in favor of #6452 or consolidate any needed changes? I have not compared the implementations beyond their reported behavior and validation.
github-actions[bot] commented 2026-10-16 08:39:12 +00:00 (Migrated from github.com)

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


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
PR 6484 core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp L25
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211572825 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6726#issuecomment-6211572825). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T08:39:12Z. --- <!-- 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/5d9dcc42d2ec5401aebd089028b8d4d7410a77b4/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/5d9dcc42d2ec5401aebd089028b8d4d7410a77b4/core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp#L25) | | | | [PR 6484](https://www.github.com/boykopovar/AnyPS5/pull/6484) | `core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp` [L25](https://github.com/boykopovar/AnyPS5/blob/5d9dcc42d2ec5401aebd089028b8d4d7410a77b4/core/libs/prx/libSceAgcDriver/tests/execution/GpuIndirectArgumentsMisalignedWriterAhead.cpp#L25) | | |
MarcZX10 commented 2026-10-16 09:20:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T09:20:29Z.


Closing in favor of #6452, as its author requested consolidation there and confirmed the same fixture fix on Windows, Radeon integrated graphics, Linux, and llvmpipe. Their runtime-aligned span also covers the macOS alignment concern. I found no separate platform constraint that requires the dynamic-allocation variant.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6212310816 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6726#issuecomment-6212310816). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T09:20:29Z. --- Closing in favor of #6452, as its author requested consolidation there and confirmed the same fixture fix on Windows, Radeon integrated graphics, Linux, and llvmpipe. Their runtime-aligned span also covers the macOS alignment concern. I found no separate platform constraint that requires the dynamic-allocation variant.

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