diff --git a/src/common/framework/test_config.ts b/src/common/framework/test_config.ts index b5d5608dd851..072aaf736027 100644 --- a/src/common/framework/test_config.ts +++ b/src/common/framework/test_config.ts @@ -4,8 +4,20 @@ export type TestConfig = { */ enableDebugLogs: boolean; + /** + * Maximum number of subcases in flight at once, within a case. Once this many + * are in flight, wait for a subcase to finish before starting the next one. + */ maxSubcasesInFlight: number; + + /** + * Every `subcasesBetweenAttemptingGC` subcases, run `attemptGarbageCollection()`. + * Setting to `Infinity` disables this. Setting to 1 attempts GC every time (slow!). + */ + subcasesBetweenAttemptingGC: number; + testHeartbeatCallback: () => void; + noRaceWithRejectOnTimeout: boolean; /** @@ -41,6 +53,7 @@ export type TestConfig = { export const globalTestConfig: TestConfig = { enableDebugLogs: false, maxSubcasesInFlight: 100, + subcasesBetweenAttemptingGC: 5000, testHeartbeatCallback: () => {}, noRaceWithRejectOnTimeout: false, unrollConstEvalLoops: false, diff --git a/src/common/internal/test_group.ts b/src/common/internal/test_group.ts index aaaec9fe3f3a..ac3b11082771 100644 --- a/src/common/internal/test_group.ts +++ b/src/common/internal/test_group.ts @@ -31,6 +31,7 @@ import { stringifyPublicParamsUniquely, } from '../internal/query/stringify_params.js'; import { validQueryPart } from '../internal/query/validQueryPart.js'; +import { attemptGarbageCollection } from '../util/collect_garbage.js'; import { DeepReadonly } from '../util/types.js'; import { assert, unreachable } from '../util/util.js'; @@ -696,6 +697,7 @@ class RunCaseSpecific implements RunCase { subRec.threw(ex); } }) + .finally(attemptGarbageCollectionIfDue) .finally(subcaseFinishedCallback); allPreviousSubcasesFinalizedPromise = allPreviousSubcasesFinalizedPromise.then( @@ -711,13 +713,17 @@ class RunCaseSpecific implements RunCase { rec.skipped(new SkipTestCase('all subcases were skipped')); } } else { - await this.runTest( - rec, - sharedState, - this.params, - /* throwSkip */ false, - getExpectedStatus(selfQuery) - ); + try { + await this.runTest( + rec, + sharedState, + this.params, + /* throwSkip */ false, + getExpectedStatus(selfQuery) + ); + } finally { + await attemptGarbageCollectionIfDue(); + } } } finally { testHeartbeatCallback(); @@ -754,3 +760,17 @@ export type CaseTimingLogLine = { */ nonskippedSubcaseCount: number; }; + +/** Every `subcasesBetweenAttemptingGC` calls to this function will `attemptGarbageCollection()`. */ +const attemptGarbageCollectionIfDue: () => Promise = (() => { + // This state is global because garbage is global. + let subcasesSinceLastGC = 0; + + return async function attemptGarbageCollectionIfDue() { + subcasesSinceLastGC++; + if (subcasesSinceLastGC >= globalTestConfig.subcasesBetweenAttemptingGC) { + subcasesSinceLastGC = 0; + return attemptGarbageCollection(); + } + }; +})(); diff --git a/src/resources/cache/hashes.json b/src/resources/cache/hashes.json index 76381468a48d..e2224325944f 100644 --- a/src/resources/cache/hashes.json +++ b/src/resources/cache/hashes.json @@ -1,112 +1,112 @@ { - "webgpu/shader/execution/binary/af_addition.bin": "7c0379bf", - "webgpu/shader/execution/binary/af_logical.bin": "96b98d5d", - "webgpu/shader/execution/binary/af_division.bin": "ba1c0a85", - "webgpu/shader/execution/binary/af_matrix_addition.bin": "fc3aca75", - "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "fa1d87d", - "webgpu/shader/execution/binary/af_multiplication.bin": "37a9fde9", - "webgpu/shader/execution/binary/af_remainder.bin": "bccf1121", - "webgpu/shader/execution/binary/af_subtraction.bin": "d2e591f4", - "webgpu/shader/execution/binary/f16_addition.bin": "e4819c49", - "webgpu/shader/execution/binary/f16_logical.bin": "43368022", - "webgpu/shader/execution/binary/f16_division.bin": "215a9d5f", - "webgpu/shader/execution/binary/f16_matrix_addition.bin": "44df582a", - "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "9cbf9947", - "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "c691df11", - "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "50d96924", - "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "f85f0f3f", - "webgpu/shader/execution/binary/f16_multiplication.bin": "d901ae1f", - "webgpu/shader/execution/binary/f16_remainder.bin": "ddce5a62", - "webgpu/shader/execution/binary/f16_subtraction.bin": "550bceb7", - "webgpu/shader/execution/binary/f32_addition.bin": "3f664fc9", - "webgpu/shader/execution/binary/f32_logical.bin": "959f6412", - "webgpu/shader/execution/binary/f32_division.bin": "3c922562", - "webgpu/shader/execution/binary/f32_matrix_addition.bin": "9ae0abcb", - "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "4c4ae637", - "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "c5e67908", - "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "f5a0975b", - "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "f4f0673f", - "webgpu/shader/execution/binary/f32_multiplication.bin": "efa37ecc", - "webgpu/shader/execution/binary/f32_remainder.bin": "23865464", - "webgpu/shader/execution/binary/f32_subtraction.bin": "1c7b460", - "webgpu/shader/execution/binary/i32_arithmetic.bin": "c12c837f", - "webgpu/shader/execution/binary/i32_comparison.bin": "7bede79f", - "webgpu/shader/execution/binary/u32_arithmetic.bin": "83459533", - "webgpu/shader/execution/binary/u32_comparison.bin": "cb6c7d10", - "webgpu/shader/execution/abs.bin": "5991874e", - "webgpu/shader/execution/acos.bin": "2ed85ea", - "webgpu/shader/execution/acosh.bin": "dca17f4f", - "webgpu/shader/execution/asin.bin": "4ff413c2", - "webgpu/shader/execution/asinh.bin": "9c22347c", - "webgpu/shader/execution/atan.bin": "be66d53", - "webgpu/shader/execution/atan2.bin": "2592c543", - "webgpu/shader/execution/atanh.bin": "53fb672c", - "webgpu/shader/execution/bitcast.bin": "7bab3e11", - "webgpu/shader/execution/ceil.bin": "f849e1e4", - "webgpu/shader/execution/clamp.bin": "71061b70", - "webgpu/shader/execution/cos.bin": "ff53edaa", - "webgpu/shader/execution/cosh.bin": "98c5dc24", - "webgpu/shader/execution/cross.bin": "8f426492", - "webgpu/shader/execution/degrees.bin": "f77a9312", - "webgpu/shader/execution/determinant.bin": "e66d6051", - "webgpu/shader/execution/distance.bin": "e7e5ec3f", - "webgpu/shader/execution/dot.bin": "5875abdb", - "webgpu/shader/execution/exp.bin": "2d0e864", - "webgpu/shader/execution/exp2.bin": "ca8333fc", - "webgpu/shader/execution/faceForward.bin": "7ac5e40e", - "webgpu/shader/execution/floor.bin": "b640c123", - "webgpu/shader/execution/fma.bin": "1d693a83", - "webgpu/shader/execution/fract.bin": "33350e24", - "webgpu/shader/execution/frexp.bin": "f988e9f5", - "webgpu/shader/execution/inverseSqrt.bin": "5b860456", - "webgpu/shader/execution/ldexp.bin": "2d1f7a2b", - "webgpu/shader/execution/length.bin": "c9942cac", - "webgpu/shader/execution/log.bin": "15d93019", - "webgpu/shader/execution/log2.bin": "51801d3c", - "webgpu/shader/execution/max.bin": "64f6084f", - "webgpu/shader/execution/min.bin": "2bd03e23", - "webgpu/shader/execution/mix.bin": "6639acfd", - "webgpu/shader/execution/modf.bin": "20764644", - "webgpu/shader/execution/normalize.bin": "dc436ae", - "webgpu/shader/execution/pack2x16float.bin": "5b7c4f27", - "webgpu/shader/execution/pow.bin": "ee13e689", - "webgpu/shader/execution/quantizeToF16.bin": "170ed69a", - "webgpu/shader/execution/radians.bin": "d65a64ef", - "webgpu/shader/execution/reflect.bin": "b51bee35", - "webgpu/shader/execution/refract.bin": "eecc27c2", - "webgpu/shader/execution/round.bin": "6f41466e", - "webgpu/shader/execution/saturate.bin": "a32a0b03", - "webgpu/shader/execution/sign.bin": "aace655c", - "webgpu/shader/execution/sin.bin": "6d317fcc", - "webgpu/shader/execution/sinh.bin": "1ff4cfa8", - "webgpu/shader/execution/smoothstep.bin": "2fe663e1", - "webgpu/shader/execution/sqrt.bin": "57534d22", - "webgpu/shader/execution/step.bin": "83066922", - "webgpu/shader/execution/tan.bin": "d2a2985", - "webgpu/shader/execution/tanh.bin": "f2b896ce", - "webgpu/shader/execution/transpose.bin": "bc6cf373", - "webgpu/shader/execution/trunc.bin": "b9a32a1f", - "webgpu/shader/execution/unpack2x16float.bin": "dc335b33", - "webgpu/shader/execution/unpack2x16snorm.bin": "1633b95f", - "webgpu/shader/execution/unpack2x16unorm.bin": "f945c3b1", - "webgpu/shader/execution/unpack4x8snorm.bin": "71858b12", - "webgpu/shader/execution/unpack4x8unorm.bin": "14d9dee7", - "webgpu/shader/execution/unary/af_arithmetic.bin": "1244dc59", - "webgpu/shader/execution/unary/af_assignment.bin": "4977c89a", - "webgpu/shader/execution/unary/bool_conversion.bin": "fa8980ab", - "webgpu/shader/execution/unary/f16_arithmetic.bin": "2cbcc359", - "webgpu/shader/execution/unary/f16_conversion.bin": "5391f8be", - "webgpu/shader/execution/unary/f32_arithmetic.bin": "e75aea78", - "webgpu/shader/execution/unary/f32_conversion.bin": "41d8c357", - "webgpu/shader/execution/unary/i32_arithmetic.bin": "c5c7c981", - "webgpu/shader/execution/unary/i32_conversion.bin": "1816a122", - "webgpu/shader/execution/unary/u32_conversion.bin": "5ccdf1c1", - "webgpu/shader/execution/unary/ai_assignment.bin": "dfcceb5e", - "webgpu/shader/execution/binary/ai_arithmetic.bin": "19fab64c", - "webgpu/shader/execution/unary/ai_arithmetic.bin": "84c6cd22", - "webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "2f1e6c16", - "webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "64dfd4a1", - "webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "48559d35", - "webgpu/shader/execution/derivatives.bin": "9297dd6d", - "webgpu/shader/execution/fwidth.bin": "76674f5a" + "webgpu/shader/execution/binary/af_addition.bin": "d0c1b760", + "webgpu/shader/execution/binary/af_logical.bin": "ca60ce77", + "webgpu/shader/execution/binary/af_division.bin": "47ae1ca1", + "webgpu/shader/execution/binary/af_matrix_addition.bin": "afaf9bae", + "webgpu/shader/execution/binary/af_matrix_subtraction.bin": "42433bf3", + "webgpu/shader/execution/binary/af_multiplication.bin": "babfc501", + "webgpu/shader/execution/binary/af_remainder.bin": "19995293", + "webgpu/shader/execution/binary/af_subtraction.bin": "62f090b9", + "webgpu/shader/execution/binary/f16_addition.bin": "540ae334", + "webgpu/shader/execution/binary/f16_logical.bin": "c1f09c30", + "webgpu/shader/execution/binary/f16_division.bin": "b4eabc05", + "webgpu/shader/execution/binary/f16_matrix_addition.bin": "6b9113b", + "webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "a7362ff1", + "webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "4ac4e5bb", + "webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "93d4d43a", + "webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "beed89d5", + "webgpu/shader/execution/binary/f16_multiplication.bin": "6b5f0d51", + "webgpu/shader/execution/binary/f16_remainder.bin": "a1f499b3", + "webgpu/shader/execution/binary/f16_subtraction.bin": "61a571d5", + "webgpu/shader/execution/binary/f32_addition.bin": "fa6cc596", + "webgpu/shader/execution/binary/f32_logical.bin": "2b155b60", + "webgpu/shader/execution/binary/f32_division.bin": "243c9ce6", + "webgpu/shader/execution/binary/f32_matrix_addition.bin": "d3bc6ed6", + "webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "2a4c1527", + "webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "d695442", + "webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "b306b19", + "webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "aac6cbfd", + "webgpu/shader/execution/binary/f32_multiplication.bin": "a21303f5", + "webgpu/shader/execution/binary/f32_remainder.bin": "79e462a1", + "webgpu/shader/execution/binary/f32_subtraction.bin": "4e6bbf38", + "webgpu/shader/execution/binary/i32_arithmetic.bin": "167760cc", + "webgpu/shader/execution/binary/i32_comparison.bin": "6a9f856a", + "webgpu/shader/execution/binary/u32_arithmetic.bin": "ac424b44", + "webgpu/shader/execution/binary/u32_comparison.bin": "a9e71302", + "webgpu/shader/execution/abs.bin": "a42729c4", + "webgpu/shader/execution/acos.bin": "664a5662", + "webgpu/shader/execution/acosh.bin": "d3fb8eb0", + "webgpu/shader/execution/asin.bin": "5a4f5b9e", + "webgpu/shader/execution/asinh.bin": "3ce3fe4d", + "webgpu/shader/execution/atan.bin": "759d432", + "webgpu/shader/execution/atan2.bin": "95008607", + "webgpu/shader/execution/atanh.bin": "569bd1b6", + "webgpu/shader/execution/bitcast.bin": "4329e501", + "webgpu/shader/execution/ceil.bin": "55cc76e5", + "webgpu/shader/execution/clamp.bin": "d580a273", + "webgpu/shader/execution/cos.bin": "3107bc4b", + "webgpu/shader/execution/cosh.bin": "d36c86cc", + "webgpu/shader/execution/cross.bin": "e48c39ba", + "webgpu/shader/execution/degrees.bin": "f74b63d2", + "webgpu/shader/execution/determinant.bin": "f07e1160", + "webgpu/shader/execution/distance.bin": "93156a89", + "webgpu/shader/execution/dot.bin": "4e2fe407", + "webgpu/shader/execution/exp.bin": "3b269b18", + "webgpu/shader/execution/exp2.bin": "7aeeeaf6", + "webgpu/shader/execution/faceForward.bin": "451ffbd8", + "webgpu/shader/execution/floor.bin": "37131d74", + "webgpu/shader/execution/fma.bin": "30111350", + "webgpu/shader/execution/fract.bin": "5ef13392", + "webgpu/shader/execution/frexp.bin": "da764bc0", + "webgpu/shader/execution/inverseSqrt.bin": "6ff34703", + "webgpu/shader/execution/ldexp.bin": "5016cec9", + "webgpu/shader/execution/length.bin": "f236d2e7", + "webgpu/shader/execution/log.bin": "1c54f128", + "webgpu/shader/execution/log2.bin": "e44e2370", + "webgpu/shader/execution/max.bin": "eb4c1901", + "webgpu/shader/execution/min.bin": "f8c70a2b", + "webgpu/shader/execution/mix.bin": "df3b3f62", + "webgpu/shader/execution/modf.bin": "b600b26f", + "webgpu/shader/execution/normalize.bin": "7af3a3d2", + "webgpu/shader/execution/pack2x16float.bin": "7c67b10e", + "webgpu/shader/execution/pow.bin": "ee37f4ba", + "webgpu/shader/execution/quantizeToF16.bin": "a7a65754", + "webgpu/shader/execution/radians.bin": "51d423b9", + "webgpu/shader/execution/reflect.bin": "3ba4eda6", + "webgpu/shader/execution/refract.bin": "13fc4914", + "webgpu/shader/execution/round.bin": "9155b88b", + "webgpu/shader/execution/saturate.bin": "73cecf71", + "webgpu/shader/execution/sign.bin": "68d61a83", + "webgpu/shader/execution/sin.bin": "44219876", + "webgpu/shader/execution/sinh.bin": "158d261d", + "webgpu/shader/execution/smoothstep.bin": "7129c56b", + "webgpu/shader/execution/sqrt.bin": "9aaaf8aa", + "webgpu/shader/execution/step.bin": "85858027", + "webgpu/shader/execution/tan.bin": "dbbda634", + "webgpu/shader/execution/tanh.bin": "8c540d5c", + "webgpu/shader/execution/transpose.bin": "a676fc9a", + "webgpu/shader/execution/trunc.bin": "35ab398d", + "webgpu/shader/execution/unpack2x16float.bin": "eb9294c9", + "webgpu/shader/execution/unpack2x16snorm.bin": "7208eb73", + "webgpu/shader/execution/unpack2x16unorm.bin": "20d9669b", + "webgpu/shader/execution/unpack4x8snorm.bin": "c77e1a72", + "webgpu/shader/execution/unpack4x8unorm.bin": "d80caf66", + "webgpu/shader/execution/unary/af_arithmetic.bin": "963c3185", + "webgpu/shader/execution/unary/af_assignment.bin": "9e8a3b3f", + "webgpu/shader/execution/unary/bool_conversion.bin": "eee7a40c", + "webgpu/shader/execution/unary/f16_arithmetic.bin": "aaea9f75", + "webgpu/shader/execution/unary/f16_conversion.bin": "5b26998a", + "webgpu/shader/execution/unary/f32_arithmetic.bin": "65dfc2ac", + "webgpu/shader/execution/unary/f32_conversion.bin": "cd874be3", + "webgpu/shader/execution/unary/i32_arithmetic.bin": "af4c0e43", + "webgpu/shader/execution/unary/i32_conversion.bin": "5b6e4d9", + "webgpu/shader/execution/unary/u32_conversion.bin": "229649a6", + "webgpu/shader/execution/unary/ai_assignment.bin": "8efcf261", + "webgpu/shader/execution/binary/ai_arithmetic.bin": "a57ee284", + "webgpu/shader/execution/unary/ai_arithmetic.bin": "948016b6", + "webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "52c24212", + "webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "256556e1", + "webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "38085521", + "webgpu/shader/execution/derivatives.bin": "f38a38ff", + "webgpu/shader/execution/fwidth.bin": "4e9fc55d" } \ No newline at end of file