Skip to content

Specification maintenance

Run these commands from the repository root. Fetching source files and generating bindings are separate, explicit operations; neither is part of check.

1. Fetch upstream source files

./gradlew check-cache

This downloads the WebGPU HTML specification from W3C and the IDL from GPUWeb, storing both under webgpu-specifications/src/jvmMain/resources/. It also updates cache.json.

2. Rebuild documentation JSON

./gradlew refresh-documentation-from-spec

The task replaces documentation.json from the checked-in HTML and IDL. Review its prose before generating bindings.

3. Fill optional missing descriptions

./gradlew generate-doc-from-llm

This optional command needs an OpenAI-compatible chat-completions server at http://127.0.0.1:1234/v1 serving mistral-small-3.1-24b-instruct-2503. It is never run by CI.

4. Check coverage and convert to YAML

./gradlew check-missing-doc
./gradlew tranform-json-doc-to-yaml

The first task prints missing keys. The second writes documentation.yaml; its task name is currently spelled tranform without the second “s”.

5. Generate bindings

./gradlew generate-binding

The generator reads the checked-in IDL and YAML and rewrites generated Kotlin sources in webgpu-api, webgpu-descriptors, and webgpu-web-bindings. Review the changes and run the business tests. Do not edit generated sources directly. webgpu-browser is hand-written: it consumes the contracts and the generated bindings and does not contain generated sources.