Skip to content

Commit

Permalink
framework: allow skipping tests based on wgslLanguageFeatures (#3058)
Browse files Browse the repository at this point in the history
* GPUTestBase: add helpers to skip test based on lang feature support

Support skipping test cases when the adaptor does or does not
support a WGSL language feature.

Fixes: #3057

* Update hashes
  • Loading branch information
dneto0 authored Nov 23, 2023
1 parent 35005a9 commit 591c655
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 105 deletions.
208 changes: 104 additions & 104 deletions src/resources/cache/hashes.json
Original file line number Diff line number Diff line change
@@ -1,106 +1,106 @@
{
"webgpu/shader/execution/binary/af_addition.bin": "5bcc542",
"webgpu/shader/execution/binary/af_logical.bin": "e44143c0",
"webgpu/shader/execution/binary/af_division.bin": "62a4177a",
"webgpu/shader/execution/binary/af_matrix_addition.bin": "a5069db6",
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "7813d4bc",
"webgpu/shader/execution/binary/af_multiplication.bin": "bb76a321",
"webgpu/shader/execution/binary/af_remainder.bin": "c1095ea1",
"webgpu/shader/execution/binary/af_subtraction.bin": "84d7c81c",
"webgpu/shader/execution/binary/f16_addition.bin": "4ad63c83",
"webgpu/shader/execution/binary/f16_logical.bin": "978dd1ef",
"webgpu/shader/execution/binary/f16_division.bin": "e80548a6",
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "796d135a",
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "c81c7770",
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "adc1bddc",
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "e19f2fe",
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "535c6b56",
"webgpu/shader/execution/binary/f16_multiplication.bin": "3edc0aa9",
"webgpu/shader/execution/binary/f16_remainder.bin": "2f2492e4",
"webgpu/shader/execution/binary/f16_subtraction.bin": "d9a6b041",
"webgpu/shader/execution/binary/f32_addition.bin": "5fc8796d",
"webgpu/shader/execution/binary/f32_logical.bin": "88c065b6",
"webgpu/shader/execution/binary/f32_division.bin": "38f2e9b6",
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "a0183a6e",
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "27131729",
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "1e60801c",
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "999ef3aa",
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "4a4544c8",
"webgpu/shader/execution/binary/f32_multiplication.bin": "3cf38e52",
"webgpu/shader/execution/binary/f32_remainder.bin": "a3a1e05c",
"webgpu/shader/execution/binary/f32_subtraction.bin": "f5344626",
"webgpu/shader/execution/binary/i32_arithmetic.bin": "a65d1ba3",
"webgpu/shader/execution/binary/i32_comparison.bin": "65dff959",
"webgpu/shader/execution/binary/u32_arithmetic.bin": "8ca20dc6",
"webgpu/shader/execution/binary/u32_comparison.bin": "29afb233",
"webgpu/shader/execution/abs.bin": "2b89d10a",
"webgpu/shader/execution/acos.bin": "4e088b3a",
"webgpu/shader/execution/acosh.bin": "e0a7c604",
"webgpu/shader/execution/asin.bin": "931b790a",
"webgpu/shader/execution/asinh.bin": "a9026e52",
"webgpu/shader/execution/atan.bin": "299e9e8f",
"webgpu/shader/execution/atan2.bin": "36e31bcc",
"webgpu/shader/execution/atanh.bin": "bc2715ef",
"webgpu/shader/execution/bitcast.bin": "9e97a7eb",
"webgpu/shader/execution/ceil.bin": "fe6b7869",
"webgpu/shader/execution/clamp.bin": "a227d3d2",
"webgpu/shader/execution/cos.bin": "2a991346",
"webgpu/shader/execution/cosh.bin": "ea3c41d8",
"webgpu/shader/execution/cross.bin": "1a1b8321",
"webgpu/shader/execution/degrees.bin": "efd95d31",
"webgpu/shader/execution/determinant.bin": "4325eef9",
"webgpu/shader/execution/distance.bin": "45854a68",
"webgpu/shader/execution/dot.bin": "b06b2ac1",
"webgpu/shader/execution/exp.bin": "9e417842",
"webgpu/shader/execution/exp2.bin": "657559cb",
"webgpu/shader/execution/faceForward.bin": "22e36217",
"webgpu/shader/execution/floor.bin": "4bded93a",
"webgpu/shader/execution/fma.bin": "259e97ec",
"webgpu/shader/execution/fract.bin": "1844053e",
"webgpu/shader/execution/frexp.bin": "795736a4",
"webgpu/shader/execution/inverseSqrt.bin": "39d0ad9d",
"webgpu/shader/execution/ldexp.bin": "9cdba877",
"webgpu/shader/execution/length.bin": "f2971413",
"webgpu/shader/execution/log.bin": "dec7e23a",
"webgpu/shader/execution/log2.bin": "d24dc283",
"webgpu/shader/execution/max.bin": "346e1e88",
"webgpu/shader/execution/min.bin": "2eee31dd",
"webgpu/shader/execution/mix.bin": "7d10c2a9",
"webgpu/shader/execution/modf.bin": "13fff4a7",
"webgpu/shader/execution/normalize.bin": "55f5763b",
"webgpu/shader/execution/pack2x16float.bin": "fc207ec6",
"webgpu/shader/execution/pow.bin": "74f4fe3c",
"webgpu/shader/execution/quantizeToF16.bin": "6f2bf65a",
"webgpu/shader/execution/radians.bin": "3c834c9d",
"webgpu/shader/execution/reflect.bin": "7b87f821",
"webgpu/shader/execution/refract.bin": "e52fa44a",
"webgpu/shader/execution/round.bin": "5d5c72e8",
"webgpu/shader/execution/saturate.bin": "4170af8d",
"webgpu/shader/execution/sign.bin": "e23244e1",
"webgpu/shader/execution/sin.bin": "4a21c66a",
"webgpu/shader/execution/sinh.bin": "e0ed55e8",
"webgpu/shader/execution/smoothstep.bin": "44e4f53b",
"webgpu/shader/execution/sqrt.bin": "bd53552f",
"webgpu/shader/execution/step.bin": "b7dfcc93",
"webgpu/shader/execution/tan.bin": "4a473cc6",
"webgpu/shader/execution/tanh.bin": "45e60ddf",
"webgpu/shader/execution/transpose.bin": "5186fe5b",
"webgpu/shader/execution/trunc.bin": "bfc3ecf9",
"webgpu/shader/execution/unpack2x16float.bin": "302e7cdd",
"webgpu/shader/execution/unpack2x16snorm.bin": "51216313",
"webgpu/shader/execution/unpack2x16unorm.bin": "8bd401b2",
"webgpu/shader/execution/unpack4x8snorm.bin": "4e4985a6",
"webgpu/shader/execution/unpack4x8unorm.bin": "16be9079",
"webgpu/shader/execution/unary/af_arithmetic.bin": "9fd5946a",
"webgpu/shader/execution/unary/af_assignment.bin": "81b91716",
"webgpu/shader/execution/unary/bool_conversion.bin": "699a8913",
"webgpu/shader/execution/unary/f16_arithmetic.bin": "5fedbac9",
"webgpu/shader/execution/unary/f16_conversion.bin": "f05c848d",
"webgpu/shader/execution/unary/f32_arithmetic.bin": "1c0045cc",
"webgpu/shader/execution/unary/f32_conversion.bin": "afa1b58b",
"webgpu/shader/execution/unary/i32_arithmetic.bin": "a996bb97",
"webgpu/shader/execution/unary/i32_complement.bin": "8ba5f8f0",
"webgpu/shader/execution/unary/i32_conversion.bin": "9c7ae9cf",
"webgpu/shader/execution/unary/u32_complement.bin": "b76f5d95",
"webgpu/shader/execution/unary/u32_conversion.bin": "2aaa9ba5"
"webgpu/shader/execution/binary/af_addition.bin": "ca9569aa",
"webgpu/shader/execution/binary/af_logical.bin": "79fb9de7",
"webgpu/shader/execution/binary/af_division.bin": "87cef40b",
"webgpu/shader/execution/binary/af_matrix_addition.bin": "8afe5300",
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "bd433833",
"webgpu/shader/execution/binary/af_multiplication.bin": "7803251d",
"webgpu/shader/execution/binary/af_remainder.bin": "f5feb53",
"webgpu/shader/execution/binary/af_subtraction.bin": "7cc42f3a",
"webgpu/shader/execution/binary/f16_addition.bin": "e56d4073",
"webgpu/shader/execution/binary/f16_logical.bin": "6dfc24ba",
"webgpu/shader/execution/binary/f16_division.bin": "933c3c35",
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "934c3596",
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "f2a1e8",
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "b1ca61be",
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "e054a92b",
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "4706075e",
"webgpu/shader/execution/binary/f16_multiplication.bin": "28dbd8b6",
"webgpu/shader/execution/binary/f16_remainder.bin": "986de10c",
"webgpu/shader/execution/binary/f16_subtraction.bin": "d3e7f74f",
"webgpu/shader/execution/binary/f32_addition.bin": "fc66b530",
"webgpu/shader/execution/binary/f32_logical.bin": "6aecdb17",
"webgpu/shader/execution/binary/f32_division.bin": "b0b2294c",
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "4f84f9a4",
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "cf99f3b9",
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "ac8e0983",
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "76301b8",
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "db0f8c38",
"webgpu/shader/execution/binary/f32_multiplication.bin": "ecbcde06",
"webgpu/shader/execution/binary/f32_remainder.bin": "9d11467e",
"webgpu/shader/execution/binary/f32_subtraction.bin": "7dbddc79",
"webgpu/shader/execution/binary/i32_arithmetic.bin": "43c80b5e",
"webgpu/shader/execution/binary/i32_comparison.bin": "1b9d7888",
"webgpu/shader/execution/binary/u32_arithmetic.bin": "c031871c",
"webgpu/shader/execution/binary/u32_comparison.bin": "9b05600",
"webgpu/shader/execution/abs.bin": "acfe9bb2",
"webgpu/shader/execution/acos.bin": "8ed18869",
"webgpu/shader/execution/acosh.bin": "1cf98804",
"webgpu/shader/execution/asin.bin": "71698297",
"webgpu/shader/execution/asinh.bin": "7256451c",
"webgpu/shader/execution/atan.bin": "96e29c5d",
"webgpu/shader/execution/atan2.bin": "2dd9139",
"webgpu/shader/execution/atanh.bin": "fafe4e6c",
"webgpu/shader/execution/bitcast.bin": "b9fb1fbd",
"webgpu/shader/execution/ceil.bin": "ff230775",
"webgpu/shader/execution/clamp.bin": "ae2f4ac",
"webgpu/shader/execution/cos.bin": "ff432f2b",
"webgpu/shader/execution/cosh.bin": "d7af2ee9",
"webgpu/shader/execution/cross.bin": "11bf35a8",
"webgpu/shader/execution/degrees.bin": "c53959da",
"webgpu/shader/execution/determinant.bin": "da997a93",
"webgpu/shader/execution/distance.bin": "817d1cb",
"webgpu/shader/execution/dot.bin": "96070df0",
"webgpu/shader/execution/exp.bin": "e9728b8a",
"webgpu/shader/execution/exp2.bin": "66d0d5c5",
"webgpu/shader/execution/faceForward.bin": "cac5c81",
"webgpu/shader/execution/floor.bin": "18f58cc",
"webgpu/shader/execution/fma.bin": "6372916b",
"webgpu/shader/execution/fract.bin": "6335e79f",
"webgpu/shader/execution/frexp.bin": "54d2bdb0",
"webgpu/shader/execution/inverseSqrt.bin": "10ba17af",
"webgpu/shader/execution/ldexp.bin": "dba21b3e",
"webgpu/shader/execution/length.bin": "aad9991",
"webgpu/shader/execution/log.bin": "ff19d8a0",
"webgpu/shader/execution/log2.bin": "b3ebf3dd",
"webgpu/shader/execution/max.bin": "61a11c89",
"webgpu/shader/execution/min.bin": "5de15c84",
"webgpu/shader/execution/mix.bin": "a07ec401",
"webgpu/shader/execution/modf.bin": "91cac6b2",
"webgpu/shader/execution/normalize.bin": "6da0731",
"webgpu/shader/execution/pack2x16float.bin": "119a9ab1",
"webgpu/shader/execution/pow.bin": "986f5d89",
"webgpu/shader/execution/quantizeToF16.bin": "77efff6b",
"webgpu/shader/execution/radians.bin": "a035b517",
"webgpu/shader/execution/reflect.bin": "c2763f1a",
"webgpu/shader/execution/refract.bin": "e71dd5de",
"webgpu/shader/execution/round.bin": "36f3ecde",
"webgpu/shader/execution/saturate.bin": "392167ed",
"webgpu/shader/execution/sign.bin": "766ace88",
"webgpu/shader/execution/sin.bin": "c1fd0733",
"webgpu/shader/execution/sinh.bin": "3f78d331",
"webgpu/shader/execution/smoothstep.bin": "9f72a10",
"webgpu/shader/execution/sqrt.bin": "17fe3757",
"webgpu/shader/execution/step.bin": "e20fb42",
"webgpu/shader/execution/tan.bin": "c3c67187",
"webgpu/shader/execution/tanh.bin": "9d06e776",
"webgpu/shader/execution/transpose.bin": "f739a482",
"webgpu/shader/execution/trunc.bin": "16600f63",
"webgpu/shader/execution/unpack2x16float.bin": "4d6c065c",
"webgpu/shader/execution/unpack2x16snorm.bin": "8d8fc5df",
"webgpu/shader/execution/unpack2x16unorm.bin": "1824a555",
"webgpu/shader/execution/unpack4x8snorm.bin": "bad79c86",
"webgpu/shader/execution/unpack4x8unorm.bin": "8a744dfa",
"webgpu/shader/execution/unary/af_arithmetic.bin": "63f22c73",
"webgpu/shader/execution/unary/af_assignment.bin": "fb65d5ff",
"webgpu/shader/execution/unary/bool_conversion.bin": "cae3c1bd",
"webgpu/shader/execution/unary/f16_arithmetic.bin": "f6937f3e",
"webgpu/shader/execution/unary/f16_conversion.bin": "786501ec",
"webgpu/shader/execution/unary/f32_arithmetic.bin": "eef2bb81",
"webgpu/shader/execution/unary/f32_conversion.bin": "983e48bb",
"webgpu/shader/execution/unary/i32_arithmetic.bin": "c93e4e68",
"webgpu/shader/execution/unary/i32_complement.bin": "2505e4e6",
"webgpu/shader/execution/unary/i32_conversion.bin": "8cceff52",
"webgpu/shader/execution/unary/u32_complement.bin": "dada6764",
"webgpu/shader/execution/unary/u32_conversion.bin": "9b89fb5"
}
9 changes: 9 additions & 0 deletions src/webgpu/capability_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,3 +790,12 @@ export const kFeatureNameInfo: {
};
/** List of all GPUFeatureName values. */
export const kFeatureNames = keysOf(kFeatureNameInfo);

/** List of all known WGSL language features */
export const kKnownWGSLLanguageFeatures = [
'readonly_and_readwrite_storage_textures',
'packed_4x8_integer_dot_product',
'unrestricted_pointer_parameters',
] as const;

export type WGSLLanguageFeature = (typeof kKnownWGSLLanguageFeatures)[number];
24 changes: 23 additions & 1 deletion src/webgpu/gpu_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
TestParams,
} from '../common/framework/fixture.js';
import { globalTestConfig } from '../common/framework/test_config.js';
import { getGPU } from '../common/util/navigator_gpu.js';
import {
assert,
makeValueTestVariant,
Expand All @@ -20,7 +21,12 @@ import {
unreachable,
} from '../common/util/util.js';

import { getDefaultLimits, kLimits, kQueryTypeInfo } from './capability_info.js';
import {
getDefaultLimits,
kLimits,
kQueryTypeInfo,
WGSLLanguageFeature,
} from './capability_info.js';
import {
kTextureFormatInfo,
kEncodableTextureFormats,
Expand Down Expand Up @@ -420,6 +426,22 @@ export class GPUTestBase extends Fixture<GPUTestSubcaseBatchState> {
}
}

/** Skips this test case if the `langFeature` is *not* supported. */
requireLanguageFeatureOrSkipTestCase(langFeature: WGSLLanguageFeature) {
const lf = getGPU(this.rec).wgslLanguageFeatures;
if (lf === undefined || !lf.has(langFeature)) {
this.skip(`WGSL language feature '${langFeature}' is not supported`);
}
}

/** Skips this test case if the `langFeature` is supported. */
skipIfLanguageFeatureSupported(langFeature: WGSLLanguageFeature) {
const lf = getGPU(this.rec).wgslLanguageFeatures;
if (lf !== undefined && lf.has(langFeature)) {
this.skip(`WGSL language feature '${langFeature}' is supported`);
}
}

/**
* Expect a GPUBuffer's contents to pass the provided check.
*
Expand Down

0 comments on commit 591c655

Please sign in to comment.