• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..16-Feb-2021-

.vscode/H16-Feb-2021-63

docs/H16-Feb-2021-253167

src/H16-Feb-2021-22,00017,875

standalone/third_party/H03-May-2022-21

tools/H16-Feb-2021-8967

.eslintrc.jsonH A D16-Feb-20212 KiB7473

.gitignoreH A D16-Feb-20212.9 KiB189139

.travis.ymlH A D16-Feb-2021509 2924

CONTRIBUTING.mdH A D16-Feb-20211.2 KiB3223

README.mdH A D16-Feb-20214.4 KiB12483

cts.code-workspaceH A D16-Feb-20211.4 KiB5352

package-lock.jsonH A D16-Feb-2021263.9 KiB7,0527,051

package.jsonH A D16-Feb-20211.5 KiB5352

tsconfig.jsonH A D16-Feb-2021482 2019

w3c.jsonH A D16-Feb-2021101 55

README.md

1# WebGPU Conformance Test Suite
2
3## >>> [**Contribution Guidelines**](https://github.com/gpuweb/gpuweb/wiki/WebGPU-CTS-guidelines) <<< | >>> [**View/Edit Test Plan**](https://hackmd.io/@webgpu/H1MwoqqAU) <<<
4
5## Run these tests live: [gpuweb.github.io/cts/standalone/](https://gpuweb.github.io/cts/standalone/)
6
7## **NOTE**: If you are contributing tests that tentatively use GLSL instead of WGSL, develop on the [glsl-dependent](https://github.com/gpuweb/cts/tree/glsl-dependent) branch (run live at [gpuweb-cts-glsl.github.io/standalone/](http://gpuweb-cts-glsl.github.io/standalone/))
8
9## Docs
10
11- This file
12- [Terminology used in the test framework](docs/terms.md)
13
14## Contributing
15
16**First, read the workflow section of the [test plan](https://hackmd.io/@webgpu/H1MwoqqAU)**
17for information on how additions to the CTS should be developed.
18Read [CONTRIBUTING.md](CONTRIBUTING.md) on licensing.
19
20For realtime communication about WebGPU spec and test, join the
21[#WebGPU:matrix.org room](https://app.element.io/#/room/#WebGPU:matrix.org)
22on Matrix.
23
24### Making Changes
25
26To add new tests, imitate the pattern in neigboring tests or
27neighboring files. New test files must be named ending in `.spec.ts`.
28
29For an example test file, see `src/webgpu/examples.spec.ts`.
30
31Since this project is written in TypeScript, it integrates best with Visual
32Studio Code. There are also some default settings (in `.vscode/settings.json`)
33which will be applied automatically.
34
35### Opening a Pull Request
36
37Before uploading, you can run pre-submit checks (`grunt pre`) to make sure
38it will pass CI.
39
40To contribute changes, simply open a pull request against the project at
41<https://github.com/gpuweb/cts> to automatically notify reviewers.
42Depending on whether your change is against the `main` branch or the
43`glsl-dependent` branch, be sure to open it against the right one.
44
45To make reviewers' lives easier, try to keep pull requests small and
46incremental when possible (though this is often difficult since tests are very
47verbose).
48
49### Making Revisions
50
51During the code review process, keep a few things in mind to help reviewers
52review your changes. Once a reviewer has looked at your change once already:
53
54- Avoid major additions or changes that would be best done in a follow-up PR.
55- Avoid rebases (`git rebase`) and force pushes (`git push -f`). These can make
56  it difficult for reviewers to review incremental changes as GitHub cannot
57  view a useful diff across a rebase. If it's necessary to resolve conflicts
58  with upstream changes, use a merge commit (`git merge`) and don't include any
59  consequential changes in the merge, so a reviewer can skip over merge commits
60  when working through the individual commits in the PR.
61- When you address a review comment, mark the thread as "Resolved".
62
63## Developing
64
65The WebGPU CTS is written in TypeScript.
66
67### Setup
68
69After checking out the repository and installing node/npm, run these commands
70in the checkout:
71
72```sh
73npm install
74
75npx grunt  # show available grunt commands
76```
77
78### Build
79
80The project builds into two directories:
81
82- `out/`: Built framework and test files, needed to run standalone or command line.
83- `out-wpt/`: Build directory for export into WPT. Contains:
84    - An adapter for running WebGPU CTS tests under WPT
85    - A copy of the needed files from `out/`
86    - A copy of any `.html` test cases from `src/`
87
88To build and run all pre-submit checks (including type and lint checks and
89unittests), use:
90
91```sh
92npx grunt pre
93```
94
95For a quicker iterative build:
96
97```sh
98npx grunt test
99```
100
101### Run
102
103To test in a browser under the standalone harness, run `npx grunt serve`, then
104open:
105
106- `http://localhost:8080/standalone/` (defaults to `?runnow=0&worker=0&debug=0&q=webgpu:*`)
107- `http://localhost:8080/standalone/?q=unittests:*`
108- `http://localhost:8080/standalone/?q=unittests:basic:*`
109
110The following url parameters change how the harness runs:
111
112- `runnow=1` runs all matching tests on page load.
113- `debug=1` enables verbose debug logging from tests.
114- `worker=1` runs the tests on a Web Worker instead of the main thread.
115
116Currently, large [test queries](docs/terms.md) may take a while to load.
117You can open the browser's Dev Tools to make sure something hasn't crashed.
118If a query loads too slowly, load a more targeted query.
119
120### Export to WPT
121
122Copy (or symlink) the `out-wpt/` directory as the `webgpu/` directory in your
123WPT checkout or your browser's "internal" WPT test directory.
124