From e89c27c648436e3470a27d628aea9a1a2c2e7312 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 4 Oct 2022 19:10:02 +0000 Subject: [PATCH] Remove some DISABLED tests. Several of the disabled tests were added for things we may want to add in the future. This CL removes those tests and we can add back if/when we decide to implement the feature. This brings the disabled tests from 69 to 31. Change-Id: I22b66256ce4086f223d3be059450eab1a2ff7693 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/104462 Auto-Submit: Dan Sinclair Kokoro: Kokoro Reviewed-by: Ben Clayton Commit-Queue: Ben Clayton Reviewed-by: David Neto --- src/tint/reader/spirv/function_memory_test.cc | 7 -- .../reader/spirv/parser_impl_handle_test.cc | 4 - src/tint/transform/robustness_test.cc | 80 ------------------- src/tint/transform/spirv_atomic_test.cc | 43 ---------- .../spirv/builder_global_variable_test.cc | 39 --------- .../wgsl/generator_impl_literal_test.cc | 58 -------------- 6 files changed, 231 deletions(-) diff --git a/src/tint/reader/spirv/function_memory_test.cc b/src/tint/reader/spirv/function_memory_test.cc index 4470d3d02c..dbf9219048 100644 --- a/src/tint/reader/spirv/function_memory_test.cc +++ b/src/tint/reader/spirv/function_memory_test.cc @@ -1070,13 +1070,6 @@ return; p->SkipDumpingPending("crbug.com/tint/98"); } -TEST_F(SpvParserMemoryTest, DISABLED_RemapStorageBuffer_ThroughFunctionCall) { - // WGSL does not support pointer-to-storage-buffer as function parameter -} -TEST_F(SpvParserMemoryTest, DISABLED_RemapStorageBuffer_ThroughFunctionParameter) { - // WGSL does not support pointer-to-storage-buffer as function parameter -} - std::string RuntimeArrayPreamble() { return R"( OpCapability Shader diff --git a/src/tint/reader/spirv/parser_impl_handle_test.cc b/src/tint/reader/spirv/parser_impl_handle_test.cc index cbad954ec1..094086aa0c 100644 --- a/src/tint/reader/spirv/parser_impl_handle_test.cc +++ b/src/tint/reader/spirv/parser_impl_handle_test.cc @@ -1484,10 +1484,6 @@ TEST_P(SpvParserHandleTest_SampledImageAccessTest, Variable) { } } -// TODO(dneto): Test variable declaration and texture builtins provoked by -// use of an image access instruction inside helper function. -TEST_P(SpvParserHandleTest_RegisterHandleUsage_SampledImage, DISABLED_FunctionParam) {} - INSTANTIATE_TEST_SUITE_P( ImageGather, SpvParserHandleTest_SampledImageAccessTest, diff --git a/src/tint/transform/robustness_test.cc b/src/tint/transform/robustness_test.cc index 9c610d4e44..fa04e47a90 100644 --- a/src/tint/transform/robustness_test.cc +++ b/src/tint/transform/robustness_test.cc @@ -277,86 +277,6 @@ var a : array; EXPECT_EQ(expect, str(got)); } -// TODO(crbug.com/tint/1177) - Validation currently forbids arrays larger than -// 0xffffffff. If WGSL supports 64-bit indexing, re-enable this test. -TEST_F(RobustnessTest, DISABLED_LargeArrays_Idx) { - auto* src = R"( -struct S { - a : array, - b : array, -}; -@group(0) @binding(0) var s : S; - -fn f() { - // Signed - var i32_a1 : f32 = s.a[ 0x7ffffffe]; - var i32_a2 : f32 = s.a[ 1]; - var i32_a3 : f32 = s.a[ 0]; - var i32_a4 : f32 = s.a[-1]; - var i32_a5 : f32 = s.a[-0x7fffffff]; - - var i32_b1 : f32 = s.b[ 0x7ffffffe]; - var i32_b2 : f32 = s.b[ 1]; - var i32_b3 : f32 = s.b[ 0]; - var i32_b4 : f32 = s.b[-1]; - var i32_b5 : f32 = s.b[-0x7fffffff]; - - // Unsigned - var u32_a1 : f32 = s.a[0u]; - var u32_a2 : f32 = s.a[1u]; - var u32_a3 : f32 = s.a[0x7ffffffeu]; - var u32_a4 : f32 = s.a[0x7fffffffu]; - var u32_a5 : f32 = s.a[0x80000000u]; - var u32_a6 : f32 = s.a[0xffffffffu]; - - var u32_b1 : f32 = s.b[0u]; - var u32_b2 : f32 = s.b[1u]; - var u32_b3 : f32 = s.b[0x7ffffffeu]; - var u32_b4 : f32 = s.b[0x7fffffffu]; - var u32_b5 : f32 = s.b[0x80000000u]; - var u32_b6 : f32 = s.b[0xffffffffu]; -} -)"; - - auto* expect = R"( -struct S { - a : array, - b : array, -}; - -@group(0) @binding(0) var s : S; - -fn f() { - var i32_a1 : f32 = s.a[2147483646]; - var i32_a2 : f32 = s.a[1]; - var i32_a3 : f32 = s.a[0]; - var i32_a4 : f32 = s.a[0]; - var i32_a5 : f32 = s.a[0]; - var i32_b1 : f32 = s.b[min(2147483646u, (arrayLength(&(s.b)) - 1u))]; - var i32_b2 : f32 = s.b[min(1u, (arrayLength(&(s.b)) - 1u))]; - var i32_b3 : f32 = s.b[min(0u, (arrayLength(&(s.b)) - 1u))]; - var i32_b4 : f32 = s.b[min(0u, (arrayLength(&(s.b)) - 1u))]; - var i32_b5 : f32 = s.b[min(0u, (arrayLength(&(s.b)) - 1u))]; - var u32_a1 : f32 = s.a[0u]; - var u32_a2 : f32 = s.a[1u]; - var u32_a3 : f32 = s.a[2147483646u]; - var u32_a4 : f32 = s.a[2147483646u]; - var u32_a5 : f32 = s.a[2147483646u]; - var u32_a6 : f32 = s.a[2147483646u]; - var u32_b1 : f32 = s.b[min(0u, (arrayLength(&(s.b)) - 1u))]; - var u32_b2 : f32 = s.b[min(1u, (arrayLength(&(s.b)) - 1u))]; - var u32_b3 : f32 = s.b[min(2147483646u, (arrayLength(&(s.b)) - 1u))]; - var u32_b4 : f32 = s.b[min(2147483647u, (arrayLength(&(s.b)) - 1u))]; - var u32_b5 : f32 = s.b[min(2147483648u, (arrayLength(&(s.b)) - 1u))]; - var u32_b6 : f32 = s.b[min(4294967295u, (arrayLength(&(s.b)) - 1u))]; -} -)"; - - auto got = Run(src); - - EXPECT_EQ(expect, str(got)); -} - TEST_F(RobustnessTest, Vector_Idx_Scalar) { auto* src = R"( var a : vec3; diff --git a/src/tint/transform/spirv_atomic_test.cc b/src/tint/transform/spirv_atomic_test.cc index 7f6db34e16..d9371bf67c 100644 --- a/src/tint/transform/spirv_atomic_test.cc +++ b/src/tint/transform/spirv_atomic_test.cc @@ -548,49 +548,6 @@ fn another_usage() { EXPECT_EQ(expect, str(got)); } -// This sort of mixed usage isn't handled yet. Not sure if we need to just yet. -// If we don't, then the transform should give sensible diagnostics instead of producing invalid -// WGSL. -// TODO(crbug.com/tint/1595) -TEST_F(SpirvAtomicTest, DISABLED_StructComplexMixedUsage) { - auto* src = R"( -struct S { - i : i32, -} - -@group(0) @binding(1) var s : S; - -fn f() { - let x : i32 = s.i; - stub_atomicStore_i32(s.i, 1i); - s.i = 3i; -} -)"; - - auto* expect = - R"( -struct S_atomic { - i : atomic, -} - -struct S { - i : i32, -} - -@group(0) @binding(1) var s : S_atomic; - -fn f() { - let x : i32 = atomicLoad(&s.i); - stub_atomicStore_i32(s.i, 1i); - atomicStore(&(s.i), 1i); -} -)"; - - auto got = Run(src); - - EXPECT_EQ(expect, str(got)); -} - TEST_F(SpirvAtomicTest, AtomicLoad) { auto* src = R"( var wg_u32 : u32; diff --git a/src/tint/writer/spirv/builder_global_variable_test.cc b/src/tint/writer/spirv/builder_global_variable_test.cc index 6231d887e2..b0bbf3f6be 100644 --- a/src/tint/writer/spirv/builder_global_variable_test.cc +++ b/src/tint/writer/spirv/builder_global_variable_test.cc @@ -473,45 +473,6 @@ OpDecorate %1 DescriptorSet 0 )"); } -// Check that multiple texture_storage types with different access modifiers -// only produces a single OpTypeImage. -// Test disabled as storage textures currently only support 'write' access. In -// the future we'll likely support read_write. -TEST_F(BuilderTest, DISABLED_GlobalVar_TextureStorageWithDifferentAccess) { - // var a : texture_storage_2d; - // var b : texture_storage_2d; - - auto* type_a = ty.storage_texture(ast::TextureDimension::k2d, ast::TexelFormat::kR32Uint, - ast::Access::kReadWrite); - auto* var_a = GlobalVar("a", type_a, Binding(0_a), Group(0_a)); - - auto* type_b = ty.storage_texture(ast::TextureDimension::k2d, ast::TexelFormat::kR32Uint, - ast::Access::kWrite); - auto* var_b = GlobalVar("b", type_b, Binding(1_a), Group(0_a)); - - spirv::Builder& b = Build(); - - EXPECT_TRUE(b.GenerateGlobalVariable(var_a)) << b.error(); - EXPECT_TRUE(b.GenerateGlobalVariable(var_b)) << b.error(); - - EXPECT_EQ(DumpInstructions(b.annots()), R"(OpDecorate %1 NonWritable -OpDecorate %1 Binding 0 -OpDecorate %1 DescriptorSet 0 -OpDecorate %5 NonReadable -OpDecorate %5 Binding 1 -OpDecorate %5 DescriptorSet 0 -)"); - // There must only be one OpTypeImage declaration with the same - // arguments - EXPECT_EQ(DumpInstructions(b.types()), R"(%4 = OpTypeInt 32 0 -%3 = OpTypeImage %4 2D 0 0 0 2 R32ui -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%6 = OpTypePointer UniformConstant %3 -%5 = OpVariable %6 UniformConstant -)"); -} - TEST_F(BuilderTest, GlobalVar_WorkgroupWithZeroInit) { auto* type_scalar = ty.i32(); auto* var_scalar = GlobalVar("a", type_scalar, ast::AddressSpace::kWorkgroup); diff --git a/src/tint/writer/wgsl/generator_impl_literal_test.cc b/src/tint/writer/wgsl/generator_impl_literal_test.cc index f33bd0ec69..f96b09e1df 100644 --- a/src/tint/writer/wgsl/generator_impl_literal_test.cc +++ b/src/tint/writer/wgsl/generator_impl_literal_test.cc @@ -152,34 +152,6 @@ INSTANTIATE_TEST_SUITE_P(Infinity, {MakeF32(0, 255, 0), "0x1p+128f"}, {MakeF32(1, 255, 0), "-0x1p+128f"}})); -INSTANTIATE_TEST_SUITE_P( - // TODO(dneto): It's unclear how Infinity and NaN should be handled. - // https://github.com/gpuweb/gpuweb/issues/1769 - // This test fails on Windows x86-64 because the machine sets the high - // mantissa bit on NaNs. - DISABLED_NaN, - // In the NaN case, the top bit in the mantissa is often used to encode - // whether the NaN is signalling or quiet, but no agreement between - // different machine architectures on whether 1 means signalling or - // if 1 means quiet. - WgslGenerator_F32LiteralTest, - ::testing::ValuesIn(std::vector{ - // LSB only. Smallest mantissa. - {MakeF32(0, 255, 1), "0x1.000002p+128f"}, // Smallest mantissa - {MakeF32(1, 255, 1), "-0x1.000002p+128f"}, - // MSB only. - {MakeF32(0, 255, 0x400000), "0x1.8p+128f"}, - {MakeF32(1, 255, 0x400000), "-0x1.8p+128f"}, - // All 1s in the mantissa. - {MakeF32(0, 255, 0x7fffff), "0x1.fffffep+128f"}, - {MakeF32(1, 255, 0x7fffff), "-0x1.fffffep+128f"}, - // Scattered bits, with 0 in top mantissa bit. - {MakeF32(0, 255, 0x20101f), "0x1.40203ep+128f"}, - {MakeF32(1, 255, 0x20101f), "-0x1.40203ep+128f"}, - // Scattered bits, with 1 in top mantissa bit. - {MakeF32(0, 255, 0x40101f), "0x1.80203ep+128f"}, - {MakeF32(1, 255, 0x40101f), "-0x1.80203ep+128f"}})); - using WgslGenerator_F16LiteralTest = TestParamHelper; TEST_P(WgslGenerator_F16LiteralTest, Emit) { @@ -222,35 +194,5 @@ INSTANTIATE_TEST_SUITE_P(Subnormal, {MakeF16(1, 0, 0x2c7u), "-4.23789024e-05h"}, // Scattered bits })); -INSTANTIATE_TEST_SUITE_P( - // Currently Inf is impossible to be spelled out in literal. - // https://github.com/gpuweb/gpuweb/issues/1769 - DISABLED_Infinity, - WgslGenerator_F16LiteralTest, - ::testing::ValuesIn(std::vector{{MakeF16(0, 31, 0), "0x1p+128h"}, - {MakeF16(1, 31, 0), "-0x1p+128h"}})); - -INSTANTIATE_TEST_SUITE_P( - // Currently NaN is impossible to be spelled out in literal. - // https://github.com/gpuweb/gpuweb/issues/1769 - DISABLED_NaN, - WgslGenerator_F16LiteralTest, - ::testing::ValuesIn(std::vector{ - // LSB only. Smallest mantissa. - {MakeF16(0, 31, 1), "0x1.004p+128h"}, // Smallest mantissa - {MakeF16(1, 31, 1), "-0x1.004p+128h"}, - // MSB only. - {MakeF16(0, 31, 0x200u), "0x1.8p+128h"}, - {MakeF16(1, 31, 0x200u), "-0x1.8p+128h"}, - // All 1s in the mantissa. - {MakeF16(0, 31, 0x3ffu), "0x1.ffcp+128h"}, - {MakeF16(1, 31, 0x3ffu), "-0x1.ffcp+128h"}, - // Scattered bits, with 0 in top mantissa bit. - {MakeF16(0, 31, 0x11fu), "0x1.47cp+128h"}, - {MakeF16(1, 31, 0x11fu), "-0x1.47cp+128h"}, - // Scattered bits, with 1 in top mantissa bit. - {MakeF16(0, 31, 0x23fu), "0x1.8fcp+128h"}, - {MakeF16(1, 31, 0x23fu), "-0x1.8fcp+128h"}})); - } // namespace } // namespace tint::writer::wgsl