From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../cts/checkout/src/common/framework/fixture.ts | 17 +- .../checkout/src/common/framework/test_config.ts | 18 + .../checkout/src/common/internal/file_loader.ts | 4 +- .../src/common/internal/logging/log_message.ts | 51 +- .../checkout/src/common/internal/logging/logger.ts | 5 +- .../checkout/src/common/internal/logging/result.ts | 22 +- .../common/internal/logging/test_case_recorder.ts | 8 +- .../checkout/src/common/internal/query/compare.ts | 5 +- .../src/common/internal/query/parseQuery.ts | 43 +- .../checkout/src/common/internal/query/query.ts | 6 +- .../cts/checkout/src/common/internal/test_group.ts | 10 +- .../src/common/internal/test_suite_listing.ts | 2 +- .../tests/cts/checkout/src/common/internal/tree.ts | 7 +- .../src/common/internal/websocket_logger.ts | 13 +- .../cts/checkout/src/common/runtime/cmdline.ts | 52 +- .../checkout/src/common/runtime/helper/options.ts | 61 +- .../common/runtime/helper/test_worker-worker.ts | 49 +- .../src/common/runtime/helper/test_worker.ts | 202 +- .../src/common/runtime/helper/utils_worker.ts | 35 + .../src/common/runtime/helper/wrap_for_worker.ts | 54 + .../cts/checkout/src/common/runtime/server.ts | 62 +- .../cts/checkout/src/common/runtime/standalone.ts | 53 +- .../tests/cts/checkout/src/common/runtime/wpt.ts | 18 +- .../tests/cts/checkout/src/common/tools/crawl.ts | 56 +- .../cts/checkout/src/common/tools/dev_server.ts | 13 + .../cts/checkout/src/common/tools/gen_cache.ts | 278 ++- .../cts/checkout/src/common/tools/gen_listings.ts | 11 +- .../common/tools/gen_listings_and_webworkers.ts | 89 + .../checkout/src/common/tools/gen_wpt_cts_html.ts | 135 +- .../src/common/tools/merge_listing_times.ts | 12 +- .../cts/checkout/src/common/tools/validate.ts | 29 +- .../tests/cts/checkout/src/common/util/crc32.ts | 57 + .../cts/checkout/src/common/util/parse_imports.ts | 36 + .../tests/cts/checkout/src/common/util/util.ts | 5 +- .../tests/cts/checkout/src/external/README.md | 2 +- .../src/external/petamoriken/float16/LICENSE.txt | 2 +- .../src/external/petamoriken/float16/float16.d.ts | 27 + .../src/external/petamoriken/float16/float16.js | 181 +- .../tests/cts/checkout/src/resources/README.md | 100 +- .../cts/checkout/src/resources/cache/hashes.json | 111 + .../cache/webgpu/shader/execution/abs.bin | Bin 0 -> 17976 bytes .../cache/webgpu/shader/execution/acos.bin | Bin 0 -> 26440 bytes .../cache/webgpu/shader/execution/acosh.bin | Bin 0 -> 30248 bytes .../cache/webgpu/shader/execution/asin.bin | Bin 0 -> 26440 bytes .../cache/webgpu/shader/execution/asinh.bin | Bin 0 -> 11664 bytes .../cache/webgpu/shader/execution/atan.bin | Bin 0 -> 20128 bytes .../cache/webgpu/shader/execution/atan2.bin | Bin 0 -> 51608 bytes .../cache/webgpu/shader/execution/atanh.bin | Bin 0 -> 21104 bytes .../webgpu/shader/execution/binary/af_addition.bin | Bin 0 -> 237960 bytes .../webgpu/shader/execution/binary/af_division.bin | Bin 0 -> 77496 bytes .../webgpu/shader/execution/binary/af_logical.bin | Bin 0 -> 12456 bytes .../shader/execution/binary/af_matrix_addition.bin | Bin 0 -> 175672 bytes .../binary/af_matrix_matrix_multiplication.bin | Bin 0 -> 82608 bytes .../binary/af_matrix_scalar_multiplication.bin | Bin 0 -> 291528 bytes .../execution/binary/af_matrix_subtraction.bin | Bin 0 -> 181112 bytes .../binary/af_matrix_vector_multiplication.bin | Bin 0 -> 152528 bytes .../shader/execution/binary/af_multiplication.bin | Bin 0 -> 207864 bytes .../shader/execution/binary/af_remainder.bin | Bin 0 -> 77496 bytes .../shader/execution/binary/af_subtraction.bin | Bin 0 -> 237960 bytes .../shader/execution/binary/ai_arithmetic.bin | Bin 0 -> 831992 bytes .../shader/execution/binary/f16_addition.bin | Bin 0 -> 169680 bytes .../shader/execution/binary/f16_division.bin | Bin 0 -> 120856 bytes .../webgpu/shader/execution/binary/f16_logical.bin | Bin 0 -> 15912 bytes .../execution/binary/f16_matrix_addition.bin | Bin 0 -> 557464 bytes .../binary/f16_matrix_matrix_multiplication.bin | Bin 0 -> 1481368 bytes .../binary/f16_matrix_scalar_multiplication.bin | Bin 0 -> 906440 bytes .../execution/binary/f16_matrix_subtraction.bin | Bin 0 -> 534232 bytes .../binary/f16_matrix_vector_multiplication.bin | Bin 0 -> 601680 bytes .../shader/execution/binary/f16_multiplication.bin | Bin 0 -> 171072 bytes .../shader/execution/binary/f16_remainder.bin | Bin 0 -> 118944 bytes .../shader/execution/binary/f16_subtraction.bin | Bin 0 -> 169680 bytes .../shader/execution/binary/f32_addition.bin | Bin 0 -> 279984 bytes .../shader/execution/binary/f32_division.bin | Bin 0 -> 174960 bytes .../webgpu/shader/execution/binary/f32_logical.bin | Bin 0 -> 18984 bytes .../execution/binary/f32_matrix_addition.bin | Bin 0 -> 991896 bytes .../binary/f32_matrix_matrix_multiplication.bin | Bin 0 -> 2510560 bytes .../binary/f32_matrix_scalar_multiplication.bin | Bin 0 -> 1534768 bytes .../execution/binary/f32_matrix_subtraction.bin | Bin 0 -> 995984 bytes .../binary/f32_matrix_vector_multiplication.bin | Bin 0 -> 950336 bytes .../shader/execution/binary/f32_multiplication.bin | Bin 0 -> 257976 bytes .../shader/execution/binary/f32_remainder.bin | Bin 0 -> 171384 bytes .../shader/execution/binary/f32_subtraction.bin | Bin 0 -> 279968 bytes .../shader/execution/binary/i32_arithmetic.bin | Bin 0 -> 727864 bytes .../shader/execution/binary/i32_comparison.bin | Bin 0 -> 3872 bytes .../shader/execution/binary/u32_arithmetic.bin | Bin 0 -> 225816 bytes .../shader/execution/binary/u32_comparison.bin | Bin 0 -> 2192 bytes .../cache/webgpu/shader/execution/bitcast.bin | Bin 0 -> 2240896 bytes .../cache/webgpu/shader/execution/ceil.bin | Bin 0 -> 16016 bytes .../cache/webgpu/shader/execution/clamp.bin | Bin 0 -> 1048136 bytes .../cache/webgpu/shader/execution/cos.bin | Bin 0 -> 20176 bytes .../cache/webgpu/shader/execution/cosh.bin | Bin 0 -> 14904 bytes .../cache/webgpu/shader/execution/cross.bin | Bin 0 -> 829096 bytes .../cache/webgpu/shader/execution/degrees.bin | Bin 0 -> 18048 bytes .../cache/webgpu/shader/execution/derivatives.bin | Bin 0 -> 11264 bytes .../cache/webgpu/shader/execution/determinant.bin | Bin 0 -> 9944 bytes .../cache/webgpu/shader/execution/distance.bin | Bin 0 -> 1731496 bytes .../cache/webgpu/shader/execution/dot.bin | Bin 0 -> 469272 bytes .../cache/webgpu/shader/execution/exp.bin | Bin 0 -> 34592 bytes .../cache/webgpu/shader/execution/exp2.bin | Bin 0 -> 34592 bytes .../cache/webgpu/shader/execution/faceForward.bin | Bin 0 -> 4214688 bytes .../cache/webgpu/shader/execution/floor.bin | Bin 0 -> 16016 bytes .../cache/webgpu/shader/execution/fma.bin | Bin 0 -> 886720 bytes .../cache/webgpu/shader/execution/fract.bin | Bin 0 -> 16408 bytes .../cache/webgpu/shader/execution/frexp.bin | Bin 0 -> 47072 bytes .../cache/webgpu/shader/execution/inverseSqrt.bin | Bin 0 -> 78424 bytes .../cache/webgpu/shader/execution/ldexp.bin | Bin 0 -> 33096 bytes .../cache/webgpu/shader/execution/length.bin | Bin 0 -> 35696 bytes .../cache/webgpu/shader/execution/log.bin | Bin 0 -> 148848 bytes .../cache/webgpu/shader/execution/log2.bin | Bin 0 -> 148848 bytes .../cache/webgpu/shader/execution/max.bin | Bin 0 -> 37944 bytes .../cache/webgpu/shader/execution/min.bin | Bin 0 -> 37944 bytes .../cache/webgpu/shader/execution/mix.bin | Bin 0 -> 5817432 bytes .../cache/webgpu/shader/execution/modf.bin | Bin 0 -> 82448 bytes .../cache/webgpu/shader/execution/normalize.bin | Bin 0 -> 47608 bytes .../webgpu/shader/execution/pack2x16float.bin | Bin 0 -> 1791400 bytes .../cache/webgpu/shader/execution/pow.bin | Bin 0 -> 1308224 bytes .../webgpu/shader/execution/quantizeToF16.bin | Bin 0 -> 8904 bytes .../cache/webgpu/shader/execution/radians.bin | Bin 0 -> 10992 bytes .../cache/webgpu/shader/execution/reflect.bin | Bin 0 -> 277720 bytes .../cache/webgpu/shader/execution/refract.bin | Bin 0 -> 2828888 bytes .../cache/webgpu/shader/execution/round.bin | Bin 0 -> 14816 bytes .../cache/webgpu/shader/execution/saturate.bin | Bin 0 -> 17096 bytes .../cache/webgpu/shader/execution/sign.bin | Bin 0 -> 21224 bytes .../cache/webgpu/shader/execution/sin.bin | Bin 0 -> 20176 bytes .../cache/webgpu/shader/execution/sinh.bin | Bin 0 -> 14904 bytes .../cache/webgpu/shader/execution/smoothstep.bin | Bin 0 -> 629408 bytes .../cache/webgpu/shader/execution/sqrt.bin | Bin 0 -> 10024 bytes .../cache/webgpu/shader/execution/step.bin | Bin 0 -> 33160 bytes .../cache/webgpu/shader/execution/tan.bin | Bin 0 -> 21776 bytes .../cache/webgpu/shader/execution/tanh.bin | Bin 0 -> 11448 bytes .../cache/webgpu/shader/execution/transpose.bin | Bin 0 -> 129192 bytes .../cache/webgpu/shader/execution/trunc.bin | Bin 0 -> 14696 bytes .../shader/execution/unary/af_arithmetic.bin | Bin 0 -> 30376 bytes .../shader/execution/unary/af_assignment.bin | Bin 0 -> 10296 bytes .../shader/execution/unary/ai_arithmetic.bin | Bin 0 -> 3256 bytes .../shader/execution/unary/ai_assignment.bin | Bin 0 -> 6936 bytes .../shader/execution/unary/bool_conversion.bin | Bin 0 -> 6480 bytes .../shader/execution/unary/f16_arithmetic.bin | Bin 0 -> 15208 bytes .../shader/execution/unary/f16_conversion.bin | Bin 0 -> 97912 bytes .../shader/execution/unary/f32_arithmetic.bin | Bin 0 -> 19544 bytes .../shader/execution/unary/f32_conversion.bin | Bin 0 -> 105744 bytes .../shader/execution/unary/i32_arithmetic.bin | Bin 0 -> 1648 bytes .../shader/execution/unary/i32_conversion.bin | Bin 0 -> 11856 bytes .../shader/execution/unary/u32_conversion.bin | Bin 0 -> 10680 bytes .../webgpu/shader/execution/unpack2x16float.bin | Bin 0 -> 4832 bytes .../webgpu/shader/execution/unpack2x16snorm.bin | Bin 0 -> 4968 bytes .../webgpu/shader/execution/unpack2x16unorm.bin | Bin 0 -> 4968 bytes .../webgpu/shader/execution/unpack4x8snorm.bin | Bin 0 -> 7416 bytes .../webgpu/shader/execution/unpack4x8unorm.bin | Bin 0 -> 7416 bytes .../src/resources/four-colors-h264-bt601-hflip.mp4 | Bin 0 -> 3174 bytes .../four-colors-h264-bt601-rotate-180.mp4 | Bin 16261 -> 3113 bytes .../four-colors-h264-bt601-rotate-270.mp4 | Bin 16261 -> 3211 bytes .../resources/four-colors-h264-bt601-rotate-90.mp4 | Bin 16261 -> 3204 bytes .../src/resources/four-colors-h264-bt601-vflip.mp4 | Bin 0 -> 3174 bytes .../src/resources/four-colors-h264-bt601.mp4 | Bin 16261 -> 3174 bytes .../src/resources/four-colors-theora-bt601.ogv | Bin 44488 -> 0 bytes .../src/resources/four-colors-vp8-bt601.webm | Bin 17910 -> 2421 bytes .../src/resources/four-colors-vp9-bt601-hflip.mp4 | Bin 0 -> 2077 bytes .../resources/four-colors-vp9-bt601-rotate-180.mp4 | Bin 0 -> 2079 bytes .../resources/four-colors-vp9-bt601-rotate-270.mp4 | Bin 0 -> 2016 bytes .../resources/four-colors-vp9-bt601-rotate-90.mp4 | Bin 0 -> 2079 bytes .../src/resources/four-colors-vp9-bt601-vflip.mp4 | Bin 0 -> 2077 bytes .../src/resources/four-colors-vp9-bt601.mp4 | Bin 0 -> 2077 bytes .../src/resources/four-colors-vp9-bt601.webm | Bin 13116 -> 1847 bytes .../src/resources/four-colors-vp9-bt709.webm | Bin 12584 -> 1789 bytes .../cts/checkout/src/unittests/conversion.spec.ts | 14 +- .../tests/cts/checkout/src/unittests/crc32.spec.ts | 28 + .../checkout/src/unittests/floating_point.spec.ts | 2289 +++++++++++--------- .../tests/cts/checkout/src/unittests/maths.spec.ts | 44 +- .../checkout/src/unittests/parse_imports.spec.ts | 79 + .../checkout/src/unittests/serialization.spec.ts | 69 + .../cts/checkout/src/unittests/texture_ok.spec.ts | 31 +- .../api/operation/adapter/requestDevice.spec.ts | 59 + .../command_buffer/copyTextureToTexture.spec.ts | 113 +- .../operation/command_buffer/image_copy.spec.ts | 94 +- .../command_buffer/queries/occlusionQuery.spec.ts | 8 +- .../texture/readonly_depth_stencil.spec.ts | 329 +++ .../src/webgpu/api/operation/reflection.spec.ts | 293 ++- .../operation/render_pipeline/sample_mask.spec.ts | 24 +- .../operation/rendering/3d_texture_slices.spec.ts | 363 ++++ .../operation/rendering/color_target_state.spec.ts | 8 +- .../webgpu/api/operation/rendering/depth.spec.ts | 9 +- .../api/operation/rendering/depth_bias.spec.ts | 12 + .../operation/rendering/depth_clip_clamp.spec.ts | 20 +- .../resource_init/check_texture/by_copy.ts | 3 +- .../resource_init/check_texture/by_ds_test.ts | 3 +- .../resource_init/check_texture/by_sampling.ts | 38 +- .../check_texture/texture_zero_init_test.ts | 548 +++++ .../operation/resource_init/texture_zero.spec.ts | 554 +---- .../shader_module/compilation_info.spec.ts | 39 +- .../operation/storage_texture/read_only.spec.ts | 626 ++++++ .../operation/storage_texture/read_write.spec.ts | 385 ++++ .../texture_view/format_reinterpretation.spec.ts | 10 +- .../api/operation/texture_view/write.spec.ts | 347 ++- .../webgpu/api/validation/buffer/mapping.spec.ts | 39 +- .../capability_checks/features/query_types.spec.ts | 56 +- .../capability_checks/limits/limit_utils.ts | 119 +- .../capability_checks/limits/maxBindGroups.spec.ts | 156 +- .../limits/maxBindGroupsPlusVertexBuffers.spec.ts | 301 +++ .../limits/maxComputeWorkgroupStorageSize.spec.ts | 9 +- .../limits/maxInterStageShaderComponents.spec.ts | 8 +- .../maxSampledTexturesPerShaderStage.spec.ts | 50 +- .../limits/maxSamplersPerShaderStage.spec.ts | 54 +- .../limits/maxStorageBuffersPerShaderStage.spec.ts | 85 +- .../maxStorageTexturesPerShaderStage.spec.ts | 46 +- .../limits/maxUniformBuffersPerShaderStage.spec.ts | 46 +- .../limits/maxVertexBuffers.spec.ts | 68 +- .../webgpu/api/validation/compute_pipeline.spec.ts | 50 + .../webgpu/api/validation/createBindGroup.spec.ts | 49 +- .../api/validation/createBindGroupLayout.spec.ts | 47 +- .../webgpu/api/validation/createTexture.spec.ts | 43 +- .../src/webgpu/api/validation/createView.spec.ts | 11 +- .../encoding/cmds/copyTextureToTexture.spec.ts | 15 +- .../encoding/createRenderBundleEncoder.spec.ts | 44 +- .../validation/encoding/encoder_open_state.spec.ts | 14 +- .../pipeline_bind_group_compat.spec.ts | 343 ++- .../validation/encoding/queries/general.spec.ts | 42 +- .../api/validation/encoding/render_bundle.spec.ts | 14 +- .../src/webgpu/api/validation/error_scope.spec.ts | 18 +- .../gpu_external_texture_expiration.spec.ts | 35 +- .../webgpu/api/validation/image_copy/image_copy.ts | 4 +- .../validation/image_copy/texture_related.spec.ts | 2 +- .../api/validation/layout_shader_compat.spec.ts | 287 ++- .../CopyExternalImageToTexture.spec.ts | 4 +- .../validation/queue/destroyed/query_set.spec.ts | 53 +- .../api/validation/queue/destroyed/texture.spec.ts | 9 +- .../render_pass/attachment_compatibility.spec.ts | 7 - .../render_pass/render_pass_descriptor.spec.ts | 190 +- .../api/validation/render_pipeline/common.ts | 11 +- .../render_pipeline/depth_stencil_state.spec.ts | 12 +- .../render_pipeline/fragment_state.spec.ts | 77 +- .../validation/render_pipeline/inter_stage.spec.ts | 72 +- .../api/validation/render_pipeline/misc.spec.ts | 34 + .../render_pipeline/resource_compatibility.spec.ts | 95 + .../texture/in_pass_encoder.spec.ts | 269 ++- .../texture/in_render_common.spec.ts | 101 +- .../resource_usages/texture/in_render_misc.spec.ts | 307 ++- .../validation/shader_module/entry_point.spec.ts | 226 +- .../validation/state/device_lost/destroy.spec.ts | 12 +- .../validation/texture/bgra8unorm_storage.spec.ts | 31 - .../checkout/src/webgpu/api/validation/utils.ts | 275 +++ .../src/webgpu/api/validation/validation_test.ts | 25 +- .../cts/checkout/src/webgpu/capability_info.ts | 125 +- .../compat/api/validation/createBindGroup.spec.ts | 178 ++ .../api/validation/createBindGroupLayout.spec.ts | 34 + .../encoding/cmds/copyTextureToBuffer.spec.ts | 9 +- .../encoding/cmds/copyTextureToTexture.spec.ts | 94 + .../render_pipeline/depth_stencil_state.spec.ts | 53 + .../render_pipeline/shader_module.spec.ts | 207 ++ .../api/validation/texture/createTexture.spec.ts | 131 ++ .../tests/cts/checkout/src/webgpu/constants.ts | 5 + .../tests/cts/checkout/src/webgpu/format_info.ts | 1147 +++++++--- .../tests/cts/checkout/src/webgpu/gpu_test.ts | 232 +- .../checkout/src/webgpu/idl/constructable.spec.ts | 54 + .../cts/checkout/src/webgpu/listing_meta.json | 724 ++++++- .../cts/checkout/src/webgpu/multisample_info.ts | 75 + .../checkout/src/webgpu/print_environment.spec.ts | 70 + .../expression/access/array/index.spec.ts | 354 +++ .../expression/access/matrix/index.spec.ts | 200 ++ .../expression/access/structure/index.spec.ts | 508 +++++ .../expression/access/vector/components.spec.ts | 118 + .../expression/access/vector/index.spec.ts | 87 + .../expression/binary/af_addition.cache.ts | 54 + .../expression/binary/af_addition.spec.ts | 85 +- .../expression/binary/af_comparison.cache.ts | 90 + .../expression/binary/af_comparison.spec.ts | 141 +- .../expression/binary/af_division.cache.ts | 57 + .../expression/binary/af_division.spec.ts | 85 +- .../expression/binary/af_matrix_addition.cache.ts | 26 + .../expression/binary/af_matrix_addition.spec.ts | 34 +- .../af_matrix_matrix_multiplication.cache.ts | 29 + .../binary/af_matrix_matrix_multiplication.spec.ts | 45 + .../af_matrix_scalar_multiplication.cache.ts | 49 + .../binary/af_matrix_scalar_multiplication.spec.ts | 69 + .../binary/af_matrix_subtraction.cache.ts | 26 + .../binary/af_matrix_subtraction.spec.ts | 34 +- .../af_matrix_vector_multiplication.cache.ts | 51 + .../binary/af_matrix_vector_multiplication.spec.ts | 69 + .../expression/binary/af_multiplication.cache.ts | 54 + .../expression/binary/af_multiplication.spec.ts | 85 +- .../expression/binary/af_remainder.cache.ts | 57 + .../expression/binary/af_remainder.spec.ts | 83 +- .../expression/binary/af_subtraction.cache.ts | 54 + .../expression/binary/af_subtraction.spec.ts | 85 +- .../expression/binary/ai_arithmetic.cache.ts | 145 ++ .../expression/binary/ai_arithmetic.spec.ts | 303 +++ .../expression/binary/ai_comparison.spec.ts | 124 ++ .../shader/execution/expression/binary/binary.ts | 8 +- .../execution/expression/binary/bitwise.spec.ts | 505 ++++- .../expression/binary/bitwise_shift.spec.ts | 25 +- .../expression/binary/bool_logical.spec.ts | 18 +- .../expression/binary/f16_addition.cache.ts | 60 + .../expression/binary/f16_addition.spec.ts | 81 +- .../expression/binary/f16_comparison.cache.ts | 144 ++ .../expression/binary/f16_comparison.spec.ts | 159 +- .../expression/binary/f16_division.cache.ts | 60 + .../expression/binary/f16_division.spec.ts | 81 +- .../expression/binary/f16_matrix_addition.cache.ts | 23 + .../expression/binary/f16_matrix_addition.spec.ts | 34 +- .../f16_matrix_matrix_multiplication.cache.ts | 25 + .../f16_matrix_matrix_multiplication.spec.ts | 36 +- .../f16_matrix_scalar_multiplication.cache.ts | 44 + .../f16_matrix_scalar_multiplication.spec.ts | 59 +- .../binary/f16_matrix_subtraction.cache.ts | 23 + .../binary/f16_matrix_subtraction.spec.ts | 34 +- .../f16_matrix_vector_multiplication.cache.ts | 44 + .../f16_matrix_vector_multiplication.spec.ts | 59 +- .../expression/binary/f16_multiplication.cache.ts | 60 + .../expression/binary/f16_multiplication.spec.ts | 81 +- .../expression/binary/f16_remainder.cache.ts | 60 + .../expression/binary/f16_remainder.spec.ts | 81 +- .../expression/binary/f16_subtraction.cache.ts | 60 + .../expression/binary/f16_subtraction.spec.ts | 81 +- .../expression/binary/f32_addition.cache.ts | 60 + .../expression/binary/f32_addition.spec.ts | 81 +- .../expression/binary/f32_comparison.cache.ts | 144 ++ .../expression/binary/f32_comparison.spec.ts | 159 +- .../expression/binary/f32_division.cache.ts | 60 + .../expression/binary/f32_division.spec.ts | 81 +- .../expression/binary/f32_matrix_addition.cache.ts | 23 + .../expression/binary/f32_matrix_addition.spec.ts | 34 +- .../f32_matrix_matrix_multiplication.cache.ts | 25 + .../f32_matrix_matrix_multiplication.spec.ts | 36 +- .../f32_matrix_scalar_multiplication.cache.ts | 44 + .../f32_matrix_scalar_multiplication.spec.ts | 59 +- .../binary/f32_matrix_subtraction.cache.ts | 23 + .../binary/f32_matrix_subtraction.spec.ts | 34 +- .../f32_matrix_vector_multiplication.cache.ts | 44 + .../f32_matrix_vector_multiplication.spec.ts | 59 +- .../expression/binary/f32_multiplication.cache.ts | 60 + .../expression/binary/f32_multiplication.spec.ts | 81 +- .../expression/binary/f32_remainder.cache.ts | 64 + .../expression/binary/f32_remainder.spec.ts | 81 +- .../expression/binary/f32_subtraction.cache.ts | 60 + .../expression/binary/f32_subtraction.spec.ts | 81 +- .../expression/binary/i32_arithmetic.cache.ts | 306 +++ .../expression/binary/i32_arithmetic.spec.ts | 392 +--- .../expression/binary/i32_comparison.cache.ts | 21 + .../expression/binary/i32_comparison.spec.ts | 36 +- .../expression/binary/u32_arithmetic.cache.ts | 293 +++ .../expression/binary/u32_arithmetic.spec.ts | 379 +--- .../expression/binary/u32_comparison.cache.ts | 21 + .../expression/binary/u32_comparison.spec.ts | 36 +- .../execution/expression/call/builtin/abs.cache.ts | 26 + .../execution/expression/call/builtin/abs.spec.ts | 64 +- .../expression/call/builtin/acos.cache.ts | 24 + .../execution/expression/call/builtin/acos.spec.ts | 57 +- .../expression/call/builtin/acosh.cache.ts | 24 + .../expression/call/builtin/acosh.spec.ts | 56 +- .../execution/expression/call/builtin/all.spec.ts | 20 +- .../execution/expression/call/builtin/any.spec.ts | 20 +- .../expression/call/builtin/asin.cache.ts | 24 + .../execution/expression/call/builtin/asin.spec.ts | 57 +- .../expression/call/builtin/asinh.cache.ts | 18 + .../expression/call/builtin/asinh.spec.ts | 41 +- .../expression/call/builtin/atan.cache.ts | 25 + .../execution/expression/call/builtin/atan.spec.ts | 52 +- .../expression/call/builtin/atan2.cache.ts | 35 + .../expression/call/builtin/atan2.spec.ts | 56 +- .../expression/call/builtin/atanh.cache.ts | 32 + .../expression/call/builtin/atanh.spec.ts | 63 +- .../call/builtin/atomics/atomicAdd.spec.ts | 4 +- .../call/builtin/atomics/atomicAnd.spec.ts | 4 +- .../atomics/atomicCompareExchangeWeak.spec.ts | 18 +- .../call/builtin/atomics/atomicExchange.spec.ts | 8 +- .../call/builtin/atomics/atomicLoad.spec.ts | 4 +- .../call/builtin/atomics/atomicMax.spec.ts | 4 +- .../call/builtin/atomics/atomicMin.spec.ts | 4 +- .../call/builtin/atomics/atomicOr.spec.ts | 4 +- .../call/builtin/atomics/atomicStore.spec.ts | 8 +- .../call/builtin/atomics/atomicSub.spec.ts | 4 +- .../call/builtin/atomics/atomicXor.spec.ts | 4 +- .../expression/call/builtin/atomics/harness.ts | 7 +- .../expression/call/builtin/bitcast.cache.ts | 837 +++++++ .../expression/call/builtin/bitcast.spec.ts | 1142 +++------- .../execution/expression/call/builtin/builtin.ts | 8 +- .../expression/call/builtin/ceil.cache.ts | 26 + .../execution/expression/call/builtin/ceil.spec.ts | 79 +- .../expression/call/builtin/clamp.cache.ts | 131 ++ .../expression/call/builtin/clamp.spec.ts | 140 +- .../execution/expression/call/builtin/cos.cache.ts | 23 + .../execution/expression/call/builtin/cos.spec.ts | 57 +- .../expression/call/builtin/cosh.cache.ts | 23 + .../execution/expression/call/builtin/cosh.spec.ts | 47 +- .../call/builtin/countLeadingZeros.spec.ts | 6 +- .../expression/call/builtin/countOneBits.spec.ts | 6 +- .../call/builtin/countTrailingZeros.spec.ts | 6 +- .../expression/call/builtin/cross.cache.ts | 25 + .../expression/call/builtin/cross.spec.ts | 79 +- .../expression/call/builtin/degrees.cache.ts | 24 + .../expression/call/builtin/degrees.spec.ts | 52 +- .../expression/call/builtin/derivatives.cache.ts | 14 + .../expression/call/builtin/derivatives.ts | 215 ++ .../expression/call/builtin/determinant.cache.ts | 99 + .../expression/call/builtin/determinant.spec.ts | 112 +- .../expression/call/builtin/distance.cache.ts | 49 + .../expression/call/builtin/distance.spec.ts | 208 +- .../execution/expression/call/builtin/dot.cache.ts | 118 + .../execution/expression/call/builtin/dot.spec.ts | 238 +- .../expression/call/builtin/dot4I8Packed.spec.ts | 74 + .../expression/call/builtin/dot4U8Packed.spec.ts | 59 + .../execution/expression/call/builtin/dpdx.spec.ts | 16 +- .../expression/call/builtin/dpdxCoarse.spec.ts | 16 +- .../expression/call/builtin/dpdxFine.spec.ts | 16 +- .../execution/expression/call/builtin/dpdy.spec.ts | 16 +- .../expression/call/builtin/dpdyCoarse.spec.ts | 16 +- .../expression/call/builtin/dpdyFine.spec.ts | 16 +- .../execution/expression/call/builtin/exp.cache.ts | 44 + .../execution/expression/call/builtin/exp.spec.ts | 69 +- .../expression/call/builtin/exp2.cache.ts | 44 + .../execution/expression/call/builtin/exp2.spec.ts | 69 +- .../expression/call/builtin/extractBits.spec.ts | 20 +- .../expression/call/builtin/faceForward.cache.ts | 125 ++ .../expression/call/builtin/faceForward.spec.ts | 198 +- .../call/builtin/firstLeadingBit.spec.ts | 6 +- .../call/builtin/firstTrailingBit.spec.ts | 6 +- .../expression/call/builtin/floor.cache.ts | 26 + .../expression/call/builtin/floor.spec.ts | 61 +- .../execution/expression/call/builtin/fma.cache.ts | 26 + .../execution/expression/call/builtin/fma.spec.ts | 70 +- .../expression/call/builtin/fract.cache.ts | 50 + .../expression/call/builtin/fract.spec.ts | 81 +- .../expression/call/builtin/frexp.cache.ts | 103 + .../expression/call/builtin/frexp.spec.ts | 304 +-- .../expression/call/builtin/insertBits.spec.ts | 18 +- .../expression/call/builtin/inversesqrt.cache.ts | 44 + .../expression/call/builtin/inversesqrt.spec.ts | 60 +- .../expression/call/builtin/ldexp.cache.ts | 61 + .../expression/call/builtin/ldexp.spec.ts | 94 +- .../expression/call/builtin/length.cache.ts | 42 + .../expression/call/builtin/length.spec.ts | 146 +- .../execution/expression/call/builtin/log.cache.ts | 30 + .../execution/expression/call/builtin/log.spec.ts | 62 +- .../expression/call/builtin/log2.cache.ts | 30 + .../execution/expression/call/builtin/log2.spec.ts | 62 +- .../execution/expression/call/builtin/max.cache.ts | 18 + .../execution/expression/call/builtin/max.spec.ts | 106 +- .../execution/expression/call/builtin/min.cache.ts | 18 + .../execution/expression/call/builtin/min.spec.ts | 106 +- .../execution/expression/call/builtin/mix.cache.ts | 56 + .../execution/expression/call/builtin/mix.spec.ts | 210 +- .../expression/call/builtin/modf.cache.ts | 75 + .../execution/expression/call/builtin/modf.spec.ts | 192 +- .../expression/call/builtin/normalize.cache.ts | 25 + .../expression/call/builtin/normalize.spec.ts | 88 +- .../expression/call/builtin/pack2x16float.cache.ts | 55 + .../expression/call/builtin/pack2x16float.spec.ts | 68 +- .../expression/call/builtin/pack2x16snorm.spec.ts | 15 +- .../expression/call/builtin/pack2x16unorm.spec.ts | 15 +- .../expression/call/builtin/pack4x8snorm.spec.ts | 23 +- .../expression/call/builtin/pack4x8unorm.spec.ts | 23 +- .../expression/call/builtin/pack4xI8.spec.ts | 69 + .../expression/call/builtin/pack4xI8Clamp.spec.ts | 73 + .../expression/call/builtin/pack4xU8.spec.ts | 54 + .../expression/call/builtin/pack4xU8Clamp.spec.ts | 57 + .../execution/expression/call/builtin/pow.cache.ts | 24 + .../execution/expression/call/builtin/pow.spec.ts | 67 +- .../expression/call/builtin/quantizeToF16.cache.ts | 41 + .../expression/call/builtin/quantizeToF16.spec.ts | 46 +- .../expression/call/builtin/radians.cache.ts | 18 + .../expression/call/builtin/radians.spec.ts | 44 +- .../expression/call/builtin/reflect.cache.ts | 26 + .../expression/call/builtin/reflect.spec.ts | 151 +- .../expression/call/builtin/refract.cache.ts | 116 + .../expression/call/builtin/refract.spec.ts | 191 +- .../expression/call/builtin/reverseBits.spec.ts | 6 +- .../expression/call/builtin/round.cache.ts | 24 + .../expression/call/builtin/round.spec.ts | 55 +- .../expression/call/builtin/saturate.cache.ts | 18 + .../expression/call/builtin/saturate.spec.ts | 56 +- .../expression/call/builtin/select.spec.ts | 129 +- .../expression/call/builtin/sign.cache.ts | 31 + .../execution/expression/call/builtin/sign.spec.ts | 66 +- .../execution/expression/call/builtin/sin.cache.ts | 23 + .../execution/expression/call/builtin/sin.spec.ts | 57 +- .../expression/call/builtin/sinh.cache.ts | 23 + .../execution/expression/call/builtin/sinh.spec.ts | 47 +- .../expression/call/builtin/smoothstep.cache.ts | 25 + .../expression/call/builtin/smoothstep.spec.ts | 71 +- .../expression/call/builtin/sqrt.cache.ts | 23 + .../execution/expression/call/builtin/sqrt.spec.ts | 47 +- .../expression/call/builtin/step.cache.ts | 41 + .../execution/expression/call/builtin/step.spec.ts | 66 +- .../execution/expression/call/builtin/tan.cache.ts | 23 + .../execution/expression/call/builtin/tan.spec.ts | 57 +- .../expression/call/builtin/tanh.cache.ts | 18 + .../execution/expression/call/builtin/tanh.spec.ts | 41 +- .../call/builtin/textureDimension.spec.ts | 160 -- .../call/builtin/textureDimensions.spec.ts | 518 +++++ .../expression/call/builtin/textureSample.spec.ts | 99 +- .../call/builtin/textureSampleBias.spec.ts | 22 - .../call/builtin/textureSampleCompare.spec.ts | 23 - .../expression/call/builtin/texture_utils.ts | 809 +++++++ .../expression/call/builtin/transpose.cache.ts | 27 + .../expression/call/builtin/transpose.spec.ts | 85 +- .../expression/call/builtin/trunc.cache.ts | 17 + .../expression/call/builtin/trunc.spec.ts | 39 +- .../call/builtin/unpack2x16float.cache.ts | 20 + .../call/builtin/unpack2x16float.spec.ts | 25 +- .../call/builtin/unpack2x16snorm.cache.ts | 20 + .../call/builtin/unpack2x16snorm.spec.ts | 25 +- .../call/builtin/unpack2x16unorm.cache.ts | 20 + .../call/builtin/unpack2x16unorm.spec.ts | 25 +- .../call/builtin/unpack4x8snorm.cache.ts | 20 + .../expression/call/builtin/unpack4x8snorm.spec.ts | 25 +- .../call/builtin/unpack4x8unorm.cache.ts | 20 + .../expression/call/builtin/unpack4x8unorm.spec.ts | 25 +- .../expression/call/builtin/unpack4xI8.spec.ts | 56 + .../expression/call/builtin/unpack4xU8.spec.ts | 48 + .../call/builtin/workgroupUniformLoad.spec.ts | 182 ++ .../expression/call/user/ptr_params.spec.ts | 849 ++++++++ .../src/webgpu/shader/execution/expression/case.ts | 440 ++++ .../shader/execution/expression/case_cache.ts | 39 +- .../expression/constructor/non_zero.spec.ts | 797 +++++++ .../expression/constructor/zero_value.spec.ts | 162 ++ .../shader/execution/expression/expectation.ts | 38 + .../shader/execution/expression/expression.ts | 800 +++---- .../shader/execution/expression/interval_filter.ts | 8 + .../shader/execution/expression/precedence.spec.ts | 113 + .../unary/address_of_and_indirection.spec.ts | 171 ++ .../expression/unary/af_arithmetic.cache.ts | 13 + .../expression/unary/af_arithmetic.spec.ts | 30 +- .../expression/unary/af_assignment.cache.ts | 51 + .../expression/unary/af_assignment.spec.ts | 66 +- .../expression/unary/ai_arithmetic.cache.ts | 11 + .../expression/unary/ai_arithmetic.spec.ts | 30 + .../expression/unary/ai_assignment.cache.ts | 21 + .../expression/unary/ai_assignment.spec.ts | 65 + .../expression/unary/ai_complement.spec.ts | 32 + .../expression/unary/bool_conversion.cache.ts | 54 + .../expression/unary/bool_conversion.spec.ts | 87 +- .../expression/unary/bool_logical.spec.ts | 4 +- .../expression/unary/f16_arithmetic.cache.ts | 13 + .../expression/unary/f16_arithmetic.spec.ts | 18 +- .../expression/unary/f16_conversion.cache.ts | 135 ++ .../expression/unary/f16_conversion.spec.ts | 226 +- .../expression/unary/f32_arithmetic.cache.ts | 13 + .../expression/unary/f32_arithmetic.spec.ts | 18 +- .../expression/unary/f32_conversion.cache.ts | 79 + .../expression/unary/f32_conversion.spec.ts | 113 +- .../expression/unary/i32_arithmetic.cache.ts | 11 + .../expression/unary/i32_arithmetic.spec.ts | 15 +- .../expression/unary/i32_complement.spec.ts | 17 +- .../expression/unary/i32_conversion.cache.ts | 116 + .../expression/unary/i32_conversion.spec.ts | 158 +- .../expression/unary/u32_complement.spec.ts | 17 +- .../expression/unary/u32_conversion.cache.ts | 107 + .../expression/unary/u32_conversion.spec.ts | 144 +- .../shader/execution/expression/unary/unary.ts | 8 +- .../shader/execution/flow_control/call.spec.ts | 113 + .../shader/execution/flow_control/for.spec.ts | 50 + .../shader/execution/flow_control/loop.spec.ts | 60 + .../shader/execution/flow_control/switch.spec.ts | 33 + .../shader/execution/flow_control/while.spec.ts | 54 + .../webgpu/shader/execution/memory_layout.spec.ts | 1059 +++++++++ .../shader/execution/memory_model/barrier.spec.ts | 179 +- .../execution/memory_model/memory_model_setup.ts | 341 ++- .../texture_intra_invocation_coherence.spec.ts | 333 +++ .../webgpu/shader/execution/robust_access.spec.ts | 30 +- .../shader/execution/robust_access_vertex.spec.ts | 1 + .../execution/shader_io/compute_builtins.spec.ts | 175 +- .../execution/shader_io/fragment_builtins.spec.ts | 1410 ++++++++++++ .../shader/execution/shader_io/user_io.spec.ts | 213 ++ .../execution/shader_io/workgroup_size.spec.ts | 150 ++ .../src/webgpu/shader/execution/stage.spec.ts | 133 ++ .../shader/execution/statement/compound.spec.ts | 137 ++ .../shader/execution/statement/discard.spec.ts | 645 ++++++ .../src/webgpu/shader/execution/zero_init.spec.ts | 4 + .../tests/cts/checkout/src/webgpu/shader/types.ts | 206 +- .../validation/const_assert/const_assert.spec.ts | 20 +- .../validation/decl/compound_statement.spec.ts | 98 + .../webgpu/shader/validation/decl/const.spec.ts | 158 ++ .../decl/context_dependent_resolution.spec.ts | 338 +++ .../src/webgpu/shader/validation/decl/let.spec.ts | 180 ++ .../webgpu/shader/validation/decl/override.spec.ts | 178 ++ .../src/webgpu/shader/validation/decl/var.spec.ts | 529 +++++ .../validation/expression/access/vector.spec.ts | 3 +- .../expression/binary/add_sub_mul.spec.ts | 320 +++ .../expression/binary/and_or_xor.spec.ts | 182 ++ .../expression/binary/bitwise_shift.spec.ts | 182 +- .../expression/binary/comparison.spec.ts | 186 ++ .../validation/expression/binary/div_rem.spec.ts | 279 +++ .../validation/expression/call/builtin/abs.spec.ts | 114 +- .../expression/call/builtin/acos.spec.ts | 162 +- .../expression/call/builtin/acosh.spec.ts | 158 +- .../validation/expression/call/builtin/all.spec.ts | 191 ++ .../validation/expression/call/builtin/any.spec.ts | 191 ++ .../expression/call/builtin/arrayLength.spec.ts | 109 + .../expression/call/builtin/asin.spec.ts | 161 +- .../expression/call/builtin/asinh.spec.ts | 153 +- .../expression/call/builtin/atan.spec.ts | 146 +- .../expression/call/builtin/atan2.spec.ts | 293 ++- .../expression/call/builtin/atanh.spec.ts | 169 +- .../expression/call/builtin/atomics.spec.ts | 235 +- .../expression/call/builtin/barriers.spec.ts | 109 + .../expression/call/builtin/ceil.spec.ts | 18 +- .../expression/call/builtin/clamp.spec.ts | 14 +- .../call/builtin/const_override_validation.ts | 292 ++- .../validation/expression/call/builtin/cos.spec.ts | 59 +- .../expression/call/builtin/cosh.spec.ts | 66 +- .../call/builtin/countLeadingZeros.spec.ts | 198 ++ .../expression/call/builtin/countOneBits.spec.ts | 198 ++ .../call/builtin/countTrailingZeros.spec.ts | 198 ++ .../expression/call/builtin/cross.spec.ts | 122 ++ .../expression/call/builtin/degrees.spec.ts | 56 +- .../expression/call/builtin/derivatives.spec.ts | 129 ++ .../expression/call/builtin/determinant.spec.ts | 95 + .../expression/call/builtin/distance.spec.ts | 149 ++ .../expression/call/builtin/dot4I8Packed.spec.ts | 66 + .../expression/call/builtin/dot4U8Packed.spec.ts | 66 + .../validation/expression/call/builtin/exp.spec.ts | 122 +- .../expression/call/builtin/exp2.spec.ts | 122 +- .../expression/call/builtin/extractBits.spec.ts | 218 ++ .../expression/call/builtin/faceForward.spec.ts | 152 ++ .../call/builtin/firstLeadingBit.spec.ts | 198 ++ .../call/builtin/firstTrailingBit.spec.ts | 198 ++ .../expression/call/builtin/floor.spec.ts | 108 + .../expression/call/builtin/fract.spec.ts | 94 + .../expression/call/builtin/frexp.spec.ts | 94 + .../expression/call/builtin/insertBits.spec.ts | 241 +++ .../expression/call/builtin/inverseSqrt.spec.ts | 76 +- .../expression/call/builtin/length.spec.ts | 58 +- .../validation/expression/call/builtin/log.spec.ts | 50 +- .../expression/call/builtin/log2.spec.ts | 50 +- .../validation/expression/call/builtin/max.spec.ts | 91 + .../validation/expression/call/builtin/min.spec.ts | 91 + .../expression/call/builtin/modf.spec.ts | 17 +- .../expression/call/builtin/normalize.spec.ts | 146 ++ .../expression/call/builtin/pack2x16snorm.spec.ts | 58 + .../expression/call/builtin/pack2x16unorm.spec.ts | 58 + .../expression/call/builtin/pack4x8snorm.spec.ts | 58 + .../expression/call/builtin/pack4x8unorm.spec.ts | 58 + .../expression/call/builtin/pack4xI8.spec.ts | 62 + .../expression/call/builtin/pack4xI8Clamp.spec.ts | 62 + .../expression/call/builtin/pack4xU8.spec.ts | 62 + .../expression/call/builtin/pack4xU8Clamp.spec.ts | 62 + .../expression/call/builtin/quantizeToF16.spec.ts | 113 + .../expression/call/builtin/radians.spec.ts | 50 +- .../expression/call/builtin/reflect.spec.ts | 131 ++ .../expression/call/builtin/reverseBits.spec.ts | 198 ++ .../expression/call/builtin/round.spec.ts | 31 +- .../expression/call/builtin/saturate.spec.ts | 17 +- .../expression/call/builtin/select.spec.ts | 250 +++ .../expression/call/builtin/shader_stage_utils.ts | 64 + .../expression/call/builtin/sign.spec.ts | 63 +- .../validation/expression/call/builtin/sin.spec.ts | 60 +- .../expression/call/builtin/sinh.spec.ts | 66 +- .../expression/call/builtin/smoothstep.spec.ts | 241 +++ .../expression/call/builtin/sqrt.spec.ts | 66 +- .../expression/call/builtin/step.spec.ts | 108 + .../validation/expression/call/builtin/tan.spec.ts | 76 +- .../expression/call/builtin/tanh.spec.ts | 98 + .../expression/call/builtin/textureGather.spec.ts | 335 +++ .../call/builtin/textureGatherCompare.spec.ts | 264 +++ .../expression/call/builtin/textureLoad.spec.ts | 370 ++++ .../expression/call/builtin/textureSample.spec.ts | 267 +++ .../builtin/textureSampleBaseClampToEdge.spec.ts | 54 + .../call/builtin/textureSampleBias.spec.ts | 309 +++ .../call/builtin/textureSampleCompare.spec.ts | 308 +++ .../call/builtin/textureSampleCompareLevel.spec.ts | 268 +++ .../call/builtin/textureSampleGrad.spec.ts | 317 +++ .../call/builtin/textureSampleLevel.spec.ts | 282 +++ .../expression/call/builtin/textureStore.spec.ts | 168 ++ .../expression/call/builtin/trunc.spec.ts | 94 + .../call/builtin/unpack2x16float.spec.ts | 62 + .../call/builtin/unpack2x16snorm.spec.ts | 62 + .../call/builtin/unpack2x16unorm.spec.ts | 62 + .../expression/call/builtin/unpack4x8snorm.spec.ts | 62 + .../expression/call/builtin/unpack4x8unorm.spec.ts | 62 + .../expression/call/builtin/unpack4xI8.spec.ts | 61 + .../expression/call/builtin/unpack4xU8.spec.ts | 61 + .../call/builtin/workgroupUniformLoad.spec.ts | 122 ++ .../expression/overload_resolution.spec.ts | 268 +++ .../validation/expression/precedence.spec.ts | 188 ++ .../unary/address_of_and_indirection.spec.ts | 243 +++ .../expression/unary/arithmetic_negation.spec.ts | 114 + .../expression/unary/bitwise_complement.spec.ts | 114 + .../expression/unary/logical_negation.spec.ts | 114 + .../extension/pointer_composite_access.spec.ts | 130 ++ ...readonly_and_readwrite_storage_textures.spec.ts | 48 + .../validation/functions/alias_analysis.spec.ts | 545 ++++- .../validation/functions/restrictions.spec.ts | 313 +-- .../webgpu/shader/validation/parse/break.spec.ts | 4 - .../shader/validation/parse/break_if.spec.ts | 141 ++ .../shader/validation/parse/compound.spec.ts | 52 + .../shader/validation/parse/continuing.spec.ts | 185 ++ .../shader/validation/parse/diagnostic.spec.ts | 260 +++ .../webgpu/shader/validation/parse/enable.spec.ts | 18 +- .../shader/validation/parse/must_use.spec.ts | 63 +- .../shader/validation/parse/pipeline_stage.spec.ts | 42 +- .../shader/validation/parse/requires.spec.ts | 103 + .../shader/validation/parse/semicolon.spec.ts | 15 + .../validation/parse/shadow_builtins.spec.ts | 995 +++++++++ .../validation/parse/statement_behavior.spec.ts | 143 ++ .../shader/validation/shader_io/binding.spec.ts | 14 - .../shader/validation/shader_io/builtins.spec.ts | 4 +- .../shader/validation/shader_io/group.spec.ts | 14 - .../validation/shader_io/group_and_binding.spec.ts | 4 +- .../shader_io/layout_constraints.spec.ts | 543 +++++ .../shader/validation/shader_io/locations.spec.ts | 149 ++ .../shader/validation/shader_io/size.spec.ts | 20 +- .../webgpu/shader/validation/types/alias.spec.ts | 122 ++ .../webgpu/shader/validation/types/array.spec.ts | 122 ++ .../webgpu/shader/validation/types/atomics.spec.ts | 145 ++ .../webgpu/shader/validation/types/matrix.spec.ts | 152 ++ .../shader/validation/types/textures.spec.ts | 170 ++ .../validation/uniformity/uniformity.spec.ts | 209 +- .../cts/checkout/src/webgpu/util/binary_stream.ts | 10 + .../cts/checkout/src/webgpu/util/check_contents.ts | 38 +- .../src/webgpu/util/color_space_conversion.ts | 32 +- .../tests/cts/checkout/src/webgpu/util/compare.ts | 32 +- .../cts/checkout/src/webgpu/util/constants.ts | 15 + .../cts/checkout/src/webgpu/util/conversion.ts | 1752 +++++++++++---- .../cts/checkout/src/webgpu/util/device_pool.ts | 12 +- .../cts/checkout/src/webgpu/util/floating_point.ts | 601 ++--- .../tests/cts/checkout/src/webgpu/util/math.ts | 465 +++- .../checkout/src/webgpu/util/pretty_diff_tables.ts | 37 +- .../tests/cts/checkout/src/webgpu/util/shader.ts | 25 +- .../cts/checkout/src/webgpu/util/texture/base.ts | 44 +- .../util/texture/color_space_conversions.spec.ts | 108 + .../src/webgpu/util/texture/texel_data.spec.ts | 16 +- .../checkout/src/webgpu/util/texture/texel_data.ts | 50 +- .../checkout/src/webgpu/util/texture/texel_view.ts | 17 +- .../checkout/src/webgpu/util/texture/texture_ok.ts | 20 +- .../webgpu/web_platform/canvas/configure.spec.ts | 5 +- .../web_platform/canvas/getCurrentTexture.spec.ts | 75 +- .../canvas/readbackFromWebGPUCanvas.spec.ts | 155 +- .../web_platform/copyToTexture/canvas.spec.ts | 6 +- .../web_platform/copyToTexture/video.spec.ts | 86 +- .../web_platform/external_texture/video.spec.ts | 349 ++- .../canvas_colorspace_bgra8unorm.https.html | 1 + .../canvas_colorspace_rgba16float.https.html | 2 +- .../canvas_colorspace_rgba8unorm.https.html | 1 + ..._alpha_bgra8unorm_premultiplied_copy.https.html | 2 +- ..._alpha_bgra8unorm_premultiplied_draw.https.html | 2 +- ...alpha_rgba16float_premultiplied_copy.https.html | 2 +- ...alpha_rgba16float_premultiplied_draw.https.html | 2 +- ..._alpha_rgba8unorm_premultiplied_copy.https.html | 2 +- ..._alpha_rgba8unorm_premultiplied_draw.https.html | 2 +- .../reftests/canvas_image_rendering.https.html | 12 +- .../reftests/delay_get_texture.html.ts | 46 + .../reftests/delay_get_texture.https.html | 10 + .../reftests/ref/canvas_image_rendering-ref.html | 12 +- .../reftests/ref/delay_get_texture-ref.html | 17 + .../cts/checkout/src/webgpu/web_platform/util.ts | 430 +++- .../src/webgpu/web_platform/worker/worker.spec.ts | 72 +- .../src/webgpu/web_platform/worker/worker.ts | 20 +- .../webgpu/web_platform/worker/worker_launcher.ts | 59 +- 748 files changed, 56589 insertions(+), 14078 deletions(-) create mode 100644 dom/webgpu/tests/cts/checkout/src/common/runtime/helper/utils_worker.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/common/runtime/helper/wrap_for_worker.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/common/tools/gen_listings_and_webworkers.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/common/util/crc32.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/common/util/parse_imports.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/hashes.json create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/abs.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/acos.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/acosh.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/asin.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/asinh.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/atan.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/atan2.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/atanh.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_addition.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_division.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_logical.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_matrix_addition.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_matrix_matrix_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_matrix_scalar_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_matrix_subtraction.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_matrix_vector_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_remainder.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/af_subtraction.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/ai_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_addition.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_division.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_logical.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_matrix_addition.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_matrix_matrix_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_matrix_scalar_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_matrix_subtraction.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_matrix_vector_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_remainder.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f16_subtraction.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_addition.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_division.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_logical.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_matrix_addition.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_matrix_matrix_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_matrix_scalar_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_matrix_subtraction.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_matrix_vector_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_multiplication.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_remainder.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/f32_subtraction.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/i32_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/i32_comparison.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/u32_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/binary/u32_comparison.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/bitcast.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/ceil.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/clamp.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/cos.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/cosh.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/cross.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/degrees.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/derivatives.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/determinant.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/distance.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/dot.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/exp.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/exp2.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/faceForward.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/floor.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/fma.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/fract.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/frexp.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/inverseSqrt.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/ldexp.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/length.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/log.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/log2.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/max.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/min.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/mix.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/modf.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/normalize.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/pack2x16float.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/pow.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/quantizeToF16.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/radians.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/reflect.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/refract.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/round.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/saturate.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/sign.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/sin.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/sinh.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/smoothstep.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/sqrt.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/step.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/tan.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/tanh.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/transpose.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/trunc.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/af_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/af_assignment.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/ai_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/ai_assignment.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/bool_conversion.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/f16_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/f16_conversion.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/f32_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/f32_conversion.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/i32_arithmetic.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/i32_conversion.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unary/u32_conversion.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unpack2x16float.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unpack2x16snorm.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unpack2x16unorm.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unpack4x8snorm.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/cache/webgpu/shader/execution/unpack4x8unorm.bin create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-h264-bt601-hflip.mp4 create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-h264-bt601-vflip.mp4 delete mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-theora-bt601.ogv create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-vp9-bt601-hflip.mp4 create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-vp9-bt601-rotate-180.mp4 create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-vp9-bt601-rotate-270.mp4 create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-vp9-bt601-rotate-90.mp4 create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-vp9-bt601-vflip.mp4 create mode 100644 dom/webgpu/tests/cts/checkout/src/resources/four-colors-vp9-bt601.mp4 create mode 100644 dom/webgpu/tests/cts/checkout/src/unittests/crc32.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/unittests/parse_imports.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/memory_sync/texture/readonly_depth_stencil.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/rendering/3d_texture_slices.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/resource_init/check_texture/texture_zero_init_test.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/storage_texture/read_only.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/operation/storage_texture/read_write.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/capability_checks/limits/maxBindGroupsPlusVertexBuffers.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/render_pipeline/resource_compatibility.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/api/validation/utils.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/compat/api/validation/createBindGroup.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/compat/api/validation/createBindGroupLayout.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/compat/api/validation/encoding/cmds/copyTextureToTexture.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/compat/api/validation/render_pipeline/depth_stencil_state.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/idl/constructable.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/multisample_info.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/print_environment.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/access/array/index.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/access/matrix/index.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/access/structure/index.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/access/vector/components.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/access/vector/index.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_addition.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_comparison.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_division.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_addition.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_matrix_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_matrix_multiplication.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_scalar_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_scalar_multiplication.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_subtraction.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_vector_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_matrix_vector_multiplication.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_remainder.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/af_subtraction.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/ai_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/ai_arithmetic.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/ai_comparison.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_addition.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_comparison.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_division.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_matrix_addition.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_matrix_matrix_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_matrix_scalar_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_matrix_subtraction.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_matrix_vector_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_remainder.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f16_subtraction.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_addition.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_comparison.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_division.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_addition.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_matrix_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_scalar_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_subtraction.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_matrix_vector_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_multiplication.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_remainder.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/f32_subtraction.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/i32_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/i32_comparison.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/u32_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/binary/u32_comparison.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/abs.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/acos.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/acosh.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/asin.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/asinh.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/atan.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/atan2.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/atanh.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/bitcast.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/ceil.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/clamp.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/cos.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/cosh.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/cross.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/degrees.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/derivatives.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/derivatives.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/determinant.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/distance.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/dot.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/dot4I8Packed.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/dot4U8Packed.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/exp.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/exp2.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/faceForward.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/floor.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/fma.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/fract.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/frexp.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/inversesqrt.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/ldexp.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/length.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/log.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/log2.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/max.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/min.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/mix.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/modf.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/normalize.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/pack2x16float.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/pack4xI8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/pack4xI8Clamp.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/pack4xU8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/pack4xU8Clamp.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/pow.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/quantizeToF16.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/radians.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/reflect.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/refract.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/round.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/saturate.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/sign.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/sin.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/sinh.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/smoothstep.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/sqrt.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/step.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/tan.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/tanh.cache.ts delete mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/textureDimension.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/textureDimensions.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/transpose.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/trunc.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/unpack2x16float.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/unpack2x16snorm.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/unpack2x16unorm.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/unpack4x8snorm.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/unpack4x8unorm.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/unpack4xI8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/unpack4xU8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/builtin/workgroupUniformLoad.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/call/user/ptr_params.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/case.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/constructor/non_zero.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/constructor/zero_value.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/expectation.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/interval_filter.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/precedence.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/address_of_and_indirection.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/af_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/af_assignment.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/ai_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/ai_arithmetic.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/ai_assignment.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/ai_assignment.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/ai_complement.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/bool_conversion.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/f16_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/f16_conversion.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/f32_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/f32_conversion.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/i32_arithmetic.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/i32_conversion.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/expression/unary/u32_conversion.cache.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/memory_layout.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/memory_model/texture_intra_invocation_coherence.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/shader_io/fragment_builtins.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/shader_io/user_io.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/shader_io/workgroup_size.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/stage.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/statement/compound.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/execution/statement/discard.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/decl/compound_statement.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/decl/context_dependent_resolution.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/decl/let.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/decl/var.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/binary/add_sub_mul.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/binary/and_or_xor.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/binary/comparison.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/binary/div_rem.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/all.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/any.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/arrayLength.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/barriers.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/countLeadingZeros.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/countOneBits.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/countTrailingZeros.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/cross.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/derivatives.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/determinant.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/distance.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/dot4I8Packed.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/dot4U8Packed.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/extractBits.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/faceForward.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/firstLeadingBit.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/firstTrailingBit.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/floor.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/fract.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/frexp.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/insertBits.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/max.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/min.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/normalize.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack2x16snorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack2x16unorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack4x8snorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack4x8unorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack4xI8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack4xI8Clamp.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack4xU8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/pack4xU8Clamp.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/quantizeToF16.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/reflect.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/reverseBits.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/select.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/shader_stage_utils.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/smoothstep.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/step.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/tanh.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureGather.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureGatherCompare.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureLoad.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureSample.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureSampleBaseClampToEdge.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureSampleBias.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureSampleCompare.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureSampleCompareLevel.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureSampleGrad.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureSampleLevel.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/textureStore.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/trunc.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/unpack2x16float.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/unpack2x16snorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/unpack2x16unorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/unpack4x8snorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/unpack4x8unorm.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/unpack4xI8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/unpack4xU8.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/call/builtin/workgroupUniformLoad.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/overload_resolution.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/precedence.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/unary/address_of_and_indirection.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/unary/arithmetic_negation.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/unary/bitwise_complement.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/expression/unary/logical_negation.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/extension/pointer_composite_access.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/extension/readonly_and_readwrite_storage_textures.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/parse/break_if.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/parse/compound.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/parse/continuing.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/parse/requires.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/parse/shadow_builtins.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/parse/statement_behavior.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/shader_io/layout_constraints.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/types/array.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/types/atomics.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/types/matrix.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/shader/validation/types/textures.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/util/texture/color_space_conversions.spec.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.html.ts create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/delay_get_texture.https.html create mode 100644 dom/webgpu/tests/cts/checkout/src/webgpu/web_platform/reftests/ref/delay_get_texture-ref.html (limited to 'dom/webgpu/tests/cts/checkout/src') diff --git a/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts b/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts index 77875e047d..616023e20c 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/framework/fixture.ts @@ -15,7 +15,8 @@ export type TestParams = { type DestroyableObject = | { destroy(): void } | { close(): void } - | { getExtension(extensionName: 'WEBGL_lose_context'): WEBGL_lose_context }; + | { getExtension(extensionName: 'WEBGL_lose_context'): WEBGL_lose_context } + | HTMLVideoElement; export class SubcaseBatchState { constructor( @@ -124,8 +125,12 @@ export class Fixture { if (WEBGL_lose_context) WEBGL_lose_context.loseContext(); } else if ('destroy' in o) { o.destroy(); - } else { + } else if ('close' in o) { o.close(); + } else { + // HTMLVideoElement + o.src = ''; + o.srcObject = null; } } } @@ -161,6 +166,14 @@ export class Fixture { this.rec.debug(new Error(msg)); } + /** + * Log an info message. + * **Use sparingly. Use `debug()` instead if logs are only needed with debug logging enabled.** + */ + info(msg: string): void { + this.rec.info(new Error(msg)); + } + /** Throws an exception marking the subcase as skipped. */ skip(msg: string): never { throw new SkipTestCase(msg); diff --git a/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts b/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts index 2575418299..e6624ae120 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/framework/test_config.ts @@ -1,4 +1,9 @@ export type TestConfig = { + /** + * Enable debug-level logs (normally logged via `Fixture.debug()`). + */ + enableDebugLogs: boolean; + maxSubcasesInFlight: number; testHeartbeatCallback: () => void; noRaceWithRejectOnTimeout: boolean; @@ -21,12 +26,25 @@ export type TestConfig = { * Whether or not we're running in compatibility mode. */ compatibility: boolean; + + /** + * Whether or not to request a fallback adapter. + */ + forceFallbackAdapter: boolean; + + /** + * Whether to enable the `logToWebSocket` function used for out-of-band test logging. + */ + logToWebSocket: boolean; }; export const globalTestConfig: TestConfig = { + enableDebugLogs: false, maxSubcasesInFlight: 500, testHeartbeatCallback: () => {}, noRaceWithRejectOnTimeout: false, unrollConstEvalLoops: false, compatibility: false, + forceFallbackAdapter: false, + logToWebSocket: false, }; diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/file_loader.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/file_loader.ts index b5e1b1a446..aae4b87995 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/file_loader.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/file_loader.ts @@ -73,8 +73,9 @@ export abstract class TestFileLoader extends EventTarget { query: TestQuery, { subqueriesToExpand = [], + fullyExpandSubtrees = [], maxChunkTime = Infinity, - }: { subqueriesToExpand?: string[]; maxChunkTime?: number } = {} + }: { subqueriesToExpand?: string[]; fullyExpandSubtrees?: string[]; maxChunkTime?: number } = {} ): Promise { const tree = await loadTreeForQuery(this, query, { subqueriesToExpand: subqueriesToExpand.map(s => { @@ -82,6 +83,7 @@ export abstract class TestFileLoader extends EventTarget { assert(q.level >= 2, () => `subqueriesToExpand entries should not be multi-file:\n ${q}`); return q; }), + fullyExpandSubtrees: fullyExpandSubtrees.map(s => parseQuery(s)), maxChunkTime, }); this.dispatchEvent(new MessageEvent('finish')); diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/log_message.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/log_message.ts index ee006cdeb3..b01c08b56e 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/log_message.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/log_message.ts @@ -1,19 +1,36 @@ import { ErrorWithExtra } from '../../util/util.js'; import { extractImportantStackTrace } from '../stack.js'; +import { LogMessageRawData } from './result.js'; + export class LogMessageWithStack extends Error { readonly extra: unknown; private stackHiddenMessage: string | undefined = undefined; - constructor(name: string, ex: Error | ErrorWithExtra) { - super(ex.message); + /** + * Wrap an Error (which was created to capture the stack at that point) into a + * LogMessageWithStack (which has extra stuff for good log messages). + * + * The original `ex.name` is ignored. Inclued it in the `name` parameter if it + * needs to be preserved. + */ + static wrapError(name: string, ex: Error | ErrorWithExtra) { + return new LogMessageWithStack({ + name, + message: ex.message, + stackHiddenMessage: undefined, + stack: ex.stack, + extra: 'extra' in ex ? ex.extra : undefined, + }); + } - this.name = name; - this.stack = ex.stack; - if ('extra' in ex) { - this.extra = ex.extra; - } + constructor(o: LogMessageRawData) { + super(o.message); + this.name = o.name; + this.stackHiddenMessage = o.stackHiddenMessage; + this.stack = o.stack; + this.extra = o.extra; } /** Set a flag so the stack is not printed in toJSON(). */ @@ -21,6 +38,11 @@ export class LogMessageWithStack extends Error { this.stackHiddenMessage ??= stackHiddenMessage; } + /** + * Print the message for display. + * + * Note: This is toJSON instead of toString to make it easy to save logs using JSON.stringify. + */ toJSON(): string { let m = this.name; if (this.message) m += ': ' + this.message; @@ -33,6 +55,21 @@ export class LogMessageWithStack extends Error { } return m; } + + /** + * Flatten the message for sending over a message channel. + * + * Note `extra` may get mangled by postMessage. + */ + toRawData(): LogMessageRawData { + return { + name: this.name, + message: this.message, + stackHiddenMessage: this.stackHiddenMessage, + stack: this.stack, + extra: this.extra, + }; + } } /** diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/logger.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/logger.ts index e4526cff54..6b95f48b74 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/logger.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/logger.ts @@ -1,3 +1,4 @@ +import { globalTestConfig } from '../../framework/test_config.js'; import { version } from '../version.js'; import { LiveTestCaseResult } from './result.js'; @@ -6,8 +7,6 @@ import { TestCaseRecorder } from './test_case_recorder.js'; export type LogResults = Map; export class Logger { - static globalDebugMode: boolean = false; - readonly overriddenDebugMode: boolean | undefined; readonly results: LogResults = new Map(); @@ -19,7 +18,7 @@ export class Logger { const result: LiveTestCaseResult = { status: 'running', timems: -1 }; this.results.set(name, result); return [ - new TestCaseRecorder(result, this.overriddenDebugMode ?? Logger.globalDebugMode), + new TestCaseRecorder(result, this.overriddenDebugMode ?? globalTestConfig.enableDebugLogs), result, ]; } diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/result.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/result.ts index 3318e8c937..9968f3d359 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/result.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/result.ts @@ -14,8 +14,24 @@ export interface LiveTestCaseResult extends TestCaseResult { logs?: LogMessageWithStack[]; } +/** + * Raw data for a test log message. + * + * This form is sendable over a message channel, except `extra` may get mangled. + */ +export interface LogMessageRawData { + name: string; + message: string; + stackHiddenMessage: string | undefined; + stack: string | undefined; + extra: unknown; +} + +/** + * Test case results in a form sendable over a message channel. + * + * Note `extra` may get mangled by postMessage. + */ export interface TransferredTestCaseResult extends TestCaseResult { - // When transferred from a worker, a LogMessageWithStack turns into a generic Error - // (its prototype gets lost and replaced with Error). - logs?: Error[]; + logs?: LogMessageRawData[]; } diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/test_case_recorder.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/test_case_recorder.ts index f5c3252b5c..78f625269e 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/logging/test_case_recorder.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/logging/test_case_recorder.ts @@ -45,8 +45,6 @@ export class TestCaseRecorder { private logs: LogMessageWithStack[] = []; private logLinesAtCurrentSeverity = 0; private debugging = false; - /** Used to dedup log messages which have identical stacks. */ - private messagesForPreviouslySeenStacks = new Map(); constructor(result: LiveTestCaseResult, debugging: boolean) { this.result = result; @@ -143,13 +141,15 @@ export class TestCaseRecorder { this.skipped(ex); return; } - this.logImpl(LogSeverity.ThrewException, 'EXCEPTION', ex); + // logImpl will discard the original error's ex.name. Preserve it here. + const name = ex instanceof Error ? `EXCEPTION: ${ex.name}` : 'EXCEPTION'; + this.logImpl(LogSeverity.ThrewException, name, ex); } private logImpl(level: LogSeverity, name: string, baseException: unknown): void { assert(baseException instanceof Error, 'test threw a non-Error object'); globalTestConfig.testHeartbeatCallback(); - const logMessage = new LogMessageWithStack(name, baseException); + const logMessage = LogMessageWithStack.wrapError(name, baseException); // Final case status should be the "worst" of all log entries. if (this.inSubCase) { diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/query/compare.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/query/compare.ts index a9419b87c1..f49833f5a2 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/query/compare.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/query/compare.ts @@ -58,7 +58,10 @@ function compareOneLevel(ordering: Ordering, aIsBig: boolean, bIsBig: boolean): return Ordering.Unordered; } -function comparePaths(a: readonly string[], b: readonly string[]): Ordering { +/** + * Compare two file paths, or file-local test paths, returning an Ordering between the two. + */ +export function comparePaths(a: readonly string[], b: readonly string[]): Ordering { const shorter = Math.min(a.length, b.length); for (let i = 0; i < shorter; ++i) { diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/query/parseQuery.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/query/parseQuery.ts index 996835b0ec..0a9b355804 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/query/parseQuery.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/query/parseQuery.ts @@ -17,12 +17,49 @@ import { import { kBigSeparator, kWildcard, kPathSeparator, kParamSeparator } from './separators.js'; import { validQueryPart } from './validQueryPart.js'; -export function parseQuery(s: string): TestQuery { +/** + * converts foo/bar/src/webgpu/this/that/file.spec.ts to webgpu:this,that,file,* + */ +function convertPathToQuery(path: string) { + // removes .spec.ts and splits by directory separators. + const parts = path.substring(0, path.length - 8).split(/\/|\\/g); + // Gets parts only after the last `src`. Example: returns ['webgpu', 'foo', 'bar', 'test'] + // for ['Users', 'me', 'src', 'cts', 'src', 'webgpu', 'foo', 'bar', 'test'] + const partsAfterSrc = parts.slice(parts.lastIndexOf('src') + 1); + const suite = partsAfterSrc.shift(); + return `${suite}:${partsAfterSrc.join(',')},*`; +} + +/** + * If a query looks like a path (ends in .spec.ts and has directory separators) + * then convert try to convert it to a query. + */ +function convertPathLikeToQuery(queryOrPath: string) { + return queryOrPath.endsWith('.spec.ts') && + (queryOrPath.includes('/') || queryOrPath.includes('\\')) + ? convertPathToQuery(queryOrPath) + : queryOrPath; +} + +/** + * Convert long suite names (the part before the first colon) to the + * shortest last word + * foo.bar.moo:test,subtest,foo -> moo:test,subtest,foo + */ +function shortenSuiteName(query: string) { + const parts = query.split(':'); + // converts foo.bar.moo to moo + const suite = parts.shift()?.replace(/.*\.(\w+)$/, '$1'); + return [suite, ...parts].join(':'); +} + +export function parseQuery(queryLike: string): TestQuery { try { - return parseQueryImpl(s); + const query = shortenSuiteName(convertPathLikeToQuery(queryLike)); + return parseQueryImpl(query); } catch (ex) { if (ex instanceof Error) { - ex.message += '\n on: ' + s; + ex.message += `\n on: ${queryLike}`; } throw ex; } diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/query/query.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/query/query.ts index 7c72a62f88..676ac46d38 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/query/query.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/query/query.ts @@ -1,5 +1,5 @@ import { TestParams } from '../../framework/fixture.js'; -import { optionEnabled } from '../../runtime/helper/options.js'; +import { optionWorkerMode } from '../../runtime/helper/options.js'; import { assert, unreachable } from '../../util/util.js'; import { Expectation } from '../logging/result.js'; @@ -188,12 +188,12 @@ export function parseExpectationsForTestQuery( assert( expectationURL.pathname === wptURL.pathname, `Invalid expectation path ${expectationURL.pathname} -Expectation should be of the form path/to/cts.https.html?worker=0&q=suite:test_path:test_name:foo=1;bar=2;... +Expectation should be of the form path/to/cts.https.html?debug=0&q=suite:test_path:test_name:foo=1;bar=2;... ` ); const params = expectationURL.searchParams; - if (optionEnabled('worker', params) !== optionEnabled('worker', wptURL.searchParams)) { + if (optionWorkerMode('worker', params) !== optionWorkerMode('worker', wptURL.searchParams)) { continue; } diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/test_group.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/test_group.ts index 632a822ef1..e1d0cde12d 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/test_group.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/test_group.ts @@ -34,7 +34,7 @@ import { validQueryPart } from '../internal/query/validQueryPart.js'; import { DeepReadonly } from '../util/types.js'; import { assert, unreachable } from '../util/util.js'; -import { logToWebsocket } from './websocket_logger.js'; +import { logToWebSocket } from './websocket_logger.js'; export type RunFn = ( rec: TestCaseRecorder, @@ -294,9 +294,11 @@ class TestBuilder { (this.description ? this.description + '\n\n' : '') + 'TODO: .unimplemented()'; this.isUnimplemented = true; - this.testFn = () => { + // Use the beforeFn to skip the test, so we don't have to iterate the subcases. + this.beforeFn = () => { throw new SkipTestCase('test unimplemented'); }; + this.testFn = () => {}; } /** Perform various validation/"lint" chenks. */ @@ -350,7 +352,7 @@ class TestBuilder { const testcaseStringUnique = stringifyPublicParamsUniquely(params); assert( !seen.has(testcaseStringUnique), - `Duplicate public test case+subcase params for test ${testPathString}: ${testcaseString}` + `Duplicate public test case+subcase params for test ${testPathString}: ${testcaseString} (${caseQuery})` ); seen.add(testcaseStringUnique); } @@ -737,7 +739,7 @@ class RunCaseSpecific implements RunCase { timems: rec.result.timems, nonskippedSubcaseCount: rec.nonskippedSubcaseCount, }; - logToWebsocket(JSON.stringify(msg)); + logToWebSocket(JSON.stringify(msg)); } } } diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/test_suite_listing.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/test_suite_listing.ts index 2d2b555366..c5a0e11448 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/test_suite_listing.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/test_suite_listing.ts @@ -1,6 +1,6 @@ // A listing of all specs within a single suite. This is the (awaited) type of // `groups` in '{cts,unittests}/listing.ts' and `listing` in the auto-generated -// 'out/{cts,unittests}/listing.js' files (see tools/gen_listings). +// 'out/{cts,unittests}/listing.js' files (see tools/gen_listings_and_webworkers). export type TestSuiteListing = TestSuiteListingEntry[]; export type TestSuiteListingEntry = TestSuiteListingEntrySpec | TestSuiteListingEntryReadme; diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/tree.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/tree.ts index 594837059c..f2fad59037 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/tree.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/tree.ts @@ -286,8 +286,9 @@ export async function loadTreeForQuery( queryToLoad: TestQuery, { subqueriesToExpand, + fullyExpandSubtrees = [], maxChunkTime = Infinity, - }: { subqueriesToExpand: TestQuery[]; maxChunkTime?: number } + }: { subqueriesToExpand: TestQuery[]; fullyExpandSubtrees?: TestQuery[]; maxChunkTime?: number } ): Promise { const suite = queryToLoad.suite; const specs = await loader.listing(suite); @@ -303,6 +304,10 @@ export async function loadTreeForQuery( // If toExpand == subquery, no expansion is needed (but it's still "seen"). if (ordering === Ordering.Equal) seenSubqueriesToExpand[i] = true; return ordering !== Ordering.StrictSubset; + }) && + fullyExpandSubtrees.every(toExpand => { + const ordering = compareQueries(toExpand, subquery); + return ordering === Ordering.Unordered; }); // L0 = suite-level, e.g. suite:* diff --git a/dom/webgpu/tests/cts/checkout/src/common/internal/websocket_logger.ts b/dom/webgpu/tests/cts/checkout/src/common/internal/websocket_logger.ts index 30246df843..373378e7c2 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/internal/websocket_logger.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/internal/websocket_logger.ts @@ -1,3 +1,5 @@ +import { globalTestConfig } from '../framework/test_config.js'; + /** * - 'uninitialized' means we haven't tried to connect yet * - Promise means it's pending @@ -8,12 +10,15 @@ let connection: Promise | WebSocket | 'failed' | 'uninitia 'uninitialized'; /** - * Log a string to a websocket at `localhost:59497`. See `tools/websocket-logger`. + * If the logToWebSocket option is enabled (?log_to_web_socket=1 in browser, + * --log-to-web-socket on command line, or enable it by default in options.ts), + * log a string to a websocket at `localhost:59497`. See `tools/websocket-logger`. * - * This does nothing if a connection couldn't be established on the first call. + * This does nothing if a logToWebSocket is not enabled, or if a connection + * couldn't be established on the first call. */ -export function logToWebsocket(msg: string) { - if (connection === 'failed') { +export function logToWebSocket(msg: string) { + if (!globalTestConfig.logToWebSocket || connection === 'failed') { return; } diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/cmdline.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/cmdline.ts index 44a73fb38b..2a00640f0e 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/runtime/cmdline.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/cmdline.ts @@ -3,6 +3,7 @@ import * as fs from 'fs'; import { dataCache } from '../framework/data_cache.js'; +import { getResourcePath, setBaseResourcePath } from '../framework/resources.js'; import { globalTestConfig } from '../framework/test_config.js'; import { DefaultTestFileLoader } from '../internal/file_loader.js'; import { prettyPrintLog } from '../internal/logging/log_message.js'; @@ -37,6 +38,12 @@ Options: return sys.exit(rc); } +if (!sys.existsSync('src/common/runtime/cmdline.ts')) { + console.log('Must be run from repository root'); + usage(1); +} +setBaseResourcePath('out-node/resources'); + // The interface that exposes creation of the GPU, and optional interface to code coverage. interface GPUProviderModule { // @returns a GPU with the given flags @@ -60,12 +67,10 @@ Colors.enabled = false; let verbose = false; let emitCoverage = false; let listMode: listModes = 'none'; -let debug = false; let printJSON = false; let quiet = false; let loadWebGPUExpectations: Promise | undefined = undefined; let gpuProviderModule: GPUProviderModule | undefined = undefined; -let dataPath: string | undefined = undefined; const queries: string[] = []; const gpuProviderFlags: string[] = []; @@ -83,9 +88,7 @@ for (let i = 0; i < sys.args.length; ++i) { } else if (a === '--list-unimplemented') { listMode = 'unimplemented'; } else if (a === '--debug') { - debug = true; - } else if (a === '--data') { - dataPath = sys.args[++i]; + globalTestConfig.enableDebugLogs = true; } else if (a === '--print-json') { printJSON = true; } else if (a === '--expectations') { @@ -102,6 +105,10 @@ for (let i = 0; i < sys.args.length; ++i) { globalTestConfig.unrollConstEvalLoops = true; } else if (a === '--compat') { globalTestConfig.compatibility = true; + } else if (a === '--force-fallback-adapter') { + globalTestConfig.forceFallbackAdapter = true; + } else if (a === '--log-to-websocket') { + globalTestConfig.logToWebSocket = true; } else { console.log('unrecognized flag: ', a); usage(1); @@ -113,9 +120,12 @@ for (let i = 0; i < sys.args.length; ++i) { let codeCoverage: CodeCoverageProvider | undefined = undefined; -if (globalTestConfig.compatibility) { +if (globalTestConfig.compatibility || globalTestConfig.forceFallbackAdapter) { // MAINTENANCE_TODO: remove the cast once compatibilityMode is officially added - setDefaultRequestAdapterOptions({ compatibilityMode: true } as GPURequestAdapterOptions); + setDefaultRequestAdapterOptions({ + compatibilityMode: globalTestConfig.compatibility, + forceFallbackAdapter: globalTestConfig.forceFallbackAdapter, + } as GPURequestAdapterOptions); } if (gpuProviderModule) { @@ -132,21 +142,20 @@ Did you remember to build with code coverage instrumentation enabled?` } } -if (dataPath !== undefined) { - dataCache.setStore({ - load: (path: string) => { - return new Promise((resolve, reject) => { - fs.readFile(`${dataPath}/${path}`, (err, data) => { - if (err !== null) { - reject(err.message); - } else { - resolve(data); - } - }); +dataCache.setStore({ + load: (path: string) => { + return new Promise((resolve, reject) => { + fs.readFile(getResourcePath(`cache/${path}`), (err, data) => { + if (err !== null) { + reject(err.message); + } else { + resolve(data); + } }); - }, - }); -} + }); + }, +}); + if (verbose) { dataCache.setDebugLogger(console.log); } @@ -166,7 +175,6 @@ if (queries.length === 0) { filterQuery ); - Logger.globalDebugMode = debug; const log = new Logger(); const failed: Array<[string, LiveTestCaseResult]> = []; diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/options.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/options.ts index 38974b803f..4a82c7d292 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/options.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/options.ts @@ -1,3 +1,5 @@ +import { unreachable } from '../../util/util.js'; + let windowURL: URL | undefined = undefined; function getWindowURL() { if (windowURL === undefined) { @@ -6,6 +8,7 @@ function getWindowURL() { return windowURL; } +/** Parse a runner option that is always boolean-typed. False if missing or '0'. */ export function optionEnabled( opt: string, searchParams: URLSearchParams = getWindowURL().searchParams @@ -14,30 +17,55 @@ export function optionEnabled( return val !== null && val !== '0'; } +/** Parse a runner option that is string-typed. If the option is missing, returns `null`. */ export function optionString( opt: string, searchParams: URLSearchParams = getWindowURL().searchParams -): string { - return searchParams.get(opt) || ''; +): string | null { + return searchParams.get(opt); +} + +/** Runtime modes for running tests in different types of workers. */ +export type WorkerMode = 'dedicated' | 'service' | 'shared'; +/** Parse a runner option for different worker modes (as in `?worker=shared`). Null if no worker. */ +export function optionWorkerMode( + opt: string, + searchParams: URLSearchParams = getWindowURL().searchParams +): WorkerMode | null { + const value = searchParams.get(opt); + if (value === null || value === '0') { + return null; + } else if (value === 'service') { + return 'service'; + } else if (value === 'shared') { + return 'shared'; + } else if (value === '' || value === '1' || value === 'dedicated') { + return 'dedicated'; + } + unreachable('invalid worker= option value'); } /** * The possible options for the tests. */ export interface CTSOptions { - worker: boolean; + worker: WorkerMode | null; debug: boolean; compatibility: boolean; + forceFallbackAdapter: boolean; unrollConstEvalLoops: boolean; - powerPreference?: GPUPowerPreference | ''; + powerPreference: GPUPowerPreference | null; + logToWebSocket: boolean; } export const kDefaultCTSOptions: CTSOptions = { - worker: false, + worker: null, debug: true, compatibility: false, + forceFallbackAdapter: false, unrollConstEvalLoops: false, - powerPreference: '', + powerPreference: null, + logToWebSocket: false, }; /** @@ -45,8 +73,8 @@ export const kDefaultCTSOptions: CTSOptions = { */ export interface OptionInfo { description: string; - parser?: (key: string, searchParams?: URLSearchParams) => boolean | string; - selectValueDescriptions?: { value: string; description: string }[]; + parser?: (key: string, searchParams?: URLSearchParams) => boolean | string | null; + selectValueDescriptions?: { value: string | null; description: string }[]; } /** @@ -59,19 +87,30 @@ export type OptionsInfos = Record; * Options to the CTS. */ export const kCTSOptionsInfo: OptionsInfos = { - worker: { description: 'run in a worker' }, + worker: { + description: 'run in a worker', + parser: optionWorkerMode, + selectValueDescriptions: [ + { value: null, description: 'no worker' }, + { value: 'dedicated', description: 'dedicated worker' }, + { value: 'shared', description: 'shared worker' }, + { value: 'service', description: 'service worker' }, + ], + }, debug: { description: 'show more info' }, compatibility: { description: 'run in compatibility mode' }, + forceFallbackAdapter: { description: 'pass forceFallbackAdapter: true to requestAdapter' }, unrollConstEvalLoops: { description: 'unroll const eval loops in WGSL' }, powerPreference: { description: 'set default powerPreference for some tests', parser: optionString, selectValueDescriptions: [ - { value: '', description: 'default' }, + { value: null, description: 'default' }, { value: 'low-power', description: 'low-power' }, { value: 'high-performance', description: 'high-performance' }, ], }, + logToWebSocket: { description: 'send some logs to ws://localhost:59497/' }, }; /** @@ -95,7 +134,7 @@ function getOptionsInfoFromSearchString( searchString: string ): Type { const searchParams = new URLSearchParams(searchString); - const optionValues: Record = {}; + const optionValues: Record = {}; for (const [optionName, info] of Object.entries(optionsInfos)) { const parser = info.parser || optionEnabled; optionValues[optionName] = parser(camelCaseToSnakeCase(optionName), searchParams); diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker-worker.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker-worker.ts index e8d187ea7e..ebc206c3b2 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker-worker.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker-worker.ts @@ -1,15 +1,11 @@ import { setBaseResourcePath } from '../../framework/resources.js'; -import { globalTestConfig } from '../../framework/test_config.js'; import { DefaultTestFileLoader } from '../../internal/file_loader.js'; -import { Logger } from '../../internal/logging/logger.js'; import { parseQuery } from '../../internal/query/parseQuery.js'; -import { TestQueryWithExpectation } from '../../internal/query/query.js'; -import { setDefaultRequestAdapterOptions } from '../../util/navigator_gpu.js'; import { assert } from '../../util/util.js'; -import { CTSOptions } from './options.js'; +import { setupWorkerEnvironment, WorkerTestRunRequest } from './utils_worker.js'; -// Should be DedicatedWorkerGlobalScope, but importing lib "webworker" conflicts with lib "dom". +// Should be WorkerGlobalScope, but importing lib "webworker" conflicts with lib "dom". /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ declare const self: any; @@ -17,25 +13,10 @@ const loader = new DefaultTestFileLoader(); setBaseResourcePath('../../../resources'); -self.onmessage = async (ev: MessageEvent) => { - const query: string = ev.data.query; - const expectations: TestQueryWithExpectation[] = ev.data.expectations; - const ctsOptions: CTSOptions = ev.data.ctsOptions; +async function reportTestResults(this: MessagePort | Worker, ev: MessageEvent) { + const { query, expectations, ctsOptions } = ev.data as WorkerTestRunRequest; - const { debug, unrollConstEvalLoops, powerPreference, compatibility } = ctsOptions; - globalTestConfig.unrollConstEvalLoops = unrollConstEvalLoops; - globalTestConfig.compatibility = compatibility; - - Logger.globalDebugMode = debug; - const log = new Logger(); - - if (powerPreference || compatibility) { - setDefaultRequestAdapterOptions({ - ...(powerPreference && { powerPreference }), - // MAINTENANCE_TODO: Change this to whatever the option ends up being - ...(compatibility && { compatibilityMode: true }), - }); - } + const log = setupWorkerEnvironment(ctsOptions); const testcases = Array.from(await loader.loadCases(parseQuery(query))); assert(testcases.length === 1, 'worker query resulted in != 1 cases'); @@ -44,5 +25,23 @@ self.onmessage = async (ev: MessageEvent) => { const [rec, result] = log.record(testcase.query.toString()); await testcase.run(rec, expectations); - self.postMessage({ query, result }); + this.postMessage({ + query, + result: { + ...result, + logs: result.logs?.map(l => l.toRawData()), + }, + }); +} + +self.onmessage = (ev: MessageEvent) => { + void reportTestResults.call(ev.source || self, ev); +}; + +self.onconnect = (event: MessageEvent) => { + const port = event.ports[0]; + + port.onmessage = (ev: MessageEvent) => { + void reportTestResults.call(port, ev); + }; }; diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker.ts index 9bbcab0946..f9a44bb7bc 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/test_worker.ts @@ -2,48 +2,190 @@ import { LogMessageWithStack } from '../../internal/logging/log_message.js'; import { TransferredTestCaseResult, LiveTestCaseResult } from '../../internal/logging/result.js'; import { TestCaseRecorder } from '../../internal/logging/test_case_recorder.js'; import { TestQueryWithExpectation } from '../../internal/query/query.js'; +import { timeout } from '../../util/timeout.js'; +import { assert } from '../../util/util.js'; -import { CTSOptions, kDefaultCTSOptions } from './options.js'; +import { CTSOptions, WorkerMode, kDefaultCTSOptions } from './options.js'; +import { WorkerTestRunRequest } from './utils_worker.js'; -export class TestWorker { - private readonly ctsOptions: CTSOptions; - private readonly worker: Worker; - private readonly resolvers = new Map void>(); +/** Query all currently-registered service workers, and unregister them. */ +function unregisterAllServiceWorkers() { + void navigator.serviceWorker.getRegistrations().then(registrations => { + for (const registration of registrations) { + void registration.unregister(); + } + }); +} - constructor(ctsOptions?: CTSOptions) { - this.ctsOptions = { ...(ctsOptions || kDefaultCTSOptions), ...{ worker: true } }; - const selfPath = import.meta.url; - const selfPathDir = selfPath.substring(0, selfPath.lastIndexOf('/')); - const workerPath = selfPathDir + '/test_worker-worker.js'; - this.worker = new Worker(workerPath, { type: 'module' }); - this.worker.onmessage = ev => { - const query: string = ev.data.query; - const result: TransferredTestCaseResult = ev.data.result; - if (result.logs) { - for (const l of result.logs) { - Object.setPrototypeOf(l, LogMessageWithStack.prototype); - } - } - this.resolvers.get(query)!(result as LiveTestCaseResult); +// NOTE: This code runs on startup for any runtime with worker support. Here, we use that chance to +// delete any leaked service workers, and register to clean up after ourselves at shutdown. +unregisterAllServiceWorkers(); +window.addEventListener('beforeunload', () => { + unregisterAllServiceWorkers(); +}); + +abstract class TestBaseWorker { + protected readonly ctsOptions: CTSOptions; + protected readonly resolvers = new Map void>(); + + constructor(worker: WorkerMode, ctsOptions?: CTSOptions) { + this.ctsOptions = { ...(ctsOptions || kDefaultCTSOptions), ...{ worker } }; + } - // MAINTENANCE_TODO(kainino0x): update the Logger with this result (or don't have a logger and - // update the entire results JSON somehow at some point). + onmessage(ev: MessageEvent) { + const query: string = ev.data.query; + const transferredResult: TransferredTestCaseResult = ev.data.result; + + const result: LiveTestCaseResult = { + status: transferredResult.status, + timems: transferredResult.timems, + logs: transferredResult.logs?.map(l => new LogMessageWithStack(l)), }; + + this.resolvers.get(query)!(result); + this.resolvers.delete(query); + + // MAINTENANCE_TODO(kainino0x): update the Logger with this result (or don't have a logger and + // update the entire results JSON somehow at some point). } - async run( - rec: TestCaseRecorder, + makeRequestAndRecordResult( + target: MessagePort | Worker | ServiceWorker, query: string, - expectations: TestQueryWithExpectation[] = [] - ): Promise { - this.worker.postMessage({ + expectations: TestQueryWithExpectation[] + ): Promise { + const request: WorkerTestRunRequest = { query, expectations, ctsOptions: this.ctsOptions, - }); - const workerResult = await new Promise(resolve => { + }; + target.postMessage(request); + + return new Promise(resolve => { + assert(!this.resolvers.has(query), "can't request same query twice simultaneously"); this.resolvers.set(query, resolve); }); - rec.injectResult(workerResult); + } + + async run( + rec: TestCaseRecorder, + query: string, + expectations: TestQueryWithExpectation[] = [] + ): Promise { + try { + rec.injectResult(await this.runImpl(query, expectations)); + } catch (ex) { + rec.start(); + rec.threw(ex); + rec.finish(); + } + } + + protected abstract runImpl( + query: string, + expectations: TestQueryWithExpectation[] + ): Promise; +} + +export class TestDedicatedWorker extends TestBaseWorker { + private readonly worker: Worker | Error; + + constructor(ctsOptions?: CTSOptions) { + super('dedicated', ctsOptions); + try { + if (typeof Worker === 'undefined') { + throw new Error('Dedicated Workers not available'); + } + + const selfPath = import.meta.url; + const selfPathDir = selfPath.substring(0, selfPath.lastIndexOf('/')); + const workerPath = selfPathDir + '/test_worker-worker.js'; + this.worker = new Worker(workerPath, { type: 'module' }); + this.worker.onmessage = ev => this.onmessage(ev); + } catch (ex) { + assert(ex instanceof Error); + // Save the exception to re-throw in runImpl(). + this.worker = ex; + } + } + + override runImpl(query: string, expectations: TestQueryWithExpectation[] = []) { + if (this.worker instanceof Worker) { + return this.makeRequestAndRecordResult(this.worker, query, expectations); + } else { + throw this.worker; + } + } +} + +/** @deprecated Use TestDedicatedWorker instead. */ +export class TestWorker extends TestDedicatedWorker {} + +export class TestSharedWorker extends TestBaseWorker { + /** MessagePort to the SharedWorker, or an Error if it couldn't be initialized. */ + private readonly port: MessagePort | Error; + + constructor(ctsOptions?: CTSOptions) { + super('shared', ctsOptions); + try { + if (typeof SharedWorker === 'undefined') { + throw new Error('Shared Workers not available'); + } + + const selfPath = import.meta.url; + const selfPathDir = selfPath.substring(0, selfPath.lastIndexOf('/')); + const workerPath = selfPathDir + '/test_worker-worker.js'; + const worker = new SharedWorker(workerPath, { type: 'module' }); + this.port = worker.port; + this.port.start(); + this.port.onmessage = ev => this.onmessage(ev); + } catch (ex) { + assert(ex instanceof Error); + // Save the exception to re-throw in runImpl(). + this.port = ex; + } + } + + override runImpl(query: string, expectations: TestQueryWithExpectation[] = []) { + if (this.port instanceof MessagePort) { + return this.makeRequestAndRecordResult(this.port, query, expectations); + } else { + throw this.port; + } + } +} + +export class TestServiceWorker extends TestBaseWorker { + constructor(ctsOptions?: CTSOptions) { + super('service', ctsOptions); + } + + override async runImpl(query: string, expectations: TestQueryWithExpectation[] = []) { + if (!('serviceWorker' in navigator)) { + throw new Error('Service Workers not available'); + } + const [suite, name] = query.split(':', 2); + const fileName = name.split(',').join('/'); + + const selfPath = import.meta.url; + const selfPathDir = selfPath.substring(0, selfPath.lastIndexOf('/')); + // Construct the path to the worker file, then use URL to resolve the `../` components. + const serviceWorkerURL = new URL( + `${selfPathDir}/../../../${suite}/webworker/${fileName}.worker.js` + ).toString(); + + // If a registration already exists for this path, it will be ignored. + const registration = await navigator.serviceWorker.register(serviceWorkerURL, { + type: 'module', + }); + // Make sure the registration we just requested is active. (We don't worry about it being + // outdated from a previous page load, because we wipe all service workers on shutdown/startup.) + while (!registration.active || registration.active.scriptURL !== serviceWorkerURL) { + await new Promise(resolve => timeout(resolve, 0)); + } + const serviceWorker = registration.active; + + navigator.serviceWorker.onmessage = ev => this.onmessage(ev); + return this.makeRequestAndRecordResult(serviceWorker, query, expectations); } } diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/utils_worker.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/utils_worker.ts new file mode 100644 index 0000000000..13880635bc --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/utils_worker.ts @@ -0,0 +1,35 @@ +import { globalTestConfig } from '../../framework/test_config.js'; +import { Logger } from '../../internal/logging/logger.js'; +import { TestQueryWithExpectation } from '../../internal/query/query.js'; +import { setDefaultRequestAdapterOptions } from '../../util/navigator_gpu.js'; + +import { CTSOptions } from './options.js'; + +export interface WorkerTestRunRequest { + query: string; + expectations: TestQueryWithExpectation[]; + ctsOptions: CTSOptions; +} + +/** + * Set config environment for workers with ctsOptions and return a Logger. + */ +export function setupWorkerEnvironment(ctsOptions: CTSOptions): Logger { + const { powerPreference, compatibility } = ctsOptions; + globalTestConfig.enableDebugLogs = ctsOptions.debug; + globalTestConfig.unrollConstEvalLoops = ctsOptions.unrollConstEvalLoops; + globalTestConfig.compatibility = compatibility; + globalTestConfig.logToWebSocket = ctsOptions.logToWebSocket; + + const log = new Logger(); + + if (powerPreference || compatibility) { + setDefaultRequestAdapterOptions({ + ...(powerPreference && { powerPreference }), + // MAINTENANCE_TODO: Change this to whatever the option ends up being + ...(compatibility && { compatibilityMode: true }), + }); + } + + return log; +} diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/wrap_for_worker.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/wrap_for_worker.ts new file mode 100644 index 0000000000..5f600fe89d --- /dev/null +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/helper/wrap_for_worker.ts @@ -0,0 +1,54 @@ +import { Fixture } from '../../framework/fixture'; +import { LogMessageWithStack } from '../../internal/logging/log_message.js'; +import { comparePaths, comparePublicParamsPaths, Ordering } from '../../internal/query/compare.js'; +import { parseQuery } from '../../internal/query/parseQuery.js'; +import { TestQuerySingleCase } from '../../internal/query/query.js'; +import { TestGroup } from '../../internal/test_group.js'; +import { assert } from '../../util/util.js'; + +import { setupWorkerEnvironment, WorkerTestRunRequest } from './utils_worker.js'; + +/** + * Sets up the currently running Web Worker to wrap the TestGroup object `g`. + * `g` is the `g` exported from a `.spec.ts` file: a TestGroupBuilder interface, + * which underneath is actually a TestGroup object. + * + * This is used in the generated `.worker.js` files that are generated to use as service workers. + */ +export function wrapTestGroupForWorker(g: TestGroup) { + self.onmessage = async (ev: MessageEvent) => { + const { query, expectations, ctsOptions } = ev.data as WorkerTestRunRequest; + try { + const log = setupWorkerEnvironment(ctsOptions); + + const testQuery = parseQuery(query); + assert(testQuery instanceof TestQuerySingleCase); + let testcase = null; + for (const t of g.iterate()) { + if (comparePaths(t.testPath, testQuery.testPathParts) !== Ordering.Equal) { + continue; + } + for (const c of t.iterate(testQuery.params)) { + if (comparePublicParamsPaths(c.id.params, testQuery.params) === Ordering.Equal) { + testcase = c; + } + } + } + assert(!!testcase, 'testcase not found'); + const [rec, result] = log.record(query); + await testcase.run(rec, testQuery, expectations); + + ev.source?.postMessage({ query, result }); + } catch (thrown) { + const ex = thrown instanceof Error ? thrown : new Error(`${thrown}`); + ev.source?.postMessage({ + query, + result: { + status: 'fail', + timems: 0, + logs: [LogMessageWithStack.wrapError('INTERNAL', ex)], + }, + }); + } + }; +} diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/server.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/server.ts index 8310784e3a..3999b285ba 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/runtime/server.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/server.ts @@ -5,6 +5,7 @@ import * as http from 'http'; import { AddressInfo } from 'net'; import { dataCache } from '../framework/data_cache.js'; +import { getResourcePath, setBaseResourcePath } from '../framework/resources.js'; import { globalTestConfig } from '../framework/test_config.js'; import { DefaultTestFileLoader } from '../internal/file_loader.js'; import { prettyPrintLog } from '../internal/logging/log_message.js'; @@ -20,21 +21,23 @@ import sys from './helper/sys.js'; function usage(rc: number): never { console.log(`Usage: - tools/run_${sys.type} [OPTIONS...] + tools/server [OPTIONS...] Options: --colors Enable ANSI colors in output. --compat Run tests in compatibility mode. --coverage Add coverage data to each result. - --data Path to the data cache directory. --verbose Print result/log of every test as it runs. + --debug Include debug messages in logging. --gpu-provider Path to node module that provides the GPU implementation. --gpu-provider-flag Flag to set on the gpu-provider as = --unroll-const-eval-loops Unrolls loops in constant-evaluation shader execution tests --u Flag to set on the gpu-provider as = Provides an HTTP server used for running tests via an HTTP RPC interface -To run a test, perform an HTTP GET or POST at the URL: - http://localhost:port/run? +First, load some tree or subtree of tests: + http://localhost:port/load?unittests:basic:* +To run a single test case, perform an HTTP GET or POST at the URL: + http://localhost:port/run?unittests:basic:test,sync To shutdown the server perform an HTTP GET or POST at the URL: http://localhost:port/terminate `); @@ -46,6 +49,8 @@ interface RunResult { status: Status; // Any additional messages printed message: string; + // The time it took to execute the test + durationMS: number; // Code coverage data, if the server was started with `--coverage` // This data is opaque (implementation defined). coverageData?: string; @@ -71,13 +76,13 @@ if (!sys.existsSync('src/common/runtime/cmdline.ts')) { console.log('Must be run from repository root'); usage(1); } +setBaseResourcePath('out-node/resources'); Colors.enabled = false; let emitCoverage = false; let verbose = false; let gpuProviderModule: GPUProviderModule | undefined = undefined; -let dataPath: string | undefined = undefined; const gpuProviderFlags: string[] = []; for (let i = 0; i < sys.args.length; ++i) { @@ -89,13 +94,17 @@ for (let i = 0; i < sys.args.length; ++i) { globalTestConfig.compatibility = true; } else if (a === '--coverage') { emitCoverage = true; - } else if (a === '--data') { - dataPath = sys.args[++i]; + } else if (a === '--force-fallback-adapter') { + globalTestConfig.forceFallbackAdapter = true; + } else if (a === '--log-to-websocket') { + globalTestConfig.logToWebSocket = true; } else if (a === '--gpu-provider') { const modulePath = sys.args[++i]; gpuProviderModule = require(modulePath); } else if (a === '--gpu-provider-flag') { gpuProviderFlags.push(sys.args[++i]); + } else if (a === '--debug') { + globalTestConfig.enableDebugLogs = true; } else if (a === '--unroll-const-eval-loops') { globalTestConfig.unrollConstEvalLoops = true; } else if (a === '--help') { @@ -110,9 +119,12 @@ for (let i = 0; i < sys.args.length; ++i) { let codeCoverage: CodeCoverageProvider | undefined = undefined; -if (globalTestConfig.compatibility) { +if (globalTestConfig.compatibility || globalTestConfig.forceFallbackAdapter) { // MAINTENANCE_TODO: remove the cast once compatibilityMode is officially added - setDefaultRequestAdapterOptions({ compatibilityMode: true } as GPURequestAdapterOptions); + setDefaultRequestAdapterOptions({ + compatibilityMode: globalTestConfig.compatibility, + forceFallbackAdapter: globalTestConfig.forceFallbackAdapter, + } as GPURequestAdapterOptions); } if (gpuProviderModule) { @@ -130,28 +142,26 @@ Did you remember to build with code coverage instrumentation enabled?` } } -if (dataPath !== undefined) { - dataCache.setStore({ - load: (path: string) => { - return new Promise((resolve, reject) => { - fs.readFile(`${dataPath}/${path}`, (err, data) => { - if (err !== null) { - reject(err.message); - } else { - resolve(data); - } - }); +dataCache.setStore({ + load: (path: string) => { + return new Promise((resolve, reject) => { + fs.readFile(getResourcePath(`cache/${path}`), (err, data) => { + if (err !== null) { + reject(err.message); + } else { + resolve(data); + } }); - }, - }); -} + }); + }, +}); + if (verbose) { dataCache.setDebugLogger(console.log); } // eslint-disable-next-line @typescript-eslint/require-await (async () => { - Logger.globalDebugMode = verbose; const log = new Logger(); const testcases = new Map(); @@ -198,14 +208,16 @@ if (verbose) { if (codeCoverage !== undefined) { codeCoverage.begin(); } + const start = performance.now(); const result = await runTestcase(testcase); + const durationMS = performance.now() - start; const coverageData = codeCoverage !== undefined ? codeCoverage.end() : undefined; let message = ''; if (result.logs !== undefined) { message = result.logs.map(log => prettyPrintLog(log)).join('\n'); } const status = result.status; - const res: RunResult = { status, message, coverageData }; + const res: RunResult = { status, message, durationMS, coverageData }; response.statusCode = 200; response.end(JSON.stringify(res)); } else { diff --git a/dom/webgpu/tests/cts/checkout/src/common/runtime/standalone.ts b/dom/webgpu/tests/cts/checkout/src/common/runtime/standalone.ts index 0376f92dda..dc75e6fd01 100644 --- a/dom/webgpu/tests/cts/checkout/src/common/runtime/standalone.ts +++ b/dom/webgpu/tests/cts/checkout/src/common/runtime/standalone.ts @@ -2,7 +2,7 @@ /* eslint no-console: "off" */ import { dataCache } from '../framework/data_cache.js'; -import { setBaseResourcePath } from '../framework/resources.js'; +import { getResourcePath, setBaseResourcePath } from '../framework/resources.js'; import { globalTestConfig } from '../framework/test_config.js'; import { DefaultTestFileLoader } from '../internal/file_loader.js'; import { Logger } from '../internal/logging/logger.js'; @@ -21,7 +21,7 @@ import { OptionsInfos, camelCaseToSnakeCase, } from './helper/options.js'; -import { TestWorker } from './helper/test_worker.js'; +import { TestDedicatedWorker, TestSharedWorker, TestServiceWorker } from './helper/test_worker.js'; const rootQuerySpec = 'webgpu:*'; let promptBeforeReload = false; @@ -47,16 +47,26 @@ const { queries: qs, options } = parseSearchParamLikeWithOptions( kStandaloneOptionsInfos, window.location.search || rootQuerySpec ); -const { runnow, debug, unrollConstEvalLoops, powerPreference, compatibility } = options; -globalTestConfig.unrollConstEvalLoops = unrollConstEvalLoops; +const { runnow, powerPreference, compatibility, forceFallbackAdapter } = options; +globalTestConfig.enableDebugLogs = options.debug; +globalTestConfig.unrollConstEvalLoops = options.unrollConstEvalLoops; globalTestConfig.compatibility = compatibility; +globalTestConfig.logToWebSocket = options.logToWebSocket; -Logger.globalDebugMode = debug; const logger = new Logger(); setBaseResourcePath('../out/resources'); -const worker = options.worker ? new TestWorker(options) : undefined; +const testWorker = + options.worker === null + ? null + : options.worker === 'dedicated' + ? new TestDedicatedWorker(options) + : options.worker === 'shared' + ? new TestSharedWorker(options) + : options.worker === 'service' + ? new TestServiceWorker(options) + : unreachable(); const autoCloseOnPass = document.getElementById('autoCloseOnPass') as HTMLInputElement; const resultsVis = document.getElementById('resultsVis')!; @@ -70,17 +80,18 @@ stopButtonElem.addEventListener('click', () => { stopRequested = true; }); -if (powerPreference || compatibility) { +if (powerPreference || compatibility || forceFallbackAdapter) { setDefaultRequestAdapterOptions({ ...(powerPreference && { powerPreference }), // MAINTENANCE_TODO: Change this to whatever the option ends up being ...(compatibility && { compatibilityMode: true }), + ...(forceFallbackAdapter && { forceFallbackAdapter: true }), }); } dataCache.setStore({ load: async (path: string) => { - const response = await fetch(`data/${path}`); + const response = await fetch(getResourcePath(`cache/${path}`)); if (!response.ok) { return Promise.reject(response.statusText); } @@ -168,8 +179,8 @@ function makeCaseHTML(t: TestTreeLeaf): VisualizedSubtree { const [rec, res] = logger.record(name); caseResult = res; - if (worker) { - await worker.run(rec, name); + if (testWorker) { + await testWorker.run(rec, name); } else { await t.run(rec); } @@ -223,6 +234,12 @@ function makeCaseHTML(t: TestTreeLeaf): VisualizedSubtree { if (caseResult.logs) { caselogs.empty(); + // Show exceptions at the top since they are often unexpected can point out an error in the test itself vs the WebGPU implementation. + caseResult.logs + .filter(l => l.name === 'EXCEPTION') + .forEach(l => { + $('
').addClass('testcaselogtext').text(l.toJSON()).appendTo(caselogs);
+            });
           for (const l of caseResult.logs) {
             const caselog = $('
').addClass('testcaselog').appendTo(caselogs); $('