From 6709673f56044c2d5749fe1c09b7194dfe22a7f2 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Tue, 14 May 2024 19:03:19 +0100 Subject: [PATCH] shader/exeuction: Fix abstract-numeric constructor tests (#3744) Specify `constEvaluationMode: 'direct'` for abstract-numeric constructor tests. This CL extends #3677 to fix more tests that early concretize values when loops are not unrolled. Depending on the platform, we either directly assign the expression evaluation to the output buffer, or go via a const array. The latter caused compilation failures as it would force a concretization of the abstract values in the array, which would become incompatible with the output type. Fixes: #3743 --- .../execution/expression/constructor/non_zero.spec.ts | 10 +++++----- .../expression/constructor/zero_value.spec.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/webgpu/shader/execution/expression/constructor/non_zero.spec.ts b/src/webgpu/shader/execution/expression/constructor/non_zero.spec.ts index 94870f5f5831..37420dd49985 100644 --- a/src/webgpu/shader/execution/expression/constructor/non_zero.spec.ts +++ b/src/webgpu/shader/execution/expression/constructor/non_zero.spec.ts @@ -191,7 +191,7 @@ g.test('abstract_vector_splat') basicExpressionBuilder(_ => `${fn}(${t.params.value * 0x100000000}${suffix}) / 0x100000000`), [], concreteVectorType, - { inputSource: 'const' }, + { inputSource: 'const', constEvaluationMode: 'direct' }, [{ input: [], expected: concreteVectorType.create(t.params.value) }] ); }); @@ -269,7 +269,7 @@ g.test('abstract_vector_elements') ), [], concreteVectorType, - { inputSource: 'const' }, + { inputSource: 'const', constEvaluationMode: 'direct' }, [{ input: [], expected: concreteVectorType.create(elements) }] ); }); @@ -391,7 +391,7 @@ g.test('abstract_vector_mix') basicExpressionBuilder(_ => `${fn}(${args.join(', ')}) / 0x100000000`), [], concreteVectorType, - { inputSource: 'const' }, + { inputSource: 'const', constEvaluationMode: 'direct' }, [ { input: [], @@ -514,7 +514,7 @@ g.test('abstract_matrix_elements') ), [], concreteMatrixType, - { inputSource: 'const' }, + { inputSource: 'const', constEvaluationMode: 'direct' }, [ { input: [], @@ -605,7 +605,7 @@ g.test('abstract_matrix_column_vectors') basicExpressionBuilder(_ => `${fn}(${columnVectors.join(', ')}) * (1.0 / 0x100000000)`), [], concreteMatrixType, - { inputSource: 'const' }, + { inputSource: 'const', constEvaluationMode: 'direct' }, [ { input: [], diff --git a/src/webgpu/shader/execution/expression/constructor/zero_value.spec.ts b/src/webgpu/shader/execution/expression/constructor/zero_value.spec.ts index aadd62aa8496..f53cc8288567 100644 --- a/src/webgpu/shader/execution/expression/constructor/zero_value.spec.ts +++ b/src/webgpu/shader/execution/expression/constructor/zero_value.spec.ts @@ -72,7 +72,7 @@ g.test('vector_prefix') basicExpressionBuilder(ops => `vec${t.params.width}()`), [], type, - { inputSource: 'const' }, + { inputSource: 'const', constEvaluationMode: 'direct' }, [{ input: [], expected: type.create(0) }] ); });