Skip to content

Commit

Permalink
Merge branch 'main' into atomic-val
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiorano authored Mar 8, 2024
2 parents c46c212 + 0a68bf7 commit 491c328
Show file tree
Hide file tree
Showing 202 changed files with 3,780 additions and 2,563 deletions.
213 changes: 108 additions & 105 deletions src/resources/cache/hashes.json
Original file line number Diff line number Diff line change
@@ -1,107 +1,110 @@
{
"webgpu/shader/execution/binary/af_addition.bin": "38b261fa",
"webgpu/shader/execution/binary/af_logical.bin": "a483b968",
"webgpu/shader/execution/binary/af_division.bin": "ec39b0da",
"webgpu/shader/execution/binary/af_matrix_addition.bin": "ca1373a8",
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "406d99af",
"webgpu/shader/execution/binary/af_multiplication.bin": "2eb6d50d",
"webgpu/shader/execution/binary/af_remainder.bin": "e2b6b21",
"webgpu/shader/execution/binary/af_subtraction.bin": "84794350",
"webgpu/shader/execution/binary/f16_addition.bin": "19e8823d",
"webgpu/shader/execution/binary/f16_logical.bin": "b89ca9b9",
"webgpu/shader/execution/binary/f16_division.bin": "6dc4b748",
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "7533842",
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "2d799920",
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "44e3b295",
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "412f0911",
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "a231201b",
"webgpu/shader/execution/binary/f16_multiplication.bin": "94b11030",
"webgpu/shader/execution/binary/f16_remainder.bin": "de68a200",
"webgpu/shader/execution/binary/f16_subtraction.bin": "f308327a",
"webgpu/shader/execution/binary/f32_addition.bin": "c87c8c08",
"webgpu/shader/execution/binary/f32_logical.bin": "c7370c09",
"webgpu/shader/execution/binary/f32_division.bin": "34ce65ae",
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "f3808d0c",
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "e33e7fe5",
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "41091ebf",
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "37ccb101",
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "4d67866",
"webgpu/shader/execution/binary/f32_multiplication.bin": "5d85a36c",
"webgpu/shader/execution/binary/f32_remainder.bin": "62f591b2",
"webgpu/shader/execution/binary/f32_subtraction.bin": "60fc275a",
"webgpu/shader/execution/binary/i32_arithmetic.bin": "a0b0a016",
"webgpu/shader/execution/binary/i32_comparison.bin": "f3d9b3f9",
"webgpu/shader/execution/binary/u32_arithmetic.bin": "16e32fd",
"webgpu/shader/execution/binary/u32_comparison.bin": "da33cc5d",
"webgpu/shader/execution/abs.bin": "1ead834c",
"webgpu/shader/execution/acos.bin": "e25802ba",
"webgpu/shader/execution/acosh.bin": "2321726f",
"webgpu/shader/execution/asin.bin": "d554a73b",
"webgpu/shader/execution/asinh.bin": "d2bdb21b",
"webgpu/shader/execution/atan.bin": "eb6476f3",
"webgpu/shader/execution/atan2.bin": "cf15e7fa",
"webgpu/shader/execution/atanh.bin": "6c57cc3",
"webgpu/shader/execution/bitcast.bin": "a25e9714",
"webgpu/shader/execution/ceil.bin": "8d120ea3",
"webgpu/shader/execution/clamp.bin": "a762ef58",
"webgpu/shader/execution/cos.bin": "a859da89",
"webgpu/shader/execution/cosh.bin": "86abdd85",
"webgpu/shader/execution/cross.bin": "e4556729",
"webgpu/shader/execution/degrees.bin": "1fa19a41",
"webgpu/shader/execution/determinant.bin": "108c3d65",
"webgpu/shader/execution/distance.bin": "77a1baa6",
"webgpu/shader/execution/dot.bin": "d4ac2e8a",
"webgpu/shader/execution/exp.bin": "15539afd",
"webgpu/shader/execution/exp2.bin": "7f6a8523",
"webgpu/shader/execution/faceForward.bin": "e7b35f43",
"webgpu/shader/execution/floor.bin": "b26656ca",
"webgpu/shader/execution/fma.bin": "5a70c683",
"webgpu/shader/execution/fract.bin": "23c0d5ec",
"webgpu/shader/execution/frexp.bin": "d28e66be",
"webgpu/shader/execution/inverseSqrt.bin": "9f297854",
"webgpu/shader/execution/ldexp.bin": "638db0c7",
"webgpu/shader/execution/length.bin": "7d237c62",
"webgpu/shader/execution/log.bin": "70720bf0",
"webgpu/shader/execution/log2.bin": "93a309be",
"webgpu/shader/execution/max.bin": "36eb4779",
"webgpu/shader/execution/min.bin": "ca772bf1",
"webgpu/shader/execution/mix.bin": "ecbf61ae",
"webgpu/shader/execution/modf.bin": "6ddea900",
"webgpu/shader/execution/normalize.bin": "d3e47c61",
"webgpu/shader/execution/pack2x16float.bin": "e6859c1a",
"webgpu/shader/execution/pow.bin": "a58be71c",
"webgpu/shader/execution/quantizeToF16.bin": "eca85bca",
"webgpu/shader/execution/radians.bin": "a216c9aa",
"webgpu/shader/execution/reflect.bin": "ebce9830",
"webgpu/shader/execution/refract.bin": "59d1e5d6",
"webgpu/shader/execution/round.bin": "9389a090",
"webgpu/shader/execution/saturate.bin": "7ca4b681",
"webgpu/shader/execution/sign.bin": "1f4eeb34",
"webgpu/shader/execution/sin.bin": "a1e234b4",
"webgpu/shader/execution/sinh.bin": "1a62054b",
"webgpu/shader/execution/smoothstep.bin": "d5824fd6",
"webgpu/shader/execution/sqrt.bin": "66f21d02",
"webgpu/shader/execution/step.bin": "310cb6c7",
"webgpu/shader/execution/tan.bin": "1e26f533",
"webgpu/shader/execution/tanh.bin": "4c546d1c",
"webgpu/shader/execution/transpose.bin": "7bef2494",
"webgpu/shader/execution/trunc.bin": "e72535eb",
"webgpu/shader/execution/unpack2x16float.bin": "593d88c6",
"webgpu/shader/execution/unpack2x16snorm.bin": "9ebd3e40",
"webgpu/shader/execution/unpack2x16unorm.bin": "83a36fa9",
"webgpu/shader/execution/unpack4x8snorm.bin": "41b12606",
"webgpu/shader/execution/unpack4x8unorm.bin": "96f1850b",
"webgpu/shader/execution/unary/af_arithmetic.bin": "6fa1d84a",
"webgpu/shader/execution/unary/af_assignment.bin": "98c8f82a",
"webgpu/shader/execution/unary/bool_conversion.bin": "dd71f171",
"webgpu/shader/execution/unary/f16_arithmetic.bin": "2f2d38fc",
"webgpu/shader/execution/unary/f16_conversion.bin": "70c94538",
"webgpu/shader/execution/unary/f32_arithmetic.bin": "db90c01c",
"webgpu/shader/execution/unary/f32_conversion.bin": "81912140",
"webgpu/shader/execution/unary/i32_arithmetic.bin": "c69716e2",
"webgpu/shader/execution/unary/i32_conversion.bin": "83218e69",
"webgpu/shader/execution/unary/u32_conversion.bin": "8f5bad00",
"webgpu/shader/execution/unary/ai_assignment.bin": "c7e6ac33",
"webgpu/shader/execution/binary/ai_arithmetic.bin": "81c11ec2",
"webgpu/shader/execution/unary/ai_arithmetic.bin": "3d27dc97"
"webgpu/shader/execution/binary/af_addition.bin": "25dcfcce",
"webgpu/shader/execution/binary/af_logical.bin": "409d37cf",
"webgpu/shader/execution/binary/af_division.bin": "bfcb23bd",
"webgpu/shader/execution/binary/af_matrix_addition.bin": "cefea21a",
"webgpu/shader/execution/binary/af_matrix_subtraction.bin": "624d816d",
"webgpu/shader/execution/binary/af_multiplication.bin": "34077746",
"webgpu/shader/execution/binary/af_remainder.bin": "9eddf765",
"webgpu/shader/execution/binary/af_subtraction.bin": "629bbf4",
"webgpu/shader/execution/binary/f16_addition.bin": "e3ff1263",
"webgpu/shader/execution/binary/f16_logical.bin": "99c0a0ed",
"webgpu/shader/execution/binary/f16_division.bin": "c0f3376",
"webgpu/shader/execution/binary/f16_matrix_addition.bin": "3054016e",
"webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin": "9cb6bbb9",
"webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin": "82f32c1d",
"webgpu/shader/execution/binary/f16_matrix_subtraction.bin": "29e9e0c7",
"webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin": "109260c1",
"webgpu/shader/execution/binary/f16_multiplication.bin": "39287c38",
"webgpu/shader/execution/binary/f16_remainder.bin": "98b48517",
"webgpu/shader/execution/binary/f16_subtraction.bin": "a4975dc4",
"webgpu/shader/execution/binary/f32_addition.bin": "b0e6fddd",
"webgpu/shader/execution/binary/f32_logical.bin": "71a0f0be",
"webgpu/shader/execution/binary/f32_division.bin": "29a37cf9",
"webgpu/shader/execution/binary/f32_matrix_addition.bin": "76e48aa9",
"webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin": "37f3a30b",
"webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin": "f00c4cd8",
"webgpu/shader/execution/binary/f32_matrix_subtraction.bin": "25553482",
"webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin": "26750bd3",
"webgpu/shader/execution/binary/f32_multiplication.bin": "68a7516b",
"webgpu/shader/execution/binary/f32_remainder.bin": "fb22b625",
"webgpu/shader/execution/binary/f32_subtraction.bin": "2e26b05f",
"webgpu/shader/execution/binary/i32_arithmetic.bin": "9256ccab",
"webgpu/shader/execution/binary/i32_comparison.bin": "c813abfa",
"webgpu/shader/execution/binary/u32_arithmetic.bin": "498f877e",
"webgpu/shader/execution/binary/u32_comparison.bin": "d69e1738",
"webgpu/shader/execution/abs.bin": "a6b6fed1",
"webgpu/shader/execution/acos.bin": "2a8f33b0",
"webgpu/shader/execution/acosh.bin": "3b39f532",
"webgpu/shader/execution/asin.bin": "94c67af3",
"webgpu/shader/execution/asinh.bin": "34c8547a",
"webgpu/shader/execution/atan.bin": "c5f98dae",
"webgpu/shader/execution/atan2.bin": "5c666ada",
"webgpu/shader/execution/atanh.bin": "5efbba8b",
"webgpu/shader/execution/bitcast.bin": "e90abd26",
"webgpu/shader/execution/ceil.bin": "fe43b603",
"webgpu/shader/execution/clamp.bin": "f4ec869a",
"webgpu/shader/execution/cos.bin": "78f30673",
"webgpu/shader/execution/cosh.bin": "15c18b89",
"webgpu/shader/execution/cross.bin": "72823897",
"webgpu/shader/execution/degrees.bin": "3b06fea4",
"webgpu/shader/execution/determinant.bin": "f0f66549",
"webgpu/shader/execution/distance.bin": "593c41fb",
"webgpu/shader/execution/dot.bin": "3eee146b",
"webgpu/shader/execution/exp.bin": "7f926769",
"webgpu/shader/execution/exp2.bin": "715c82a",
"webgpu/shader/execution/faceForward.bin": "8a365384",
"webgpu/shader/execution/floor.bin": "7b9a6254",
"webgpu/shader/execution/fma.bin": "88549fc7",
"webgpu/shader/execution/fract.bin": "e4eff2f9",
"webgpu/shader/execution/frexp.bin": "18a53421",
"webgpu/shader/execution/inverseSqrt.bin": "71016a37",
"webgpu/shader/execution/ldexp.bin": "450c6068",
"webgpu/shader/execution/length.bin": "62190368",
"webgpu/shader/execution/log.bin": "c4b1985b",
"webgpu/shader/execution/log2.bin": "28ccd982",
"webgpu/shader/execution/max.bin": "ba573f18",
"webgpu/shader/execution/min.bin": "5a834580",
"webgpu/shader/execution/mix.bin": "bf942d40",
"webgpu/shader/execution/modf.bin": "a8de3f36",
"webgpu/shader/execution/normalize.bin": "4bf84190",
"webgpu/shader/execution/pack2x16float.bin": "cc42ef45",
"webgpu/shader/execution/pow.bin": "6e8d08d1",
"webgpu/shader/execution/quantizeToF16.bin": "8c615e93",
"webgpu/shader/execution/radians.bin": "624ff571",
"webgpu/shader/execution/reflect.bin": "d0d624ae",
"webgpu/shader/execution/refract.bin": "3dd68359",
"webgpu/shader/execution/round.bin": "502c36a8",
"webgpu/shader/execution/saturate.bin": "be4cf88f",
"webgpu/shader/execution/sign.bin": "91310555",
"webgpu/shader/execution/sin.bin": "441d6be3",
"webgpu/shader/execution/sinh.bin": "4ebaa2e7",
"webgpu/shader/execution/smoothstep.bin": "6298e644",
"webgpu/shader/execution/sqrt.bin": "3cf64df1",
"webgpu/shader/execution/step.bin": "90148c99",
"webgpu/shader/execution/tan.bin": "e753749c",
"webgpu/shader/execution/tanh.bin": "62c99641",
"webgpu/shader/execution/transpose.bin": "2a4448c6",
"webgpu/shader/execution/trunc.bin": "ed9a0d22",
"webgpu/shader/execution/unpack2x16float.bin": "e81297f7",
"webgpu/shader/execution/unpack2x16snorm.bin": "513f9a8b",
"webgpu/shader/execution/unpack2x16unorm.bin": "8b56d0ce",
"webgpu/shader/execution/unpack4x8snorm.bin": "51af8a63",
"webgpu/shader/execution/unpack4x8unorm.bin": "302cf4a6",
"webgpu/shader/execution/unary/af_arithmetic.bin": "cd4618d",
"webgpu/shader/execution/unary/af_assignment.bin": "7d5de0f1",
"webgpu/shader/execution/unary/bool_conversion.bin": "401fb8c5",
"webgpu/shader/execution/unary/f16_arithmetic.bin": "ad86d013",
"webgpu/shader/execution/unary/f16_conversion.bin": "86e35a85",
"webgpu/shader/execution/unary/f32_arithmetic.bin": "fe97afd1",
"webgpu/shader/execution/unary/f32_conversion.bin": "97730c3c",
"webgpu/shader/execution/unary/i32_arithmetic.bin": "69f783bb",
"webgpu/shader/execution/unary/i32_conversion.bin": "4fec061e",
"webgpu/shader/execution/unary/u32_conversion.bin": "1a298dea",
"webgpu/shader/execution/unary/ai_assignment.bin": "1c2edca2",
"webgpu/shader/execution/binary/ai_arithmetic.bin": "657f2fb7",
"webgpu/shader/execution/unary/ai_arithmetic.bin": "216769d9",
"webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin": "544f4363",
"webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin": "14212e77",
"webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin": "57f19c15"
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 7 additions & 7 deletions src/unittests/conversion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ import {
i32,
kFloat16Format,
kFloat32Format,
Matrix,
MatrixValue,
numbersApproximatelyEqual,
pack2x16float,
pack2x16snorm,
pack2x16unorm,
pack4x8snorm,
pack4x8unorm,
packRGB9E5UFloat,
Scalar,
ScalarValue,
toMatrix,
u32,
unpackRGB9E5UFloat,
vec2,
vec3,
vec4,
Vector,
VectorValue,
} from '../webgpu/util/conversion.js';

import { UnitTest } from './unit_test.js';
Expand Down Expand Up @@ -191,7 +191,7 @@ g.test('floatBitsToULPFromZero,32').fn(t => {
});

g.test('scalarWGSL').fn(t => {
const cases: Array<[Scalar, string]> = [
const cases: Array<[ScalarValue, string]> = [
[f32(0.0), '0.0f'],
// The number -0.0 can be remapped to 0.0 when stored in a Scalar
// object. It is not possible to guarantee that '-0.0f' will
Expand Down Expand Up @@ -227,7 +227,7 @@ expect: ${expect}`
});

g.test('vectorWGSL').fn(t => {
const cases: Array<[Vector, string]> = [
const cases: Array<[VectorValue, string]> = [
[vec2(f32(42.0), f32(24.0)), 'vec2(42.0f, 24.0f)'],
[vec2(f16Bits(0x5140), f16Bits(0x4e00)), 'vec2(42.0h, 24.0h)'],
[vec2(u32(42), u32(24)), 'vec2(42u, 24u)'],
Expand Down Expand Up @@ -261,7 +261,7 @@ expect: ${expect}`
});

g.test('matrixWGSL').fn(t => {
const cases: Array<[Matrix, string]> = [
const cases: Array<[MatrixValue, string]> = [
[
toMatrix(
[
Expand Down Expand Up @@ -391,7 +391,7 @@ g.test('constructorMatrix')
return [...Array(rows).keys()].map(r => scalar_builder(c * cols + r));
});

const got = new Matrix(elements);
const got = new MatrixValue(elements);
const got_type = got.type;
t.expect(
got_type.cols === cols,
Expand Down
26 changes: 20 additions & 6 deletions src/unittests/floating_point.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7193,7 +7193,7 @@ g.test('subtractionMatrixMatrixInterval')
g.test('multiplicationMatrixMatrixInterval')
.params(u =>
u
.combine('trait', ['f32', 'f16'] as const)
.combine('trait', ['f32', 'f16', 'abstract'] as const)
.beginSubcases()
.combineWithParams<MatrixPairToMatrixCase>([
// Only testing that different shapes of matrices are handled correctly
Expand Down Expand Up @@ -7768,12 +7768,26 @@ const kMultiplicationMatrixScalarIntervalCases = {
],
},
] as MatrixScalarToMatrixCase[],
abstract: [
// From https://github.com/gpuweb/cts/issues/3044
{
matrix: [
[kValue.f64.negative.min, 0],
[0, 0],
],
scalar: kValue.f64.negative.subnormal.min,
expected: [
[[0, reinterpretU64AsF64(0x400ffffffffffffdn)], 0], // [[0, 3.9999995...], 0],
[0, 0],
],
},
] as MatrixScalarToMatrixCase[],
} as const;

g.test('multiplicationMatrixScalarInterval')
.params(u =>
u
.combine('trait', ['f32', 'f16'] as const)
.combine('trait', ['f32', 'f16', 'abstract'] as const)
.beginSubcases()
.expandWithParams<MatrixScalarToMatrixCase>(p => {
const trait = FP[p.trait];
Expand Down Expand Up @@ -7945,7 +7959,7 @@ interface MatrixVectorToVectorCase {
g.test('multiplicationMatrixVectorInterval')
.params(u =>
u
.combine('trait', ['f32', 'f16'] as const)
.combine('trait', ['f32', 'f16', 'abstract'] as const)
.beginSubcases()
.combineWithParams<MatrixVectorToVectorCase>([
// Only testing that different shapes of matrices are handled correctly
Expand Down Expand Up @@ -8062,16 +8076,16 @@ interface VectorMatrixToVectorCase {
g.test('multiplicationVectorMatrixInterval')
.params(u =>
u
.combine('trait', ['f32', 'f16'] as const)
.combine('trait', ['f32', 'f16', 'abstract'] as const)
.beginSubcases()
.combineWithParams<VectorMatrixToVectorCase>([
// Only testing that different shapes of matrices are handled correctly
// here, to reduce test duplication.
// multiplicationVectorMatrixInterval uses DotIntervalOp for calculating
// intervals, so the testing for dotInterval covers the actual interval
// calculations.
// Keep all expected result integer no larger than 2047 to ensure that all result is exactly
// represeantable in both f32 and f16.
// Keep all expected result integer no larger than 2047 to ensure that
// all result is exactly representable in both f32 and f16.
{
vector: [1, 2],
matrix: [
Expand Down
12 changes: 6 additions & 6 deletions src/webgpu/api/operation/render_pipeline/sample_mask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { makeTestGroup } from '../../../../common/framework/test_group.js';
import { assert, range } from '../../../../common/util/util.js';
import { GPUTest, TextureTestMixin } from '../../../gpu_test.js';
import { checkElementsPassPredicate, checkElementsEqual } from '../../../util/check_contents.js';
import { TypeF32, TypeU32 } from '../../../util/conversion.js';
import { Type } from '../../../util/conversion.js';
import { TexelView } from '../../../util/texture/texel_view.js';

const kColors = [
Expand Down Expand Up @@ -438,7 +438,7 @@ class F extends TextureTestMixin(GPUTest) {
fragmentShaderOutputMask: number
) {
const buffer = this.copy2DTextureToBufferUsingComputePass(
TypeF32, // correspond to 'rgba8unorm' format
Type.f32, // correspond to 'rgba8unorm' format
4,
texture.createView(),
sampleCount
Expand All @@ -464,7 +464,7 @@ class F extends TextureTestMixin(GPUTest) {
const buffer = this.copy2DTextureToBufferUsingComputePass(
// Use f32 as the scalar type for depth (depth24plus, depth32float)
// Use u32 as the scalar type for stencil (stencil8)
aspect === 'depth-only' ? TypeF32 : TypeU32,
aspect === 'depth-only' ? Type.f32 : Type.u32,
1,
depthStencilTexture.createView({ aspect }),
sampleCount
Expand Down Expand Up @@ -705,7 +705,7 @@ color' <= color.
);

const colorBuffer = t.copy2DTextureToBufferUsingComputePass(
TypeF32, // correspond to 'rgba8unorm' format
Type.f32, // correspond to 'rgba8unorm' format
4,
color.createView(),
sampleCount
Expand All @@ -717,7 +717,7 @@ color' <= color.
colorResultPromises.push(colorResult);

const depthBuffer = t.copy2DTextureToBufferUsingComputePass(
TypeF32, // correspond to 'depth24plus-stencil8' format
Type.f32, // correspond to 'depth24plus-stencil8' format
1,
depthStencil.createView({ aspect: 'depth-only' }),
sampleCount
Expand All @@ -729,7 +729,7 @@ color' <= color.
depthResultPromises.push(depthResult);

const stencilBuffer = t.copy2DTextureToBufferUsingComputePass(
TypeU32, // correspond to 'depth24plus-stencil8' format
Type.u32, // correspond to 'depth24plus-stencil8' format
1,
depthStencil.createView({ aspect: 'stencil-only' }),
sampleCount
Expand Down
Loading

0 comments on commit 491c328

Please sign in to comment.