Skip to content

[skill-update] skill(webnn): align to W3C WebNN CRD January 2026#9

Closed
github-actions[bot] wants to merge 1 commit intomainfrom
skill-update/webnn-skill-update-d82e5588ce8d595c
Closed

[skill-update] skill(webnn): align to W3C WebNN CRD January 2026#9
github-actions[bot] wants to merge 1 commit intomainfrom
skill-update/webnn-skill-update-d82e5588ce8d595c

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Updates the skills/webnn skill to align with the W3C WebNN Candidate Recommendation published 22 January 2026 (updated from the April 2024 snapshot).

Material deltas

1. deviceType removed → accelerated: boolean replaces it

The spec removed MLDeviceType (the cpu/gpu/npu enum) in #809 to simplify device selection. MLContextOptions now has:

  • powerPreference: "default" | "high-performance" | "low-power" (unchanged)
  • accelerated: boolean, default truetrue lets the browser prefer GPU/NPU guided by powerPreference; false requests CPU inference

All skill files updated accordingly. A compatibility note in references/compatibility.md flags that older Chromium builds used deviceType as a legacy surface.

2. Worker context expanded

The ML interface is now Exposed=(Window, Worker) — includes DedicatedWorker, SharedWorker, and ServiceWorker, not only DedicatedWorker as previously documented.

3. New API surfaces documented in references/webnn-reference.md

  • MLContext.createConstantTensor(descriptor, inputData) — creates a pre-initialized constant tensor
  • navigator.ml.createContext(gpuDevice) overload — WebGPU interop path
  • MLContext.readTensor(tensor, outputData) overload — reads into an existing AllowSharedBufferSource buffer
  • MLGraphBuilder.build() single-invocation constraint
  • Operator labels (MLOperatorOptions.label) for diagnosable error messages

Files changed

File Change
SKILL.md Steps 5, 7, 8, 3.4, 5.4, Error Handling updated for new device API and Worker scope
references/webnn-reference.md Core execution model, context options, integration rules, operator labels all updated
references/compatibility.md Device selection section rewritten; execution context expanded; migration note added
references/examples.md Context creation and smoke test updated to use powerPreference without deviceType
references/troubleshooting.md createContext() and device selection troubleshooting updated
assets/webnn-runtime.template.ts Removed WebNNDeviceType; WebNNContextOptions uses accelerated instead of deviceType

Validations run

python .agents/skills/skill-creator/scripts/validate-metadata.py \
  --name "webnn" \
  --description "Implements and debugs browser Web Neural Network API integrations..."
# → SUCCESS: Metadata is valid and optimized for discovery.

Checklist items confirmed: name/directory match, description within limits, SKILL.md under 500 lines, no human docs added, all paths use forward slashes.

Remaining risks

  • Implementation lag: The spec change from deviceType to accelerated was published January 2026. Chromium milestone rollout is ongoing; implementers should verify milestone support against references/compatibility.md before shipping.
  • webnn.io secondary source: The prefetched 01.txt was largely CSS/JS with no extractable API content; all API detail sourced from the W3C spec (higher priority per prompt instructions). No conflict to resolve.

Generated by Skill Update Worker ·

- Replace deviceType (cpu/gpu/npu) with accelerated boolean per spec change #809
- Expand execution context support from DedicatedWorker to all Worker types
- Document createConstantTensor(), createContext(GPUDevice) overload, readTensor(tensor, outputData) overload
- Add build() single-invocation constraint to reference
- Update MLContextOptions: remove deviceType, add accelerated boolean (default true)
- Update compatibility.md with migration note for legacy deviceType usage
- Update examples.md context creation to use new API shape
- Update WebNNContextOptions TypeScript type in template asset
- Note operator labels (MLOperatorOptions.label) in reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@webmaxru webmaxru closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant