Skip to content

Commit 06240b2

Browse files
authored
Update 16-bit exp tests to use smaller values (#312)
The `exp` function computes `e^x`, and has wider precision drift for higher values of `x` due to compounding floating point rounding errors. For FP32, values under 100 tend to be pretty reliable, but for FP16 you really need values under 10 to have reliable precision. This updates the tests to use 2 as the test value instead of 10, making the test reliable across our test suite.
1 parent 24b2efb commit 06240b2

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

test/Feature/HLSLLib/exp.16.test

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ Buffers:
2525
- Name: In
2626
Format: Float16
2727
Stride: 8
28-
Data: [ 0x7e00, 0xfc00, 0x8001, 0x8000, 0x0000, 0x0001, 0x7c00, 0xbc00, 0x4900, 0x7e00, 0x7e00, 0x7e00,]
29-
# NaN, -Inf, -denorm, -0, 0, denorm, Inf, -1, 10,
28+
Data: [ 0x7e00, 0xfc00, 0x8001, 0x8000, 0x0000, 0x0001, 0x7c00, 0xbc00, 0x4000, 0x7e00, 0x7e00, 0x7e00,]
29+
# NaN, -Inf, -denorm, -0, 0, denorm, Inf, -1, 2,
3030
- Name: Out
3131
Format: Float16
3232
Stride: 8
3333
ZeroInitSize: 24
3434
- Name: ExpectedOut # The result we expect
3535
Format: Float16
3636
Stride: 8
37-
Data: [ 0x7e00, 0x0000, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x7c00, 0x35e3, 0x7561, 0x7e00, 0x7e00, 0x7e00,]
38-
# NaN, 0, 1, 1, 1, 1, Inf, 0.367879441, 22026.46579,
37+
Data: [ 0x7e00, 0x0000, 0x3c00, 0x3c00, 0x3c00, 0x3c00, 0x7c00, 0x35e3, 0x4764, 0x7e00, 0x7e00, 0x7e00,]
38+
# NaN, 0, 1, 1, 1, 1, Inf, 0.367879441, 7.38905609893,
3939
Results:
4040
- Result: Test1
4141
Rule: BufferFloatULP
@@ -61,11 +61,6 @@ DescriptorSets:
6161
...
6262
#--- end
6363

64-
# 16bit-hlk-issue-7570
65-
# https://github.com/microsoft/DirectXShaderCompiler/issues/7570
66-
# no hlk tests for 16 bit exp so unsure of correct driver behavior for 10
67-
# XFAIL: Clang
68-
# XFAIL: DXC
6964
# REQUIRES: Half
7065
# RUN: split-file %s %t
7166
# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl

0 commit comments

Comments
 (0)