Skip to content

Commit feae699

Browse files
Copilotalsepkow
andauthored
Move double-precision tests to DoublePrecision class (microsoft#8157)
Addresses mmerecki's comment on PR microsoft#8134: several tests operating on double-precision values remained in `DxilConf_SM69_Vectorized_Core` but belong in `DxilConf_SM69_Vectorized_Double`. ## Changes **Moved from `DxilConf_SM69_Vectorized_Core` to `DxilConf_SM69_Vectorized_Double`:** - `CastToFloat64_*` (9 variants: HLSLBool_t, HLSLHalf_t, float, uint16_t, uint32_t, uint64_t, int16_t, int32_t, int64_t) - `AsDouble_uint32_t` - `AsUint_SplitDouble_double` **Technical change:** - Removed tests from `DxilConf_SM69_Vectorized_Core` class - Added same tests to `DxilConf_SM69_Vectorized_Double` class using `HLK_TEST_DOUBLE` macro - Tests are now properly associated with `Device.Graphics.D3D12.DXILCore.ShaderModel69.DoublePrecision` specification - Tests organized in sections: "Explicit Cast to Double (from various types)" and "AsType (double precision)" Test names and OpType template parameters remain unchanged. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Create a follow-up PR in microsoft/DirectXShaderCompiler to address mmerecki's comment on PR microsoft#8134 (microsoft#8134 (comment)). > > Problem: > PR microsoft#8134 split long vector execution tests into separate classes based on HLK requirements, introducing DxilConf_SM69_Vectorized_Core and DxilConf_SM69_Vectorized_Double test classes in tools/clang/unittests/HLSLExec/LongVectors.cpp. mmerecki noted that several tests still live under DxilConf_SM69_Vectorized_Core but appear to be double-precision related and should be moved to DxilConf_SM69_Vectorized_Double. > > The tests listed by mmerecki: > - DxilConf_SM69_Vectorized_Core::CastToFloat64_HLSLBool_t > - DxilConf_SM69_Vectorized_Core::CastToFloat64_HLSLHalf_t > - DxilConf_SM69_Vectorized_Core::CastToFloat64_float > - DxilConf_SM69_Vectorized_Core::CastToFloat64_uint16_t > - DxilConf_SM69_Vectorized_Core::CastToFloat64_uint32_t > - DxilConf_SM69_Vectorized_Core::CastToFloat64_uint64_t > - DxilConf_SM69_Vectorized_Core::CastToFloat64_int16_t > - DxilConf_SM69_Vectorized_Core::CastToFloat64_int32_t > - DxilConf_SM69_Vectorized_Core::CastToFloat64_int64_t > - DxilConf_SM69_Vectorized_Core::AsDouble_uint32_t > - DxilConf_SM69_Vectorized_Core::AsUint_SplitDouble_double > > Expected behavior / fix: > - Update tools/clang/unittests/HLSLExec/LongVectors.cpp so that these tests are associated with the DoublePrecision HLK specification. > - Concretely, remove the above tests from DxilConf_SM69_Vectorized_Core and add equivalent tests to DxilConf_SM69_Vectorized_Double. > - Prefer using HLK_TEST_DOUBLE for the tests being moved so they pick up the "Device.Graphics.D3D12.DXILCore.ShaderModel69.DoublePrecision" specification. > - Ensure the resulting test method names remain stable/consistent and compilation passes. > - Validate that moved tests still call the correct OpType values (OpType::CastToFloat64, OpType::AsDouble, OpType::AsUint_SplitDouble) with appropriate template type arguments. > > Notes / pointers: > - Relevant file: tools/clang/unittests/HLSLExec/LongVectors.cpp (see locations around DxilConf_SM69_Vectorized_Core and DxilConf_SM69_Vectorized_Double classes). > - DxilConf_SM69_Vectorized_Double class defines HLK_TEST_DOUBLE and already contains many double tests. > > Deliverables: > - A new PR with changes only necessary to re-home these tests from Core to Double. > - Include a concise PR description referencing mmerecki's comment and why the tests belong in the DoublePrecision group. > > </details> <!-- START COPILOT CODING AGENT SUFFIX --> *This pull request was created from Copilot chat.* > <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/DirectXShaderCompiler/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: alsepkow <[email protected]>
1 parent c44a383 commit feae699

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

tools/clang/unittests/HLSLExec/LongVectors.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
21402140
HLK_TEST(CastToUint64, HLSLBool_t);
21412141
HLK_TEST(CastToFloat16, HLSLBool_t);
21422142
HLK_TEST(CastToFloat32, HLSLBool_t);
2143-
HLK_TEST(CastToFloat64, HLSLBool_t);
21442143

21452144
HLK_TEST(CastToBool, HLSLHalf_t);
21462145
HLK_TEST(CastToInt16, HLSLHalf_t);
@@ -2150,7 +2149,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
21502149
HLK_TEST(CastToUint32_FromFP, HLSLHalf_t);
21512150
HLK_TEST(CastToUint64_FromFP, HLSLHalf_t);
21522151
HLK_TEST(CastToFloat32, HLSLHalf_t);
2153-
HLK_TEST(CastToFloat64, HLSLHalf_t);
21542152

21552153
HLK_TEST(CastToBool, float);
21562154
HLK_TEST(CastToInt16, float);
@@ -2160,7 +2158,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
21602158
HLK_TEST(CastToUint32_FromFP, float);
21612159
HLK_TEST(CastToUint64_FromFP, float);
21622160
HLK_TEST(CastToFloat16, float);
2163-
HLK_TEST(CastToFloat64, float);
21642161

21652162
HLK_TEST(CastToBool, uint16_t);
21662163
HLK_TEST(CastToInt16, uint16_t);
@@ -2170,7 +2167,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
21702167
HLK_TEST(CastToUint64, uint16_t);
21712168
HLK_TEST(CastToFloat16, uint16_t);
21722169
HLK_TEST(CastToFloat32, uint16_t);
2173-
HLK_TEST(CastToFloat64, uint16_t);
21742170

21752171
HLK_TEST(CastToBool, uint32_t);
21762172
HLK_TEST(CastToInt16, uint32_t);
@@ -2180,7 +2176,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
21802176
HLK_TEST(CastToUint64, uint32_t);
21812177
HLK_TEST(CastToFloat16, uint32_t);
21822178
HLK_TEST(CastToFloat32, uint32_t);
2183-
HLK_TEST(CastToFloat64, uint32_t);
21842179

21852180
HLK_TEST(CastToBool, uint64_t);
21862181
HLK_TEST(CastToInt16, uint64_t);
@@ -2190,7 +2185,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
21902185
HLK_TEST(CastToUint32, uint64_t);
21912186
HLK_TEST(CastToFloat16, uint64_t);
21922187
HLK_TEST(CastToFloat32, uint64_t);
2193-
HLK_TEST(CastToFloat64, uint64_t);
21942188

21952189
HLK_TEST(CastToBool, int16_t);
21962190
HLK_TEST(CastToInt32, int16_t);
@@ -2200,7 +2194,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
22002194
HLK_TEST(CastToUint64, int16_t);
22012195
HLK_TEST(CastToFloat16, int16_t);
22022196
HLK_TEST(CastToFloat32, int16_t);
2203-
HLK_TEST(CastToFloat64, int16_t);
22042197

22052198
HLK_TEST(CastToBool, int32_t);
22062199
HLK_TEST(CastToInt16, int32_t);
@@ -2210,7 +2203,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
22102203
HLK_TEST(CastToUint64, int32_t);
22112204
HLK_TEST(CastToFloat16, int32_t);
22122205
HLK_TEST(CastToFloat32, int32_t);
2213-
HLK_TEST(CastToFloat64, int32_t);
22142206

22152207
HLK_TEST(CastToBool, int64_t);
22162208
HLK_TEST(CastToInt16, int64_t);
@@ -2220,7 +2212,6 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
22202212
HLK_TEST(CastToUint64, int64_t);
22212213
HLK_TEST(CastToFloat16, int64_t);
22222214
HLK_TEST(CastToFloat32, int64_t);
2223-
HLK_TEST(CastToFloat64, int64_t);
22242215

22252216
// Trigonometric
22262217
HLK_TEST(Acos, HLSLHalf_t);
@@ -2255,11 +2246,9 @@ class DxilConf_SM69_Vectorized_Core : public TestClassCommon {
22552246
HLK_TEST(AsFloat, uint32_t);
22562247
HLK_TEST(AsInt, uint32_t);
22572248
HLK_TEST(AsUint, uint32_t);
2258-
HLK_TEST(AsDouble, uint32_t);
22592249
HLK_TEST(AsFloat16, HLSLHalf_t);
22602250
HLK_TEST(AsInt16, HLSLHalf_t);
22612251
HLK_TEST(AsUint16, HLSLHalf_t);
2262-
HLK_TEST(AsUint_SplitDouble, double);
22632252

22642253
// Unary Math
22652254
HLK_TEST(Abs, int16_t);
@@ -2802,6 +2791,21 @@ class DxilConf_SM69_Vectorized_Double : public TestClassCommon {
28022791
HLK_TEST_DOUBLE(CastToFloat16, double);
28032792
HLK_TEST_DOUBLE(CastToFloat32, double);
28042793

2794+
// Explicit Cast to Double (from various types)
2795+
HLK_TEST_DOUBLE(CastToFloat64, HLSLBool_t);
2796+
HLK_TEST_DOUBLE(CastToFloat64, HLSLHalf_t);
2797+
HLK_TEST_DOUBLE(CastToFloat64, float);
2798+
HLK_TEST_DOUBLE(CastToFloat64, uint16_t);
2799+
HLK_TEST_DOUBLE(CastToFloat64, uint32_t);
2800+
HLK_TEST_DOUBLE(CastToFloat64, uint64_t);
2801+
HLK_TEST_DOUBLE(CastToFloat64, int16_t);
2802+
HLK_TEST_DOUBLE(CastToFloat64, int32_t);
2803+
HLK_TEST_DOUBLE(CastToFloat64, int64_t);
2804+
2805+
// AsType (double precision)
2806+
HLK_TEST_DOUBLE(AsDouble, uint32_t);
2807+
HLK_TEST_DOUBLE(AsUint_SplitDouble, double);
2808+
28052809
// Unary Math
28062810
HLK_TEST_DOUBLE(Abs, double);
28072811
HLK_TEST_DOUBLE(Sign, double);

0 commit comments

Comments
 (0)