Repository navigation
opt: Filter duplicate decorations during serialization - #6828
Merged
Merged
Conversation
Add a mechanism to filter out duplicate decorations when writing the SPIR-V module back to binary in Module::ToBinary. This prevents validation errors when optimization passes (like loop unrolling) duplicate decorated instructions. The filtering uses a hash set of serialized instructions to identify and skip duplicates. A new parameter `filter_duplicates` is added to `Module::ToBinary` to allow disabling this behavior, which is used during the optimizer's integrity check to prevent false positive assertion failures. Added unit test in `module_test.cpp` to verify the behavior. Assisted by: Antigravity Fixes: microsoft/DirectXShaderCompiler#8609
dneto0
requested changes
Aug 5, 2026
dneto0
left a comment
Collaborator
There was a problem hiding this comment.
the main blocker is the need for a method comment.
Collaborator
Sorry about that. I'll try to avoid that in future. |
Thank you! I was pretty surprised that github behaved that way, I wouldn't have expected it at all! :) |
alsepkow
added a commit
to llvm/offload-test-suite
that referenced
this pull request
Nov 19, 2026
Remove XFAIL for mad.32. Note that microsoft/DirectXShaderCompiler#7706 remains open as this problem was mitigated by KhronosGroup/SPIRV-Tools#6828 Co-authored-by: Copilot <[email protected]> Copilot-Session: e7051af1-cdb6-4f2f-9221-aa9ba11732c8
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.
Add a mechanism to filter out duplicate decorations when writing the
SPIR-V module back to binary in Module::ToBinary. This prevents validation
errors when optimization passes (like loop unrolling) duplicate decorated
instructions.
The filtering uses a hash set of serialized instructions to identify and
skip duplicates.
A new parameter
filter_duplicatesis added toModule::ToBinarytoallow disabling this behavior, which is used during the optimizer's
integrity check to prevent false positive assertion failures.
Added unit test in
module_test.cppto verify the behavior.Assisted by: Antigravity
Fixes: microsoft/DirectXShaderCompiler#8609