Skip to content

Commit 1d8fa9e

Browse files
style: run prettier --write .
1 parent cbdd1fe commit 1d8fa9e

43 files changed

Lines changed: 706 additions & 695 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/cts-triage/SKILL.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ cargo xtask cts 'webgpu:api,validation,category:subcategory:*' 2>&1 | grep -E "(
4848
```
4949

5050
Track the pass rate for each subcategory. This helps you identify:
51+
5152
- What's already working (don't break it!)
5253
- Where the failures are concentrated
5354
- Which issues affect multiple categories
@@ -61,6 +62,7 @@ cargo xtask cts 'webgpu:api,validation,category:subcategory:*' 2>&1 | grep "\[fa
6162
```
6263

6364
Look for patterns:
65+
6466
- **Format-specific failures**: May indicate missing format capability checks
6567
- **Parameter-specific failures**: Validation missing for specific parameter combinations
6668

@@ -73,6 +75,7 @@ cargo xtask cts 'webgpu:api,validation,category:subcategory:specific_test' 2>&1
7375
```
7476

7577
Look for:
78+
7679
- **"EXPECTATION FAILED: DID NOT REJECT"**: wgpu is accepting invalid input (validation gap)
7780
- **"Validation succeeded unexpectedly"**: Similar to above
7881
- **"Unexpected validation error occurred"**: wgpu is rejecting valid input
@@ -87,6 +90,7 @@ grep -A 40 "test_name" cts/src/webgpu/api/validation/path/file.spec.ts
8790
```
8891

8992
The test source shows:
93+
9094
- What configurations are being tested
9195
- What the expected behavior is (pass/fail)
9296
- The validation rules from the WebGPU spec
@@ -97,21 +101,25 @@ The test source shows:
97101
Group failures into categories:
98102

99103
**High Priority - Validation Gaps:**
104+
100105
- wgpu accepts invalid configurations that should fail
101106
- Security or correctness implications
102107
- Example: Accepting wrong texture formats, missing aspect checks
103108

104109
**Medium Priority - Spec Compliance:**
110+
105111
- Edge cases not handled correctly
106112
- Optional field validation issues
107113
- Example: depthCompare optional field handling
108114

109115
**Low Priority - Minor Gaps:**
116+
110117
- Less common scenarios
111118
- Limited real-world impact
112119
- Example: Depth bias with non-triangle topologies
113120

114121
**Known Issues - Skip:**
122+
115123
- Known failure patterns (documented in AGENTS.md)
116124
- Track count but don't try to fix
117125

@@ -120,6 +128,7 @@ Group failures into categories:
120128
For validation gaps, find where validation should happen:
121129

122130
1. **Search for existing validation:**
131+
123132
```bash
124133
grep -n "relevant_keyword" wgpu-core/src/device/resource.rs
125134
```
@@ -130,6 +139,7 @@ For validation gaps, find where validation should happen:
130139
- Look for existing validation patterns you can follow
131140

132141
3. **Check for helper functions:**
142+
133143
```bash
134144
grep "fn is_" wgpu-types/src/texture/format.rs
135145
```
@@ -162,25 +172,31 @@ Do not write information about changes you have made to the triage document. Onl
162172
**Overall Status:** XP/YF/ZS (%/%/%)
163173

164174
## Passing Sub-suites ✅
175+
165176
[List sub-suites that have no failures (all pass or skip)]
166177

167178
## Remaining Issues ⚠️
179+
168180
[List sub-suites that have failures and if it can be stated concisely, a summary of the issue]
169181

170182
## Issue Detail
183+
171184
[List detail of any investigation into failures. Do not go into detail about passed suites, just list the failures.]
172185

173186
### 1. title, e.g. a distinguishing word from the test selector
187+
174188
**Test selector:** `webgpu:api,validation,render_pipeline,depth_stencil_state:format:*`
175189
**What it tests:** [Description]
176190
**Example failure:**
177191
[a selector for a single failing test, e.g.:]
192+
178193
```
179194
webgpu:api,validation,render_pipeline,depth_stencil_state:depthCompare_optional:isAsync=false;format="stencil8"
180195
```
181196

182197
**Error:**
183198
[error message from the failing tests, e.g.:]
199+
184200
```
185201
Unexpected validation error occurred: Depth/stencil state is invalid:
186202
Format Stencil8 does not have a depth aspect, but depth test/write is enabled
@@ -194,6 +210,7 @@ The validation is triggering incorrectly. When `depthCompare` is undefined/missi
194210
[Your proposed fix. Again, do not speculate. Only state the fix if it is obvious from the root cause analysis, or if you have done specific investigation into how to fix it.]
195211

196212
### 2. title
213+
197214
[repeat as needed for additional issues]
198215
````
199216

@@ -202,6 +219,7 @@ The validation is triggering incorrectly. When `depthCompare` is undefined/missi
202219
For fixed tests that are now passing, add them to `cts_runner/test.lst`:
203220

204221
1. **Use wildcards** to minimize lines:
222+
205223
```
206224
webgpu:api,validation,category:subcategory:isAsync=false;*
207225
```
@@ -237,26 +255,31 @@ noted here with "do not attempt to fix", then stop and ask the user before
237255
attempting to fix.
238256

239257
**Pattern: Format-specific failures**
258+
240259
- Check if format validation is missing
241260
- Look for `is_depth_stencil_format()`, `is_color_format()` etc.
242261
- May need to add format capability checks
243262

244263
**Pattern: Aspect-related failures**
264+
245265
- Check if code validates format aspects (DEPTH, STENCIL, COLOR)
246266
- Use `hal::FormatAspects::from(format)` to check
247267
- Validate operations match available aspects
248268

249269
**Pattern: Optional field failures**
270+
250271
- May be WebGPU optional field semantics issue
251272
- Check if undefined in JS becomes a default value in Rust
252273
- May need to distinguish "not set" from "set to default"
253274

254275
**Pattern: Atomics accepted incorrectly**
276+
255277
- Naga allows referencing an atomic directly in an expression
256278
- Should only allow accessing via `atomicLoad`, `atomicStore`, etc.
257279
- Only investigate as necessary to confirm this is the issue. Do not attempt to fix. Refer user to https://github.com/gfx-rs/wgpu/issues/5474.
258280

259281
**Pattern: Error reporting for destroyed resources**
282+
260283
- Tests that check for validation errors when a destroyed resource is used. `wgpu` often reports these errors later than WebGPU requires, causing the tests to fail.
261284
- `wgpu` may report these errors earlier than it should, causing the test to fail with an unexpected validation error.
262285
- Look for:

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
<!-- Thank you for filing this! Please read the [debugging tips](https://github.com/gfx-rs/wgpu/wiki/Debugging-wgpu-Applications).

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
4+
title: ""
55
labels: enhancement
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/ISSUE_TEMPLATE/other.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Other
33
about: Strange things you want to tell us
4-
title: ''
4+
title: ""
55
labels: question
6-
assignees: ''
6+
assignees: ""
77
---

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ jobs:
760760

761761
# Miri is *only* available on nightly.
762762
- name: Install nightly toolchain
763-
763+
764764
run: |
765765
rustup toolchain install nightly --no-self-update --profile=minimal --component miri
766766
rustup override set nightly
@@ -781,7 +781,6 @@ jobs:
781781
# Consider expanding it to include some API tests with the noop backend.
782782
cargo miri test --package=wgpu --no-default-features -- write_only
783783
784-
785784
fmt:
786785
# runtime is normally 15 seconds
787786
timeout-minutes: 2

AGENTS.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Global instructions
22

33
## Code Style
4+
45
- Limit the amount of comments you put in the code to a strict minimum. You should almost never add comments, except sometimes on non-trivial code, function definitions if the arguments aren't self-explanatory, and class definitions and their members.
56
- Do not use emoji.
67

@@ -91,30 +92,29 @@ See `docs/big-picture.png` for an overview of the system.
9192

9293
The major components are:
9394

94-
* `wgpu-hal` implements a backend for each supported graphics API (Vulkan, DX12, Metal, GLES).
95+
- `wgpu-hal` implements a backend for each supported graphics API (Vulkan, DX12, Metal, GLES).
9596

96-
* `wgpu-core` implements the WebGPU API, including resource management and validation.
97+
- `wgpu-core` implements the WebGPU API, including resource management and validation.
9798
It calls the platform graphics APIs via `wgpu-hal`, and uses `naga` for shader translation.
9899

99-
* `wgpu` is the native Rust API. In addition to providing bindings to `wgpu-core`, the `wgpu`
100+
- `wgpu` is the native Rust API. In addition to providing bindings to `wgpu-core`, the `wgpu`
100101
crate can also be compiled to WASM and built against the "WebGPU" backend, where it uses
101102
whatever WebGPU implementation is provided by the WASM environment. `wgpu` is not used
102103
by Deno and Firefox.
103104

104-
* `naga` is the shader translator. It reads shaders in WGSL, GLSL, or SPIR-V,
105+
- `naga` is the shader translator. It reads shaders in WGSL, GLSL, or SPIR-V,
105106
translates to Naga IR, and then writes shaders in GLSL, HLSL, MSL (Metal Shading Language), SPIR-V, or WGSL.
106107
It is responsible for validating that WGSL shaders are valid according to the WGSL language specification.
107108

108-
* `wgpu-types` contains some type definitions that are applicable both to `wgpu-core` and to
109+
- `wgpu-types` contains some type definitions that are applicable both to `wgpu-core` and to
109110
the `wgpu` "WebGPU" backend.
110111

111-
* `deno_webgpu` contains WebGPU bindings for the Deno Javascript runtime.
112+
- `deno_webgpu` contains WebGPU bindings for the Deno Javascript runtime.
112113
We also use Deno as a test environment for running the WebGPU CTS.
113114
Only make a change in the Deno bindings if you are sure that the issue
114115
doesn't apply to other clients (Firefox or `wgpu` Rust API). If it does
115116
apply to other clients, the issue should probably be fixed in `wgpu-core`.
116117

117-
118118
For a more detailed discussion of the `wgpu` architecture, refer to
119119
<https://github.com/gfx-rs/wgpu/wiki/Architecture>.
120120

@@ -173,6 +173,7 @@ This is stuff that Claude wrote for itself. It can probably be improved.
173173
- Verify constant evaluation by checking the output file
174174

175175
**Running Tests:**
176+
176177
```bash
177178
# Unit tests only
178179
cargo test -p naga --lib

CODE_OF_CONDUCT.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ In this community we strive to go the extra step to look out for each other. Don
1414

1515
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
1616

17-
* Please avoid using overtly sexual aliases or other nicknames that might detract from a friendly, safe and welcoming environment for all.
18-
* Please be kind and courteous. There’s no need to be mean or rude.
19-
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
20-
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
21-
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term “harassment” as including the definition in the [Citizen Code of Conduct](https://github.com/stumpsyn/policies/blob/master/citizen_code_of_conduct.md); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don’t tolerate behavior that excludes people in socially marginalized groups.
22-
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact the maintainers immediately. Whether you’re a regular contributor or a newcomer, we care about making this community a safe place for you and we’ve got your back.
23-
* Do not make casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology.
24-
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
17+
- Please avoid using overtly sexual aliases or other nicknames that might detract from a friendly, safe and welcoming environment for all.
18+
- Please be kind and courteous. There’s no need to be mean or rude.
19+
- Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
20+
- Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
21+
- We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term “harassment” as including the definition in the [Citizen Code of Conduct](https://github.com/stumpsyn/policies/blob/master/citizen_code_of_conduct.md); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don’t tolerate behavior that excludes people in socially marginalized groups.
22+
- Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact the maintainers immediately. Whether you’re a regular contributor or a newcomer, we care about making this community a safe place for you and we’ve got your back.
23+
- Do not make casual mention of slavery or indentured servitude and/or false comparisons of one's occupation or situation to slavery. Please consider using or asking about alternate terminology when referring to such metaphors in technology.
24+
- Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
2525

2626
## Moderation
2727

CONTRIBUTING.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ contribute. If you are unfamiliar with the wgpu project, we recommend you read
77
[`GOVERNANCE.md`] for an overview of its goals, and how it's governed.
88

99
## Table of Contents
10+
1011
- [Documentation Overview](#documentation-overview)
1112
- [Talking to other humans in the wgpu project](#talking-to-other-humans-in-the-wgpu-project)
1213
- ["What can I work on?" as a new contributor](#what-can-i-work-on-as-a-new-contributor)
@@ -40,7 +41,6 @@ The wgpu project has multiple official platforms for community engagement:
4041
- The Matrix channel [`wgpu:matrix.org`](https://matrix.to/#/#wgpu:matrix.org)
4142
is dedicated to informal chat about contributions the project. It is
4243
particularly useful for:
43-
4444
- Saying hello, and introducing yourself.
4545
- Validating contributions (i.e., determining if they'll be accepted,
4646
ensuring your approach is correct, making sure you aren't wasting effort,
@@ -58,7 +58,6 @@ The wgpu project has multiple official platforms for community engagement:
5858

5959
- [GitHub issues] are used to discuss open development questions and track work
6060
the community intends to complete; this might include:
61-
6261
- Work that needs resolution via pull requests (see below)
6362
- Bug reports
6463
- Feature requests
@@ -77,12 +76,11 @@ The wgpu project has multiple official platforms for community engagement:
7776
happen on Google Meet and happen on Wednesday at 11:00 US Eastern Standard
7877
Time and last approximately an hour. Remember to obey the
7978
[`CODE_OF_CONDUCT.md`] in the meeting.
80-
8179
- [Meeting Notes]
8280
- [Meeting Link]
81+
8382
- [GitHub discussions]: TODO: Experimentally used by some enthusiastic members
8483
of our community. Not supported officially.
85-
8684

8785
[GitHub discussions]: https://github.com/gfx-rs/wgpu/discussions
8886
[GitHub issues]: https://github.com/gfx-rs/wgpu/issues
@@ -178,7 +176,7 @@ understand it as a positive change to the codebase.
178176

179177
Using LLMs and AIs to generate code that is part of a contribution is allowed.
180178
However, the author submitting the PR must fully adhere to [Change Ownership](#change-ownership) rules.
181-
The author is responsible for the code, regardless of how it was created.
179+
The author is responsible for the code, regardless of how it was created.
182180
Do not use "LLM generated" as a justification for low quality code.
183181

184182
#### Designing new features
@@ -229,12 +227,12 @@ These problems are serious enough that maintainers may choose to
229227
reject large, complex pull requests, regardless of the value of the
230228
feature or the technical merit of the code.
231229

232-
The problem isn't really the *size* of the pull request: a simple
230+
The problem isn't really the _size_ of the pull request: a simple
233231
rename, with no changes to functionality, might touch hundreds of
234232
files, but be easy to review. Or, a change to naga might affect dozens
235233
of snapshot test output files, without being hard to understand.
236234

237-
Rather, the problem is the *complexity* of the pull request: how many
235+
Rather, the problem is the _complexity_ of the pull request: how many
238236
moving pieces does the reviewer need to assess at once? In our
239237
experience, almost every large change can be pared down by separating
240238
out:
@@ -245,7 +243,6 @@ out:
245243
- Helpers and utilities that can be used elsewhere in the code base,
246244
even if they don't show their full value until the whole thing is
247245
merged.
248-
249246
- Renames and code motion with no semantic effect, like changes to
250247
types or behavior. When putting these in a separate pull request
251248
would be awkward, they should at least be segregated into their own

0 commit comments

Comments
 (0)