microsoft / microsoft/DirectXShaderCompiler
Missing validation for some intrinsic arguments that require literal
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
In hctdb.py, some intrinsics have arguments marked is_const=True. These arguments require immediate literal values. Currently, DxilValidation doesn't enforce this in a general way. Some intrinsics may have specific checks, but others are missing. For instance, #6280 updates some intrinsics that were missing this property, and they are still lacking validation for this property.
In DxilValidation, we should implement general check for DXIL intrinsic arguments with is_const=True property to ensure they are always immediate values. We can add a generated function to DxilValidationImpl.inc to look up the property, and we could add code to check that the necessary arguments are constant to the generated DxilInst_ helpers in DxilInstructions.h.
Environment
- DXC version: any
- Host Operating System: any
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading hctdb.py and tracing DxilValidation, DxilValidationImpl.inc, and the generated DxilInst_ helpers in DxilInstructions.h. Compare existing intrinsic-specific checks with arguments marked is_const=True. Done means validation consistently rejects non-immediate values for every intrinsic argument with that property.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100