AIKernel.Wasm.WebGpuComputeProvider
0.1.1
See the version list below for details.
dotnet add package AIKernel.Wasm.WebGpuComputeProvider --version 0.1.1
NuGet\Install-Package AIKernel.Wasm.WebGpuComputeProvider -Version 0.1.1
<PackageReference Include="AIKernel.Wasm.WebGpuComputeProvider" Version="0.1.1" />
<PackageVersion Include="AIKernel.Wasm.WebGpuComputeProvider" Version="0.1.1" />
<PackageReference Include="AIKernel.Wasm.WebGpuComputeProvider" />
paket add AIKernel.Wasm.WebGpuComputeProvider --version 0.1.1
#r "nuget: AIKernel.Wasm.WebGpuComputeProvider, 0.1.1"
#:package AIKernel.Wasm.WebGpuComputeProvider@0.1.1
#addin nuget:?package=AIKernel.Wasm.WebGpuComputeProvider&version=0.1.1
#tool nuget:?package=AIKernel.Wasm.WebGpuComputeProvider&version=0.1.1
AIKernel.Wasm
AIKernel.Wasm isolates browser/WebAssembly runtime services and WebGPU boundaries for AIKernel.
AIKernel.Providers owns host-side OS standard drivers. AIKernel.Wasm owns WASM-specific runtime, process, memory, stdin, file system, event, audio, screenshot, save-state, time, and WebGPU compute boundaries.
Core abstractions such as IProcess, IProcessHost, IComputeProvider, and
IProvider are referenced from AIKernel.Abstractions. AIKernel.Wasm provides
browser/WebAssembly implementations without leaking WASM runtime concerns back
into Core or AIKernel.Providers.
Package
AIKernel.Wasm.RuntimeAIKernel.Wasm.WebGpuComputeProvideraikernel-wasm
Documentation
- Getting Started
- User Guide
- Architecture
- Provider Catalog
- Runtime Providers
- WebGPU Compute
- Manifests and Metadata
- Python Wrapper
- Testing
- Operations and Release Checklist
- Licensing
Runtime Providers
The runtime package defines WASM-scoped providers for:
WasmRuntimeWasmProcessProviderWasmMemoryProviderWasmStdinProviderWasmFileSystemProviderWasmEventProviderWasmAudioProviderWasmScreenshotProviderWasmSaveStateProviderWasmTimeProvider
WasmProcessProvider implements the Core IProcessHost contract and creates
IProcess handles with Starting, Running, Stopped, and Error state
transitions. Process lifecycle transitions publish OS events through
IEventBus when an event bus is supplied.
WasmRuntimeContext is the shared runtime state object used by the providers.
It tracks loaded modules, deterministic linear memory, imports and exports,
stdin lines, an in-memory WASI-style file surface, framebuffer bytes, audio
bytes, save-state snapshots, and a controllable deterministic clock.
The provider responsibilities are intentionally narrow:
WasmMemoryProviderperforms checked linear-memory read/write operations.WasmStdinProviderforwards intervention input to the runtimestdinexport.WasmFileSystemProviderexposes deterministic runtime files and file access events.WasmEventProviderbridges WASM-originated events into AIKernelIEventBus.WasmAudioProviderstores the latest audio buffer for a browser/WebAudio bridge.WasmScreenshotProviderreturns framebuffer bytes for capture pipelines.WasmSaveStateProvidersnapshots and restores linear memory.WasmTimeProvidercontrols pause, resume, scale, and deterministic time advance.
The current runtime model is deterministic and testable on Windows and Linux. Browser-specific host bindings can be supplied at the boundary without changing the Core contracts.
WebGPU Compute
WebGpuComputeProvider lives under src/Compute/WebGpuComputeProvider and
implements AIKernel.Abstractions.Compute.IComputeProvider.
The provider exposes:
compute.dispatchcompute.vector_add
Backend bindings are separated into:
WebGpuNativeBackendWebGpuWasmBackend
WebGpuWasmBackend accepts an IWebGpuJsInterop bridge. In browser builds,
that bridge owns navigator.gpu, buffer transfer, pipeline creation, and
dispatchWorkgroups. The .NET provider keeps the AIKernel compute contract,
buffer size validation, fallback routing, and EventBus publication.
When WebGPU is unavailable, the provider delegates CPU fallback execution to
AIKernel.Providers.Standard.Compute.CpuComputeProvider. Kernel execution
publishes GpuKernelExecuted when an IEventBus is supplied.
Python Wrapper
python/ contains the aikernel-wasm Python package. It exposes the public
WASM runtime providers and WebGPU compute provider through pythonnet as a thin
managed wrapper:
WasmRuntime,WasmRuntimeContextWasmProcessProvider,WasmMemoryProvider,WasmStdinProviderWasmFileSystemProvider,WasmEventProvider,WasmAudioProviderWasmScreenshotProvider,WasmSaveStateProvider,WasmTimeProviderWebGpuComputeProvider,WebGpuComputeInvoker,WebGpuComputeCapability
The wrapper does not re-implement WASM runtime semantics in Python. It resolves
bundled assemblies from aikernel_wasm/native or local NuGet packages and can
use AIKERNEL_WASM_ASSEMBLY_PATH for additional assembly roots.
Control Integration
Core.Control and Bonsai observe WASM runtime behavior through IEventBus.
AIKernel.Wasm publishes process, memory, stdin, file, and GPU events using
stable event names such as ProcessStarted, ProcessStopped,
ProcessCrashed, MemoryAccessed, StdinSent, FileAccessed, and
GpuKernelExecuted. This keeps runtime automation decoupled from browser and
provider-specific implementation details.
Running WASM Applications
WASM applications are represented as AIKernel processes. A host creates a
process through IProcessHost.CreateProcessAsync, optionally passing
WasmProcessOptions with module bytes and initial memory size. The resulting
IProcess can be started, stopped, listed, killed, restarted, observed through
logs, and connected to scheduler rules through the same OS command model used
by other providers.
CLI Integration
The aik CLI treats GPU, process, logs, and scheduler operations as OS
commands:
aik gpu list
aik gpu run vector-add --a a.bin --b b.bin
aik run sample
aik ps
aik kill <pid-or-name>
aik restart <pid-or-name>
aik logs sample
aik schedule add --every 1m "aik system info"
Build
dotnet build AIKernel.Wasm.slnx -c Release
dotnet test AIKernel.Wasm.slnx -c Release --no-build
Contributor Guidelines
WASM runtime and WebGPU changes must follow the shared AIKernel development discipline:
Runtime/provider code should preserve deterministic process state, use fail-closed Result/Try boundaries for host integration, keep browser-specific interop behind abstractions, and keep Python wrappers aligned with public C# contracts.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AIKernel.Abstractions (= 0.1.1)
- AIKernel.Common (= 0.1.1)
- AIKernel.Dtos (= 0.1.1)
- AIKernel.Enums (= 0.1.1)
- AIKernel.Providers.Standard (= 0.1.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AIKernel.Wasm.WebGpuComputeProvider:
| Package | Downloads |
|---|---|
|
AIKernel.Wasm.Models
EN: AIKernel WASM model execution package for descriptor-driven WebGPU resident model boundaries. JA: descriptor-driven な WebGPU resident model 境界を提供する AIKernel WASM model execution package です。 |
GitHub repositories
This package is not used by any popular GitHub repositories.
AIKernel.Wasm v0.1.1 - Aligns the WASM runtime and WebGPU provider with AIKernel.NET, AIKernel.Core, and AIKernel.Providers 0.1.1 while preserving monadic Result/Try/Option runtime provider lookup, adapter success checks, and WebGPU initialization fallback.