Skip to content

Commit

Permalink
Merge branch 'main' into service-worker
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Mar 8, 2024
2 parents 0c45e9b + f71a834 commit 85d764a
Show file tree
Hide file tree
Showing 9 changed files with 597 additions and 163 deletions.
216 changes: 108 additions & 108 deletions src/resources/cache/hashes.json
Original file line number Diff line number Diff line change
@@ -1,110 +1,110 @@
{
"webgpu/shader/execution/binary/af_addition.bin": "cf91cbac",
"webgpu/shader/execution/binary/af_logical.bin": "39e762c9",
"webgpu/shader/execution/binary/af_division.bin": "589d456c",
"webgpu/shader/execution/binary/af_matrix_addition.bin": "8751daed",
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "dbfdb5b8",
"webgpu/shader/execution/binary/af_multiplication.bin": "522a7aa3",
"webgpu/shader/execution/binary/af_remainder.bin": "57735742",
"webgpu/shader/execution/binary/af_subtraction.bin": "7b4714b8",
"webgpu/shader/execution/binary/f16_addition.bin": "9451a6ec",
"webgpu/shader/execution/binary/f16_logical.bin": "3d552774",
"webgpu/shader/execution/binary/f16_division.bin": "fd209366",
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "90dfc3a4",
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "81b8d51a",
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "2291c89f",
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "3b9e174",
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "168857bd",
"webgpu/shader/execution/binary/f16_multiplication.bin": "950d694e",
"webgpu/shader/execution/binary/f16_remainder.bin": "9005aed2",
"webgpu/shader/execution/binary/f16_subtraction.bin": "519b4964",
"webgpu/shader/execution/binary/f32_addition.bin": "9eaead31",
"webgpu/shader/execution/binary/f32_logical.bin": "b8a8b013",
"webgpu/shader/execution/binary/f32_division.bin": "31621a9",
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "4d30c5b",
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "25f1411e",
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "d2887e3d",
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "1f478519",
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "e3b85737",
"webgpu/shader/execution/binary/f32_multiplication.bin": "e40a7143",
"webgpu/shader/execution/binary/f32_remainder.bin": "72f83449",
"webgpu/shader/execution/binary/f32_subtraction.bin": "65f903be",
"webgpu/shader/execution/binary/i32_arithmetic.bin": "89a9bfa6",
"webgpu/shader/execution/binary/i32_comparison.bin": "64fa1dd",
"webgpu/shader/execution/binary/u32_arithmetic.bin": "6018eb78",
"webgpu/shader/execution/binary/u32_comparison.bin": "674f5867",
"webgpu/shader/execution/abs.bin": "150b8b5c",
"webgpu/shader/execution/acos.bin": "c281a5e",
"webgpu/shader/execution/acosh.bin": "3fff9b71",
"webgpu/shader/execution/asin.bin": "ea40c045",
"webgpu/shader/execution/asinh.bin": "e227d365",
"webgpu/shader/execution/atan.bin": "978d434a",
"webgpu/shader/execution/atan2.bin": "b6ce441e",
"webgpu/shader/execution/atanh.bin": "c4340fa3",
"webgpu/shader/execution/bitcast.bin": "758f5b7d",
"webgpu/shader/execution/ceil.bin": "1b4d63f5",
"webgpu/shader/execution/clamp.bin": "cb35a47d",
"webgpu/shader/execution/cos.bin": "cde654bc",
"webgpu/shader/execution/cosh.bin": "64faafa",
"webgpu/shader/execution/cross.bin": "fc1537e6",
"webgpu/shader/execution/degrees.bin": "71c5167b",
"webgpu/shader/execution/determinant.bin": "630c7e7b",
"webgpu/shader/execution/distance.bin": "6c1209c8",
"webgpu/shader/execution/dot.bin": "eff3fcd",
"webgpu/shader/execution/exp.bin": "c6e73f9a",
"webgpu/shader/execution/exp2.bin": "64abb414",
"webgpu/shader/execution/faceForward.bin": "3f5b0f54",
"webgpu/shader/execution/floor.bin": "3b57067d",
"webgpu/shader/execution/fma.bin": "c460792c",
"webgpu/shader/execution/fract.bin": "85c5e8e",
"webgpu/shader/execution/frexp.bin": "9c4ff959",
"webgpu/shader/execution/inverseSqrt.bin": "11568263",
"webgpu/shader/execution/ldexp.bin": "8fa7e873",
"webgpu/shader/execution/length.bin": "dc6151c1",
"webgpu/shader/execution/log.bin": "4d24c460",
"webgpu/shader/execution/log2.bin": "6c03a3c9",
"webgpu/shader/execution/max.bin": "4cf43051",
"webgpu/shader/execution/min.bin": "e50bdd2a",
"webgpu/shader/execution/mix.bin": "9cccc111",
"webgpu/shader/execution/modf.bin": "fd5d1a5e",
"webgpu/shader/execution/normalize.bin": "b6958da6",
"webgpu/shader/execution/pack2x16float.bin": "78f2fc5d",
"webgpu/shader/execution/pow.bin": "4c9cabf",
"webgpu/shader/execution/quantizeToF16.bin": "be28b74c",
"webgpu/shader/execution/radians.bin": "6dc07aba",
"webgpu/shader/execution/reflect.bin": "f77b18c2",
"webgpu/shader/execution/refract.bin": "64363f83",
"webgpu/shader/execution/round.bin": "cec85ddd",
"webgpu/shader/execution/saturate.bin": "17943f76",
"webgpu/shader/execution/sign.bin": "a61a6ac2",
"webgpu/shader/execution/sin.bin": "c9421f5d",
"webgpu/shader/execution/sinh.bin": "de7c5c38",
"webgpu/shader/execution/smoothstep.bin": "ddb59eec",
"webgpu/shader/execution/sqrt.bin": "7a479df0",
"webgpu/shader/execution/step.bin": "d85e1913",
"webgpu/shader/execution/tan.bin": "84d83005",
"webgpu/shader/execution/tanh.bin": "34488898",
"webgpu/shader/execution/transpose.bin": "255d3a78",
"webgpu/shader/execution/trunc.bin": "d757f94d",
"webgpu/shader/execution/unpack2x16float.bin": "aa1694aa",
"webgpu/shader/execution/unpack2x16snorm.bin": "46405147",
"webgpu/shader/execution/unpack2x16unorm.bin": "9791f641",
"webgpu/shader/execution/unpack4x8snorm.bin": "f96dc804",
"webgpu/shader/execution/unpack4x8unorm.bin": "ec48978e",
"webgpu/shader/execution/unary/af_arithmetic.bin": "d076eb23",
"webgpu/shader/execution/unary/af_assignment.bin": "adbe8385",
"webgpu/shader/execution/unary/bool_conversion.bin": "9646fdba",
"webgpu/shader/execution/unary/f16_arithmetic.bin": "c076e5b8",
"webgpu/shader/execution/unary/f16_conversion.bin": "9fb0a061",
"webgpu/shader/execution/unary/f32_arithmetic.bin": "16ea4caa",
"webgpu/shader/execution/unary/f32_conversion.bin": "d0b5b5eb",
"webgpu/shader/execution/unary/i32_arithmetic.bin": "1edde650",
"webgpu/shader/execution/unary/i32_conversion.bin": "9422df57",
"webgpu/shader/execution/unary/u32_conversion.bin": "ecf61049",
"webgpu/shader/execution/unary/ai_assignment.bin": "9c3a1a12",
"webgpu/shader/execution/binary/ai_arithmetic.bin": "10936463",
"webgpu/shader/execution/unary/ai_arithmetic.bin": "d4a2b423",
"webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "e2ea28e",
"webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "d37763f4",
"webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "acd97fe0"
"webgpu/shader/execution/binary/af_addition.bin": "9e6bb40b",
"webgpu/shader/execution/binary/af_logical.bin": "f94a29ff",
"webgpu/shader/execution/binary/af_division.bin": "8704c37c",
"webgpu/shader/execution/binary/af_matrix_addition.bin": "b59e2234",
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "15df66af",
"webgpu/shader/execution/binary/af_multiplication.bin": "2242a619",
"webgpu/shader/execution/binary/af_remainder.bin": "8086dade",
"webgpu/shader/execution/binary/af_subtraction.bin": "e53c1365",
"webgpu/shader/execution/binary/f16_addition.bin": "afdc54ef",
"webgpu/shader/execution/binary/f16_logical.bin": "8578ce4b",
"webgpu/shader/execution/binary/f16_division.bin": "2d0c0114",
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "a50cdce0",
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "efc3b4ab",
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "26676d6a",
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "e4edb2d7",
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "f842b1b0",
"webgpu/shader/execution/binary/f16_multiplication.bin": "bb35a4e3",
"webgpu/shader/execution/binary/f16_remainder.bin": "e93bdbca",
"webgpu/shader/execution/binary/f16_subtraction.bin": "c3e94ae0",
"webgpu/shader/execution/binary/f32_addition.bin": "b68c034a",
"webgpu/shader/execution/binary/f32_logical.bin": "59d918",
"webgpu/shader/execution/binary/f32_division.bin": "2c8b11b7",
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "4126dc1b",
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "62873d98",
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "21e2747d",
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "cc94f234",
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "9c2e6cd5",
"webgpu/shader/execution/binary/f32_multiplication.bin": "4ed9ee8e",
"webgpu/shader/execution/binary/f32_remainder.bin": "948d2cd0",
"webgpu/shader/execution/binary/f32_subtraction.bin": "69f69402",
"webgpu/shader/execution/binary/i32_arithmetic.bin": "332f1d5c",
"webgpu/shader/execution/binary/i32_comparison.bin": "861bb9f5",
"webgpu/shader/execution/binary/u32_arithmetic.bin": "3cad169e",
"webgpu/shader/execution/binary/u32_comparison.bin": "983335ab",
"webgpu/shader/execution/abs.bin": "c1c4a8bc",
"webgpu/shader/execution/acos.bin": "88380cf5",
"webgpu/shader/execution/acosh.bin": "946a233c",
"webgpu/shader/execution/asin.bin": "a2c67033",
"webgpu/shader/execution/asinh.bin": "f28b59d9",
"webgpu/shader/execution/atan.bin": "2cee2864",
"webgpu/shader/execution/atan2.bin": "bd7c6ea0",
"webgpu/shader/execution/atanh.bin": "b6bf4115",
"webgpu/shader/execution/bitcast.bin": "70ecb22e",
"webgpu/shader/execution/ceil.bin": "ef4b63b3",
"webgpu/shader/execution/clamp.bin": "a15927db",
"webgpu/shader/execution/cos.bin": "d2637e65",
"webgpu/shader/execution/cosh.bin": "35313dfb",
"webgpu/shader/execution/cross.bin": "855dabf1",
"webgpu/shader/execution/degrees.bin": "c9fcd251",
"webgpu/shader/execution/determinant.bin": "35559e07",
"webgpu/shader/execution/distance.bin": "92b1db93",
"webgpu/shader/execution/dot.bin": "e9f334d9",
"webgpu/shader/execution/exp.bin": "eb2236b5",
"webgpu/shader/execution/exp2.bin": "be2a3cec",
"webgpu/shader/execution/faceForward.bin": "46a0b1e5",
"webgpu/shader/execution/floor.bin": "e344e0c5",
"webgpu/shader/execution/fma.bin": "6698c624",
"webgpu/shader/execution/fract.bin": "72bc967f",
"webgpu/shader/execution/frexp.bin": "bd4c658a",
"webgpu/shader/execution/inverseSqrt.bin": "ccfa7145",
"webgpu/shader/execution/ldexp.bin": "8687325b",
"webgpu/shader/execution/length.bin": "396826a2",
"webgpu/shader/execution/log.bin": "122a5653",
"webgpu/shader/execution/log2.bin": "67b13d2c",
"webgpu/shader/execution/max.bin": "d4ff0119",
"webgpu/shader/execution/min.bin": "2926ee4a",
"webgpu/shader/execution/mix.bin": "1594b9d2",
"webgpu/shader/execution/modf.bin": "4ada33d1",
"webgpu/shader/execution/normalize.bin": "17ede905",
"webgpu/shader/execution/pack2x16float.bin": "85b5a077",
"webgpu/shader/execution/pow.bin": "de6cbe1f",
"webgpu/shader/execution/quantizeToF16.bin": "ea70183f",
"webgpu/shader/execution/radians.bin": "b5aa0c2a",
"webgpu/shader/execution/reflect.bin": "50fcf338",
"webgpu/shader/execution/refract.bin": "3b45edc1",
"webgpu/shader/execution/round.bin": "4cce1078",
"webgpu/shader/execution/saturate.bin": "1cbfacb8",
"webgpu/shader/execution/sign.bin": "546e3817",
"webgpu/shader/execution/sin.bin": "44ac2899",
"webgpu/shader/execution/sinh.bin": "9f41b531",
"webgpu/shader/execution/smoothstep.bin": "57462aa8",
"webgpu/shader/execution/sqrt.bin": "dcfb10c3",
"webgpu/shader/execution/step.bin": "5c833687",
"webgpu/shader/execution/tan.bin": "be4676df",
"webgpu/shader/execution/tanh.bin": "277f551b",
"webgpu/shader/execution/transpose.bin": "3c98c4d1",
"webgpu/shader/execution/trunc.bin": "9d734652",
"webgpu/shader/execution/unpack2x16float.bin": "ab0ea0a7",
"webgpu/shader/execution/unpack2x16snorm.bin": "c0822f22",
"webgpu/shader/execution/unpack2x16unorm.bin": "41795b16",
"webgpu/shader/execution/unpack4x8snorm.bin": "5d1a46b9",
"webgpu/shader/execution/unpack4x8unorm.bin": "2b888052",
"webgpu/shader/execution/unary/af_arithmetic.bin": "3fbd3a6c",
"webgpu/shader/execution/unary/af_assignment.bin": "e63fadc7",
"webgpu/shader/execution/unary/bool_conversion.bin": "1c900bd0",
"webgpu/shader/execution/unary/f16_arithmetic.bin": "f7cf43b",
"webgpu/shader/execution/unary/f16_conversion.bin": "15e774cb",
"webgpu/shader/execution/unary/f32_arithmetic.bin": "a368172b",
"webgpu/shader/execution/unary/f32_conversion.bin": "2dc36a4b",
"webgpu/shader/execution/unary/i32_arithmetic.bin": "95da0e14",
"webgpu/shader/execution/unary/i32_conversion.bin": "489e027b",
"webgpu/shader/execution/unary/u32_conversion.bin": "a072dd41",
"webgpu/shader/execution/unary/ai_assignment.bin": "789dba46",
"webgpu/shader/execution/binary/ai_arithmetic.bin": "d4f07108",
"webgpu/shader/execution/unary/ai_arithmetic.bin": "b1e7f548",
"webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "4f90530b",
"webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "2e3f8d2b",
"webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "a447760b"
}
4 changes: 2 additions & 2 deletions src/webgpu/api/operation/rendering/draw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import {
TypedArrayBufferView,
TypedArrayBufferViewConstructor,
} from '../../../../common/util/util.js';
import { GPUTest, TextureTestMixin } from '../../../gpu_test.js';
import { AdapterLimitsGPUTest, TextureTestMixin } from '../../../gpu_test.js';
import { PerPixelComparison } from '../../../util/texture/texture_ok.js';

class DrawTest extends TextureTestMixin(GPUTest) {
class DrawTest extends TextureTestMixin(AdapterLimitsGPUTest) {
checkTriangleDraw(opts: {
firstIndex: number | undefined;
count: number;
Expand Down
90 changes: 82 additions & 8 deletions src/webgpu/gpu_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,47 @@ export function initUncanonicalizedDeviceDescriptor(
}
}

/**
* Gets the adapter limits as a standard JavaScript object.
*/
function getAdapterLimitsAsDeviceRequiredLimits(adapter: GPUAdapter) {
const requiredLimits: Record<string, GPUSize64> = {};
const adapterLimits = adapter.limits as unknown as Record<string, GPUSize64>;
for (const key in adapter.limits) {
requiredLimits[key] = adapterLimits[key];
}
return requiredLimits;
}

/**
* Conditionally applies adapter limits to device descriptor
* but does not overwrite existing requested limits.
*/
function conditionallyApplyAdapterLimitsToDeviceDescriptor(
adapter: GPUAdapter,
useAdapterLimits: boolean,
descriptor: UncanonicalizedDeviceDescriptor | undefined
): UncanonicalizedDeviceDescriptor {
return {
...(descriptor || {}),
requiredLimits: {
...(useAdapterLimits && getAdapterLimitsAsDeviceRequiredLimits(adapter)),
...(descriptor?.requiredLimits || {}),
},
};
}

export class GPUTestSubcaseBatchState extends SubcaseBatchState {
/** Provider for default device. */
private provider: Promise<DeviceProvider> | undefined;
/** Provider for mismatched device. */
private mismatchedProvider: Promise<DeviceProvider> | undefined;
/** True if device should be created with adapter limits */
private useAdapterLimits = false;

constructor(recorder: TestCaseRecorder, params: TestParams) {
super(recorder, params);
}

override async postInit(): Promise<void> {
// Skip all subcases if there's no device.
Expand All @@ -123,6 +159,14 @@ export class GPUTestSubcaseBatchState extends SubcaseBatchState {
return this.provider;
}

useAdapterLimitsForDevice() {
assert(
this.provider === undefined,
'useAdapterLimits must be called before getting the device'
);
this.useAdapterLimits = true;
}

get isCompatibility() {
return globalTestConfig.compatibility;
}
Expand All @@ -140,10 +184,18 @@ export class GPUTestSubcaseBatchState extends SubcaseBatchState {
*/
selectDeviceOrSkipTestCase(descriptor: DeviceSelectionDescriptor): void {
assert(this.provider === undefined, "Can't selectDeviceOrSkipTestCase() multiple times");
this.provider = devicePool.acquire(
this.recorder,
initUncanonicalizedDeviceDescriptor(descriptor)
);
this.provider = devicePool
.requestAdapter(this.recorder)
.then(adapter =>
devicePool.acquire(
adapter,
conditionallyApplyAdapterLimitsToDeviceDescriptor(
adapter,
this.useAdapterLimits,
initUncanonicalizedDeviceDescriptor(descriptor)
)
)
);
// Suppress uncaught promise rejection (we'll catch it later).
this.provider.catch(() => {});
}
Expand Down Expand Up @@ -201,10 +253,18 @@ export class GPUTestSubcaseBatchState extends SubcaseBatchState {
"Can't selectMismatchedDeviceOrSkipTestCase() multiple times"
);

this.mismatchedProvider = mismatchedDevicePool.acquire(
this.recorder,
initUncanonicalizedDeviceDescriptor(descriptor)
);
this.mismatchedProvider = mismatchedDevicePool
.requestAdapter(this.recorder)
.then(adapter =>
mismatchedDevicePool.acquire(
adapter,
conditionallyApplyAdapterLimitsToDeviceDescriptor(
adapter,
this.useAdapterLimits,
initUncanonicalizedDeviceDescriptor(descriptor)
)
)
);
// Suppress uncaught promise rejection (we'll catch it later).
this.mismatchedProvider.catch(() => {});
}
Expand Down Expand Up @@ -1203,6 +1263,20 @@ export class GPUTest extends GPUTestBase {
}
}

/**
* A version of GPUTest that requires the adapter limits.
*/
export class AdapterLimitsGPUTest extends GPUTest {
public static override MakeSharedState(
recorder: TestCaseRecorder,
params: TestParams
): GPUTestSubcaseBatchState {
const state = new GPUTestSubcaseBatchState(recorder, params);
state.useAdapterLimitsForDevice();
return state;
}
}

/**
* Texture expectation mixin can be applied on top of GPUTest to add texture
* related expectation helpers.
Expand Down
6 changes: 6 additions & 0 deletions src/webgpu/listing_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,9 @@
"webgpu:shader,validation,expression,call,builtin,atan:values:*": { "subcaseMS": 0.335 },
"webgpu:shader,validation,expression,call,builtin,atanh:integer_argument:*": { "subcaseMS": 0.912 },
"webgpu:shader,validation,expression,call,builtin,atanh:values:*": { "subcaseMS": 0.231 },
"webgpu:shader,validation,expression,call,builtin,atomics:atomic_parameterization:*": { "subcaseMS": 1.346 },
"webgpu:shader,validation,expression,call,builtin,atomics:data_parameters:*": { "subcaseMS": 38.382 },
"webgpu:shader,validation,expression,call,builtin,atomics:return_types:*": { "subcaseMS": 28.021 },
"webgpu:shader,validation,expression,call,builtin,atomics:stage:*": { "subcaseMS": 1.346 },
"webgpu:shader,validation,expression,call,builtin,barriers:no_return_value:*": { "subcaseMS": 1.500 },
"webgpu:shader,validation,expression,call,builtin,barriers:only_in_compute:*": { "subcaseMS": 1.500 },
Expand Down Expand Up @@ -2138,6 +2141,9 @@
"webgpu:shader,validation,types,alias:no_indirect_recursion_via_struct_attribute:*": { "subcaseMS": 1.584 },
"webgpu:shader,validation,types,alias:no_indirect_recursion_via_struct_member:*": { "subcaseMS": 1.000 },
"webgpu:shader,validation,types,alias:no_indirect_recursion_via_vector_element:*": { "subcaseMS": 1.050 },
"webgpu:shader,validation,types,atomics:address_space:*": { "subcaseMS": 1.050 },
"webgpu:shader,validation,types,atomics:invalid_operations:*": { "subcaseMS": 1.050 },
"webgpu:shader,validation,types,atomics:type:*": { "subcaseMS": 1.050 },
"webgpu:shader,validation,types,struct:no_direct_recursion:*": { "subcaseMS": 0.951 },
"webgpu:shader,validation,types,struct:no_indirect_recursion:*": { "subcaseMS": 0.901 },
"webgpu:shader,validation,types,struct:no_indirect_recursion_via_array_element:*": { "subcaseMS": 0.901 },
Expand Down
Loading

0 comments on commit 85d764a

Please sign in to comment.