fix(agc): keep shader preparation temporaries off guest stacks #2456
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2456"
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 Mouhand-Kaddo on 2026-10-09T21:50:43Z.
Summary
What
Shader registration and ABI preparation run on caller-owned guest fibers.
QueueStateembeds 48 KiB of constant RAM; local instances and copies madeRegisterShaderreserve about 99 KiB andPrepareRegisteredabout 51 KiB, even on paths that never used those locals. A 64 KiB guest fiber could therefore overwrite its neighbor.Keep the five shader-preparation temporaries on the heap, retaining their initialization and copy behavior:
This changes storage duration/location only. No shader semantics, guest fiber sizes, title checks, or fallback behavior change.
Evidence
Tested
agc_shader_preparation_stackfails on Windows and Arch withpreparation wrote below its fiber context. The valid-registration case separately reproduces the remainingPrepareRegisteredoverflow after moving only the other four locals.After: both tests pass on both platforms. They use 32 KiB fiber contexts with a sentinel region below them, exercise existing input validation and successful synthetic compute registration/ABI preparation, and check that the sentinel survives. Each completes well under one second locally; the valid-registration test skips without Vulkan.
libson main19a0daa7plus this commit. Windows 11, WinLibs GCC 15.2, RX 6900 XT: 527 tests, 523 passed, 1 skipped, 3 failed (36.82 s). Arch WSL2, GCC 16.2, lavapipe: 532 tests, 504 passed, 27 skipped, 1 timeout (41.82 s). Windows failures areagc_driver_pixel_interlock,agc_driver_sdwa_float_selectors, andagc_driver_sdwa_ldexp_f16; Arch times out inagc_driver_flat_store. All four were also reproduced after rebuilding the affected targets on unchanged mainda122c90.Overlap check reports a textual conflict with #1902, which moves null-pixel registration to another helper. It does not fix stack storage; if it lands first, retain this heap allocation in its new helper. No dependency on its behavior.
Merge Danger
Door: two-way
Blast Radius: preparation
Shader-preparation calls incur heap allocation and can propagate allocation failure. Existing registration publication, validation and transaction behavior remain intact.
Checklist
19a0daa7; open PRs checked for the same stack fix (textual overlap with #1902 described above)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:02:15Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:09:28Z.
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.
main)core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppL733-749Pull request closed