Skip to content

fix(agc): allocate indirect arguments test block dynamically on Windows - #6478

Closed
leorossi2005 wants to merge 1 commit into
boykopovar:mainfrom
leorossi2005:fix/agc-indirect-args-test-alignment
Closed

leorossi2005 wants to merge 1 commit into
boykopovar:mainfrom
leorossi2005:fix/agc-indirect-args-test-alignment

Conversation

@leorossi2005

Copy link
Copy Markdown
Contributor

What

GpuIndirectArgumentsMisalignedWriterAhead defined a static array with alignas(BlockBytes) where BlockBytes is 65536. On Windows, the PE-COFF format limits section alignment in object files to 8192 bytes, which caused MinGW GCC to fail compilation with:

error: requested alignment '65536' exceeds object file maximum 8192

Allocate the guest block dynamically through a GuestBlock helper using VirtualAlloc on Windows and std::aligned_alloc on Linux, matching the other execution tests in the library (UnimportedLabelOrder.cpp, GlobalLoads.cpp).

Tested

Tested on Windows 11 x86-64 (MinGW GCC 15.2.0, Release):

  • agc_driver_gpu_indirect_arguments_misaligned_writer_ahead compiles cleanly and passes (1/1 Test #449 ... Passed 0.92 sec).
  • tools/check_conventions.py --base origin/main passes.

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
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

GpuIndirectArgumentsMisalignedWriterAhead defined a static array with alignas(BlockBytes) where BlockBytes is 65536. On Windows, the PE-COFF format limits section alignment in object files to 8192 bytes, which caused MinGW GCC to fail compilation with: requested alignment '65536' exceeds object file maximum 8192.

Allocate the guest block dynamically through a GuestBlock helper using VirtualAlloc on Windows and std::aligned_alloc on Linux, matching the other execution tests in the library.
@github-actions

Copy link
Copy Markdown

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

@Amoenus

Amoenus commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@leorossi2005 This corrects the same GpuIndirectArgumentsMisalignedWriterAhead alignment failure as earlier #6452 (unchanged head 4fe92c9c2). That PR uses a 2 * BlockBytes - 1 zeroed static backing array, an aligned span and a runtime alignment assertion, retaining the original +4 argument offset and GPU assertions. It has a full required-toolchain Windows build, 25 fresh fixture passes per RTX 5080 / AMD Radeon Graphics, plus independent RTX 4080 / Intel UHD 770 fixture checks. The new macOS review there is explicitly standalone snippet evidence, not a fixture run.

I propose consolidating this fixture correction in #6452; these two changes are alternatives and should not be stacked. If the dynamic allocation addresses a case that the aligned span misses, please point it out so we can resolve the choice. #6498's full Windows validation currently uses #6452 as its separate test-build dependency. I have added this overlap to #6452's body; no agreement is assumed yet.

AI-assisted: Codex.

@leorossi2005

Copy link
Copy Markdown
Contributor Author

Thanks for pointing it out, @Amoenus

Apologies for the duplicate PR — I had specifically searched open PRs for the fixture name before submitting, but for some reason GitHub's search didn't surface #6452 at the time.

Thanks also to @jotitadev for the macOS findings and for confirming that both approaches address the issue there as well (via std::aligned_alloc or the runtime-aligned span). I originally went with the dynamic GuestBlock pattern (VirtualAlloc/aligned_alloc) to follow UnimportedLabelOrder.cpp and GlobalLoads.cpp, but since #6452 was submitted earlier, keeps static backing, and already has extensive multi-vendor test coverage and downstream dependencies (#6498), consolidating in #6452 makes complete sense.

Closing in favor of #6452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants