microsoft / microsoft/DirectXShaderCompiler

Missing validation for some intrinsic arguments that require literal

Open
#6,289 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement validation
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.