From 6ed6b3f1460f2e23700c6823f0eebc611ac9989b Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Wed, 18 Jun 2025 13:44:26 -0700 Subject: [PATCH 1/6] initial test files for rcp --- test/Feature/HLSLLib/rcp.16.test | 67 ++++++++++++++++++++++++++++++++ test/Feature/HLSLLib/rcp.32.test | 67 ++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 test/Feature/HLSLLib/rcp.16.test create mode 100644 test/Feature/HLSLLib/rcp.32.test diff --git a/test/Feature/HLSLLib/rcp.16.test b/test/Feature/HLSLLib/rcp.16.test new file mode 100644 index 00000000..838c2079 --- /dev/null +++ b/test/Feature/HLSLLib/rcp.16.test @@ -0,0 +1,67 @@ +#--- source.hlsl + +StructuredBuffer In : register(t0); + +RWStructuredBuffer Out : register(u1); + +[numthreads(1,1,1)] +void main() { + Out[0] = rcp(In[0]); + half4 Tmp = {rcp(In[1].xyz), rcp(In[1].w)}; + Out[1] = Tmp; + half4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; + Out[2] = Tmp2; +} + + +//--- pipeline.yaml + +--- +Shaders: + - Stage: Compute + Entry: main + DispatchSize: [1, 1, 1] +Buffers: + - Name: In + Format: Float16 + Stride: 8 + Data: [ 0x7e00, 0xfc00, 0x8001, 0x8000, 0x0000, 0x0001, 0x7c00, 0x3c00, 0xbc00, 0x4100, 0xb400,] + # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, + - Name: Out + Format: Float16 + Stride: 8 + ZeroInitSize: 24 + - Name: ExpectedOut # The result we expect + Format: Float16 + Stride: 8 + Data: [ 0x7e00, 0x7e00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7e00, 0x3c00, 0xbc00, 0x3666, 0xc400,] + # NaN, NaN, Inf, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, +Results: + - Result: Test1 + Rule: BufferFloatULP + ULPT: 2 + Actual: Out + Expected: ExpectedOut +DescriptorSets: + - Resources: + - Name: In + Kind: StructuredBuffer + DirectXBinding: + Register: 0 + Space: 0 + VulkanBinding: + Binding: 0 + - Name: Out + Kind: RWStructuredBuffer + DirectXBinding: + Register: 1 + Space: 0 + VulkanBinding: + Binding: 1 +... +#--- end + +# REQUIRES: Half +# RUN: split-file %s %t +# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl +# RUN: %offloader %t/pipeline.yaml %t.o diff --git a/test/Feature/HLSLLib/rcp.32.test b/test/Feature/HLSLLib/rcp.32.test new file mode 100644 index 00000000..b556ee58 --- /dev/null +++ b/test/Feature/HLSLLib/rcp.32.test @@ -0,0 +1,67 @@ +#--- source.hlsl + +StructuredBuffer In : register(t0); + +RWStructuredBuffer Out : register(u1); + +[numthreads(1,1,1)] +void main() { + Out[0] = rcp(In[0]); + float4 Tmp = {rcp(In[1].xyz), rcp(In[1].w)}; + Out[1] = Tmp; + float4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; + Out[2] = Tmp2; +} + + +//--- pipeline.yaml + +--- +Shaders: + - Stage: Compute + Entry: main + DispatchSize: [1, 1, 1] +Buffers: + - Name: In + Format: Float32 + Stride: 16 + Data: [ nan, -inf, -0x1.e7d42cp-127, -0, 0, 0x1.e7d42cp-127, inf, 1, -1, 2.5, -0.25,] + # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, + - Name: Out + Format: Float32 + Stride: 16 + ZeroInitSize: 48 + - Name: ExpectedOut # The result we expect + Format: Float32 + Stride: 16 + Data: [ nan, nan, inf, inf, inf, inf, nan, 1, -1, 0.4, -4,] + # NaN, NaN, Inf, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, +Results: + - Result: Test1 + Rule: BufferFloatULP + ULPT: 2 + Actual: Out + Expected: ExpectedOut +DescriptorSets: + - Resources: + - Name: In + Kind: StructuredBuffer + DirectXBinding: + Register: 0 + Space: 0 + VulkanBinding: + Binding: 0 + - Name: Out + Kind: RWStructuredBuffer + DirectXBinding: + Register: 1 + Space: 0 + VulkanBinding: + Binding: 1 +... +#--- end + + +# RUN: split-file %s %t +# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl +# RUN: %offloader %t/pipeline.yaml %t.o From 6574a73d1692dc46ef1f59bb899c44774fa16a4e Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Fri, 20 Jun 2025 12:12:23 -0700 Subject: [PATCH 2/6] fix tests + add 64 bit test --- test/Feature/HLSLLib/rcp.16.test | 8 ++-- test/Feature/HLSLLib/rcp.32.test | 8 ++-- test/Feature/HLSLLib/rcp.64.test | 67 ++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 test/Feature/HLSLLib/rcp.64.test diff --git a/test/Feature/HLSLLib/rcp.16.test b/test/Feature/HLSLLib/rcp.16.test index 838c2079..5aebea0d 100644 --- a/test/Feature/HLSLLib/rcp.16.test +++ b/test/Feature/HLSLLib/rcp.16.test @@ -25,8 +25,8 @@ Buffers: - Name: In Format: Float16 Stride: 8 - Data: [ 0x7e00, 0xfc00, 0x8001, 0x8000, 0x0000, 0x0001, 0x7c00, 0x3c00, 0xbc00, 0x4100, 0xb400,] - # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, + Data: [ 0x7e00, 0xfc00, 0x8001, 0x8000, 0x0000, 0x0001, 0x7c00, 0x3c00, 0xbc00, 0x4100, 0xb400, 0x4000] + # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, 2 - Name: Out Format: Float16 Stride: 8 @@ -34,8 +34,8 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float16 Stride: 8 - Data: [ 0x7e00, 0x7e00, 0x7c00, 0x7c00, 0x7c00, 0x7c00, 0x7e00, 0x3c00, 0xbc00, 0x3666, 0xc400,] - # NaN, NaN, Inf, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, + Data: [ 0x7e00, 0x8000, 0xfc00, 0xfc00, 0x7c00, 0x7c00, 0x0, 0x3c00, 0xbc00, 0x3666, 0xc400, 0x3800] + # NaN, -0, -Inf, -Inf, Inf, Inf, 0, 1, -1, 0.4, -4, 0.5 Results: - Result: Test1 Rule: BufferFloatULP diff --git a/test/Feature/HLSLLib/rcp.32.test b/test/Feature/HLSLLib/rcp.32.test index b556ee58..e97a512f 100644 --- a/test/Feature/HLSLLib/rcp.32.test +++ b/test/Feature/HLSLLib/rcp.32.test @@ -25,8 +25,8 @@ Buffers: - Name: In Format: Float32 Stride: 16 - Data: [ nan, -inf, -0x1.e7d42cp-127, -0, 0, 0x1.e7d42cp-127, inf, 1, -1, 2.5, -0.25,] - # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, + Data: [ nan, -inf, -0x1.e7d42cp-127, -0, 0, 0x1.e7d42cp-127, inf, 1, -1, 2.5, -0.25, 2] + # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, 2 - Name: Out Format: Float32 Stride: 16 @@ -34,8 +34,8 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float32 Stride: 16 - Data: [ nan, nan, inf, inf, inf, inf, nan, 1, -1, 0.4, -4,] - # NaN, NaN, Inf, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, + Data: [ nan, -0, -inf, -inf, inf, inf, 0, 1, -1, 0.4, -4 , 0.5] + # NaN, NaN, Inf, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, 0.5 Results: - Result: Test1 Rule: BufferFloatULP diff --git a/test/Feature/HLSLLib/rcp.64.test b/test/Feature/HLSLLib/rcp.64.test new file mode 100644 index 00000000..2a079af5 --- /dev/null +++ b/test/Feature/HLSLLib/rcp.64.test @@ -0,0 +1,67 @@ +#--- source.hlsl + +StructuredBuffer In : register(t0); + +RWStructuredBuffer Out : register(u1); + +[numthreads(1,1,1)] +void main() { + Out[0] = rcp(In[0]); + float4 Tmp = {rcp(In[1].xyz), rcp(In[1].w)}; + Out[1] = Tmp; + float4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; + Out[2] = Tmp2; +} + + +//--- pipeline.yaml + +--- +Shaders: + - Stage: Compute + Entry: main + DispatchSize: [1, 1, 1] +Buffers: + - Name: In + Format: Float64 + Stride: 32 + Data: [ nan, -inf, -0x0.fffffffffffffp-1022, -0, 0, 0x0.fffffffffffffp-1022, inf, 1, -1, 2.5, -0.25, 2] + # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, 2 + - Name: Out + Format: Float64 + Stride: 32 + ZeroInitSize: 96 + - Name: ExpectedOut # The result we expect + Format: Float64 + Stride: 32 + Data: [ nan, -0, -0x1.0000000000001p+1022, -inf, inf, inf, 0, 1, -1, 0x1.99999a0000000p-2, -4 , 0.5] + # NaN, NaN, -4.49423e+307, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, 0.5 +Results: + - Result: Test1 + Rule: BufferFloatULP + ULPT: 2 + Actual: Out + Expected: ExpectedOut +DescriptorSets: + - Resources: + - Name: In + Kind: StructuredBuffer + DirectXBinding: + Register: 0 + Space: 0 + VulkanBinding: + Binding: 0 + - Name: Out + Kind: RWStructuredBuffer + DirectXBinding: + Register: 1 + Space: 0 + VulkanBinding: + Binding: 1 +... +#--- end + + +# RUN: split-file %s %t +# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl +# RUN: %offloader %t/pipeline.yaml %t.o From 253cbea6c2275ad0cadf6bed354b694195fed07a Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Fri, 20 Jun 2025 12:16:29 -0700 Subject: [PATCH 3/6] add requires line --- test/Feature/HLSLLib/rcp.64.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Feature/HLSLLib/rcp.64.test b/test/Feature/HLSLLib/rcp.64.test index 2a079af5..af14e207 100644 --- a/test/Feature/HLSLLib/rcp.64.test +++ b/test/Feature/HLSLLib/rcp.64.test @@ -61,7 +61,7 @@ DescriptorSets: ... #--- end - +# REQUIRES: Double # RUN: split-file %s %t # RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl # RUN: %offloader %t/pipeline.yaml %t.o From 464a8b7c97e041b6830fb0e4e7601101a00eacb5 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Mon, 14 Jul 2025 15:12:43 -0700 Subject: [PATCH 4/6] remove values like nan/inf/denorm --- test/Feature/HLSLLib/rcp.16.test | 8 ++++---- test/Feature/HLSLLib/rcp.32.test | 6 ++---- test/Feature/HLSLLib/rcp.64.test | 6 ++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/test/Feature/HLSLLib/rcp.16.test b/test/Feature/HLSLLib/rcp.16.test index 5aebea0d..0609b6f7 100644 --- a/test/Feature/HLSLLib/rcp.16.test +++ b/test/Feature/HLSLLib/rcp.16.test @@ -25,8 +25,8 @@ Buffers: - Name: In Format: Float16 Stride: 8 - Data: [ 0x7e00, 0xfc00, 0x8001, 0x8000, 0x0000, 0x0001, 0x7c00, 0x3c00, 0xbc00, 0x4100, 0xb400, 0x4000] - # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, 2 + Data: [ 0x8000, 0x0000, 0x3c00, 0xbc00, 0x4100, 0xb400, 0x4000, 0x3800, 0x4100, 0xb400, 0x4000, 0x3800] + # -0, 0, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5 - Name: Out Format: Float16 Stride: 8 @@ -34,8 +34,8 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float16 Stride: 8 - Data: [ 0x7e00, 0x8000, 0xfc00, 0xfc00, 0x7c00, 0x7c00, 0x0, 0x3c00, 0xbc00, 0x3666, 0xc400, 0x3800] - # NaN, -0, -Inf, -Inf, Inf, Inf, 0, 1, -1, 0.4, -4, 0.5 + Data: [ 0xfc00, 0x7c00, 0x3c00, 0xbc00, 0x3666, 0xc400, 0x3800, 0x4000, 0x3666, 0xc400, 0x3800, 0x4000] + # -Inf, Inf, 1, -1, 0.4, -4, 0.5, 2, 0.4, -4, 0.5, 2 Results: - Result: Test1 Rule: BufferFloatULP diff --git a/test/Feature/HLSLLib/rcp.32.test b/test/Feature/HLSLLib/rcp.32.test index e97a512f..998efe47 100644 --- a/test/Feature/HLSLLib/rcp.32.test +++ b/test/Feature/HLSLLib/rcp.32.test @@ -25,8 +25,7 @@ Buffers: - Name: In Format: Float32 Stride: 16 - Data: [ nan, -inf, -0x1.e7d42cp-127, -0, 0, 0x1.e7d42cp-127, inf, 1, -1, 2.5, -0.25, 2] - # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, 2 + Data: [-0, 0, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5] - Name: Out Format: Float32 Stride: 16 @@ -34,8 +33,7 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float32 Stride: 16 - Data: [ nan, -0, -inf, -inf, inf, inf, 0, 1, -1, 0.4, -4 , 0.5] - # NaN, NaN, Inf, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, 0.5 + Data: [-inf, inf, 1, -1, 0.4, -4 , 0.5, 2, 0.4, -4 , 0.5, 2] Results: - Result: Test1 Rule: BufferFloatULP diff --git a/test/Feature/HLSLLib/rcp.64.test b/test/Feature/HLSLLib/rcp.64.test index af14e207..a1010b82 100644 --- a/test/Feature/HLSLLib/rcp.64.test +++ b/test/Feature/HLSLLib/rcp.64.test @@ -25,8 +25,7 @@ Buffers: - Name: In Format: Float64 Stride: 32 - Data: [ nan, -inf, -0x0.fffffffffffffp-1022, -0, 0, 0x0.fffffffffffffp-1022, inf, 1, -1, 2.5, -0.25, 2] - # NaN, -Inf, -denorm, -0, 0, denorm, Inf, 1, -1, 2.5, -0.25, 2 + Data: [ -0, 0, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5] - Name: Out Format: Float64 Stride: 32 @@ -34,8 +33,7 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float64 Stride: 32 - Data: [ nan, -0, -0x1.0000000000001p+1022, -inf, inf, inf, 0, 1, -1, 0x1.99999a0000000p-2, -4 , 0.5] - # NaN, NaN, -4.49423e+307, Inf, Inf, Inf, NaN, 1, -1, 0.4, -4, 0.5 + Data: [ -inf, inf, 1, -1, 0x1.99999a0000000p-2, -4 , 0.5, 2, 0x1.99999a0000000p-2, -4 , 0.5, 2] Results: - Result: Test1 Rule: BufferFloatULP From 162bf7fcaef208008b53a01194c10a553eae70b3 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 22 Jul 2025 13:58:24 -0700 Subject: [PATCH 5/6] update to xfail on clang vulkan; add a constant folding test; change from ulp to epsilon to allow for larger differences --- test/Feature/HLSLLib/rcp.16.test | 18 +++++++++++------- test/Feature/HLSLLib/rcp.32.test | 13 ++++++++----- test/Feature/HLSLLib/rcp.64.test | 14 +++++++++----- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/test/Feature/HLSLLib/rcp.16.test b/test/Feature/HLSLLib/rcp.16.test index 0609b6f7..06f8e007 100644 --- a/test/Feature/HLSLLib/rcp.16.test +++ b/test/Feature/HLSLLib/rcp.16.test @@ -11,6 +11,7 @@ void main() { Out[1] = Tmp; half4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; Out[2] = Tmp2; + Out[3] = rcp(half4(1, 10, 0.2, -4)); } @@ -25,21 +26,21 @@ Buffers: - Name: In Format: Float16 Stride: 8 - Data: [ 0x8000, 0x0000, 0x3c00, 0xbc00, 0x4100, 0xb400, 0x4000, 0x3800, 0x4100, 0xb400, 0x4000, 0x3800] - # -0, 0, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5 + Data: [ 0x8000, 0x4900, 0x3c00, 0xbc00, 0x4100, 0xb400, 0x4000, 0x3800, 0x4100, 0xb400, 0x4000, 0x3800] + # -0, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5 - Name: Out Format: Float16 Stride: 8 - ZeroInitSize: 24 + ZeroInitSize: 32 - Name: ExpectedOut # The result we expect Format: Float16 Stride: 8 - Data: [ 0xfc00, 0x7c00, 0x3c00, 0xbc00, 0x3666, 0xc400, 0x3800, 0x4000, 0x3666, 0xc400, 0x3800, 0x4000] - # -Inf, Inf, 1, -1, 0.4, -4, 0.5, 2, 0.4, -4, 0.5, 2 + Data: [ 0xfc00, 0x2e66, 0x3c00, 0xbc00, 0x3666, 0xc400, 0x3800, 0x4000, 0x3666, 0xc400, 0x3800, 0x4000, 0x3c00, 0x2e66, 0x4500, 0xb400] + # -Inf, 0.1, 1, -1, 0.4, -4, 0.5, 2, 0.4, -4, 0.5, 2, 1, 0.1, 5, -0.25 Results: - Result: Test1 - Rule: BufferFloatULP - ULPT: 2 + Rule: BufferFloatEpsilon + Epsilon: 0.0008 Actual: Out Expected: ExpectedOut DescriptorSets: @@ -61,6 +62,9 @@ DescriptorSets: ... #--- end +# https://github.com/llvm/llvm-project/issues/149561 +# XFAIL: Clang-Vulkan + # REQUIRES: Half # RUN: split-file %s %t # RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl diff --git a/test/Feature/HLSLLib/rcp.32.test b/test/Feature/HLSLLib/rcp.32.test index 998efe47..d8d5224f 100644 --- a/test/Feature/HLSLLib/rcp.32.test +++ b/test/Feature/HLSLLib/rcp.32.test @@ -11,6 +11,7 @@ void main() { Out[1] = Tmp; float4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; Out[2] = Tmp2; + Out[3] = rcp(float4(1, 10, 0.2, -4)); } @@ -25,19 +26,19 @@ Buffers: - Name: In Format: Float32 Stride: 16 - Data: [-0, 0, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5] + Data: [-0, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.432] - Name: Out Format: Float32 Stride: 16 - ZeroInitSize: 48 + ZeroInitSize: 64 - Name: ExpectedOut # The result we expect Format: Float32 Stride: 16 - Data: [-inf, inf, 1, -1, 0.4, -4 , 0.5, 2, 0.4, -4 , 0.5, 2] + Data: [-inf, 0.1, 1, -1, 0.4, -4 , 0.5, 2, 0.4, -4 , 0.5, 2.31481481481, 1, 0.1, 5, -0.25] Results: - Result: Test1 - Rule: BufferFloatULP - ULPT: 2 + Rule: BufferFloatEpsilon + Epsilon: 0.0008 Actual: Out Expected: ExpectedOut DescriptorSets: @@ -59,6 +60,8 @@ DescriptorSets: ... #--- end +# https://github.com/llvm/llvm-project/issues/149561 +# XFAIL: Clang-Vulkan # RUN: split-file %s %t # RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl diff --git a/test/Feature/HLSLLib/rcp.64.test b/test/Feature/HLSLLib/rcp.64.test index a1010b82..fbf57673 100644 --- a/test/Feature/HLSLLib/rcp.64.test +++ b/test/Feature/HLSLLib/rcp.64.test @@ -11,6 +11,7 @@ void main() { Out[1] = Tmp; float4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; Out[2] = Tmp2; + Out[3] = rcp(double4(1, 10, 0.2, -4)); } @@ -25,19 +26,19 @@ Buffers: - Name: In Format: Float64 Stride: 32 - Data: [ -0, 0, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5] + Data: [ -0, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.432] - Name: Out Format: Float64 Stride: 32 - ZeroInitSize: 96 + ZeroInitSize: 128 - Name: ExpectedOut # The result we expect Format: Float64 Stride: 32 - Data: [ -inf, inf, 1, -1, 0x1.99999a0000000p-2, -4 , 0.5, 2, 0x1.99999a0000000p-2, -4 , 0.5, 2] + Data: [ -inf, 0.1, 1, -1, 0x1.99999a0000000p-2, -4 , 0.5, 2, 0x1.99999a0000000p-2, -4 , 0.5, 2.31481, 1, 0.1, 5, -0.25] Results: - Result: Test1 - Rule: BufferFloatULP - ULPT: 2 + Rule: BufferFloatEpsilon + Epsilon: 0.0008 Actual: Out Expected: ExpectedOut DescriptorSets: @@ -59,6 +60,9 @@ DescriptorSets: ... #--- end +# https://github.com/llvm/llvm-project/issues/149561 +# XFAIL: Clang-Vulkan + # REQUIRES: Double # RUN: split-file %s %t # RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl From 4a44795ae71c7f2f39a6be532e1330d52a13ae77 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Fri, 25 Jul 2025 16:31:30 -0700 Subject: [PATCH 6/6] respond to pr comments --- test/Feature/HLSLLib/rcp.16.test | 8 ++++---- test/Feature/HLSLLib/rcp.32.test | 4 ++-- test/Feature/HLSLLib/rcp.64.test | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/Feature/HLSLLib/rcp.16.test b/test/Feature/HLSLLib/rcp.16.test index 06f8e007..14b26a69 100644 --- a/test/Feature/HLSLLib/rcp.16.test +++ b/test/Feature/HLSLLib/rcp.16.test @@ -26,8 +26,8 @@ Buffers: - Name: In Format: Float16 Stride: 8 - Data: [ 0x8000, 0x4900, 0x3c00, 0xbc00, 0x4100, 0xb400, 0x4000, 0x3800, 0x4100, 0xb400, 0x4000, 0x3800] - # -0, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5 + Data: [ 0x4200, 0x4900, 0x3c00, 0xbc00, 0x4100, 0xb400, 0x4000, 0x3800, 0x4100, 0xb400, 0x4000, 0x3800] + # 3, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.5 - Name: Out Format: Float16 Stride: 8 @@ -35,8 +35,8 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float16 Stride: 8 - Data: [ 0xfc00, 0x2e66, 0x3c00, 0xbc00, 0x3666, 0xc400, 0x3800, 0x4000, 0x3666, 0xc400, 0x3800, 0x4000, 0x3c00, 0x2e66, 0x4500, 0xb400] - # -Inf, 0.1, 1, -1, 0.4, -4, 0.5, 2, 0.4, -4, 0.5, 2, 1, 0.1, 5, -0.25 + Data: [0x3555, 0x2e66, 0x3c00, 0xbc00, 0x3666, 0xc400, 0x3800, 0x4000, 0x3666, 0xc400, 0x3800, 0x4000, 0x3c00, 0x2e66, 0x4500, 0xb400] + # 0.333, 0.1, 1, -1, 0.4, -4, 0.5, 2, 0.4, -4, 0.5, 2, 1, 0.1, 5, -0.25 Results: - Result: Test1 Rule: BufferFloatEpsilon diff --git a/test/Feature/HLSLLib/rcp.32.test b/test/Feature/HLSLLib/rcp.32.test index d8d5224f..4d7b2b26 100644 --- a/test/Feature/HLSLLib/rcp.32.test +++ b/test/Feature/HLSLLib/rcp.32.test @@ -26,7 +26,7 @@ Buffers: - Name: In Format: Float32 Stride: 16 - Data: [-0, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.432] + Data: [3, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.432] - Name: Out Format: Float32 Stride: 16 @@ -34,7 +34,7 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float32 Stride: 16 - Data: [-inf, 0.1, 1, -1, 0.4, -4 , 0.5, 2, 0.4, -4 , 0.5, 2.31481481481, 1, 0.1, 5, -0.25] + Data: [0.333333, 0.1, 1, -1, 0.4, -4 , 0.5, 2, 0.4, -4 , 0.5, 2.31481481481, 1, 0.1, 5, -0.25] Results: - Result: Test1 Rule: BufferFloatEpsilon diff --git a/test/Feature/HLSLLib/rcp.64.test b/test/Feature/HLSLLib/rcp.64.test index fbf57673..290d757f 100644 --- a/test/Feature/HLSLLib/rcp.64.test +++ b/test/Feature/HLSLLib/rcp.64.test @@ -7,9 +7,9 @@ RWStructuredBuffer Out : register(u1); [numthreads(1,1,1)] void main() { Out[0] = rcp(In[0]); - float4 Tmp = {rcp(In[1].xyz), rcp(In[1].w)}; + double4 Tmp = {rcp(In[1].xyz), rcp(In[1].w)}; Out[1] = Tmp; - float4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; + double4 Tmp2 = {rcp(In[2].xy), rcp(In[2].zw)}; Out[2] = Tmp2; Out[3] = rcp(double4(1, 10, 0.2, -4)); } @@ -26,7 +26,7 @@ Buffers: - Name: In Format: Float64 Stride: 32 - Data: [ -0, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.432] + Data: [ 3, 10, 1, -1, 2.5, -0.25, 2, 0.5, 2.5, -0.25, 2, 0.432] - Name: Out Format: Float64 Stride: 32 @@ -34,7 +34,7 @@ Buffers: - Name: ExpectedOut # The result we expect Format: Float64 Stride: 32 - Data: [ -inf, 0.1, 1, -1, 0x1.99999a0000000p-2, -4 , 0.5, 2, 0x1.99999a0000000p-2, -4 , 0.5, 2.31481, 1, 0.1, 5, -0.25] + Data: [ 0.333333, 0.1, 1, -1, 0.4, -4, 0.5, 2, 0.4, -4, 0.5, 2.31481, 1, 0.1, 5, -0.25 ] Results: - Result: Test1 Rule: BufferFloatEpsilon