diff --git a/src/resources/cache/hashes.json b/src/resources/cache/hashes.json index 43aa1859e581..49b2d89ac9b3 100644 --- a/src/resources/cache/hashes.json +++ b/src/resources/cache/hashes.json @@ -1,103 +1,103 @@ { - "webgpu/shader/execution/binary/af_addition.bin": "cbafc82c", + "webgpu/shader/execution/binary/af_addition.bin": "293261fa", "webgpu/shader/execution/binary/af_logical.bin": "9ec85311", - "webgpu/shader/execution/binary/af_division.bin": "f89905b3", - "webgpu/shader/execution/binary/af_matrix_addition.bin": "3e99f56e", - "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "ee161b6", - "webgpu/shader/execution/binary/af_multiplication.bin": "a22cdaa9", - "webgpu/shader/execution/binary/af_remainder.bin": "b874f4ec", - "webgpu/shader/execution/binary/af_subtraction.bin": "778e0c61", - "webgpu/shader/execution/binary/f16_addition.bin": "2d0950e3", + "webgpu/shader/execution/binary/af_division.bin": "85f3ade6", + "webgpu/shader/execution/binary/af_matrix_addition.bin": "10ee5614", + "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "583ef942", + "webgpu/shader/execution/binary/af_multiplication.bin": "4c7829d0", + "webgpu/shader/execution/binary/af_remainder.bin": "4b919d4e", + "webgpu/shader/execution/binary/af_subtraction.bin": "ab923082", + "webgpu/shader/execution/binary/f16_addition.bin": "d0e37f23", "webgpu/shader/execution/binary/f16_logical.bin": "1edd08ec", - "webgpu/shader/execution/binary/f16_division.bin": "7aefab2", - "webgpu/shader/execution/binary/f16_matrix_addition.bin": "29ac151b", - "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "3d1260a7", - "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "4bbb407c", - "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "1300adb5", - "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "ca0c57ad", - "webgpu/shader/execution/binary/f16_multiplication.bin": "32d97a5f", - "webgpu/shader/execution/binary/f16_remainder.bin": "d5452448", - "webgpu/shader/execution/binary/f16_subtraction.bin": "7fed0126", - "webgpu/shader/execution/binary/f32_addition.bin": "6ba12f18", + "webgpu/shader/execution/binary/f16_division.bin": "dbb02527", + "webgpu/shader/execution/binary/f16_matrix_addition.bin": "836361db", + "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "2ef3e4f8", + "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "5a21b39f", + "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "f0ab8f14", + "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "c06afade", + "webgpu/shader/execution/binary/f16_multiplication.bin": "83457adf", + "webgpu/shader/execution/binary/f16_remainder.bin": "ff06563f", + "webgpu/shader/execution/binary/f16_subtraction.bin": "f035d680", + "webgpu/shader/execution/binary/f32_addition.bin": "8ac813c8", "webgpu/shader/execution/binary/f32_logical.bin": "fab7cfc5", - "webgpu/shader/execution/binary/f32_division.bin": "8e4a63bb", - "webgpu/shader/execution/binary/f32_matrix_addition.bin": "454ae6ca", - "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "8edc9ed2", - "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "eb8bab4d", - "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "438f6f2c", - "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "7c60fba5", - "webgpu/shader/execution/binary/f32_multiplication.bin": "5985aa4d", - "webgpu/shader/execution/binary/f32_remainder.bin": "d03a6f99", - "webgpu/shader/execution/binary/f32_subtraction.bin": "73b6dc49", + "webgpu/shader/execution/binary/f32_division.bin": "d2372fe5", + "webgpu/shader/execution/binary/f32_matrix_addition.bin": "9e72cea3", + "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "3c23bdf1", + "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "c6edce81", + "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "140cb137", + "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "3f3b7585", + "webgpu/shader/execution/binary/f32_multiplication.bin": "b4cf8753", + "webgpu/shader/execution/binary/f32_remainder.bin": "bde79d19", + "webgpu/shader/execution/binary/f32_subtraction.bin": "520e4227", "webgpu/shader/execution/binary/i32_arithmetic.bin": "de93ee2a", "webgpu/shader/execution/binary/i32_comparison.bin": "aaa1f21b", "webgpu/shader/execution/binary/u32_arithmetic.bin": "d79a1011", "webgpu/shader/execution/binary/u32_comparison.bin": "31764c75", - "webgpu/shader/execution/abs.bin": "7592c2e9", - "webgpu/shader/execution/acos.bin": "ffa331d7", - "webgpu/shader/execution/acosh.bin": "8bc525c1", - "webgpu/shader/execution/asin.bin": "c40b93d8", - "webgpu/shader/execution/asinh.bin": "83a941a2", - "webgpu/shader/execution/atan.bin": "1a597eec", - "webgpu/shader/execution/atan2.bin": "225c7bf5", - "webgpu/shader/execution/atanh.bin": "a0a50a1", - "webgpu/shader/execution/bitcast.bin": "fb5cbfe6", - "webgpu/shader/execution/ceil.bin": "9b74d951", - "webgpu/shader/execution/clamp.bin": "e21840ce", - "webgpu/shader/execution/cos.bin": "716ae7de", - "webgpu/shader/execution/cosh.bin": "2caa57a3", - "webgpu/shader/execution/cross.bin": "3cd2bb7d", - "webgpu/shader/execution/degrees.bin": "854e3b43", - "webgpu/shader/execution/determinant.bin": "e393a3d6", - "webgpu/shader/execution/distance.bin": "ab1efb22", - "webgpu/shader/execution/dot.bin": "dca4281b", - "webgpu/shader/execution/exp.bin": "229d2470", - "webgpu/shader/execution/exp2.bin": "29bcb796", - "webgpu/shader/execution/faceForward.bin": "5b501473", - "webgpu/shader/execution/floor.bin": "4c2cbe16", - "webgpu/shader/execution/fma.bin": "eb0531af", - "webgpu/shader/execution/fract.bin": "b94ef628", - "webgpu/shader/execution/frexp.bin": "5e1f6865", - "webgpu/shader/execution/inverseSqrt.bin": "d793704a", - "webgpu/shader/execution/ldexp.bin": "38e2de2e", - "webgpu/shader/execution/length.bin": "1e248428", - "webgpu/shader/execution/log.bin": "77a9e6ce", - "webgpu/shader/execution/log2.bin": "62a8591f", - "webgpu/shader/execution/max.bin": "a6e79c98", - "webgpu/shader/execution/min.bin": "8d202927", - "webgpu/shader/execution/mix.bin": "92b9d5a6", - "webgpu/shader/execution/modf.bin": "a7865848", - "webgpu/shader/execution/normalize.bin": "6060c1b7", + "webgpu/shader/execution/abs.bin": "2e8d3b31", + "webgpu/shader/execution/acos.bin": "7261dd02", + "webgpu/shader/execution/acosh.bin": "8463f905", + "webgpu/shader/execution/asin.bin": "dba9716d", + "webgpu/shader/execution/asinh.bin": "50c6c6bf", + "webgpu/shader/execution/atan.bin": "f70605ab", + "webgpu/shader/execution/atan2.bin": "e952a", + "webgpu/shader/execution/atanh.bin": "d0e0aebc", + "webgpu/shader/execution/bitcast.bin": "402f4036", + "webgpu/shader/execution/ceil.bin": "1c3d5c64", + "webgpu/shader/execution/clamp.bin": "fd0e7ebb", + "webgpu/shader/execution/cos.bin": "bb674c27", + "webgpu/shader/execution/cosh.bin": "ba25d30c", + "webgpu/shader/execution/cross.bin": "407ad2e6", + "webgpu/shader/execution/degrees.bin": "fdf556ed", + "webgpu/shader/execution/determinant.bin": "7e232d50", + "webgpu/shader/execution/distance.bin": "418569f5", + "webgpu/shader/execution/dot.bin": "363e0a26", + "webgpu/shader/execution/exp.bin": "ffdc9127", + "webgpu/shader/execution/exp2.bin": "3198cdce", + "webgpu/shader/execution/faceForward.bin": "d9a85ccb", + "webgpu/shader/execution/floor.bin": "ca979144", + "webgpu/shader/execution/fma.bin": "8ae90693", + "webgpu/shader/execution/fract.bin": "53814386", + "webgpu/shader/execution/frexp.bin": "252b655b", + "webgpu/shader/execution/inverseSqrt.bin": "c4e90efc", + "webgpu/shader/execution/ldexp.bin": "8f98881b", + "webgpu/shader/execution/length.bin": "75b4ee0e", + "webgpu/shader/execution/log.bin": "dcd40a7f", + "webgpu/shader/execution/log2.bin": "627dac46", + "webgpu/shader/execution/max.bin": "3f1c2e9f", + "webgpu/shader/execution/min.bin": "45d6891d", + "webgpu/shader/execution/mix.bin": "e98e8fe7", + "webgpu/shader/execution/modf.bin": "ff151681", + "webgpu/shader/execution/normalize.bin": "78b436b3", "webgpu/shader/execution/pack2x16float.bin": "b2cb12ea", - "webgpu/shader/execution/pow.bin": "9cafb208", - "webgpu/shader/execution/quantizeToF16.bin": "e9fe32d3", - "webgpu/shader/execution/radians.bin": "3de6e3e2", - "webgpu/shader/execution/reflect.bin": "ada28c0e", - "webgpu/shader/execution/refract.bin": "1bfc8954", - "webgpu/shader/execution/round.bin": "d6980b30", - "webgpu/shader/execution/saturate.bin": "ac1c87b7", - "webgpu/shader/execution/sign.bin": "8159fff8", - "webgpu/shader/execution/sin.bin": "57eef8dd", - "webgpu/shader/execution/sinh.bin": "fe8c4a10", - "webgpu/shader/execution/smoothstep.bin": "5edbb429", - "webgpu/shader/execution/sqrt.bin": "c56cd7f8", - "webgpu/shader/execution/step.bin": "5dba0cdb", - "webgpu/shader/execution/tan.bin": "a130ad0d", - "webgpu/shader/execution/tanh.bin": "3129d901", - "webgpu/shader/execution/transpose.bin": "a9009349", - "webgpu/shader/execution/trunc.bin": "7e345f71", - "webgpu/shader/execution/unpack2x16float.bin": "84d23fa6", - "webgpu/shader/execution/unpack2x16snorm.bin": "df585faa", - "webgpu/shader/execution/unpack2x16unorm.bin": "7e5b4b66", - "webgpu/shader/execution/unpack4x8snorm.bin": "fdd14e11", - "webgpu/shader/execution/unpack4x8unorm.bin": "a095fd3d", - "webgpu/shader/execution/unary/af_arithmetic.bin": "92cf0ae3", - "webgpu/shader/execution/unary/af_assignment.bin": "6345d35", + "webgpu/shader/execution/pow.bin": "fa072c72", + "webgpu/shader/execution/quantizeToF16.bin": "562ce4f0", + "webgpu/shader/execution/radians.bin": "a0c6a614", + "webgpu/shader/execution/reflect.bin": "b50a8ad1", + "webgpu/shader/execution/refract.bin": "8273810c", + "webgpu/shader/execution/round.bin": "ea149559", + "webgpu/shader/execution/saturate.bin": "75800ee8", + "webgpu/shader/execution/sign.bin": "5983c1c9", + "webgpu/shader/execution/sin.bin": "67965c32", + "webgpu/shader/execution/sinh.bin": "3c4446fb", + "webgpu/shader/execution/smoothstep.bin": "75936c2b", + "webgpu/shader/execution/sqrt.bin": "90190029", + "webgpu/shader/execution/step.bin": "2472df33", + "webgpu/shader/execution/tan.bin": "e0c107da", + "webgpu/shader/execution/tanh.bin": "38d6dff6", + "webgpu/shader/execution/transpose.bin": "a3d80916", + "webgpu/shader/execution/trunc.bin": "8f1f7789", + "webgpu/shader/execution/unpack2x16float.bin": "51963f82", + "webgpu/shader/execution/unpack2x16snorm.bin": "812bd989", + "webgpu/shader/execution/unpack2x16unorm.bin": "fda0d260", + "webgpu/shader/execution/unpack4x8snorm.bin": "e1d1d8bb", + "webgpu/shader/execution/unpack4x8unorm.bin": "d475743c", + "webgpu/shader/execution/unary/af_arithmetic.bin": "a096903c", + "webgpu/shader/execution/unary/af_assignment.bin": "619820ec", "webgpu/shader/execution/unary/bool_conversion.bin": "cb53bf65", - "webgpu/shader/execution/unary/f16_arithmetic.bin": "c913cc95", - "webgpu/shader/execution/unary/f16_conversion.bin": "fd520112", - "webgpu/shader/execution/unary/f32_arithmetic.bin": "e113d162", - "webgpu/shader/execution/unary/f32_conversion.bin": "26505ced", + "webgpu/shader/execution/unary/f16_arithmetic.bin": "d01d694d", + "webgpu/shader/execution/unary/f16_conversion.bin": "1b868ac3", + "webgpu/shader/execution/unary/f32_arithmetic.bin": "31bc2303", + "webgpu/shader/execution/unary/f32_conversion.bin": "8a1d039d", "webgpu/shader/execution/unary/i32_arithmetic.bin": "d322b73d", "webgpu/shader/execution/unary/i32_complement.bin": "c4e6cbb", "webgpu/shader/execution/unary/i32_conversion.bin": "d6905a0f", diff --git a/src/resources/cache/webgpu/shader/execution/abs.bin b/src/resources/cache/webgpu/shader/execution/abs.bin index 16111ac66a32..6dac731ea9e8 100644 Binary files a/src/resources/cache/webgpu/shader/execution/abs.bin and b/src/resources/cache/webgpu/shader/execution/abs.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/clamp.bin b/src/resources/cache/webgpu/shader/execution/clamp.bin index 1ceb3f19a10d..d6cacb26723f 100644 Binary files a/src/resources/cache/webgpu/shader/execution/clamp.bin and b/src/resources/cache/webgpu/shader/execution/clamp.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/cross.bin b/src/resources/cache/webgpu/shader/execution/cross.bin index 64041c731193..3c7167535bcb 100644 Binary files a/src/resources/cache/webgpu/shader/execution/cross.bin and b/src/resources/cache/webgpu/shader/execution/cross.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/degrees.bin b/src/resources/cache/webgpu/shader/execution/degrees.bin index 715e6b656f74..aa76feabe220 100644 Binary files a/src/resources/cache/webgpu/shader/execution/degrees.bin and b/src/resources/cache/webgpu/shader/execution/degrees.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/floor.bin b/src/resources/cache/webgpu/shader/execution/floor.bin index a4b363825bea..453a5f07a856 100644 Binary files a/src/resources/cache/webgpu/shader/execution/floor.bin and b/src/resources/cache/webgpu/shader/execution/floor.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/fma.bin b/src/resources/cache/webgpu/shader/execution/fma.bin index db54353a5262..fd9d53d1457e 100644 Binary files a/src/resources/cache/webgpu/shader/execution/fma.bin and b/src/resources/cache/webgpu/shader/execution/fma.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/max.bin b/src/resources/cache/webgpu/shader/execution/max.bin index 63704eb23300..eca57f0766ac 100644 Binary files a/src/resources/cache/webgpu/shader/execution/max.bin and b/src/resources/cache/webgpu/shader/execution/max.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/min.bin b/src/resources/cache/webgpu/shader/execution/min.bin index 18b26a3bf8c8..e215656934eb 100644 Binary files a/src/resources/cache/webgpu/shader/execution/min.bin and b/src/resources/cache/webgpu/shader/execution/min.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/mix.bin b/src/resources/cache/webgpu/shader/execution/mix.bin index e6d92fc898d5..78d847790dc6 100644 Binary files a/src/resources/cache/webgpu/shader/execution/mix.bin and b/src/resources/cache/webgpu/shader/execution/mix.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/modf.bin b/src/resources/cache/webgpu/shader/execution/modf.bin index e5387db46257..7f882b4cac6f 100644 Binary files a/src/resources/cache/webgpu/shader/execution/modf.bin and b/src/resources/cache/webgpu/shader/execution/modf.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/radians.bin b/src/resources/cache/webgpu/shader/execution/radians.bin index 63c7cc3ccd5b..04586914f516 100644 Binary files a/src/resources/cache/webgpu/shader/execution/radians.bin and b/src/resources/cache/webgpu/shader/execution/radians.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/round.bin b/src/resources/cache/webgpu/shader/execution/round.bin index c3b30b68f0a1..b720a684a5f5 100644 Binary files a/src/resources/cache/webgpu/shader/execution/round.bin and b/src/resources/cache/webgpu/shader/execution/round.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/saturate.bin b/src/resources/cache/webgpu/shader/execution/saturate.bin index 39df7169b750..6c46d62b7ef5 100644 Binary files a/src/resources/cache/webgpu/shader/execution/saturate.bin and b/src/resources/cache/webgpu/shader/execution/saturate.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/sign.bin b/src/resources/cache/webgpu/shader/execution/sign.bin index 2f3b2aa258b2..fb8b30546818 100644 Binary files a/src/resources/cache/webgpu/shader/execution/sign.bin and b/src/resources/cache/webgpu/shader/execution/sign.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/transpose.bin b/src/resources/cache/webgpu/shader/execution/transpose.bin index d1b6bf04ee7e..3a253c219583 100644 Binary files a/src/resources/cache/webgpu/shader/execution/transpose.bin and b/src/resources/cache/webgpu/shader/execution/transpose.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/trunc.bin b/src/resources/cache/webgpu/shader/execution/trunc.bin index ba81e2ada427..e640d5710a79 100644 Binary files a/src/resources/cache/webgpu/shader/execution/trunc.bin and b/src/resources/cache/webgpu/shader/execution/trunc.bin differ diff --git a/src/resources/cache/webgpu/shader/execution/unary/af_assignment.bin b/src/resources/cache/webgpu/shader/execution/unary/af_assignment.bin index a92279b5ce4e..6a462d037f73 100644 Binary files a/src/resources/cache/webgpu/shader/execution/unary/af_assignment.bin and b/src/resources/cache/webgpu/shader/execution/unary/af_assignment.bin differ diff --git a/src/unittests/floating_point.spec.ts b/src/unittests/floating_point.spec.ts index 45dba525df7f..dbe6e98a652f 100644 --- a/src/unittests/floating_point.spec.ts +++ b/src/unittests/floating_point.spec.ts @@ -27,7 +27,7 @@ export const g = makeTestGroup(UnitTest); * for expectations. */ const kFPTraitForULP = { - abstract: 'f32', + abstract_float: 'f32', f32: 'f32', f16: 'f16', } as const; @@ -39,7 +39,7 @@ const kUnboundedEndpoints: IntervalEndpoints = [Number.NEGATIVE_INFINITY, Number const kUnboundedInterval = { f32: FP.f32.toParam(kUnboundedEndpoints), f16: FP.f16.toParam(kUnboundedEndpoints), - abstract: FP.abstract.toParam(kUnboundedEndpoints), + abstract_float: FP.abstract_float.toParam(kUnboundedEndpoints), }; /** @returns a number N * ULP greater than the provided number */ @@ -50,7 +50,7 @@ const kPlusNULPFunctions = { f16: (x: number, n: number) => { return x + n * oneULPF16(x); }, - abstract: (x: number, n: number) => { + abstract_float: (x: number, n: number) => { return x + n * oneULPF64(x); }, }; @@ -63,8 +63,8 @@ const kPlusOneULPFunctions = { f16: (x: number): number => { return kPlusNULPFunctions['f16'](x, 1); }, - abstract: (x: number): number => { - return kPlusNULPFunctions['abstract'](x, 1); + abstract_float: (x: number): number => { + return kPlusNULPFunctions['abstract_float'](x, 1); }, }; @@ -76,7 +76,7 @@ const kMinusNULPFunctions = { f16: (x: number, n: number) => { return x - n * oneULPF16(x); }, - abstract: (x: number, n: number) => { + abstract_float: (x: number, n: number) => { return x - n * oneULPF64(x); }, }; @@ -89,8 +89,8 @@ const kMinusOneULPFunctions = { f16: (x: number): number => { return kMinusNULPFunctions['f16'](x, 1); }, - abstract: (x: number): number => { - return kMinusNULPFunctions['abstract'](x, 1); + abstract_float: (x: number): number => { + return kMinusNULPFunctions['abstract_float'](x, 1); }, }; @@ -140,7 +140,7 @@ interface ConstructorCase { g.test('constructor') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -171,7 +171,7 @@ g.test('constructor') // Note: Out of range values are limited to infinities for abstract float, due to abstract // float and 'number' both being f64. So there are no separate OOR tests for abstract float, // otherwise the testing framework will consider them duplicated. - if (p.trait !== 'abstract') { + if (p.trait !== 'abstract_float') { // prettier-ignore cases.push(...[ // Out of range @@ -201,7 +201,7 @@ interface ContainsNumberCase { g.test('contains_number') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -297,7 +297,7 @@ g.test('contains_number') // Note: Out of range values are limited to infinities for abstract float, due to abstract // float and 'number' both being f64. So there are no separate OOR tests for abstract float, // otherwise the testing framework will consider them duplicated. - if (p.trait !== 'abstract') { + if (p.trait !== 'abstract_float') { // prettier-ignore cases.push(...[ // Out of range high @@ -340,7 +340,7 @@ interface ContainsIntervalCase { g.test('contains_interval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -406,7 +406,7 @@ g.test('contains_interval') // Note: Out of range values are limited to infinities for abstract float, due to abstract // float and 'number' both being f64. So there are no separate OOR tests for abstract float, // otherwise the testing framework will consider them duplicated. - if (p.trait !== 'abstract') { + if (p.trait !== 'abstract_float') { // prettier-ignore cases.push(...[ // Out of range high @@ -452,7 +452,7 @@ interface SpanIntervalsCase { g.test('spanIntervals') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -506,7 +506,7 @@ interface isVectorCase { g.test('isVector') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -612,7 +612,7 @@ interface toVectorCase { g.test('toVector') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -734,7 +734,7 @@ interface isMatrixCase { g.test('isMatrix') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -1169,7 +1169,7 @@ interface toMatrixCase { g.test('toMatrix') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -2091,7 +2091,7 @@ const kULPErrorValue = { g.test('ulpInterval') .params(u => u - .combine('trait', ['abstract', 'f32', 'f16'] as const) + .combine('trait', ['abstract_float', 'f32', 'f16'] as const) .beginSubcases() .expandWithParams(p => { const trait = kFPTraitForULP[p.trait]; @@ -2196,7 +2196,7 @@ const kConstantCorrectlyRoundedExpectation = { } as { [value in ConstantNumberFrequentlyUsedInCases]: IntervalEndpoints }, // Since abstract is actually f64 and JS number is also f64, the JS number value will map to // identical abstracty value without rounded. - abstract: { + abstract_float: { '0.1': 0.1, '-0.1': -0.1, '1.9': 1.9, @@ -2212,7 +2212,7 @@ interface ScalarToIntervalCase { g.test('absInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -2850,16 +2850,16 @@ const kDegreesIntervalCases = { { input: kValue.f16.positive.pi.three_quarters, expected: [kMinusOneULPFunctions['f16'](135), 135] }, { input: kValue.f16.positive.pi.whole, expected: [kMinusOneULPFunctions['f16'](180), 180] }, ] as ScalarToIntervalCase[], - abstract: [ + abstract_float: [ { input: kValue.f64.negative.pi.whole, expected: -180 }, { input: kValue.f64.negative.pi.three_quarters, expected: -135 }, { input: kValue.f64.negative.pi.half, expected: -90 }, - { input: kValue.f64.negative.pi.third, expected: kPlusOneULPFunctions['abstract'](-60) }, + { input: kValue.f64.negative.pi.third, expected: kPlusOneULPFunctions['abstract_float'](-60) }, { input: kValue.f64.negative.pi.quarter, expected: -45 }, - { input: kValue.f64.negative.pi.sixth, expected: kPlusOneULPFunctions['abstract'](-30) }, - { input: kValue.f64.positive.pi.sixth, expected: kMinusOneULPFunctions['abstract'](30) }, + { input: kValue.f64.negative.pi.sixth, expected: kPlusOneULPFunctions['abstract_float'](-30) }, + { input: kValue.f64.positive.pi.sixth, expected: kMinusOneULPFunctions['abstract_float'](30) }, { input: kValue.f64.positive.pi.quarter, expected: 45 }, - { input: kValue.f64.positive.pi.third, expected: kMinusOneULPFunctions['abstract'](60) }, + { input: kValue.f64.positive.pi.third, expected: kMinusOneULPFunctions['abstract_float'](60) }, { input: kValue.f64.positive.pi.half, expected: 90 }, { input: kValue.f64.positive.pi.three_quarters, expected: 135 }, { input: kValue.f64.positive.pi.whole, expected: 180 }, @@ -2869,7 +2869,7 @@ const kDegreesIntervalCases = { g.test('degreesInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = p.trait; @@ -3026,7 +3026,7 @@ const kFloorIntervalCases = { { input: -(2 ** 14), expected: -(2 ** 14) }, { input: 0x8000, expected: 0x8000 }, // https://github.com/gpuweb/cts/issues/2766 ], - abstract: [ + abstract_float: [ { input: 2 ** 62, expected: 2 ** 62 }, { input: -(2 ** 62), expected: -(2 ** 62) }, { @@ -3039,7 +3039,7 @@ const kFloorIntervalCases = { g.test('floorInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -3386,7 +3386,7 @@ g.test('log2Interval') g.test('negationInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -3495,7 +3495,7 @@ const kRadiansIntervalCases = { { input: 135, expected: [kMinusOneULPFunctions['f16'](kValue.f16.positive.pi.three_quarters), kPlusOneULPFunctions['f16'](kValue.f16.positive.pi.three_quarters)] }, { input: 180, expected: [kMinusOneULPFunctions['f16'](kValue.f16.positive.pi.whole), kPlusOneULPFunctions['f16'](kValue.f16.positive.pi.whole)] }, ] as ScalarToIntervalCase[], - abstract: [ + abstract_float: [ { input: -180, expected: kValue.f64.negative.pi.whole }, { input: -135, expected: kValue.f64.negative.pi.three_quarters }, { input: -90, expected: kValue.f64.negative.pi.half }, @@ -3514,7 +3514,7 @@ const kRadiansIntervalCases = { g.test('radiansInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = p.trait; @@ -3550,7 +3550,7 @@ const kRoundIntervalCases = { { input: -(2 ** 14), expected: -(2 ** 14) }, { input: 0x8000, expected: 0x8000 }, // https://github.com/gpuweb/cts/issues/2766 ], - abstract: [ + abstract_float: [ { input: 2 ** 62, expected: 2 ** 62 }, { input: -(2 ** 62), expected: -(2 ** 62) }, { @@ -3563,7 +3563,7 @@ const kRoundIntervalCases = { g.test('roundInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -3615,7 +3615,7 @@ g.test('roundInterval') g.test('saturateInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -3660,7 +3660,7 @@ g.test('saturateInterval') g.test('signInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -3995,7 +3995,7 @@ g.test('tanhInterval') g.test('truncInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -4072,7 +4072,7 @@ const kAdditionInterval64BitsNormalCases = { // -0.1+0.1 expect f16 interval [0xAE67+0x2E66, 0xAE66+0x2E67] { input: [-0.1, 0.1], expected: [reinterpretU16AsF16(0xae67)+reinterpretU16AsF16(0x2e66), reinterpretU16AsF16(0xae66)+reinterpretU16AsF16(0x2e67)] }, // ~0.0 ] as ScalarPairToIntervalCase[], - abstract: [ + abstract_float: [ // 0.1 isn't exactly representable in f64, but will be quantized to an // exact value when storing to a 'number' (0x3FB999999999999A). // This is why below the expectations are not intervals. @@ -4088,7 +4088,7 @@ const kAdditionInterval64BitsNormalCases = { g.test('additionInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -4386,12 +4386,12 @@ const kDivisionInterval64BitsNormalCases = { g.test('divisionInterval') .params(u => u - .combine('trait', ['abstract', 'f32', 'f16'] as const) + .combine('trait', ['abstract_float', 'f32', 'f16'] as const) .beginSubcases() .expandWithParams(p => { // This is a ULP based interval, so abstract should behave like f32, so // swizzling the trait as needed. - const trait = p.trait === 'abstract' ? 'f32' : p.trait; + const trait = p.trait === 'abstract_float' ? 'f32' : p.trait; const fp = FP[trait]; const constants = fp.constants(); // prettier-ignore @@ -4427,7 +4427,7 @@ g.test('divisionInterval') .fn(t => { // This is a ULP based interval, so abstract should behave like f32, so // swizzling the trait as needed for calculating the expected result. - const trait = t.params.trait === 'abstract' ? 'f32' : t.params.trait; + const trait = t.params.trait === 'abstract_float' ? 'f32' : t.params.trait; const fp = FP[trait]; const error = (n: number): number => { @@ -4546,7 +4546,7 @@ g.test('ldexpInterval') g.test('maxInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -4612,7 +4612,7 @@ g.test('maxInterval') g.test('minInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -4699,7 +4699,7 @@ const kMultiplicationInterval64BitsNormalCases = { { input: [0.1, -0.1], expected: [reinterpretU16AsF16(0xa120), reinterpretU16AsF16(0xa11e)] }, // ~-0.01 { input: [-0.1, 0.1], expected: [reinterpretU16AsF16(0xa120), reinterpretU16AsF16(0xa11e)] }, // ~-0.01 ] as ScalarPairToIntervalCase[], - abstract: [ + abstract_float: [ // 0.1 isn't exactly representable in f64, but will be quantized to an // exact value when storing to a 'number' (0x3FB999999999999A). // This is why below the expectations are not intervals. @@ -4714,7 +4714,7 @@ const kMultiplicationInterval64BitsNormalCases = { g.test('multiplicationInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -4863,7 +4863,7 @@ const kRemainderCases = { g.test('remainderInterval') .params(u => u - .combine('trait', ['abstract', 'f32', 'f16'] as const) + .combine('trait', ['abstract_float', 'f32', 'f16'] as const) .beginSubcases() .expandWithParams(p => { const trait = kFPTraitForULP[p.trait]; @@ -5023,7 +5023,7 @@ const kSubtractionInterval64BitsNormalCases = { // Expect f16 interval [0xAE67-0x2E67, 0xAE66-0x2E66] { input: [-0.1, 0.1], expected: [reinterpretU16AsF16(0xae67)-reinterpretU16AsF16(0x2e67), reinterpretU16AsF16(0xae66)-reinterpretU16AsF16(0x2e66)] }, ] as ScalarPairToIntervalCase[], - abstract: [ + abstract_float: [ // 0.1 isn't exactly representable in f64, but will be quantized to an // exact value when storing to a 'number' (0x3FB999999999999A). // This is why below the expectations are not intervals. @@ -5039,7 +5039,7 @@ const kSubtractionInterval64BitsNormalCases = { g.test('subtractionInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -5105,7 +5105,7 @@ interface ScalarTripleToIntervalCase { g.test('clampMedianInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -5163,7 +5163,7 @@ g.test('clampMedianInterval') g.test('clampMinMaxInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -5255,7 +5255,7 @@ const kFmaIntervalCases = { // minimum case: -1 * [subnormal ulp] + -1 * [subnormal ulp] rounded to [-2 * [subnormal ulp], 0], // maximum case: -0.0 + -0.0 = 0. { input: [kValue.f16.positive.subnormal.max, kValue.f16.negative.subnormal.min, kValue.f16.negative.subnormal.max], expected: [-2 * FP['f16'].oneULP(0, 'no-flush'), 0] }, ] as ScalarTripleToIntervalCase[], - abstract: [ + abstract_float: [ // These operations break down in the CTS, because `number` is a f64 under the hood, so precision is sometimes lost // if intermediate results are closer to 0 than the smallest subnormal will be precisely 0. // See https://github.com/gpuweb/cts/issues/2993 for details @@ -5269,7 +5269,7 @@ const kFmaIntervalCases = { g.test('fmaInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -5384,13 +5384,13 @@ const kMixImpreciseIntervalCases = { { input: [kValue.f16.negative.min, 10.0, 0.5], expected: kUnboundedEndpoints }, { input: [kValue.f16.negative.min, -10.0, 0.5], expected: [-32768.0, -32752.0] }, ] as ScalarTripleToIntervalCase[], - abstract: [ + abstract_float: [ // [0.0, 1.0] cases { input: [0.0, 1.0, 0.1], expected: 0.1 }, { input: [0.0, 1.0, 0.9], expected: 0.9 }, // [1.0, 0.0] cases { input: [1.0, 0.0, 0.1], expected: 0.9 }, - { input: [1.0, 0.0, 0.9], expected: kMinusNULPFunctions['abstract'](0.1, 2) }, // This not being 0.1 is related to https://github.com/gpuweb/cts/issues/2993 + { input: [1.0, 0.0, 0.9], expected: kMinusNULPFunctions['abstract_float'](0.1, 2) }, // This not being 0.1 is related to https://github.com/gpuweb/cts/issues/2993 // [0.0, 10.0] cases { input: [0.0, 10.0, 0.1], expected: 1 }, { input: [0.0, 10.0, 0.9], expected: 9 }, @@ -5417,7 +5417,7 @@ const kMixImpreciseIntervalCases = { g.test('mixImpreciseInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -5546,13 +5546,13 @@ const kMixPreciseIntervalCases = { // Intermediate OOB { input: [1.0, 2.0, kPlusOneULPFunctions['f16'](kValue.f16.positive.max / 2)], expected: kUnboundedEndpoints }, ] as ScalarTripleToIntervalCase[], - abstract: [ + abstract_float: [ // [0.0, 1.0] cases { input: [0.0, 1.0, 0.1], expected: 0.1 }, { input: [0.0, 1.0, 0.9], expected: 0.9 }, // [1.0, 0.0] cases { input: [1.0, 0.0, 0.1], expected: 0.9 }, - { input: [1.0, 0.0, 0.9], expected: kMinusNULPFunctions['abstract'](0.1, 2) }, // This not being 0.1 is related to https://github.com/gpuweb/cts/issues/2993 + { input: [1.0, 0.0, 0.9], expected: kMinusNULPFunctions['abstract_float'](0.1, 2) }, // This not being 0.1 is related to https://github.com/gpuweb/cts/issues/2993 // [0.0, 10.0] cases { input: [0.0, 10.0, 0.1], expected: 1 }, { input: [0.0, 10.0, 0.9], expected: 9 }, @@ -5572,14 +5572,14 @@ const kMixPreciseIntervalCases = { { input: [kValue.f64.negative.min, -10.0, 0.5], expected: reinterpretU64AsF64(0xffdf_ffff_ffff_ffffn) }, // Intermediate OOB - { input: [1.0, 2.0, kPlusOneULPFunctions['abstract'](kValue.f64.positive.max / 2)], expected: kUnboundedEndpoints }, + { input: [1.0, 2.0, kPlusOneULPFunctions['abstract_float'](kValue.f64.positive.max / 2)], expected: kUnboundedEndpoints }, ] as ScalarTripleToIntervalCase[], } as const; g.test('mixPreciseInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -6311,7 +6311,7 @@ const kCrossIntervalCases = { ] }, ] as VectorPairToVectorCase[], - abstract: [ + abstract_float: [ { input: [ [kValue.f64.positive.subnormal.max, kValue.f64.negative.subnormal.max, kValue.f64.negative.subnormal.min], [kValue.f64.negative.subnormal.min, kValue.f64.positive.subnormal.min, kValue.f64.negative.subnormal.max] @@ -6334,7 +6334,7 @@ const kCrossIntervalCases = { g.test('crossInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -6579,7 +6579,7 @@ interface MatrixToMatrixCase { g.test('transposeInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const trait = FP[p.trait]; @@ -6733,7 +6733,7 @@ interface MatrixPairToMatrixCase { g.test('additionMatrixMatrixInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .combineWithParams([ // Only testing that different shapes of matrices are handled correctly @@ -6930,7 +6930,7 @@ g.test('additionMatrixMatrixInterval') g.test('subtractionMatrixMatrixInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .combineWithParams([ // Only testing that different shapes of matrices are handled correctly @@ -8181,7 +8181,7 @@ interface ModfCase { g.test('modfInterval') .params(u => u - .combine('trait', ['f32', 'f16', 'abstract'] as const) + .combine('trait', ['f32', 'f16', 'abstract_float'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); diff --git a/src/unittests/serialization.spec.ts b/src/unittests/serialization.spec.ts index 9717ba3ecf84..816c15acf2f5 100644 --- a/src/unittests/serialization.spec.ts +++ b/src/unittests/serialization.spec.ts @@ -293,28 +293,34 @@ g.test('fpinterval_f16').fn(t => { g.test('fpinterval_abstract').fn(t => { for (const interval of [ - FP.abstract.toInterval(0), - FP.abstract.toInterval(-0), - FP.abstract.toInterval(1), - FP.abstract.toInterval(-1), - FP.abstract.toInterval(0.5), - FP.abstract.toInterval(-0.5), - FP.abstract.toInterval(kValue.f64.positive.max), - FP.abstract.toInterval(kValue.f64.positive.min), - FP.abstract.toInterval(kValue.f64.positive.subnormal.max), - FP.abstract.toInterval(kValue.f64.positive.subnormal.min), - FP.abstract.toInterval(kValue.f64.negative.subnormal.max), - FP.abstract.toInterval(kValue.f64.negative.subnormal.min), - FP.abstract.toInterval(kValue.f64.positive.infinity), - FP.abstract.toInterval(kValue.f64.negative.infinity), + FP.abstract_float.toInterval(0), + FP.abstract_float.toInterval(-0), + FP.abstract_float.toInterval(1), + FP.abstract_float.toInterval(-1), + FP.abstract_float.toInterval(0.5), + FP.abstract_float.toInterval(-0.5), + FP.abstract_float.toInterval(kValue.f64.positive.max), + FP.abstract_float.toInterval(kValue.f64.positive.min), + FP.abstract_float.toInterval(kValue.f64.positive.subnormal.max), + FP.abstract_float.toInterval(kValue.f64.positive.subnormal.min), + FP.abstract_float.toInterval(kValue.f64.negative.subnormal.max), + FP.abstract_float.toInterval(kValue.f64.negative.subnormal.min), + FP.abstract_float.toInterval(kValue.f64.positive.infinity), + FP.abstract_float.toInterval(kValue.f64.negative.infinity), - FP.abstract.toInterval([-0, 0]), - FP.abstract.toInterval([-1, 1]), - FP.abstract.toInterval([-0.5, 0.5]), - FP.abstract.toInterval([kValue.f64.positive.min, kValue.f64.positive.max]), - FP.abstract.toInterval([kValue.f64.positive.subnormal.min, kValue.f64.positive.subnormal.max]), - FP.abstract.toInterval([kValue.f64.negative.subnormal.min, kValue.f64.negative.subnormal.max]), - FP.abstract.toInterval([kValue.f64.negative.infinity, kValue.f64.positive.infinity]), + FP.abstract_float.toInterval([-0, 0]), + FP.abstract_float.toInterval([-1, 1]), + FP.abstract_float.toInterval([-0.5, 0.5]), + FP.abstract_float.toInterval([kValue.f64.positive.min, kValue.f64.positive.max]), + FP.abstract_float.toInterval([ + kValue.f64.positive.subnormal.min, + kValue.f64.positive.subnormal.max, + ]), + FP.abstract_float.toInterval([ + kValue.f64.negative.subnormal.min, + kValue.f64.negative.subnormal.max, + ]), + FP.abstract_float.toInterval([kValue.f64.negative.infinity, kValue.f64.positive.infinity]), ]) { const s = new BinaryStream(new Uint8Array(1024).buffer); serializeFPInterval(s, interval); diff --git a/src/webgpu/listing_meta.json b/src/webgpu/listing_meta.json index 93d0090a1189..e7e6ccec93dc 100644 --- a/src/webgpu/listing_meta.json +++ b/src/webgpu/listing_meta.json @@ -1306,14 +1306,14 @@ "webgpu:shader,execution,expression,call,builtin,mix:f32_nonmatching_vec2:*": { "subcaseMS": 503.551 }, "webgpu:shader,execution,expression,call,builtin,mix:f32_nonmatching_vec3:*": { "subcaseMS": 590.326 }, "webgpu:shader,execution,expression,call,builtin,mix:f32_nonmatching_vec4:*": { "subcaseMS": 679.901 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_fract:*": { "subcaseMS": 327.601 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_vec2_fract:*": { "subcaseMS": 435.400 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_vec2_whole:*": { "subcaseMS": 434.300 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_vec3_fract:*": { "subcaseMS": 942.701 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_vec3_whole:*": { "subcaseMS": 932.000 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_vec4_fract:*": { "subcaseMS": 1645.901 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_vec4_whole:*": { "subcaseMS": 1812.500 }, - "webgpu:shader,execution,expression,call,builtin,modf:abstract_whole:*": { "subcaseMS": 296.601 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_fract:*": { "subcaseMS": 327.601 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_vec2_fract:*": { "subcaseMS": 435.400 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_vec2_whole:*": { "subcaseMS": 434.300 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_vec3_fract:*": { "subcaseMS": 942.701 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_vec3_whole:*": { "subcaseMS": 932.000 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_vec4_fract:*": { "subcaseMS": 1645.901 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_vec4_whole:*": { "subcaseMS": 1812.500 }, + "webgpu:shader,execution,expression,call,builtin,modf:abstract_float_whole:*": { "subcaseMS": 296.601 }, "webgpu:shader,execution,expression,call,builtin,modf:f16_fract:*": { "subcaseMS": 11.801 }, "webgpu:shader,execution,expression,call,builtin,modf:f16_vec2_fract:*": { "subcaseMS": 9.200 }, "webgpu:shader,execution,expression,call,builtin,modf:f16_vec2_whole:*": { "subcaseMS": 8.404 }, @@ -1489,7 +1489,7 @@ "webgpu:shader,execution,expression,call,builtin,workgroupBarrier:barrier:*": { "subcaseMS": 0.701 }, "webgpu:shader,execution,expression,call,builtin,workgroupBarrier:stage:*": { "subcaseMS": 1.801 }, "webgpu:shader,execution,expression,unary,af_arithmetic:negation:*": { "subcaseMS": 2165.950 }, - "webgpu:shader,execution,expression,unary,af_assignment:abstract:*": { "subcaseMS": 788.400 }, + "webgpu:shader,execution,expression,unary,af_assignment:abstract_float:*": { "subcaseMS": 788.400 }, "webgpu:shader,execution,expression,unary,af_assignment:f16:*": { "subcaseMS": 1.000 }, "webgpu:shader,execution,expression,unary,af_assignment:f32:*": { "subcaseMS": 42.000 }, "webgpu:shader,execution,expression,unary,bool_conversion:bool:*": { "subcaseMS": 8.357 }, diff --git a/src/webgpu/shader/execution/expression/binary/af_addition.cache.ts b/src/webgpu/shader/execution/expression/binary/af_addition.cache.ts index f5e9d3b481a5..fb0234fc9735 100644 --- a/src/webgpu/shader/execution/expression/binary/af_addition.cache.ts +++ b/src/webgpu/shader/execution/expression/binary/af_addition.cache.ts @@ -3,20 +3,20 @@ import { sparseScalarF64Range, sparseVectorF64Range } from '../../../../util/mat import { makeCaseCache } from '../case_cache.js'; const additionVectorScalarInterval = (v: readonly number[], s: number): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.additionInterval(e, s))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.additionInterval(e, s))); }; const additionScalarVectorInterval = (s: number, v: readonly number[]): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.additionInterval(s, e))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.additionInterval(s, e))); }; const scalar_cases = { ['scalar']: () => { - return FP.abstract.generateScalarPairToIntervalCases( + return FP.abstract_float.generateScalarPairToIntervalCases( sparseScalarF64Range(), sparseScalarF64Range(), 'finite', - FP.abstract.additionInterval + FP.abstract_float.additionInterval ); }, }; @@ -24,7 +24,7 @@ const scalar_cases = { const vector_scalar_cases = ([2, 3, 4] as const) .map(dim => ({ [`vec${dim}_scalar`]: () => { - return FP.abstract.generateVectorScalarToVectorCases( + return FP.abstract_float.generateVectorScalarToVectorCases( sparseVectorF64Range(dim), sparseScalarF64Range(), 'finite', @@ -37,7 +37,7 @@ const vector_scalar_cases = ([2, 3, 4] as const) const scalar_vector_cases = ([2, 3, 4] as const) .map(dim => ({ [`scalar_vec${dim}`]: () => { - return FP.abstract.generateScalarVectorToVectorCases( + return FP.abstract_float.generateScalarVectorToVectorCases( sparseScalarF64Range(), sparseVectorF64Range(dim), 'finite', diff --git a/src/webgpu/shader/execution/expression/binary/af_division.cache.ts b/src/webgpu/shader/execution/expression/binary/af_division.cache.ts index 5af293b3de28..ad7b8646effa 100644 --- a/src/webgpu/shader/execution/expression/binary/af_division.cache.ts +++ b/src/webgpu/shader/execution/expression/binary/af_division.cache.ts @@ -3,20 +3,20 @@ import { sparseScalarF64Range, sparseVectorF64Range } from '../../../../util/mat import { makeCaseCache } from '../case_cache.js'; const divisionVectorScalarInterval = (v: readonly number[], s: number): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.divisionInterval(e, s))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.divisionInterval(e, s))); }; const divisionScalarVectorInterval = (s: number, v: readonly number[]): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.divisionInterval(s, e))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.divisionInterval(s, e))); }; const scalar_cases = { ['scalar']: () => { - return FP.abstract.generateScalarPairToIntervalCases( + return FP.abstract_float.generateScalarPairToIntervalCases( sparseScalarF64Range(), sparseScalarF64Range(), 'finite', - FP.abstract.divisionInterval + FP.abstract_float.divisionInterval ); }, }; @@ -24,7 +24,7 @@ const scalar_cases = { const vector_scalar_cases = ([2, 3, 4] as const) .map(dim => ({ [`vec${dim}_scalar`]: () => { - return FP.abstract.generateVectorScalarToVectorCases( + return FP.abstract_float.generateVectorScalarToVectorCases( sparseVectorF64Range(dim), sparseScalarF64Range(), 'finite', @@ -37,7 +37,7 @@ const vector_scalar_cases = ([2, 3, 4] as const) const scalar_vector_cases = ([2, 3, 4] as const) .map(dim => ({ [`scalar_vec${dim}`]: () => { - return FP.abstract.generateScalarVectorToVectorCases( + return FP.abstract_float.generateScalarVectorToVectorCases( sparseScalarF64Range(), sparseVectorF64Range(dim), 'finite', diff --git a/src/webgpu/shader/execution/expression/binary/af_matrix_addition.cache.ts b/src/webgpu/shader/execution/expression/binary/af_matrix_addition.cache.ts index 75c13d7702b6..5d1197e11cda 100644 --- a/src/webgpu/shader/execution/expression/binary/af_matrix_addition.cache.ts +++ b/src/webgpu/shader/execution/expression/binary/af_matrix_addition.cache.ts @@ -7,11 +7,11 @@ const mat_cases = ([2, 3, 4] as const) .flatMap(cols => ([2, 3, 4] as const).map(rows => ({ [`mat${cols}x${rows}`]: () => { - return FP.abstract.generateMatrixPairToMatrixCases( + return FP.abstract_float.generateMatrixPairToMatrixCases( sparseMatrixF64Range(cols, rows), sparseMatrixF64Range(cols, rows), 'finite', - FP.abstract.additionMatrixMatrixInterval + FP.abstract_float.additionMatrixMatrixInterval ); }, })) diff --git a/src/webgpu/shader/execution/expression/binary/af_matrix_subtraction.cache.ts b/src/webgpu/shader/execution/expression/binary/af_matrix_subtraction.cache.ts index b030f369e3d3..15af9c176001 100644 --- a/src/webgpu/shader/execution/expression/binary/af_matrix_subtraction.cache.ts +++ b/src/webgpu/shader/execution/expression/binary/af_matrix_subtraction.cache.ts @@ -7,11 +7,11 @@ const mat_cases = ([2, 3, 4] as const) .flatMap(cols => ([2, 3, 4] as const).map(rows => ({ [`mat${cols}x${rows}`]: () => { - return FP.abstract.generateMatrixPairToMatrixCases( + return FP.abstract_float.generateMatrixPairToMatrixCases( sparseMatrixF64Range(cols, rows), sparseMatrixF64Range(cols, rows), 'finite', - FP.abstract.subtractionMatrixMatrixInterval + FP.abstract_float.subtractionMatrixMatrixInterval ); }, })) diff --git a/src/webgpu/shader/execution/expression/binary/af_multiplication.cache.ts b/src/webgpu/shader/execution/expression/binary/af_multiplication.cache.ts index e111682cd28a..656d098f51bd 100644 --- a/src/webgpu/shader/execution/expression/binary/af_multiplication.cache.ts +++ b/src/webgpu/shader/execution/expression/binary/af_multiplication.cache.ts @@ -3,20 +3,20 @@ import { sparseScalarF64Range, sparseVectorF64Range } from '../../../../util/mat import { makeCaseCache } from '../case_cache.js'; const multiplicationVectorScalarInterval = (v: readonly number[], s: number): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.multiplicationInterval(e, s))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.multiplicationInterval(e, s))); }; const multiplicationScalarVectorInterval = (s: number, v: readonly number[]): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.multiplicationInterval(s, e))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.multiplicationInterval(s, e))); }; const scalar_cases = { ['scalar']: () => { - return FP.abstract.generateScalarPairToIntervalCases( + return FP.abstract_float.generateScalarPairToIntervalCases( sparseScalarF64Range(), sparseScalarF64Range(), 'finite', - FP.abstract.multiplicationInterval + FP.abstract_float.multiplicationInterval ); }, }; @@ -24,7 +24,7 @@ const scalar_cases = { const vector_scalar_cases = ([2, 3, 4] as const) .map(dim => ({ [`vec${dim}_scalar`]: () => { - return FP.abstract.generateVectorScalarToVectorCases( + return FP.abstract_float.generateVectorScalarToVectorCases( sparseVectorF64Range(dim), sparseScalarF64Range(), 'finite', @@ -37,7 +37,7 @@ const vector_scalar_cases = ([2, 3, 4] as const) const scalar_vector_cases = ([2, 3, 4] as const) .map(dim => ({ [`scalar_vec${dim}`]: () => { - return FP.abstract.generateScalarVectorToVectorCases( + return FP.abstract_float.generateScalarVectorToVectorCases( sparseScalarF64Range(), sparseVectorF64Range(dim), 'finite', diff --git a/src/webgpu/shader/execution/expression/binary/af_remainder.cache.ts b/src/webgpu/shader/execution/expression/binary/af_remainder.cache.ts index eba0a27760b0..24ae4ca1acef 100644 --- a/src/webgpu/shader/execution/expression/binary/af_remainder.cache.ts +++ b/src/webgpu/shader/execution/expression/binary/af_remainder.cache.ts @@ -3,20 +3,20 @@ import { sparseScalarF64Range, sparseVectorF64Range } from '../../../../util/mat import { makeCaseCache } from '../case_cache.js'; const remainderVectorScalarInterval = (v: readonly number[], s: number): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.remainderInterval(e, s))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.remainderInterval(e, s))); }; const remainderScalarVectorInterval = (s: number, v: readonly number[]): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.remainderInterval(s, e))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.remainderInterval(s, e))); }; const scalar_cases = { ['scalar']: () => { - return FP.abstract.generateScalarPairToIntervalCases( + return FP.abstract_float.generateScalarPairToIntervalCases( sparseScalarF64Range(), sparseScalarF64Range(), 'finite', - FP.abstract.remainderInterval + FP.abstract_float.remainderInterval ); }, }; @@ -24,7 +24,7 @@ const scalar_cases = { const vector_scalar_cases = ([2, 3, 4] as const) .map(dim => ({ [`vec${dim}_scalar`]: () => { - return FP.abstract.generateVectorScalarToVectorCases( + return FP.abstract_float.generateVectorScalarToVectorCases( sparseVectorF64Range(dim), sparseScalarF64Range(), 'finite', @@ -37,7 +37,7 @@ const vector_scalar_cases = ([2, 3, 4] as const) const scalar_vector_cases = ([2, 3, 4] as const) .map(dim => ({ [`scalar_vec${dim}`]: () => { - return FP.abstract.generateScalarVectorToVectorCases( + return FP.abstract_float.generateScalarVectorToVectorCases( sparseScalarF64Range(), sparseVectorF64Range(dim), 'finite', diff --git a/src/webgpu/shader/execution/expression/binary/af_subtraction.cache.ts b/src/webgpu/shader/execution/expression/binary/af_subtraction.cache.ts index ea5107e143fc..fd475e79aba6 100644 --- a/src/webgpu/shader/execution/expression/binary/af_subtraction.cache.ts +++ b/src/webgpu/shader/execution/expression/binary/af_subtraction.cache.ts @@ -3,20 +3,20 @@ import { sparseScalarF64Range, sparseVectorF64Range } from '../../../../util/mat import { makeCaseCache } from '../case_cache.js'; const subtractionVectorScalarInterval = (v: readonly number[], s: number): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.subtractionInterval(e, s))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.subtractionInterval(e, s))); }; const subtractionScalarVectorInterval = (s: number, v: readonly number[]): FPVector => { - return FP.abstract.toVector(v.map(e => FP.abstract.subtractionInterval(s, e))); + return FP.abstract_float.toVector(v.map(e => FP.abstract_float.subtractionInterval(s, e))); }; const scalar_cases = { ['scalar']: () => { - return FP.abstract.generateScalarPairToIntervalCases( + return FP.abstract_float.generateScalarPairToIntervalCases( sparseScalarF64Range(), sparseScalarF64Range(), 'finite', - FP.abstract.subtractionInterval + FP.abstract_float.subtractionInterval ); }, }; @@ -24,7 +24,7 @@ const scalar_cases = { const vector_scalar_cases = ([2, 3, 4] as const) .map(dim => ({ [`vec${dim}_scalar`]: () => { - return FP.abstract.generateVectorScalarToVectorCases( + return FP.abstract_float.generateVectorScalarToVectorCases( sparseVectorF64Range(dim), sparseScalarF64Range(), 'finite', @@ -37,7 +37,7 @@ const vector_scalar_cases = ([2, 3, 4] as const) const scalar_vector_cases = ([2, 3, 4] as const) .map(dim => ({ [`scalar_vec${dim}`]: () => { - return FP.abstract.generateScalarVectorToVectorCases( + return FP.abstract_float.generateScalarVectorToVectorCases( sparseScalarF64Range(), sparseVectorF64Range(dim), 'finite', diff --git a/src/webgpu/shader/execution/expression/call/builtin/abs.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/abs.cache.ts index caed2f469678..8d3c3d23a0d6 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/abs.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/abs.cache.ts @@ -2,7 +2,7 @@ import { FP } from '../../../../../util/floating_point.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/abs.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/abs.spec.ts index b0736cb22fb6..bbcbfb623de8 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/abs.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/abs.spec.ts @@ -148,7 +148,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run(t, abstractBuiltin('abs'), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases); }); diff --git a/src/webgpu/shader/execution/expression/call/builtin/clamp.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/clamp.cache.ts index b28e75fd40f4..241a1a940e17 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/clamp.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/clamp.cache.ts @@ -39,7 +39,7 @@ function generateIntegerTestCases( function generateFloatTestCases( test_values: readonly number[], - trait: 'f32' | 'f16' | 'abstract', + trait: 'f32' | 'f16' | 'abstract_float', stage: 'const' | 'non_const' ): Array { return test_values.flatMap(low => @@ -62,11 +62,11 @@ function generateFloatTestCases( // Cases: [f32|f16|abstract]_[non_]const // abstract_non_const is empty and unused -const fp_cases = (['f32', 'f16', 'abstract'] as const) +const fp_cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(trait => ([true, false] as const).map(nonConst => ({ [`${trait}_${nonConst ? 'non_const' : 'const'}`]: () => { - if (trait === 'abstract' && nonConst) { + if (trait === 'abstract_float' && nonConst) { return []; } return generateFloatTestCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/clamp.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/clamp.spec.ts index 75abf1f11d8d..8e65d268b7c6 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/clamp.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/clamp.spec.ts @@ -68,7 +68,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract_const'); + const cases = await d.get('abstract_float_const'); await run( t, abstractBuiltin('clamp'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/cross.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/cross.cache.ts index 74752d3afb26..0245f9f076c0 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/cross.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/cross.cache.ts @@ -3,11 +3,11 @@ import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract]_[non_]const // abstract_non_const is empty and not used -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(trait => ([true, false] as const).map(nonConst => ({ [`${trait}_${nonConst ? 'non_const' : 'const'}`]: () => { - if (trait === 'abstract' && nonConst) { + if (trait === 'abstract_float' && nonConst) { return []; } return FP[trait].generateVectorPairToVectorCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/cross.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/cross.spec.ts index bf26a42f2f5e..ded5f052334b 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/cross.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/cross.spec.ts @@ -21,7 +21,7 @@ g.test('abstract_float') .desc(`abstract float tests`) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_const'); + const cases = await d.get('abstract_float_const'); await run( t, abstractBuiltin('cross'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/degrees.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/degrees.cache.ts index 2dbe8923c4cc..03041c84fa3d 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/degrees.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/degrees.cache.ts @@ -3,11 +3,11 @@ import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract]_[non_]const // abstract_non_const is empty and not used -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(trait => ([true, false] as const).map(nonConst => ({ [`${trait}_${nonConst ? 'non_const' : 'const'}`]: () => { - if (trait === 'abstract' && nonConst) { + if (trait === 'abstract_float' && nonConst) { return []; } return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/degrees.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/degrees.spec.ts index 0e52c52c11a3..726b476354e3 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/degrees.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/degrees.spec.ts @@ -26,7 +26,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract_const'); + const cases = await d.get('abstract_float_const'); await run( t, abstractBuiltin('degrees'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/floor.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/floor.cache.ts index 0af966cfd257..871c9a25ec6a 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/floor.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/floor.cache.ts @@ -5,13 +5,13 @@ const kSmallMagnitudeTestValues = [0.1, 0.9, 1.0, 1.1, 1.9, -0.1, -0.9, -1.0, -1 // See https://github.com/gpuweb/cts/issues/2766 for details const kIssue2766Value = { - abstract: 0x8000_0000_0000_0000, + abstract_float: 0x8000_0000_0000_0000, f32: 0x8000_0000, f16: 0x8000, }; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/floor.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/floor.spec.ts index 08a29ed3e5f4..5861d47ba4a6 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/floor.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/floor.spec.ts @@ -26,7 +26,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run(t, abstractBuiltin('floor'), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases); }); diff --git a/src/webgpu/shader/execution/expression/call/builtin/fma.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/fma.cache.ts index 0efa57f39c73..54151c80ff0b 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/fma.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/fma.cache.ts @@ -3,11 +3,11 @@ import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract]_[non_]const // abstract_non_const is empty and not used -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(trait => ([true, false] as const).map(nonConst => ({ [`${trait}_${nonConst ? 'non_const' : 'const'}`]: () => { - if (trait === 'abstract' && nonConst) { + if (trait === 'abstract_float' && nonConst) { return []; } return FP[trait].generateScalarTripleToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/fma.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/fma.spec.ts index 39360cb5bc51..1cfdaab20e4e 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/fma.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/fma.spec.ts @@ -26,7 +26,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract_const'); + const cases = await d.get('abstract_float_const'); await run( t, abstractBuiltin('fma'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/max.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/max.cache.ts index 7566d9342fa5..a2c0ea7fbda1 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/max.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/max.cache.ts @@ -2,7 +2,7 @@ import { FP } from '../../../../../util/floating_point.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarPairToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/max.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/max.spec.ts index a596c3f12486..b8ac7357a155 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/max.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/max.spec.ts @@ -100,7 +100,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run( t, abstractBuiltin('max'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/min.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/min.cache.ts index 83c986a392ed..1311f9516f66 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/min.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/min.cache.ts @@ -2,7 +2,7 @@ import { FP } from '../../../../../util/floating_point.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarPairToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/min.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/min.spec.ts index a9ada22da702..bdfcbdaef2e4 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/min.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/min.spec.ts @@ -99,7 +99,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run( t, abstractBuiltin('min'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/mix.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/mix.cache.ts index 3f1de937b159..72ee572909a2 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/mix.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/mix.cache.ts @@ -3,11 +3,11 @@ import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract]_[non_]const // abstract_non_const is empty and unused -const scalar_cases = (['f32', 'f16', 'abstract'] as const) +const scalar_cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(trait => ([true, false] as const).map(nonConst => ({ [`${trait}_${nonConst ? 'non_const' : 'const'}`]: () => { - if (trait === 'abstract' && nonConst) { + if (trait === 'abstract_float' && nonConst) { return []; } return FP[trait].generateScalarTripleToIntervalCases( @@ -22,14 +22,14 @@ const scalar_cases = (['f32', 'f16', 'abstract'] as const) ) .reduce((a, b) => ({ ...a, ...b }), {}); -// Cases: [f32|f16]_vecN_scalar_[non_]const -// abstract_vecN_non_const is empty and unused -const vec_scalar_cases = (['f32', 'f16', 'abstract'] as const) +// Cases: [f32|f16|abstract]_vecN_scalar_[non_]const +// abstract_float_vecN_non_const is empty and unused +const vec_scalar_cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(trait => ([2, 3, 4] as const).flatMap(dim => ([true, false] as const).map(nonConst => ({ [`${trait}_vec${dim}_scalar_${nonConst ? 'non_const' : 'const'}`]: () => { - if (trait === 'abstract' && nonConst) { + if (trait === 'abstract_float' && nonConst) { return []; } return FP[trait].generateVectorPairScalarToVectorComponentWiseCase( diff --git a/src/webgpu/shader/execution/expression/call/builtin/mix.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/mix.spec.ts index 91a66646b6b1..af55e08dfa7c 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/mix.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/mix.spec.ts @@ -33,7 +33,7 @@ g.test('abstract_float_matching') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract_const'); + const cases = await d.get('abstract_float_const'); await run( t, abstractBuiltin('mix'), @@ -49,7 +49,7 @@ g.test('abstract_float_nonmatching_vec2') .desc(`abstract_float tests with two vec2 params and scalar third param`) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec2_scalar_const'); + const cases = await d.get('abstract_float_vec2_scalar_const'); await run( t, abstractBuiltin('mix'), @@ -65,7 +65,7 @@ g.test('abstract_float_nonmatching_vec3') .desc(`abstract_float tests with two vec3 params and scalar third param`) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec3_scalar_const'); + const cases = await d.get('abstract_float_vec3_scalar_const'); await run( t, abstractBuiltin('mix'), @@ -81,7 +81,7 @@ g.test('abstract_float_nonmatching_vec4') .desc(`abstract_float tests with two vec4 params and scalar third param`) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec4_scalar_const'); + const cases = await d.get('abstract_float_vec4_scalar_const'); await run( t, abstractBuiltin('mix'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/modf.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/modf.cache.ts index 1a76de56bbae..331305445571 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/modf.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/modf.cache.ts @@ -44,7 +44,7 @@ function makeVectorCaseWhole(kind: FPKind, v: readonly number[]): Case { } // Cases: [f32|f16|abstract]_[fract|whole] -const scalar_cases = (['f32', 'f16', 'abstract'] as const) +const scalar_cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(kind => (['whole', 'fract'] as const).map(portion => ({ [`${kind}_${portion}`]: () => { @@ -56,7 +56,7 @@ const scalar_cases = (['f32', 'f16', 'abstract'] as const) .reduce((a, b) => ({ ...a, ...b }), {}); // Cases: [f32|f16|abstract]_vecN_[fract|whole] -const vec_cases = (['f32', 'f16', 'abstract'] as const) +const vec_cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(kind => ([2, 3, 4] as const).flatMap(n => (['whole', 'fract'] as const).map(portion => ({ diff --git a/src/webgpu/shader/execution/expression/call/builtin/modf.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/modf.spec.ts index 3e12d4f8696d..bcf1c402932d 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/modf.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/modf.spec.ts @@ -364,7 +364,7 @@ struct __modf_result_vec4_f16 { await run(t, wholeBuilder(), [TypeVec(4, TypeF16)], TypeVec(4, TypeF16), t.params, cases); }); -g.test('abstract_fract') +g.test('abstract_float_fract') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -378,11 +378,11 @@ struct __modf_result_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_fract'); + const cases = await d.get('abstract_float_fract'); await run(t, abstractFractBuilder(), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases); }); -g.test('abstract_whole') +g.test('abstract_float_whole') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -396,11 +396,11 @@ struct __modf_result_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_whole'); + const cases = await d.get('abstract_float_whole'); await run(t, abstractWholeBuilder(), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases); }); -g.test('abstract_vec2_fract') +g.test('abstract_float_vec2_fract') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -414,7 +414,7 @@ struct __modf_result_vec2_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec2_fract'); + const cases = await d.get('abstract_float_vec2_fract'); await run( t, abstractFractBuilder(), @@ -425,7 +425,7 @@ struct __modf_result_vec2_abstract { ); }); -g.test('abstract_vec2_whole') +g.test('abstract_float_vec2_whole') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -439,7 +439,7 @@ struct __modf_result_vec2_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec2_whole'); + const cases = await d.get('abstract_float_vec2_whole'); await run( t, abstractWholeBuilder(), @@ -450,7 +450,7 @@ struct __modf_result_vec2_abstract { ); }); -g.test('abstract_vec3_fract') +g.test('abstract_float_vec3_fract') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -464,7 +464,7 @@ struct __modf_result_vec3_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec3_fract'); + const cases = await d.get('abstract_float_vec3_fract'); await run( t, abstractFractBuilder(), @@ -475,7 +475,7 @@ struct __modf_result_vec3_abstract { ); }); -g.test('abstract_vec3_whole') +g.test('abstract_float_vec3_whole') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -489,7 +489,7 @@ struct __modf_result_vec3_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec3_whole'); + const cases = await d.get('abstract_float_vec3_whole'); await run( t, abstractWholeBuilder(), @@ -500,7 +500,7 @@ struct __modf_result_vec3_abstract { ); }); -g.test('abstract_vec4_fract') +g.test('abstract_float_vec4_fract') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -514,7 +514,7 @@ struct __modf_result_vec4_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec4_fract'); + const cases = await d.get('abstract_float_vec4_fract'); await run( t, abstractFractBuilder(), @@ -525,7 +525,7 @@ struct __modf_result_vec4_abstract { ); }); -g.test('abstract_vec4_whole') +g.test('abstract_float_vec4_whole') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc( ` @@ -539,7 +539,7 @@ struct __modf_result_vec4_abstract { ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract_vec4_whole'); + const cases = await d.get('abstract_float_vec4_whole'); await run( t, abstractWholeBuilder(), diff --git a/src/webgpu/shader/execution/expression/call/builtin/radians.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/radians.cache.ts index e92b4970c499..d51cabac4176 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/radians.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/radians.cache.ts @@ -2,7 +2,7 @@ import { FP } from '../../../../../util/floating_point.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/radians.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/radians.spec.ts index f83f89b9154e..131e54ab4f2c 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/radians.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/radians.spec.ts @@ -27,7 +27,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run( t, abstractBuiltin('radians'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/round.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/round.cache.ts index e5383b2075ed..e892b721a0ba 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/round.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/round.cache.ts @@ -3,13 +3,13 @@ import { makeCaseCache } from '../../case_cache.js'; // See https://github.com/gpuweb/cts/issues/2766 for details const kIssue2766Value = { - abstract: 0x8000_0000_0000_0000, + abstract_float: 0x8000_0000_0000_0000, f32: 0x8000_0000, f16: 0x8000, }; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/round.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/round.spec.ts index de2d6acfd0e1..7def374df0d8 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/round.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/round.spec.ts @@ -29,7 +29,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run(t, abstractBuiltin('round'), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases); }); diff --git a/src/webgpu/shader/execution/expression/call/builtin/saturate.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/saturate.cache.ts index 4a4ffeee30f7..24d15eb27f5a 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/saturate.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/saturate.cache.ts @@ -3,7 +3,7 @@ import { linearRange } from '../../../../../util/math.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/saturate.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/saturate.spec.ts index bf19a3c6cb23..8db7c5cea021 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/saturate.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/saturate.spec.ts @@ -26,7 +26,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run( t, abstractBuiltin('saturate'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/sign.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/sign.cache.ts index 8bac506ddc3a..7bd54b148966 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/sign.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/sign.cache.ts @@ -4,7 +4,7 @@ import { fullI32Range } from '../../../../../util/math.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract] -const fp_cases = (['f32', 'f16', 'abstract'] as const) +const fp_cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/sign.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/sign.spec.ts index a17bb7b205ac..fc5761e78941 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/sign.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/sign.spec.ts @@ -26,7 +26,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run(t, abstractBuiltin('sign'), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases); }); diff --git a/src/webgpu/shader/execution/expression/call/builtin/transpose.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/transpose.cache.ts index cb89e2d1944d..db9c075a5d81 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/transpose.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/transpose.cache.ts @@ -2,14 +2,14 @@ import { FP } from '../../../../../util/floating_point.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract]_matCxR_[non_]const -// abstract_matCxR_non_const is empty and not used -const cases = (['f32', 'f16', 'abstract'] as const) +// abstract_float_matCxR_non_const is empty and not used +const cases = (['f32', 'f16', 'abstract_float'] as const) .flatMap(trait => ([2, 3, 4] as const).flatMap(cols => ([2, 3, 4] as const).flatMap(rows => ([true, false] as const).map(nonConst => ({ [`${trait}_mat${cols}x${rows}_${nonConst ? 'non_const' : 'const'}`]: () => { - if (trait === 'abstract' && nonConst) { + if (trait === 'abstract_float' && nonConst) { return []; } return FP[trait].generateMatrixToMatrixCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/transpose.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/transpose.spec.ts index 82250cb985cf..aa8801c9fc64 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/transpose.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/transpose.spec.ts @@ -28,7 +28,7 @@ g.test('abstract_float') .fn(async t => { const cols = t.params.cols; const rows = t.params.rows; - const cases = await d.get(`abstract_mat${cols}x${rows}_const`); + const cases = await d.get(`abstract_float_mat${cols}x${rows}_const`); await run( t, abstractBuiltin('transpose'), diff --git a/src/webgpu/shader/execution/expression/call/builtin/trunc.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/trunc.cache.ts index 061c95b07fed..daf745d37e71 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/trunc.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/trunc.cache.ts @@ -2,7 +2,7 @@ import { FP } from '../../../../../util/floating_point.js'; import { makeCaseCache } from '../../case_cache.js'; // Cases: [f32|f16|abstract] -const cases = (['f32', 'f16', 'abstract'] as const) +const cases = (['f32', 'f16', 'abstract_float'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/trunc.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/trunc.spec.ts index 7dcc9395c3e3..3a90c33139cb 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/trunc.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/trunc.spec.ts @@ -27,7 +27,7 @@ g.test('abstract_float') .combine('vectorize', [undefined, 2, 3, 4] as const) ) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run(t, abstractBuiltin('trunc'), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases); }); diff --git a/src/webgpu/shader/execution/expression/unary/af_arithmetic.cache.ts b/src/webgpu/shader/execution/expression/unary/af_arithmetic.cache.ts index 4f274e892217..bfe36a972d04 100644 --- a/src/webgpu/shader/execution/expression/unary/af_arithmetic.cache.ts +++ b/src/webgpu/shader/execution/expression/unary/af_arithmetic.cache.ts @@ -4,10 +4,10 @@ import { makeCaseCache } from '../case_cache.js'; export const d = makeCaseCache('unary/af_arithmetic', { negation: () => { - return FP.abstract.generateScalarToIntervalCases( + return FP.abstract_float.generateScalarToIntervalCases( scalarF64Range({ neg_norm: 250, neg_sub: 20, pos_sub: 20, pos_norm: 250 }), 'unfiltered', - FP.abstract.negationInterval + FP.abstract_float.negationInterval ); }, }); diff --git a/src/webgpu/shader/execution/expression/unary/af_assignment.cache.ts b/src/webgpu/shader/execution/expression/unary/af_assignment.cache.ts index 7c607927fe54..fb14bfad46f4 100644 --- a/src/webgpu/shader/execution/expression/unary/af_assignment.cache.ts +++ b/src/webgpu/shader/execution/expression/unary/af_assignment.cache.ts @@ -10,7 +10,7 @@ import { reinterpretU64AsF64 } from '../../../../util/reinterpret.js'; import { makeCaseCache } from '../case_cache.js'; export const d = makeCaseCache('unary/af_assignment', { - abstract: () => { + abstract_float: () => { const inputs = [ // Values that are useful for debugging the underlying framework/shader code, since it cannot be directly unit tested. 0, diff --git a/src/webgpu/shader/execution/expression/unary/af_assignment.spec.ts b/src/webgpu/shader/execution/expression/unary/af_assignment.spec.ts index 76e96fe80354..7aaa63b52733 100644 --- a/src/webgpu/shader/execution/expression/unary/af_assignment.spec.ts +++ b/src/webgpu/shader/execution/expression/unary/af_assignment.spec.ts @@ -25,7 +25,7 @@ function abstract_assignment(): ShaderBuilder { export const g = makeTestGroup(GPUTest); -g.test('abstract') +g.test('abstract_float') .specURL('https://www.w3.org/TR/WGSL/#floating-point-conversion') .desc( ` @@ -34,7 +34,7 @@ testing that extracting abstract floats works ) .params(u => u.combine('inputSource', onlyConstInputSource)) .fn(async t => { - const cases = await d.get('abstract'); + const cases = await d.get('abstract_float'); await run(t, abstract_assignment(), [TypeAbstractFloat], TypeAbstractFloat, t.params, cases, 1); }); diff --git a/src/webgpu/util/floating_point.ts b/src/webgpu/util/floating_point.ts index 726afc588350..3158950b7b52 100644 --- a/src/webgpu/util/floating_point.ts +++ b/src/webgpu/util/floating_point.ts @@ -59,10 +59,10 @@ import { } from './math.js'; /** Indicate the kind of WGSL floating point numbers being operated on */ -export type FPKind = 'f32' | 'f16' | 'abstract'; +export type FPKind = 'f32' | 'f16' | 'abstract_float'; enum SerializedFPIntervalKind { - Abstract, + AbstractFloat, F32, F16, } @@ -70,8 +70,8 @@ enum SerializedFPIntervalKind { /** serializeFPKind() serializes a FPKind to a BinaryStream */ export function serializeFPKind(s: BinaryStream, value: FPKind) { switch (value) { - case 'abstract': - s.writeU8(SerializedFPIntervalKind.Abstract); + case 'abstract_float': + s.writeU8(SerializedFPIntervalKind.AbstractFloat); break; case 'f16': s.writeU8(SerializedFPIntervalKind.F16); @@ -86,8 +86,8 @@ export function serializeFPKind(s: BinaryStream, value: FPKind) { export function deserializeFPKind(s: BinaryStream): FPKind { const kind = s.readU8(); switch (kind) { - case SerializedFPIntervalKind.Abstract: - return 'abstract'; + case SerializedFPIntervalKind.AbstractFloat: + return 'abstract_float'; case SerializedFPIntervalKind.F16: return 'f16'; case SerializedFPIntervalKind.F32: @@ -194,7 +194,7 @@ export function serializeFPInterval(s: BinaryStream, i: FPInterval) { if_true: () => { // Bounded switch (i.kind) { - case 'abstract': + case 'abstract_float': s.writeF64(i.begin); s.writeF64(i.end); break; @@ -225,7 +225,7 @@ export function deserializeFPInterval(s: BinaryStream): FPInterval { if_true: () => { // Bounded switch (kind) { - case 'abstract': + case 'abstract_float': return new FPInterval(traits.kind, s.readF64(), s.readF64()); case 'f32': return new FPInterval(traits.kind, s.readF32(), s.readF32()); @@ -3314,7 +3314,7 @@ export abstract class FPTraits { const constants = this.constants(); const domain_x = [this.toInterval([constants.negative.min, constants.positive.max])]; const domain_y = - this.kind === 'f32' || this.kind === 'abstract' + this.kind === 'f32' || this.kind === 'abstract_float' ? [this.toInterval([-(2 ** 126), -(2 ** -126)]), this.toInterval([2 ** -126, 2 ** 126])] : [this.toInterval([-(2 ** 14), -(2 ** -14)]), this.toInterval([2 ** -14, 2 ** 14])]; return { @@ -4828,11 +4828,11 @@ const kF32Traits = new F32Traits(); // Pre-defined values that get used multiple times in _constants' initializers. Cannot use FPTraits members, since this // executes before they are defined. const kAbstractUnboundedInterval = new FPInterval( - 'abstract', + 'abstract_float', Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY ); -const kAbstractZeroInterval = new FPInterval('abstract', 0); +const kAbstractZeroInterval = new FPInterval('abstract_float', 0); // This is implementation is incomplete class FPAbstractTraits extends FPTraits { @@ -4881,16 +4881,16 @@ class FPAbstractTraits extends FPTraits { // Have to use the constants.ts values here, because values defined in the // initializer cannot be referenced in the initializer negPiToPiInterval: new FPInterval( - 'abstract', + 'abstract_float', kValue.f64.negative.pi.whole, kValue.f64.positive.pi.whole ), greaterThanZeroInterval: new FPInterval( - 'abstract', + 'abstract_float', kValue.f64.positive.subnormal.min, kValue.f64.positive.max ), - negOneToOneInterval: new FPInterval('abstract', -1, 1), + negOneToOneInterval: new FPInterval('abstract_float', -1, 1), zeroVector: { 2: [kAbstractZeroInterval, kAbstractZeroInterval], @@ -5013,7 +5013,7 @@ class FPAbstractTraits extends FPTraits { }; public constructor() { - super('abstract'); + super('abstract_float'); } public constants(): FPConstants { @@ -5459,14 +5459,14 @@ class F16Traits extends FPTraits { export const FP = { f32: kF32Traits, f16: new F16Traits(), - abstract: new FPAbstractTraits(), + abstract_float: new FPAbstractTraits(), }; /** @returns the floating-point traits for `type` */ export function fpTraitsFor(type: ScalarType): FPTraits { switch (type.kind) { case 'abstract-float': - return FP.abstract; + return FP.abstract_float; case 'f32': return FP.f32; case 'f16':