From e91b44ae5efdc29978a26730acfbb919fe8e6759 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 11 Mar 2024 11:44:50 -0400 Subject: [PATCH] wgsl: Implement AbstractFloat `ceil` execution tests (#3449) Issue #1297 --- src/resources/cache/hashes.json | 186 +++++++++--------- .../cache/webgpu/shader/execution/ceil.bin | Bin 8552 -> 16016 bytes src/unittests/floating_point.spec.ts | 9 +- .../expression/call/builtin/ceil.cache.ts | 3 +- .../expression/call/builtin/ceil.spec.ts | 20 +- src/webgpu/util/floating_point.ts | 2 +- 6 files changed, 119 insertions(+), 101 deletions(-) diff --git a/src/resources/cache/hashes.json b/src/resources/cache/hashes.json index 16bf07892d15..69cb91f857c4 100644 --- a/src/resources/cache/hashes.json +++ b/src/resources/cache/hashes.json @@ -1,109 +1,109 @@ { - "webgpu/shader/execution/binary/af_addition.bin": "590ce5d0", + "webgpu/shader/execution/binary/af_addition.bin": "cc90f705", "webgpu/shader/execution/binary/af_logical.bin": "4269127d", - "webgpu/shader/execution/binary/af_division.bin": "d4ff5475", - "webgpu/shader/execution/binary/af_matrix_addition.bin": "298ef48e", - "webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "7fed8020", - "webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "48e954b2", - "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "6d4ead98", - "webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "209e2c19", - "webgpu/shader/execution/binary/af_multiplication.bin": "5eafc30c", - "webgpu/shader/execution/binary/af_remainder.bin": "75cfdd3", - "webgpu/shader/execution/binary/af_subtraction.bin": "5acd5252", + "webgpu/shader/execution/binary/af_division.bin": "303c23c9", + "webgpu/shader/execution/binary/af_matrix_addition.bin": "bf3f432a", + "webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "f262ebd9", + "webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "ac0e04e3", + "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "ac5cd859", + "webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "44a39136", + "webgpu/shader/execution/binary/af_multiplication.bin": "4fa27383", + "webgpu/shader/execution/binary/af_remainder.bin": "4fa868c6", + "webgpu/shader/execution/binary/af_subtraction.bin": "8d5c9b21", "webgpu/shader/execution/binary/ai_arithmetic.bin": "f89aeb4", - "webgpu/shader/execution/binary/f16_addition.bin": "b3b843b9", + "webgpu/shader/execution/binary/f16_addition.bin": "f2313284", "webgpu/shader/execution/binary/f16_logical.bin": "36a51091", - "webgpu/shader/execution/binary/f16_division.bin": "67fc610", - "webgpu/shader/execution/binary/f16_matrix_addition.bin": "d7b16cc0", - "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "aae9227", - "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "d148fe2c", - "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "7fdc67ab", - "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "6c6f0373", - "webgpu/shader/execution/binary/f16_multiplication.bin": "d4cba123", - "webgpu/shader/execution/binary/f16_remainder.bin": "39b2f3d1", - "webgpu/shader/execution/binary/f16_subtraction.bin": "eca69567", - "webgpu/shader/execution/binary/f32_addition.bin": "bc6520f4", + "webgpu/shader/execution/binary/f16_division.bin": "6d276852", + "webgpu/shader/execution/binary/f16_matrix_addition.bin": "7a8dd641", + "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "352fbb8f", + "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "7f315242", + "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "6e623bf7", + "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "bc0e0051", + "webgpu/shader/execution/binary/f16_multiplication.bin": "5ddc6615", + "webgpu/shader/execution/binary/f16_remainder.bin": "a7d11cc7", + "webgpu/shader/execution/binary/f16_subtraction.bin": "9a16a043", + "webgpu/shader/execution/binary/f32_addition.bin": "c5b2f15e", "webgpu/shader/execution/binary/f32_logical.bin": "e1d07173", - "webgpu/shader/execution/binary/f32_division.bin": "b9b4bace", - "webgpu/shader/execution/binary/f32_matrix_addition.bin": "c1ff4f67", - "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "12ce1afc", - "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "728004ae", - "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "7203414c", - "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "60bd62d5", - "webgpu/shader/execution/binary/f32_multiplication.bin": "763a40d3", - "webgpu/shader/execution/binary/f32_remainder.bin": "a14fb18d", - "webgpu/shader/execution/binary/f32_subtraction.bin": "8bf897d8", + "webgpu/shader/execution/binary/f32_division.bin": "583afe1", + "webgpu/shader/execution/binary/f32_matrix_addition.bin": "d568c885", + "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "ddcd0f48", + "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "99892730", + "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "3ea99dec", + "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "d5235751", + "webgpu/shader/execution/binary/f32_multiplication.bin": "a465f647", + "webgpu/shader/execution/binary/f32_remainder.bin": "8402dd76", + "webgpu/shader/execution/binary/f32_subtraction.bin": "63832192", "webgpu/shader/execution/binary/i32_arithmetic.bin": "936d712", "webgpu/shader/execution/binary/i32_comparison.bin": "5db8f3b0", "webgpu/shader/execution/binary/u32_arithmetic.bin": "415ac05e", "webgpu/shader/execution/binary/u32_comparison.bin": "f90d60f3", - "webgpu/shader/execution/abs.bin": "ab026917", - "webgpu/shader/execution/acos.bin": "ebec4fe2", - "webgpu/shader/execution/acosh.bin": "538a0f85", - "webgpu/shader/execution/asin.bin": "8f34001e", - "webgpu/shader/execution/asinh.bin": "f6474f7e", - "webgpu/shader/execution/atan.bin": "9f57357c", - "webgpu/shader/execution/atan2.bin": "c3c9ab97", - "webgpu/shader/execution/atanh.bin": "b8c67df8", - "webgpu/shader/execution/bitcast.bin": "54c7c36a", - "webgpu/shader/execution/ceil.bin": "b60fd415", - "webgpu/shader/execution/clamp.bin": "ae2291cc", - "webgpu/shader/execution/cos.bin": "c1c8d701", - "webgpu/shader/execution/cosh.bin": "cce8eabb", - "webgpu/shader/execution/cross.bin": "385fe441", - "webgpu/shader/execution/degrees.bin": "f0fb9a6d", - "webgpu/shader/execution/determinant.bin": "7a7750f3", - "webgpu/shader/execution/distance.bin": "939b3544", - "webgpu/shader/execution/dot.bin": "f1fc309e", - "webgpu/shader/execution/exp.bin": "d49bb232", - "webgpu/shader/execution/exp2.bin": "88b69575", - "webgpu/shader/execution/faceForward.bin": "f5b0b400", - "webgpu/shader/execution/floor.bin": "41edc029", - "webgpu/shader/execution/fma.bin": "2e5b7503", - "webgpu/shader/execution/fract.bin": "dd5251b2", - "webgpu/shader/execution/frexp.bin": "43ded4af", - "webgpu/shader/execution/inverseSqrt.bin": "f6f44cf2", - "webgpu/shader/execution/ldexp.bin": "3ea94e77", - "webgpu/shader/execution/length.bin": "2296407f", - "webgpu/shader/execution/log.bin": "1d09cc4", - "webgpu/shader/execution/log2.bin": "e000def9", - "webgpu/shader/execution/max.bin": "18ccab7a", - "webgpu/shader/execution/min.bin": "ab321644", - "webgpu/shader/execution/mix.bin": "5563295f", - "webgpu/shader/execution/modf.bin": "774fe500", - "webgpu/shader/execution/normalize.bin": "35783a23", + "webgpu/shader/execution/abs.bin": "5f333", + "webgpu/shader/execution/acos.bin": "2abc764c", + "webgpu/shader/execution/acosh.bin": "accd2622", + "webgpu/shader/execution/asin.bin": "514f90a0", + "webgpu/shader/execution/asinh.bin": "55b36d3a", + "webgpu/shader/execution/atan.bin": "1e5c011e", + "webgpu/shader/execution/atan2.bin": "51bc4048", + "webgpu/shader/execution/atanh.bin": "3c86dc17", + "webgpu/shader/execution/bitcast.bin": "e10e2bf5", + "webgpu/shader/execution/ceil.bin": "9e9f3783", + "webgpu/shader/execution/clamp.bin": "f160e302", + "webgpu/shader/execution/cos.bin": "f0047dd0", + "webgpu/shader/execution/cosh.bin": "58d620e5", + "webgpu/shader/execution/cross.bin": "f5c1fd91", + "webgpu/shader/execution/degrees.bin": "fbbc1fa3", + "webgpu/shader/execution/determinant.bin": "35335634", + "webgpu/shader/execution/distance.bin": "c0783351", + "webgpu/shader/execution/dot.bin": "fe3b0bf4", + "webgpu/shader/execution/exp.bin": "10e9c894", + "webgpu/shader/execution/exp2.bin": "6fef9b0b", + "webgpu/shader/execution/faceForward.bin": "596738cf", + "webgpu/shader/execution/floor.bin": "d2efe779", + "webgpu/shader/execution/fma.bin": "25db025e", + "webgpu/shader/execution/fract.bin": "8d9072e", + "webgpu/shader/execution/frexp.bin": "49afbf7f", + "webgpu/shader/execution/inverseSqrt.bin": "5bffd293", + "webgpu/shader/execution/ldexp.bin": "d0947f57", + "webgpu/shader/execution/length.bin": "3d4adcaa", + "webgpu/shader/execution/log.bin": "703cca75", + "webgpu/shader/execution/log2.bin": "7fa8bb66", + "webgpu/shader/execution/max.bin": "a9f6689f", + "webgpu/shader/execution/min.bin": "51966c50", + "webgpu/shader/execution/mix.bin": "b9f407dc", + "webgpu/shader/execution/modf.bin": "1e9c1919", + "webgpu/shader/execution/normalize.bin": "a3c6ac4", "webgpu/shader/execution/pack2x16float.bin": "54f11627", - "webgpu/shader/execution/pow.bin": "7421e698", - "webgpu/shader/execution/quantizeToF16.bin": "7f112f83", - "webgpu/shader/execution/radians.bin": "98a95e1b", - "webgpu/shader/execution/reflect.bin": "3f180462", - "webgpu/shader/execution/refract.bin": "b08230a3", - "webgpu/shader/execution/round.bin": "476b7078", - "webgpu/shader/execution/saturate.bin": "d2b2a9bc", - "webgpu/shader/execution/sign.bin": "b70cde44", - "webgpu/shader/execution/sin.bin": "26beb35a", - "webgpu/shader/execution/sinh.bin": "7c561ea2", - "webgpu/shader/execution/smoothstep.bin": "c889c68a", - "webgpu/shader/execution/sqrt.bin": "dbda0613", - "webgpu/shader/execution/step.bin": "7c108793", - "webgpu/shader/execution/tan.bin": "879dd531", - "webgpu/shader/execution/tanh.bin": "7e1d66a6", - "webgpu/shader/execution/transpose.bin": "762ed60", - "webgpu/shader/execution/trunc.bin": "8c46cbe8", - "webgpu/shader/execution/unpack2x16float.bin": "5bd42344", - "webgpu/shader/execution/unpack2x16snorm.bin": "478e7fa5", - "webgpu/shader/execution/unpack2x16unorm.bin": "a2f9b4f5", - "webgpu/shader/execution/unpack4x8snorm.bin": "93d90295", - "webgpu/shader/execution/unpack4x8unorm.bin": "31999cab", - "webgpu/shader/execution/unary/af_arithmetic.bin": "446e85d9", - "webgpu/shader/execution/unary/af_assignment.bin": "9911dc5f", + "webgpu/shader/execution/pow.bin": "87e8391c", + "webgpu/shader/execution/quantizeToF16.bin": "c5be64e5", + "webgpu/shader/execution/radians.bin": "5bd5a987", + "webgpu/shader/execution/reflect.bin": "e6ba9df9", + "webgpu/shader/execution/refract.bin": "7f1a1889", + "webgpu/shader/execution/round.bin": "f3376643", + "webgpu/shader/execution/saturate.bin": "2a8d20df", + "webgpu/shader/execution/sign.bin": "e7232801", + "webgpu/shader/execution/sin.bin": "8acb35", + "webgpu/shader/execution/sinh.bin": "f356d922", + "webgpu/shader/execution/smoothstep.bin": "24299f69", + "webgpu/shader/execution/sqrt.bin": "724c8512", + "webgpu/shader/execution/step.bin": "4fe42940", + "webgpu/shader/execution/tan.bin": "3366acbb", + "webgpu/shader/execution/tanh.bin": "b4f80ddb", + "webgpu/shader/execution/transpose.bin": "9a65abfa", + "webgpu/shader/execution/trunc.bin": "9292ec12", + "webgpu/shader/execution/unpack2x16float.bin": "81649bef", + "webgpu/shader/execution/unpack2x16snorm.bin": "fbbaa36f", + "webgpu/shader/execution/unpack2x16unorm.bin": "37f1917", + "webgpu/shader/execution/unpack4x8snorm.bin": "46b063cd", + "webgpu/shader/execution/unpack4x8unorm.bin": "ffb80fc5", + "webgpu/shader/execution/unary/af_arithmetic.bin": "8f9a3824", + "webgpu/shader/execution/unary/af_assignment.bin": "d8fab2f2", "webgpu/shader/execution/unary/ai_arithmetic.bin": "497ec1e1", "webgpu/shader/execution/unary/ai_assignment.bin": "fc978bdd", "webgpu/shader/execution/unary/bool_conversion.bin": "bcab7d9a", - "webgpu/shader/execution/unary/f16_arithmetic.bin": "b0a84279", - "webgpu/shader/execution/unary/f16_conversion.bin": "4bbd348e", - "webgpu/shader/execution/unary/f32_arithmetic.bin": "a98d962e", - "webgpu/shader/execution/unary/f32_conversion.bin": "9af02ab5", + "webgpu/shader/execution/unary/f16_arithmetic.bin": "13caa810", + "webgpu/shader/execution/unary/f16_conversion.bin": "3699afe4", + "webgpu/shader/execution/unary/f32_arithmetic.bin": "9236999", + "webgpu/shader/execution/unary/f32_conversion.bin": "416b0d0", "webgpu/shader/execution/unary/i32_arithmetic.bin": "8f3c4616", "webgpu/shader/execution/unary/i32_conversion.bin": "972063c", "webgpu/shader/execution/unary/u32_conversion.bin": "168fcf74" diff --git a/src/resources/cache/webgpu/shader/execution/ceil.bin b/src/resources/cache/webgpu/shader/execution/ceil.bin index 5ec60b6e150d5694fda5f5933f6accd39d76bf2d..7ff8dea27eee16d130ecd1b08b03666896b79702 100644 GIT binary patch literal 16016 zcmb7L4RBS(6~1smFiOHOI7}cl)n+QR6x1LMm4?JP{0tM!5TZea31keZPO3a`!jBoA zSd3#6tr=@XW0_bRD$qhYPShcVL^PlgeIkMqrJ*4+OejN2gG#JT&$(|8=iGhl+jpNF z4tu`uySsPqy?b}hU0ug&ndhkCg*${=2^}CyWi3$ALEQw{bwCal-pCCXWMcwsN4& zRt~i9F0DOxVNBLFG_+|*ahKrJeWi-h-AA0(N`U>Qwv{?Yq*)|zyGJ?U>Qwvnz|q8mK-djNzT>FKl(~?u#6@-68BKCBkBvGeIao%MoEHio`BZYSj3zmQk%j-Gd<2XGB95BhrZ(rE% z=j61*@Y60i&Dn44^K)Xymhr7=tu{{OtSxWbI9)C0T5O!`8F#;7<1{w!YqoJlOuuQj zjZ?ns*w{fOz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j_oWCWg?kevB?&7>-g4aDdZjB8GtuH#CO|j{`R>=7->=A-LVjtC& z+Zm%vgH1{YS6>^rzMVVpmlRkx%WLT9z`8@&%(PK~b$7$2r=p^ffpxvuozJ*|b!)s1 z6}jOAuYDPD=z_&J0oa)zmBdOc`s&y^{v4)U*~%MPL!Yyvr@1w zo*lHEUbkFq=I=`h)`!_8Sl{PfslGK3$8j0GzJB-8b?JREd0L8-*L5|~yas=>QthNT zd0qEhG>^jjLY0o<ry(3lh<{xcpY;u?;lkN<*(*L5F6^TPa{PqmZcpGQ3=WmCqK8lmqbt-TFh+ZGX$?H1xoq)eNs`@BSUe~Gb61>+|=_pQK t*QxIyyq8nyC{AA2sqZcu^z)-Qd0nTz^Hk|Nij&uM>bue=T}N^9{|A#htsDRV delta 15 VcmbPG`@)HlX(MB@A`1f$001Z?19boZ diff --git a/src/unittests/floating_point.spec.ts b/src/unittests/floating_point.spec.ts index ad27c1d711d8..7f4388c2eaa9 100644 --- a/src/unittests/floating_point.spec.ts +++ b/src/unittests/floating_point.spec.ts @@ -2657,12 +2657,17 @@ const kCeilIntervalCases = { { input: -(2 ** 14), expected: -(2 ** 14) }, { input: 0x8000, expected: 0x8000 }, // https://github.com/gpuweb/cts/issues/2766 ], + abstract: [ + { input: 2 ** 52, expected: 2 ** 52 }, + { input: -(2 ** 52), expected: -(2 ** 52) }, + { input: 0x8000000000000000, expected: 0x8000000000000000 }, // https://github.com/gpuweb/cts/issues/2766 + ], } as const; g.test('ceilInterval') .params(u => u - .combine('trait', ['f32', 'f16'] as const) + .combine('trait', ['f32', 'f16', 'abstract'] as const) .beginSubcases() .expandWithParams(p => { const constants = FP[p.trait].constants(); @@ -2689,7 +2694,7 @@ g.test('ceilInterval') { input: constants.negative.max, expected: 0 }, ...kCeilIntervalCases[p.trait], - // 32-bit subnormals + // Subnormals { input: constants.positive.subnormal.max, expected: [0, 1] }, { input: constants.positive.subnormal.min, expected: [0, 1] }, { input: constants.negative.subnormal.min, expected: 0 }, diff --git a/src/webgpu/shader/execution/expression/call/builtin/ceil.cache.ts b/src/webgpu/shader/execution/expression/call/builtin/ceil.cache.ts index 3141d1d1a16f..c0178d9b83ad 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/ceil.cache.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/ceil.cache.ts @@ -7,10 +7,11 @@ const kSmallMagnitudeTestValues = [0.1, 0.9, 1.0, 1.1, 1.9, -0.1, -0.9, -1.0, -1 const kIssue2766Value = { f32: 0x8000_0000, f16: 0x8000, + abstract: 0x8000_0000_0000_0000, }; // Cases: [f32|f16] -const cases = (['f32', 'f16'] as const) +const cases = (['f32', 'f16', 'abstract'] as const) .map(trait => ({ [`${trait}`]: () => { return FP[trait].generateScalarToIntervalCases( diff --git a/src/webgpu/shader/execution/expression/call/builtin/ceil.spec.ts b/src/webgpu/shader/execution/expression/call/builtin/ceil.spec.ts index 5f6236149e53..842875f0940f 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/ceil.spec.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/ceil.spec.ts @@ -11,9 +11,9 @@ Returns the ceiling of e. Component-wise when T is a vector. import { makeTestGroup } from '../../../../../../common/framework/test_group.js'; import { GPUTest } from '../../../../../gpu_test.js'; import { Type } from '../../../../../util/conversion.js'; -import { allInputSources, run } from '../../expression.js'; +import { allInputSources, onlyConstInputSource, run } from '../../expression.js'; -import { builtin } from './builtin.js'; +import { abstractFloatBuiltin, builtin } from './builtin.js'; import { d } from './ceil.cache.js'; export const g = makeTestGroup(GPUTest); @@ -22,9 +22,21 @@ g.test('abstract_float') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') .desc(`abstract float tests`) .params(u => - u.combine('inputSource', allInputSources).combine('vectorize', [undefined, 2, 3, 4] as const) + u + .combine('inputSource', onlyConstInputSource) + .combine('vectorize', [undefined, 2, 3, 4] as const) ) - .unimplemented(); + .fn(async t => { + const cases = await d.get('abstract'); + await run( + t, + abstractFloatBuiltin('ceil'), + [Type.abstractFloat], + Type.abstractFloat, + t.params, + cases + ); + }); g.test('f32') .specURL('https://www.w3.org/TR/WGSL/#float-builtin-functions') diff --git a/src/webgpu/util/floating_point.ts b/src/webgpu/util/floating_point.ts index 9015eca362eb..2c850695cef1 100644 --- a/src/webgpu/util/floating_point.ts +++ b/src/webgpu/util/floating_point.ts @@ -5120,7 +5120,7 @@ class FPAbstractTraits extends FPTraits { 'atan2Interval' ); public readonly atanhInterval = this.unimplementedScalarToInterval.bind(this, 'atanhInterval'); - public readonly ceilInterval = this.unimplementedScalarToInterval.bind(this, 'ceilInterval'); + public readonly ceilInterval = this.ceilIntervalImpl.bind(this); public readonly clampMedianInterval = this.clampMedianIntervalImpl.bind(this); public readonly clampMinMaxInterval = this.clampMinMaxIntervalImpl.bind(this); public readonly clampIntervals = [this.clampMedianInterval, this.clampMinMaxInterval];