Directories
¶
| Path | Synopsis |
|---|---|
|
Package cabi is the guest side of the Canonical ABI's memory for Go programs built with GOOS=wasip1: the cabi_realloc export a host calls to return lists and strings, guest-side allocations for arguments, and the guest's own linear memory as a wit.Memory.
|
Package cabi is the guest side of the Canonical ABI's memory for Go programs built with GOOS=wasip1: the cabi_realloc export a host calls to return lists and strings, guest-side allocations for arguments, and the guest's own linear memory as a wit.Memory. |
|
examples
|
|
|
batchcompute
command
Command batchcompute is a WASI container that computes on the GPU through the batched command stream (wasi_webgpu_batch) and checks every element it reads back.
|
Command batchcompute is a WASI container that computes on the GPU through the batched command stream (wasi_webgpu_batch) and checks every element it reads back. |
|
compute
command
Command compute is a WASI container that computes on the GPU through wasi:webgpu and checks every result against the CPU: a vector add of 1M floats and a 256x256 matrix product.
|
Command compute is a WASI container that computes on the GPU through wasi:webgpu and checks every result against the CPU: a vector add of 1M floats and a 256x256 matrix product. |
|
mnist
command
Command mnist is a WASI container that reads a handwritten digit: it embeds MNIST-12 (ONNX model zoo, MIT) and a 28x28 picture, runs the model through wasi-nn, and prints the digit with its probability.
|
Command mnist is a WASI container that reads a handwritten digit: it embeds MNIST-12 (ONNX model zoo, MIT) and a 28x28 picture, runs the model through wasi-nn, and prints the digit with its probability. |
|
triangle
command
Command triangle is a WASI container that draws a spinning triangle on a surface through wasi:webgpu and wasi-gfx:surface: in the playground the surface is a pane of the dashboard.
|
Command triangle is a WASI container that draws a spinning triangle on a surface through wasi:webgpu and wasi-gfx:surface: in the playground the surface is a pane of the dashboard. |
|
Package gpubatch is the host side of the batched GPU command stream for WASI containers: the import module "wasi_webgpu_batch", served by the engine's host-module mechanism (wasi.HostModule), natively and in the browser.
|
Package gpubatch is the host side of the batched GPU command stream for WASI containers: the import module "wasi_webgpu_batch", served by the engine's host-module mechanism (wasi.HostModule), natively and in the browser. |
|
internal
|
|
|
cmd/enginetest
command
Command enginetest is a minimal engine worker, as the playground's: the engine's browser executor (one Web Worker per container, the SAB bridge) with this module's host modules, wasi:webgpu and wasi-nn (CPU and WebGPU backends).
|
Command enginetest is a minimal engine worker, as the playground's: the engine's browser executor (one Web Worker per container, the SAB bridge) with this module's host modules, wasi:webgpu and wasi-nn (CPU and WebGPU backends). |
|
cmd/gpuprobe
command
Command gpuprobe asks a real browser, through Playwright, what WebGPU it offers a page: whether navigator.gpu exists (in a window and in a worker), and the adapter's vendor, architecture and whether it is a fallback (software) adapter.
|
Command gpuprobe asks a real browser, through Playwright, what WebGPU it offers a page: whether navigator.gpu exists (in a window and in a worker), and the adapter's vendor, architecture and whether it is a fallback (software) adapter. |
|
cmd/llmbaseline
command
Command llmbaseline measures the reference speeds that in-container WebGPU inference is compared against (docs/llm-design.md, step 0): llama.cpp on one CPU thread (and Metal, as context), and WebLLM in Chrome for Testing on the Apple GPU, interleaved round by round with the load checked before each run.
|
Command llmbaseline measures the reference speeds that in-container WebGPU inference is compared against (docs/llm-design.md, step 0): llama.cpp on one CPU thread (and Metal, as context), and WebLLM in Chrome for Testing on the Apple GPU, interleaved round by round with the load checked before each run. |
|
cmd/mnistpng
command
Command mnistpng extracts one picture of the MNIST test set (IDX files, gzipped, as published by Y. LeCun, C. Cortes and C. Burges; CC BY-SA 3.0) to a 28x28 grayscale PNG and prints its label, so the mnist example classifies a real handwritten digit whose answer is known.
|
Command mnistpng extracts one picture of the MNIST test set (IDX files, gzipped, as published by Y. LeCun, C. Cortes and C. Burges; CC BY-SA 3.0) to a 28x28 grayscale PNG and prints its label, so the mnist example classifies a real handwritten digit whose answer is known. |
|
cmd/onnxvendor
command
Command onnxvendor copies the ONNX node tests this repository's onnx package can run into onnx/testdata/node: from a checkout of github.com/onnx/onnx (v1.22.0 is the last tag that ships onnx/backend/test/data/node), every test whose model decodes, uses only supported operators and passes onnx.NewSession.
|
Command onnxvendor copies the ONNX node tests this repository's onnx package can run into onnx/testdata/node: from a checkout of github.com/onnx/onnx (v1.22.0 is the last tag that ships onnx/backend/test/data/node), every test whose model decodes, uses only supported operators and passes onnx.NewSession. |
|
cmd/webtest
command
Command webtest runs in a browser Web Worker (as the playground's engine worker does) and checks the WebGPU wasi-nn backend against the ONNX node tests and MNIST-12: for each case it fetches the model and its test data from the page's origin, runs it through webgpu.Backend, compares with the reference (rtol 1e-3, atol 1e-7, the ONNX backend's tolerances) and posts a JSON report: the adapter, and every case's result.
|
Command webtest runs in a browser Web Worker (as the playground's engine worker does) and checks the WebGPU wasi-nn backend against the ONNX node tests and MNIST-12: for each case it fetches the model and its test data from the page's origin, runs it through webgpu.Backend, compares with the reference (rtol 1e-3, atol 1e-7, the ONNX backend's tolerances) and posts a JSON report: the adapter, and every case's result. |
|
cmd/witgen
command
Command witgen writes the core imports of a WIT interface for Go guests (GOOS=wasip1): one //go:wasmimport per function and resource drop, with its Canonical ABI core signature (package wit), and a table from import name to a call taking and returning core values as uint64.
|
Command witgen writes the core imports of a WIT interface for Go guests (GOOS=wasip1): one //go:wasmimport per function and resource drop, with its Canonical ABI core signature (package wit), and a table from import name to a call taking and returning core values as uint64. |
|
reentry
Package reentry measures risk R1 of docs/DESIGN.md: can a host, while a Go wasip1 guest is inside a //go:wasmimport call, call the guest's //go:wasmexport cabi_realloc and write the result into the block it returns? The canonical ABI needs exactly that to return a list or a string from a host function.
|
Package reentry measures risk R1 of docs/DESIGN.md: can a host, while a Go wasip1 guest is inside a //go:wasmimport call, call the guest's //go:wasmexport cabi_realloc and write the result into the block it returns? The canonical ABI needs exactly that to return a list or a string from a host function. |
|
webdriver
Package webdriver is a small W3C WebDriver client (https://www.w3.org/TR/webdriver/): just what the e2e lane for Safari needs, to drive the real Safari through safaridriver (Playwright's WebKit is not Safari).
|
Package webdriver is a small W3C WebDriver client (https://www.w3.org/TR/webdriver/): just what the e2e lane for Safari needs, to drive the real Safari through safaridriver (Playwright's WebKit is not Safari). |
|
Package nn is the host side of wasi-nn for go-wasmcontainers: the preview 1 (witx) interface, import module "wasi_ephemeral_nn" (github.com/WebAssembly/wasi-nn, wasi-nn.witx), served by the engine's WASI host as a host module, natively and in the browser.
|
Package nn is the host side of wasi-nn for go-wasmcontainers: the preview 1 (witx) interface, import module "wasi_ephemeral_nn" (github.com/WebAssembly/wasi-nn, wasi-nn.witx), served by the engine's WASI host as a host module, natively and in the browser. |
|
webgpu
Package webgpu is a wasi-nn backend that runs ONNX graphs on the browser's GPU through WebGPU (WGSL compute kernels), for the "gpu" execution target.
|
Package webgpu is a wasi-nn backend that runs ONNX graphs on the browser's GPU through WebGPU (WGSL compute kernels), for the "gpu" execution target. |
|
Package onnx loads ONNX models (onnx/onnx.proto) and runs a bounded set of operators on the CPU, in pure Go.
|
Package onnx loads ONNX models (onnx/onnx.proto) and runs a bounded set of operators on the CPU, in pure Go. |
|
Package wasigpu is the guest side of wasi:webgpu (wasi:webgpu@0.3.0-rc.2) for Go programs built with GOOS=wasip1: the compute subset (adapter, device, buffers, WGSL modules, compute pipelines, bind groups, command encoders, queue, mapping).
|
Package wasigpu is the guest side of wasi:webgpu (wasi:webgpu@0.3.0-rc.2) for Go programs built with GOOS=wasip1: the compute subset (adapter, device, buffers, WGSL modules, compute pipelines, bind groups, command encoders, queue, mapping). |
|
batchsink
Package batchsink is the guest side of the host module wasi_webgpu_batch (package gpubatch): a webgpu.ReadSink over its four imports, so that a wasip1 Go program writes against the go-gfx/webgpu API unchanged.
|
Package batchsink is the guest side of the host module wasi_webgpu_batch (package gpubatch): a webgpu.ReadSink over its four imports, so that a wasip1 Go program writes against the go-gfx/webgpu API unchanged. |
|
Package wasinn is the guest side of wasi-nn (preview 1, import module "wasi_ephemeral_nn") for Go programs built with GOOS=wasip1: load a model, set inputs, compute, read outputs.
|
Package wasinn is the guest side of wasi-nn (preview 1, import module "wasi_ephemeral_nn") for Go programs built with GOOS=wasip1: load a model, set inputs, compute, read outputs. |
|
Package webgpu is the host side of wasi:webgpu (wasi-gfx, wasi:webgpu@0.3.0-rc.2) for core modules: every function of the WIT interface is a typed import of one host module, lowered and lifted with the Canonical ABI (package wit) by hand, without a component-model runtime.
|
Package webgpu is the host side of wasi:webgpu (wasi-gfx, wasi:webgpu@0.3.0-rc.2) for core modules: every function of the WIT interface is a typed import of one host module, lowered and lifted with the Canonical ABI (package wit) by hand, without a component-model runtime. |
|
Package wit reads WIT (the WebAssembly Interface Types language, component-model design/mvp/WIT.md) for the subset the wasi-gfx packages use, and implements the Canonical ABI (design/mvp/CanonicalABI.md) over a core module's linear memory: alignment, sizes, flattening, loads, stores, flat lifting and lowering.
|
Package wit reads WIT (the WebAssembly Interface Types language, component-model design/mvp/WIT.md) for the subset the wasi-gfx packages use, and implements the Canonical ABI (design/mvp/CanonicalABI.md) over a core module's linear memory: alignment, sizes, flattening, loads, stores, flat lifting and lowering. |
Click to show internal directories.
Click to hide internal directories.