The WebGPU conformance test suite (CTS) is developed at https://github.com/gpuweb/cts. It is written in TypeScript and compiled to JavaScript to run as part of WPT.
(Note: there is no copy of the WebGPU CTS in WPT. This is because browsers are at different stages of implementation, and it is more useful to pin a particular revision of the CTS rather than use the latest version.)
Most of the WebGPU CTS runs on Chrome's infrastructure using the GPU Telemetry harness (see content/test/gpu/gpu_tests/webgpu_cts_integration_test.py). Only the reftests run using the web tests infrastructure.
An autoroller (https://autoroll.skia.org/r/webgpu-cts-chromium-autoroll) rolls the WebGPU CTS into Chromium regularly. Part of the roll requires regenerating a few files which the autoroller attempts to do.
third_party/webgpu-cts/ts_sources.txt
is a generated file which tells GN the list of Typescript sources to be transpiled to Javascript.third_party/webgpu-cts/resource_files.txt
is a generated file which tells GN the list of resources that should be included in the test isolate for CTS test pages to load.third_party/blink/web_tests/wpt_internal/webgpu/web_platform/reftests/**/*.html
are the reftests and reference files which run on the web tests test infrastructure.(If you want to test unlanded reftest changes to the WebGPU CTS, first check them out in third_party/webgpu-cts/src
, then run third_party/webgpu-cts/scripts/gen_ts_dep_lists.py
and third_party/webgpu-cts/scripts/run_regenerate_internal_cts_html.py
.)
Build the webgpu_blink_web_tests
target (change build directory name as needed):
autoninja -C out/YOUR_TARGET webgpu_blink_web_tests
Then, do one of the following:
third_party/blink/tools/run_blink_wptserve.py -t YOUR_TARGET
Run tests with expectations applied (arguments copied from test_suites.pyl
; check there to see if this documentation is outdated):
./out/YOUR_TARGET/bin/run_webgpu_blink_web_tests --target YOUR_TARGET --flag-specific=webgpu
--no-xvfb --additional-driver-flag=--enable-features=Vulkan
.--flag-specific
may be changed from webgpu
to webgpu-with-backend-validation
or webgpu-with-partial-backend-validation
.To run a particular test rather than all the reftests, add a test filter. Examples:
--isolated-script-test-filter='wpt_internal/webgpu/web_platform/reftests/canvas_complex_bgra8unorm_draw.https.html
--isolated-script-test-filter='wpt_internal/webgpu/web_platform/reftests/canvas_clear.https.html
Finally, to view the results, open out/YOUR_TARGET/layout-test-results/results.html
.