Repository navigation
feat(agc): implement deferred faults for descriptors read through null SRT pointers - #1292
Merged
Merged
Conversation
This was referenced Oct 8, 2026
This was referenced Oct 8, 2026
Merged
Celegans12
force-pushed
the
feat/agc-draw-null-srt
branch
from
October 8, 2026 14:52
660e18d to
7380808
Compare
Capturing a shader threw "null or misaligned address" when the flat SRT walk read through a pointer loaded from memory that is null or unmapped, even when the program skips that s_load. Such a read now yields zero and a record with its pc and address, as does a slot whose address needs it. The registered artifact checks one flag word per guarded slot at each ReadConst; the capture appends the flags and the records to the flattened SRT, and a set flag raises an Unmapped BDA fault through the fault buffer and stops the invocation as a BDA read does. Nothing per capture enters a key: poisoned and clean captures share one variant and specialization. Descriptors, branch conditions, uniform fills, table bases and user-data pointers that need such a value still throw, and poisoned results stay out of the dispatch and draw caches. The shader disk cache format becomes 21.
…l SRT pointers Capturing a shader evaluates every V#, T# and S# the program uses, including those behind a branch the wave does not take. When such a descriptor was loaded through a pointer read from memory that is null or unmapped, the capture threw "guest memory is not readable", while the console faults only if a wave executes that s_load. The descriptor now reads as zero words, and the flat SRT walk records the s_load's dwords as it does for flat reads, so their guarded ReadConst raises the BDA fault where the wave runs the s_load. A zero V# is an absent buffer and a zero T# binds a null descriptor, as for any zero word read from memory, so nothing new enters a key. A zeroed descriptor whose read no flat slot records still throws, as do branch conditions, uniform fills, table bases and user-data pointers.
9 tasks done
Celegans12
force-pushed
the
feat/agc-draw-null-srt
branch
from
October 8, 2026 22:39
7380808 to
d3a66db
Compare
This was referenced Oct 9, 2026
Open
Collaborator
|
Checked on a build merged onto current |
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.
What
Stacked on #759; please review the last commit only.
A capture evaluates every V#, T# and S# a shader uses, even behind a branch the wave won't take. If one is loaded through a null or unmapped pointer read from memory, the capture throws (
null or misaligned address,guest memory is not readable), while the console only faults when a wave runs thats_load. #759 covers only flat SRT reads.EvaluateRuntimeSourcesImpl, a descriptor dword read that feat(agc): implement deferred faults for reads through null SRT pointers #759 would record makes the whole descriptor zero; the flat walk records thes_load's dwords as before. If no record names that read, it still throws.ReadConstfaults at thes_load's pc. Onmaina zero V# is an absent buffer, a zero T# a null descriptor and a zero S# a valid sampler, so a zeroed descriptor binds and specializes like zeros read from memory: no new key.*(SRT + 0x98)only ifs_buffer_load_dword ..., 0x120is nonzero; the pointer is null in the skipped draws.EvaluateRuntimeSourcesImpl.Tested
main1be6f9f with feat(agc): implement deferred faults for reads through null SRT pointers #759: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 485/485 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_guarded_null_pointer: a V# loaded through a pointer behind an SCC branch reads its payload when mapped, faults at thes_load's pc and address when null or unmapped and taken, and doesn't fault when skipped; a zero V# from memory and a zeroed one share one pipeline variant.agc_shader_memory: a compute V# through a null or unmapped pointer and a vertex V# through a null one get four records and zero words, with the variant, specialization and module of a zero V# from memory. Both tests fail on feat(agc): implement deferred faults for reads through null SRT pointers #759 alone.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)