microsoft / microsoft/DirectXShaderCompiler

ValidateRootSignatureInContainer fails to pass ValidatorSelection to CreateValidator

Open
#7,052 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
In dxcutil.cpp, dxcutil::ValidateRootSignatureInContainer fails to pass the hlsl::options::ValidatorSelection SelectValidator parameter through to the CreateValidator call. This results in that call using the ValidatorSelection::Auto value, which will attempt to use the external validator by default and fall back to using internal validator otherwise.

Steps to Reproduce
Found via code inspection.

https://github.com/microsoft/DirectXShaderCompiler/blob/070d0d5a2beacef9eeb51037a9b04665716fd6f3/tools/clang/tools/dxcompiler/dxcutil.cpp#L264-L270

https://github.com/microsoft/DirectXShaderCompiler/blob/070d0d5a2beacef9eeb51037a9b04665716fd6f3/tools/clang/tools/dxcompiler/dxcutil.cpp#L52-L54

This could occur when compiling an ordinary shader target with a root signature attribute on the entry, or when compiling directly to a serialized root signature container.

Hypothetical repro scenarios include:

  1. using -select-validator internal when external validator is present - uses the external validator instead
  2. using -select-validator external when external validator is not present - should fail with DXC_E_VALIDATOR_MISSING, but uses the internal validator instead

Scenario 2 could be tested by controlling the environment to prevent access to any dxil.dll. Testing scenario 1 might require a special mock dxil.dll test binary that indicates unexpected use of the external validator.

Environment

  • DXC version: latest main
  • 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 in tools/clang/tools/dxcompiler/dxcutil.cpp, especially dxcutil::ValidateRootSignatureInContainer and the referenced CreateValidator call. Trace how ValidatorSelection is handled in nearby validator creation paths, then verify that internal and external selections produce the expected behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.