test(agc): align the indirect arguments block at run time #6452
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6452"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T16:03:54Z.
What
Fixes #6716. Restore the Windows build of
agc_driver_gpu_indirect_arguments_misaligned_writer_ahead, added by merged #5747. The required WinLibs GCC 15.2.0 r7 rejects itsalignas(65536)static object:Select an aligned 64 KiB span inside a zero-initialized
2 * BlockBytes - 1backing array. The storage lasts for the whole process and always has room for the aligned span. An explicit runtime assertion checks alignment. The registered range remains 64 KiB;ArgumentsOffset=4, shaders and the 24-group/two-adopted-dispatch assertions are unchanged. No production driver changes.Reported on the original PR in this comment. No overlapping open fix was found at preparation time; later alternatives are tracked below.
Tested
Windows 11 Enterprise 26200, WinLibs GCC 15.2.0 r7, Release/bundled dependencies. Head
4fe92c9c23c7bd861d63664d4efde3033b6226f6, main0029e62f974c453a5f6c7333f3bdb13e770e3903; live main at readiness check0029e62f974c453a5f6c7333f3bdb13e770e3903.0c4816f61: compiling this fixture's object target fails with the diagnostic above. Its source is byte-identical at main0029. This is a compiler regression control, before GPU execution.libsbuilds, conventions and test-registration checkers pass, with all execution fixtures built.CastAddressToIntegerAtReturnportability advisory in unchangedLow(), which deliberately packs the low 32 address bits for the guest descriptor; its body is byte-identical to main. No diagnostics are suppressed and neither analyzer reports parser/configuration failures.The original campaign above did not run Linux. The current-main Linux execution refresh is recorded below; no title-startup, performance or new full Linux application result is claimed.
Independent Windows confirmation from @johnmaia (source): required WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, main0029 versus this PR merged into that main. Main fails with the same alignment diagnostic; the corrected target builds and its fixture passes on NVIDIA RTX 4080 /617.42 and Intel UHD 770 /101.6129. These are the other contributor's target/fixture results, with no repetition counts or full-application test claim; our own repeated runs above remain RTX 5080 and AMD Radeon Graphics.
Checklist
Portability review and alternative correction
@jotitadev's macOS review independently ran a standalone globals snippet, not this fixture: Xcode 27 Apple clang, M2 Max, macOS 27.2. Apple's linker lowered 64 KiB section alignment to 4 KiB (x86_64) / 16 KiB (arm64); both O0 snippets produced a block at offset 0x8000 modulo 64 KiB. O2 happened to align it. The span plus runtime assertion addresses that layout dependency too. This is attributed snippet evidence, not a full macOS AnyPS5 build or GPU run; the source head is unchanged. The title now describes the general alignment correction.
Later-opened #6478 proposed an alternative correction of this same fixture using VirtualAlloc/aligned_alloc. Its author confirmed consolidation here and closed #6478. The overlap is resolved. This PR retains the static backing and runtime alignment assertion, full Windows build/regression, two-vendor repetition, and attributed independent RTX 4080 / Intel UHD 770 fixture checks above. Our #6498 validates with this PR's exact correction as its separate Windows build dependency.
Current-main portability and consolidation (2026-10-16 UTC)
Composition 861ad99e9 is main5d plus this unchanged head. The fixture source is byte-identical to4fe. Selected-target builds and the original test pass5/5 per RTX5080/Radeon integrated GPU on Windows11/GCC15.2r7, and5/5 on Ubuntu24/WSL2/GCC13.3/Mesa25.2.8 llvmpipe. Both device selections are checked per process; maximum1.12s/0.49s/0.21s, no skips. Conventions pass on both hosts. These are selected-target checks, not new full application builds; the earlier full Windows and static-analysis results retain their original pins. Detailed response and consolidation request.
Later-opened #6726 proposes dynamic allocation for this same declaration/failure; its author requested consolidation guidance. I compared its633078d1e head and recommend retaining this smaller static-span correction, as already done for closed #6478. #6716 is the same reported build failure. #6726 is now closed; the duplicate overlap is resolved.
Current Windows CI coverage: main93's successful job builds this target from
tests/ExecutionTestNotBuilt.cpp, then CTest skips it. The workflow selects only three real execution fixtures. Thus that green job does not compile or validate the real over-aligned declaration addressed here. The actual-fixture local and independent validation above remains the relevant evidence; this log inspection is not a fresh current-main compile.Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-15T16:13:56Z.
Windows check. Windows 11, WinLibs GCC 15.2.0 r7 (MinGW), Release,
BUILD_TESTING=ON.main0029e62f9doesn't build here:GpuIndirectArgumentsMisalignedWriterAhead.cpp:25:58: error: requested alignment '65536' exceeds object file maximum 8192.4fe92c9c2) merged into it, the target builds, andagc_driver_gpu_indirect_arguments_misaligned_writer_aheadpasses on an RTX 4080 (NVIDIA 617.42) and an Intel UHD 770 (101.6129).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T17:36:18Z.
Review: COMMENTED
Static note from macOS, head
4fe92c9c2: this isn't Windows-only. Apple's linker doesn't rejectalignas(65536)on a static object, it lowers it with a warning, somain's fixture can get a block that is not 64 KiB aligned there without any build error.I compiled a minimal copy of the fixture's globals (
alignas(256)array,alignas(65536) std::array<std::uint8_t, 65536> Block{},alignas(256)array) with Apple clang from Xcode 27 on an M2 Max, macOS 27.2:So on Mach-O the alignment depends on the layout. The aligned span inside a
2 * BlockBytes - 1array, plus the new runtimeRequire, fixes it there too. The PR title could say "on Windows and macOS", or just "align the indirect arguments block at run time". #6478 usesstd::aligned_allocoff Windows, which also gets it right on macOS.I didn't build or run this fixture. The results above come from the standalone snippet only.
Written with AI assistance (Claude Code). I compiled and ran the snippet above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T20:41:07Z.
Windows confirmation for #6452 (head
4fe92c9c2), independent of the author. Windows 11 Pro 26220, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, NVIDIA GeForce RTX 4070 (driver 596.21), PR merged into main44df21632with no conflicts.44df21632(control): buildingagc_driver_gpu_indirect_arguments_misaligned_writer_ahead_testsfails withGpuIndirectArgumentsMisalignedWriterAhead.cpp:25:58: error: requested alignment '65536' exceeds object file maximum 8192. The alignas came in with #5747 (6b14169a4).ctest -R '^agc_driver_gpu_indirect_arguments_(misaligned_writer_ahead|written_ahead)$' --repeat until-fail:3 --timeout 300: both pass 3/3 (misaligned_writer_ahead 2.33/0.83/1.85 s, written_ahead 0.97/2.68/7.36 s). A verbose run shows the Vulkan device used and "gpu indirect arguments misaligned writer ahead test passed", so it is not a skip.Requireon the address), with no platform ifdef, so the fixture requirement is not hidden; the same logic holds on ELF by reading, but I did not run Linux.tools/check_conventions.py --base origin/mainpasses andgit diff origin/main --checkis clean.Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T08:13:54Z.
I noticed #6726 was opened for the same MinGW
alignas(65536)failure in this exact test file, usingVirtualAlloc/aligned_allocrather than this PR’s static backing span. Your PR reports repeated Windows fixture runs and independent GPU confirmation, while #6726 has only translation-unit checks so far. Would you prefer that #6726 close in favor of this PR, or is there a platform/build constraint this approach does not cover that should be consolidated before merge?Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T08:53:04Z.
@MarcZX100 Consolidation confirmed: #6726 is closed in favor of #6452. I compared your head
633078d1ewith this head4fe92c9c2and have not identified a platform constraint requiring the dynamic-allocation variant. This span keeps the original static lifetime/allocation class and registered 64 KiB footprint. The2 * BlockBytes - 1backing guarantees room for the aligned span, independently of section alignment, and the runtime assertion checks it.I refreshed the original fixture on current main
5d9dcc42d: tested composition861ad99e9. The fixture source is byte-identical to this PR head, with no changes to the shaders,ArgumentsOffset=4, 24-group result or two-adopted-dispatch assertion.These are selected-target results, not new full application builds; the earlier full Windows build and independent vendor/macOS-snippet evidence keep their original pins in the description. This closes our previous Linux execution gap. No macOS full-build/GPU claim.
The earlier VirtualAlloc/aligned_alloc alternative #6478 was also consolidated here and closed. #6716 reports this same declaration/failure, so I linked it here too. I verified #6726's closed state and restored the duplicate checklist item. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T09:20:55Z.
I closed #6726 in favor of this PR as requested. I also checked the current conventions failure (run 38876675677): it is only the PR-template unchecked item
Based on recent main (validated5d merge); #6726 consolidation pending. Since #6726 is now closed and your later comment records the current-main validation, updating the description/checklist and rerunning conventions should clear it.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T09:38:06Z.
Confirmed: the updated description now has a successful conventions run (38880685985). The stale checklist failure is resolved.