AIKernel v0.1.3 GPU canonical Migration Notes
AIKernel v0.1.3 promotes the GPU work proven in AIKernel.Doom into canonical contracts. The goal is not to make every package GPU-dependent; the goal is to give WebGPU, Dawn, CUDA, and CPU fallback providers the same vocabulary.
What Changed
AIKernel.Enumsnow definesGpuBackend,GpuProviderCapabilities,AIKernel.Dtos.Gpunow defines canonical DTOs for frame tokens, raw/HUDAIKernel.Abstractions.Gpunow defines provider, context, Aisthesis,AIKernel.Dtos.Gpu.GpuCanonicalValidationnow provides shared validation- GPU HUD state is split into geometry/style (
HudPanelRect) and semantic - Spatial reasoning accepts exactly four 9x9 matrices in
AisMatrixorder: - Sensor analysis must use
GpuFrameTargetKind.RawFramebuffer. HUD composite
GpuFrameTargetKind, GpuReadbackPolicy, and GpuEgoRadarMode.
frame targets, frame diagnostics, GPU HUD input, GPU Aisthesis input/output, and GPU spatial reasoning input/output.
Spatial Reasoner, HUD Composer, buffer, and texture interfaces.
for layouts, capabilities, raw-frame capture, HUD buffers, spatial matrices, frame diagnostics, and individual canonical diagnostics metadata dictionaries.
state (HudPanelStateVector).
Topos, Route, Threat, Zoe. CTG and other task state belongs in StateVector.
and display fallback targets are presentation surfaces, not Aisthesis inputs.
Provider Guidance
Providers should expose GpuProviderCapabilities in metadata even when they also implement older compute contracts. Browser WebGPU providers typically set:
SupportsComputeSupportsHudCompositeSupportsAisthesisSupportsSpatialReasoningSupportsZeroCopyRawTextureSupportsCpuFallbackSupportsFrameDiagnostics
Native CUDA capability modules typically set:
SupportsComputeSupportsNativeValidationSupportsFrameDiagnostics
Browser WebGPU providers should implement the canonical pass interfaces even when the first implementation still uses deterministic fallback projections:
IGpuProviderIGpuAisthesisProcessorIGpuSpatialReasonerIGpuHudComposer
The provider should report GpuFrameDiagnostics for all four public paths:
GamePathBonsaiPathHudPathSensorPath
If zero-copy is unavailable, the path must include a fallback reason. A path must not report both ZeroCopy=true and Readback=RequiredFallback.
Bridge metadata is a required contract, not display-only data. Providers and browser/native bridge adapters should validate each outgoing canonical diagnostics metadata dictionary with GpuCanonicalValidation.ValidateDiagnosticsMetadata(...) before queue submission or JS/native handoff. Malformed boolean, integer, execution-mode, pilot-state, promotion-gate, or pass-readiness values should fail closed at the bridge boundary instead of being repaired downstream.
Runtime Guidance
GPU shader code should be a pure view over already-resolved runtime state. Compass/radar smoothing, hold, decay, and semantic suppression should be computed by the runtime layer before values are uploaded to GPU buffers.
Browser Bridge Assets
Use the files shipped by AIKernel.Wasm.WebGpuComputeProvider together:
runtime/browser/webgpu-envelope-bridge.jsshaders/aisthesis/aisthesis.wgsl,shaders/spatial/spatial-reasoning.wgsl,buffers/layouts/gpu-layouts.json
and shaders/hud/hud-composite.wgsl
Replace old rev3 asset paths in host copy rules and browser imports. Do not mix bridge, shader, or layout files from different builds. The dispatch schema is aikernel.gpu.dispatch with envelope version 0.1.3; the envelope version does not include the NuGet development suffix. Validate both the browser dispatch path and deterministic CPU fallback.
Developer Checklist
- Align package references to the same
0.1.3family; keep stable and - Replace Doom-local future GPU DTOs with
AIKernel.Dtos.GpuDTOs as the - Route raw sensor capture through
RawFramebuffer. - Keep HUD/composite targets separate from Aisthesis capture.
- Verify layouts with
aik gpu verify. - Treat GPU lost as one-way CPU fallback unless a higher-level host explicitly
- Validate provider capabilities with
GpuCanonicalValidationbefore binding - Validate
GpuAisthesisInputbefore any image analysis pass; HUD-composited - Validate
GpuSpatialReasoningInputbefore matrix dispatch; exactly four - Validate each canonical diagnostics metadata dictionary before browser JS,
- Preserve
GpuFrameDiagnosticsin HUD/log surfaces so browser demos can show
development dependencies separate.
consumer packages move to v0.1.3.
owns a full restart boundary.
a shader pass.
targets must fail closed.
9x9 matrices must be supplied in Topos, Route, Threat, Zoe order.
Dawn, or CUDA bridge handoff.
GPU vs CPU fallback and zero-copy status without ad hoc flags.
Doom Migration Notes
AIKernel.Doom can migrate incrementally:
- Keep the current browser DTO adapters as compatibility shims.
- Map raw capture descriptors to
GpuFrameTarget. - Map ego-radar/HUD state to
GpuHudInput. - Replace Doom-local Aisthesis feature DTOs with
GpuAisthesisInputand - Replace Doom-local topology matrices with
GpuSpatialReasoningInput. - Compare Doom HUD status rows against
GpuFrameDiagnosticsbefore removing
GpuAisthesisOutput.
existing debug flags.
This keeps the public demo stable while moving the reusable GPU vocabulary into AIKernel.Wasm and AIKernel.NET.
migration/v0.1.3-gpu-canonical-migration.md