Repository navigation
[Validator] Add validation for createHandleFromBinding - #8205
Merged
Damyan Pepper (damyanp) merged 17 commits intoMar 16, 2026
Merged
Damyan Pepper (damyanp) merged 17 commits into
Damyan Pepper (damyanp) merged 17 commits into
Conversation
…osoft#7019) Add validation in BuildResMap() to check that the index parameter of createHandleFromBinding falls within the range [rangeLowerBound, rangeUpperBound] from the ResBind parameter. This matches the existing validation done for createHandle. Add a LIT test that verifies the validator catches an out-of-range index (index 0 with rangeLowerBound=1, rangeUpperBound=1). Co-authored-by: damyanp <[email protected]>
…ation Extend the test to cover both edge cases: index below rangeLowerBound (0 < 1) and index above rangeUpperBound (4 > 3). Uses a range of [1,3] to ensure both boundaries are tested independently. Co-authored-by: damyanp <[email protected]>
Co-authored-by: damyanp <[email protected]>
Co-authored-by: damyanp <[email protected]>
Member
Author
|
There doesn't seem to be any validation at all for CreateHandleFromBinding. Maybe the right way to resolve this would be to get all the validation in place? |
Damyan Pepper (damyanp)
marked this pull request as ready for review
February 26, 2026 22:28
Joshua Batista (bob80905)
approved these changes
Feb 27, 2026
Expand validation to check: 1. bind parameter is constant 2. resourceClass in the binding is valid (CBuffer/Sampler/SRV/UAV) 3. constant index is within [rangeLowerBound, rangeUpperBound] (existing) Add test for invalid resourceClass (value 5, outside 0-3 range). Co-authored-by: damyanp <[email protected]>
Co-authored-by: damyanp <[email protected]>
… into copilot/fix-issue-7019-tests # Conflicts: # docs/ReleaseNotes.md
Co-authored-by: damyanp <[email protected]>
Damyan Pepper (damyanp)
marked this pull request as draft
March 12, 2026 02:37
Consolidate the three separate createHandleFromBinding test files into two following the existing _passing/_failing convention: - createHandleFromBinding_passing.ll: valid indices at lower and upper bounds - createHandleFromBinding_failing.ll: index below/above range + invalid class Removed the non-constant bind test since it's a defensive check that can't be triggered without also triggering unrelated validation errors. Co-authored-by: damyanp <[email protected]>
Re-add createHandleFromBinding_non_constant_bind.ll to maintain test coverage for the bind parameter constness check. Co-authored-by: damyanp <[email protected]>
Remove mention of "non-constant bind parameters" from the description since that case is tested in the separate _non_constant_bind.ll file. Co-authored-by: damyanp <[email protected]>
Damyan Pepper (damyanp)
marked this pull request as ready for review
March 13, 2026 00:57
Damyan Pepper (damyanp)
requested review from
Joshua Batista (bob80905),
Justin Bogner (bogner) and
Tex Riddell (tex3d)
March 13, 2026 00:57
When the binding range has size 1 (rangeLowerBound == rangeUpperBound), the resource is non-array and the index must be a constant. This mirrors the existing CreateHandle validation which rejects non-constant indices on non-array resources. Co-authored-by: Copilot <[email protected]>
The rangeLowerBound == rangeUpperBound check cannot distinguish non-array resources from 1-element arrays, so revert the non-constant index rejection for now. Keep the passing test case that verifies non-constant indices on array resources are accepted. Co-authored-by: Copilot <[email protected]>
Rename local variables to UpperCamelCase: hdl->Hdl, bind->Bind, cIndex->CIndex, index->Index. Co-authored-by: Copilot <[email protected]>
Justin Bogner (bogner)
approved these changes
Mar 13, 2026
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.
Previously, the validator didn't validate the parameters to createHandleFromBinding. This change adds validation that validates:
Fixes #7019