microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.11k stars 698 forks source link

Improve DXIL Validator Testing Infrastructure #5064

Open llvm-beanz opened 1 year ago

llvm-beanz commented 1 year ago

What The dxv tool should be extended to support testing workflows required to adequately and easily test the dxil validator. We should also investigate alternative solutions to replace %dxilver when we move to lit for testing.

Why We need to update how we test the DXIL validator to expand test coverage, adopt LIT, and make it easier to test and maintain.

One of the challenges with the DXIL validator tests is that the frontend should not be capable of generating malformed IR to trigger some failures. For example, the IR metadata should always be well formed and valid. We should also validate as many issues as possible at the source level in DXC so that we can provide better user diagnostics. Because of these design considerations, the current testing infrastructure can be fragile.

The current infrastructure is built on TAEF/GoogleTest, and much of it relies on HLSL source being compiled to textural IR, which is then modified with find/replace operations before being re-assembled into a DXIL container and validated.

Acceptance Criteria

New workflow for DXIL validator tests that works with LIT and covers all the required workflows for changing dxil validator versions.

llvm-beanz commented 1 year ago

DXC is also missing test coverage for external validator workflows. We should figure out a way to address that.