Merged
Conversation
added 4 commits
March 26, 2024 10:02
node shader validation tests depended heavily on metadata numbers and order. This make them robust so they can work with the 6.9 changes or without
deduplication of the 1,9 tuple made the test fail. Using -DAG checks allows the order to work anyway
Contributor
You can test this locally with the following command:git-clang-format --diff e4fa1c518413a3ca871a1b1699308b6db0ede892 b94408dcb6dbbcb6fa84d4efb1440b45280656a1 -- tools/clang/unittests/HLSL/ValidationTest.cppView the diff from clang-format here.diff --git a/tools/clang/unittests/HLSL/ValidationTest.cpp b/tools/clang/unittests/HLSL/ValidationTest.cpp
index 26bc6e88..aeb83571 100644
--- a/tools/clang/unittests/HLSL/ValidationTest.cpp
+++ b/tools/clang/unittests/HLSL/ValidationTest.cpp
@@ -4274,7 +4274,7 @@ TEST_F(ValidationTest, ComputeNodeCompatibility) {
{"!\"node01\", null, null, !([0-9]+)}\n"
"!\\1 = !{i32 8, i32 15"}, // original: node shader
{"!\"node01\", null, null, !\\1}\n"
- "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
+ "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
"Compute entry 'node01' has unexpected node shader metadata", true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\compute_node_compatibility.hlsl", "lib_6_8",
@@ -4282,7 +4282,7 @@ TEST_F(ValidationTest, ComputeNodeCompatibility) {
{"!\"node02\", null, null, !([0-9]+)}\n"
"!\\1 = !{i32 8, i32 15"}, // original: node shader
{"!\"node02\", null, null, !\\1}\n"
- "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
+ "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
"Compute entry 'node02' has unexpected node shader metadata", true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\compute_node_compatibility.hlsl", "lib_6_8",
@@ -4290,7 +4290,7 @@ TEST_F(ValidationTest, ComputeNodeCompatibility) {
{"!\"node03\", null, null, !([0-9]+)}\n"
"!\\1 = !{i32 8, i32 15"}, // original: node shader
{"!\"node03\", null, null, !\\1}\n"
- "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
+ "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
"Compute entry 'node03' has unexpected node shader metadata", true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\compute_node_compatibility.hlsl", "lib_6_8",
@@ -4298,7 +4298,7 @@ TEST_F(ValidationTest, ComputeNodeCompatibility) {
{"!\"node04\", null, null, !([0-9]+)}\n"
"!\\1 = !{i32 8, i32 15"}, // original: node shader
{"!\"node04\", null, null, !\\1}\n"
- "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
+ "!\\1 = !{i32 8, i32 5"}, // changed to: compute shader
"Compute entry 'node04' has unexpected node shader metadata", true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\compute_node_compatibility.hlsl", "lib_6_8",
@@ -4307,8 +4307,8 @@ TEST_F(ValidationTest, ComputeNodeCompatibility) {
"!\\1 = !{i32 8, i32 15, i32 13, i32 2"}, // original: node shader
// coalesing launch type
{"!\"node04\", null, null, !\\1}\n"
- "!\\1 = !{i32 8, i32 5, i32 13, i32 3"}, // changed to: compute shader
- // thread launch type
+ "!\\1 = !{i32 8, i32 5, i32 13, i32 3"}, // changed to: compute shader
+ // thread launch type
"Compute entry 'node04' has unexpected node shader metadata", true);
}
@@ -4419,11 +4419,13 @@ TEST_F(ValidationTest, NodeInputMultiplicity) {
"!\\2 = !{!([0-9]+)}", // input records
"= !{i32 1, i32 33, i32 2, !([0-9]+)}"}, // end of output
{"= !{i32 8, i32 15, i32 13, i32 1,\\1i32 20, !\\2\\3"
- "!\\2 = !{!\\4, !100}", // multiple input records
+ "!\\2 = !{!\\4, !100}", // multiple input records
"= !{i32 1, i32 33, i32 2, !\\1}\n"
- "!100 = !{i32 1, i32 97, i32 2, !\\1}\n"}, // extra DispatchNodeInputRecord
+ "!100 = !{i32 1, i32 97, i32 2, !\\1}\n"}, // extra
+ // DispatchNodeInputRecord
"node shader 'node01' may not have more than one input record \\(2 are "
- "declared\\)", true);
+ "declared\\)",
+ true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\node_input_compatibility.hlsl", "lib_6_8",
@@ -4432,11 +4434,12 @@ TEST_F(ValidationTest, NodeInputMultiplicity) {
"!\\2 = !{!([0-9]+)}", // input records
"= !{i32 1, i32 33, i32 2, !([0-9]+)}"}, // end of output
{"= !{i32 8, i32 15, i32 13, i32 1,\\1i32 20, !\\2\\3"
- "!\\2 = !{!\\4, !100}", // multiple input records
+ "!\\2 = !{!\\4, !100}", // multiple input records
"= !{i32 1, i32 33, i32 2, !\\1}\n"
"!100 = !{i32 1, i32 9, i32 2, !\\1}\n"}, // extra EmptyNodeInput
"node shader 'node01' may not have more than one input record \\(2 are "
- "declared\\)", true);
+ "declared\\)",
+ true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\node_input_compatibility.hlsl", "lib_6_8",
@@ -4445,11 +4448,12 @@ TEST_F(ValidationTest, NodeInputMultiplicity) {
"!\\2 = !{!([0-9]+)}", // input records
"= !{i32 1, i32 33, i32 2, !([0-9]+)}"}, // end of output
{"= !{i32 8, i32 15, i32 13, i32 2,\\1i32 20, !\\2\\3"
- "!\\2 = !{!\\4, !100}", // multiple input records
+ "!\\2 = !{!\\4, !100}", // multiple input records
"= !{i32 1, i32 33, i32 2, !\\1}\n"
"!100 = !{i32 1, i32 65, i32 2, !\\1}\n"}, // extra GroupNodeInputRecords
"node shader 'node02' may not have more than one input record \\(2 are "
- "declared\\)", true);
+ "declared\\)",
+ true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\node_input_compatibility.hlsl", "lib_6_8",
@@ -4458,11 +4462,12 @@ TEST_F(ValidationTest, NodeInputMultiplicity) {
"!\\2 = !{!([0-9]+)}", // input records
"= !{i32 1, i32 33, i32 2, !([0-9]+)}"}, // end of output
{"= !{i32 8, i32 15, i32 13, i32 2,\\1i32 20, !\\2\\3"
- "!\\2 = !{!\\4, !100}", // multiple input records
+ "!\\2 = !{!\\4, !100}", // multiple input records
"= !{i32 1, i32 33, i32 2, !\\1}\n"
"!100 = !{i32 1, i32 9, i32 2, !\\1}\n"}, // extra EmptyNodeInput
"node shader 'node02' may not have more than one input record \\(2 are "
- "declared\\)", true);
+ "declared\\)",
+ true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\node_input_compatibility.hlsl", "lib_6_8",
@@ -4471,11 +4476,12 @@ TEST_F(ValidationTest, NodeInputMultiplicity) {
"!\\2 = !{!([0-9]+)}", // input records
"= !{i32 1, i32 33, i32 2, !([0-9]+)}"}, // end of output
{"= !{i32 8, i32 15, i32 13, i32 3,\\1i32 20, !\\2\\3"
- "!\\2 = !{!\\4, !100}", // multiple input records
+ "!\\2 = !{!\\4, !100}", // multiple input records
"= !{i32 1, i32 33, i32 2, !\\1}\n"
"!100 = !{i32 1, i32 33, i32 2, !\\1}\n"}, // extra ThreadNodeInputRecord
"node shader 'node03' may not have more than one input record \\(2 are "
- "declared\\)", true);
+ "declared\\)",
+ true);
RewriteAssemblyCheckMsg(
L"..\\DXILValidation\\node_input_compatibility.hlsl", "lib_6_8",
@@ -4484,12 +4490,12 @@ TEST_F(ValidationTest, NodeInputMultiplicity) {
"!\\2 = !{!([0-9]+)}", // input records
"= !{i32 1, i32 33, i32 2, !([0-9]+)}"}, // end of output
{"= !{i32 8, i32 15, i32 13, i32 3,\\1i32 20, !\\2\\3"
- "!\\2 = !{!\\4, !100}", // multiple input records
+ "!\\2 = !{!\\4, !100}", // multiple input records
"= !{i32 1, i32 33, i32 2, !\\1}\n"
"!100 = !{i32 1, i32 9, i32 2, !\\1}\n"}, // extra EmptyNodeInput
"node shader 'node03' may not have more than one input record \\(2 are "
- "declared\\)", true);
-
+ "declared\\)",
+ true);
}
TEST_F(ValidationTest, CacheInitWithMinPrec) {
|
damyanp
reviewed
Mar 26, 2024
damyanp
approved these changes
Mar 29, 2024
tex3d
approved these changes
Apr 1, 2024
tools/clang/test/CodeGenDXIL/hlsl/objects/NodeObjects/node-objects-metadata.hlsl
Show resolved
Hide resolved
tools/clang/test/SemaHLSL/hlsl/objects/texture/CalculateLODExtraDiag.hlsl
Show resolved
Hide resolved
pow2clk
commented
Apr 16, 2024
tools/clang/test/CodeGenDXIL/hlsl/objects/NodeObjects/node-objects-metadata.hlsl
Show resolved
Hide resolved
tools/clang/test/SemaHLSL/hlsl/objects/texture/CalculateLODExtraDiag.hlsl
Show resolved
Hide resolved
SjMxr233
pushed a commit
to ShaderHelper/DirectXShaderCompiler
that referenced
this pull request
Jul 24, 2025
In experimenting with bumping the max shader model version in the mesh nodes branch, many unrelated tests started failing due to being overly-sensitive to ordering, particularly for metadata. This uses regular expressions or order-independent checks to make these tests more robust so they will be able to handle the change to 6.9 when it comes to main, whatever form that takes. Followup to microsoft#6432
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In experimenting with bumping the max shader model version in the mesh nodes branch, many unrelated tests started failing due to being overly-sensitive to ordering, particularly for metadata. This uses regular expressions or order-independent checks to make these tests more robust so they will be able to handle the change to 6.9 when it comes to main, whatever form that takes.
Followup to #6432