Skip to content

Commit a23587f

Browse files
committed
update docs
1 parent f55d393 commit a23587f

4 files changed

Lines changed: 39 additions & 20 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
[![bun](https://img.shields.io/badge/bun-%E2%89%A5%201.4-f9f1e1?logo=bun)](https://bun.sh)
77

88
**The `webgpu` npm package segfaults Bun. This is a WebGPU that runs there.** A `bun:ffi` binding to
9-
[wgpu-native](https://github.com/gfx-rs/wgpu-native), API-compatible with
10-
[`webgpu`](https://www.npmjs.com/package/webgpu) — headless compute and offscreen rendering on
11-
Windows, macOS and Linux, x64 and arm64.
9+
[wgpu-native](https://github.com/gfx-rs/wgpu-native) — the C API over
10+
[`wgpu`](https://github.com/gfx-rs/wgpu), which is the core of WebGPU in **Firefox, Servo and
11+
Deno** — API-compatible with [`webgpu`](https://www.npmjs.com/package/webgpu). Headless compute and
12+
offscreen rendering on Windows, macOS and Linux, x64 and arm64.
1213

1314
```sh
1415
bun add wgpu-bun
@@ -79,7 +80,7 @@ It is a **subpath** on purpose: the root export stays exactly the three names `w
7980

8081
| | **wgpu-bun** | [`bun-webgpu`](https://github.com/kommander/bun-webgpu) | [`webgpu`](https://www.npmjs.com/package/webgpu) |
8182
|---|---|---|---|
82-
| Backend | **wgpu-native** (the Rust `wgpu` everyone else ships) | Dawn | Dawn |
83+
| Backend | **wgpu-native** the Rust `wgpu` behind Firefox, Servo and Deno | Dawn — Chromium's | Dawn — Chromium's |
8384
| Runs under Bun | **yes** | yes | **no** — the N-API addon segfaults the runtime |
8485
| `popErrorScope()` | **reports, with negative tests proving it can go red** | crashes its allocator, even on an empty scope | works |
8586
| `getCompilationInfo()` | **real diagnostics**, synthesised from the validation error | unimplemented | works |

docs/COMPATIBILITY.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,15 @@ And by design:
9494
- **Browser API fidelity beyond WebGPU.** No `requestAnimationFrame`, no `ImageBitmap`, no
9595
`OffscreenCanvas`. Note that `queue.copyExternalImageToTexture` therefore has no equivalent — decode
9696
to a `Uint8Array` and use `writeTexture`.
97-
- **Dawn.** Not a fallback, not a build flag. If you want Dawn under Bun, `bun-webgpu` already does it.
98-
- **Node.** Bun-only, deliberately — `bun:ffi` *is* the implementation strategy.
97+
- **Dawn.** Not a fallback and not a build flag *in this package*. If you want Dawn under Bun,
98+
`bun-webgpu` already does it.
99+
- **Node.** Bun-only, deliberately — `bun:ffi` *is* the implementation strategy here.
100+
101+
Both of those are properties of **this package**, not of the repository. `wgpu-bun` is the Bun
102+
binding; a Node counterpart, or a Dawn-backed one, would be its own package built on its own
103+
mechanism, and neither would change what the sentences above say about this one. That is also why
104+
the repository is `argon-chat/wgpu` and not `argon-chat/wgpu-bun` — see
105+
[RELEASE.md](./RELEASE.md#repository-name-deliberately-not-the-package-name).
99106
- **WebGPU CTS conformance.** A worthy goal; not a claim that will be made before it is measured.
100107

101108
Nothing on this list returns a plausible-looking nothing. A call either does the thing or throws

docs/ERROR-PATH.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,22 @@ choice**, so those are first-class deliverables, not a later milestone.
7979

8080
Dawn and wgpu-native are both conformant-ish WebGPU implementations that disagree in observable ways:
8181
validation strictness, WGSL acceptance, reported limits, resource lifetimes, error message text.
82-
Neither is "correct"; they are different. wgpu-native is the C API over
83-
[wgpu](https://github.com/gfx-rs/wgpu), the same implementation every Rust/wgpu consumer ships. If
84-
that is your deployment target, a Dawn-backed binding tests an implementation you do not run — and
85-
passes.
82+
Neither is "correct"; they are different.
83+
84+
They are also not obscure alternatives — they are **the two browser implementations**, and which one
85+
you validate against is the choice this package exists to hand you:
86+
87+
| | implementation | ships in |
88+
|---|---|---|
89+
| **wgpu-native** — what this binds | the C API over [`wgpu`](https://github.com/gfx-rs/wgpu) | "the core of the WebGPU integration in **Firefox, Servo, and Deno**" — wgpu's own README |
90+
| **Dawn** — what `webgpu` and `bun-webgpu` bind | Google's implementation | "the underlying implementation of WebGPU in **Chromium**" — Dawn's own README |
91+
92+
Deno is the one to notice if you are choosing a JavaScript runtime's binding: its WebGPU is wgpu, so
93+
this is the binding that makes Bun agree with Deno rather than with Chrome. And if you ship a Rust
94+
or wgpu-based renderer, it is the same implementation your other half already runs.
95+
96+
The general form of the argument: a Dawn-backed binding tests an implementation you may not deploy —
97+
and passes.
8698

8799
Bindings are the right layer to make that choice at. Being able to pick the implementation your JS
88100
code is validated against, rather than inheriting whichever one your binding's author preferred, is

docs/RELEASE.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,18 @@ Worth knowing before submitting: the existing entries do not consistently follow
9595
actually reads. The maintainers ask for edits on the existing PR rather than a new one, so expect a
9696
round of review rather than a merge or a close.
9797

98-
## Repository name and discoverability
98+
## Repository name: deliberately NOT the package name
9999

100-
The npm package is `wgpu-bun`; the repository is `argon-chat/wgpu`. A search for "bun webgpu" on
101-
GitHub does not find the latter, which is the whole audience.
100+
The npm package is `wgpu-bun`; the repository is `argon-chat/wgpu`, and it stays that way.
102101

103-
Renaming to `wgpu-bun` costs a redirect GitHub maintains for you, and requires updating in the same
104-
change:
102+
The obvious argument for renaming is discoverability — a GitHub search for "bun webgpu" does not
103+
find `argon-chat/wgpu`. Topics answer that (below), and the owner's roadmap answers the rest:
104+
**Dawn and a Node port are both on the table.** A repository named `wgpu-bun` would then be hosting
105+
a binding that is neither only-wgpu nor only-bun, and renaming a second time costs the same as the
106+
first. The package name is one artefact this repository produces, not its identity.
105107

106-
- `repository.url`, `homepage` and `bugs.url` in `package.json` — an npm trusted-publisher
107-
configuration matches on the repository, so it must be updated on npmjs.com too, for all five
108-
packages;
109-
- the three badge URLs at the top of `README.md`;
110-
- the `SHIM_ASSETS` release URLs in `shim.manifest.ts`.
108+
So if a future reader wonders why the two names differ: they differ on purpose, and the general one
109+
is the repository.
111110

112111
Topics, which cost nothing and are how GitHub search actually finds things:
113112

0 commit comments

Comments
 (0)