Repository navigation
fix(agc): keep shader preparation temporaries off guest stacks - #2456
Closed
Mouhand-Kaddo wants to merge 1 commit into
Closed
Mouhand-Kaddo wants to merge 1 commit into
Mouhand-Kaddo wants to merge 1 commit into
Conversation
|
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. |
8 tasks done
|
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fix(agc): prepare the null pixel program at draw when its variant was not prepared #1902 described above)