[skill-update] skill(webnn): align to W3C WebNN CRD January 2026#9
Closed
github-actions[bot] wants to merge 1 commit intomainfrom
Closed
[skill-update] skill(webnn): align to W3C WebNN CRD January 2026#9github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the
skills/webnnskill to align with the W3C WebNN Candidate Recommendation published 22 January 2026 (updated from the April 2024 snapshot).Material deltas
1.
deviceTyperemoved →accelerated: booleanreplaces itThe spec removed
MLDeviceType(thecpu/gpu/npuenum) in #809 to simplify device selection.MLContextOptionsnow has:powerPreference:"default"|"high-performance"|"low-power"(unchanged)accelerated:boolean, defaulttrue—truelets the browser prefer GPU/NPU guided bypowerPreference;falserequests CPU inferenceAll skill files updated accordingly. A compatibility note in
references/compatibility.mdflags that older Chromium builds useddeviceTypeas a legacy surface.2. Worker context expanded
The
MLinterface is nowExposed=(Window, Worker)— includes DedicatedWorker, SharedWorker, and ServiceWorker, not onlyDedicatedWorkeras previously documented.3. New API surfaces documented in
references/webnn-reference.mdMLContext.createConstantTensor(descriptor, inputData)— creates a pre-initialized constant tensornavigator.ml.createContext(gpuDevice)overload — WebGPU interop pathMLContext.readTensor(tensor, outputData)overload — reads into an existingAllowSharedBufferSourcebufferMLGraphBuilder.build()single-invocation constraintMLOperatorOptions.label) for diagnosable error messagesFiles changed
SKILL.mdreferences/webnn-reference.mdreferences/compatibility.mdreferences/examples.mdpowerPreferencewithoutdeviceTypereferences/troubleshooting.mdcreateContext()and device selection troubleshooting updatedassets/webnn-runtime.template.tsWebNNDeviceType;WebNNContextOptionsusesacceleratedinstead ofdeviceTypeValidations run
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
deviceTypetoacceleratedwas published January 2026. Chromium milestone rollout is ongoing; implementers should verify milestone support againstreferences/compatibility.mdbefore shipping.01.txtwas 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.