microsoft / microsoft/DirectXShaderCompiler

Unnecessary, unreachable validation for mesh/amplification shader DXIL ops

Open
#7,149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug tech-debt validation
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

The following is unnecessary, unreachable validation for mesh/amplification shader DXIL ops:
https://github.com/microsoft/DirectXShaderCompiler/blob/d5951b74d76351c17626bf90daf6684ed8598d3d/lib/DxilValidation/DxilValidation.cpp#L895-L918

These are unreachable due to the missing corresponding case statements for triggering the call to ValidateSignatureDxilOp, here:
https://github.com/microsoft/DirectXShaderCompiler/blob/d5951b74d76351c17626bf90daf6684ed8598d3d/lib/DxilValidation/DxilValidation.cpp#L1689-L1709

However, it is also unnecessary to manually check shader model for DXIL ops, since that's part of code generated from the properties defined here:
https://github.com/microsoft/DirectXShaderCompiler/blob/d5951b74d76351c17626bf90daf6684ed8598d3d/utils/hct/hctdb.py#L597-L604

Generated function called from here:
https://github.com/microsoft/DirectXShaderCompiler/blob/d5951b74d76351c17626bf90daf6684ed8598d3d/lib/DxilValidation/DxilValidation.cpp#L2041

In conclusion, these case blocks are not doing anything and may be removed.

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 in lib/DxilValidation/DxilValidation.cpp at the validation blocks around lines 895-918 and the dispatch cases around lines 1689-1709. Read the DXIL operation properties in utils/hct/hctdb.py around lines 597-604 and the generated validation call near line 2041. Done means the unreachable validation blocks are removed without changing the generated operation validation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.