v0.0.41 · etalon-wgsl-forge & qualia-core-db::wgsl_forge::etalon_bridge · WebGPU + WebGL2 Mobile

WGSL Forge

A deterministic GPU-kernel compiler, Naga AST validator, and CPU-oracle correctness certifier powered by etalon-wgsl-forge. It lowers typed KernelSpec + Schedule graphs into multi-backend shaders (WebGPU WGSL, Mobile WebGL2 GLSL ES 3.0, SPIR-V, HLSL, and MSL) without LLM heuristics.

LIVE WASM + WEBGPU / WEBGL2 STUDIO · ./pkg/vibe/vibe_wasm.js · Tag 4200 Receipt

Interactive WGSL Forge & VibeScript Schedule Certification Studio

Target Execution & Shader Tier:
Probing WebGPU & WebGL2 ES 3.0…

Configure orthogonal tiling, workgroup geometry, vectorization width, and cooperative subgroup matrix acceleration below. Every parameter change synthesizes deterministic shader code (WGSL for WebGPU or #version 300 es GLSL for mobile WebGL2), evaluates the schedule verification contract via eval_program_with_receipt_wasm (forge.shader.*, gpu.compute.*, p64.runtime.*, nquin.wire.*), plots the operational intensity on the hardware Roofline model, and diffs a $16 \times 16$ output tile against the independent CPU reference oracle.

1. KernelSpec & Schedule Parameters

Shared Mem
8.0 KiB
Arith. Intensity
16.0 FLOP/B
WG Occupancy
25.0%
Max $|\Delta|$ vs CPU
2.38e-7

2. Editable VibeScript Schedule Verifier (vibe:0.3/{forge,gpu,p64,nquin})

astHash: pending…
VibeScript Evaluation Output (WASM)
Evaluating schedule in vibe-wasm…
Signed CBOR-LD Execution Receipt (Tag 4200)
Waiting for receipt…

Workgroup Tile Hierarchy & GPU Roofline Visualizer

Tap/drag on the matrix grid to select active workgroup tile $(T_Y, T_X)$ · Right: Log-Log Roofline plot

Compute-Bound

CPU Reference vs. GPU Oracle Parity ($16 \times 16$ Tile)

Tap/hover cells to inspect $|\Delta| = |\text{GPU} - \text{CPU}|$ ($\max |\Delta| < 10^{-6}$) & live lowered shader

ORACLE CERTIFIED
Live Synthesized Naga-Validated WGSL Module @compute @workgroup_size(16, 16, 1)

                

1. The Five-Stage Pipeline & Architectural Boundary: etalon-wgsl-forge Compiles & Certifies; the Engine Executes

Whether you are browsing high-level system design or auditing GPU execution safety, the core architectural separation is strict: QualiaDB owns domain semantics, policy admissibility (`ExactnessProfile` / `ADR 0003`), and weight containers (`P64`), while etalon-wgsl-forge owns deterministic shader lowering, Naga AST validation, and hardware-vs-CPU oracle certification:

Forge — Deterministic Producer & Certifier (etalon-wgsl-forge)

Compiles GPU compute kernels from a typed mathematical specification (KernelSpec) and an orthogonal hardware execution schedule (Schedule), validates the generated shader AST via Naga, and certifies every kernel on real GPU silicon against an independent CPU reference oracle. Also transcodes GGUF/Safetensors weights into the 64-byte aligned p64 container.

Runtime Engine — Governed Dispatch (qualia-core-db & etalon)

The in-process runtime loads adapter-keyed certified shaders and p64 weight volumes (`{stem}.execution-profile.json`) to execute inference, graph sieves, and continuum physics. Sustained decode throughput is measured by the runtime engine (e.g., ~18.8 tok/s native Vulkan on RTX A2000 for SmolLM2-360M Q8; ~5.9 tok/s in-browser WebGPU).

Typed KernelSpec + Schedule IR Across Target Backends

In etalon-wgsl-forge, a compute kernel is declared once as a pure mathematical DAG (KernelSpec). Tiling, workgroup dimensions, shared-memory staging, and vectorization width live in a separate Schedule descriptor so hardware tuning can never silently alter mathematical semantics. Every lowered shader is parsed and type-checked through Naga AST validation before emission to target backends:

WGSL
WebGPU & wgpu native
GLSL ES 3.0
Mobile WebGL2 fallback
SPIR-V
Vulkan binary module
HLSL
DirectX 12 / DXC
MSL
Apple Metal
CUDA-C
NVRTC / Tensor Core WMMA

Generated, Naga-validated, and oracle-certified kernel families include:

Three-Pillar GPU Oracle Certification (ETA-14, ETA-15, ETA-17)

Every generated kernel is dispatched on the target hardware adapter, read back with deterministic fencing, and compared element-by-element against an independent CPU reference oracle before its adapter-keyed receipt is sealed into QualiaDB:

ETA-14 · TENSOR & DECODE ORACLE

Full GQA Transformer Layer

A complete multi-head GQA transformer decode layer composed of etalon-wgsl-forge kernels is certified on real SmolLM2-360M weights (n_embd = 960, 15 Q-heads / 5 KV-heads, head_dim = 64, ffn = 2560, RoPE base 100k), matching the composed CPU reference oracle to a maximum relative error of 3.28×10⁻⁶ on RTX A2000 Vulkan.

ETA-15 · FDTD & CONTINUUM ORACLE

Maxwell CFL & Poynting Balance

3D FDTD electromagnetic and 2D SWE hydrodynamic kernels in etalon-sim enforce the Courant–Friedrichs–Lewy condition ($c\Delta t\sqrt{\Delta x^{-2}+\Delta y^{-2}+\Delta z^{-2}} \le 1$) prior to dispatch and verify discrete Poynting energy conservation against the 64-bit CPU reference integrator.

ETA-17 · NQUIN GRAPH ORACLE

Bitwise Sieve & Radix Parity

etalon-nquin certifies 48-byte NQuinWire GPU predicate sieves and 8-pass LSD radix sorts against the CPU reference implementation with ExactnessProfile::Exact (oracle_mismatches == 0) and 5-field XOR parity verification.

Hardware Backend Selection & Steward Policy

The Etalon silicon steward selects its GPU backend by capability intersection (f16, subgroup operations, timestamp queries) and records the active adapter in the execution profile; you can also pin a backend explicitly:

# Default is Vulkan (vendor-neutral across AMD / Intel / NVIDIA / ARM / Linux & Windows).
# Pin a backend explicitly:
QUALIA_WGPU_BACKEND=vulkan   # default, full compute & graphics certification
QUALIA_WGPU_BACKEND=dx12     # Windows DirectX 12 hardware lane
QUALIA_WGPU_BACKEND=metal    # Apple Silicon / macOS Metal lane
Vulkan
Default vendor-neutral path with full Naga SPIR-V validation and hardware timestamp profiling.
DirectX 12
Windows-native HLSL/DXC pipeline with Etalon device-loss recovery and queue stewardship.
Metal, WebGPU & Mobile WebGL2
Apple MSL backend, browser wasm32-unknown-unknown WGSL execution via etalon-wasm, and GLSL ES 3.0 mobile fallback.

Execution Profiles & Policy Admissibility (ADR 0003)

QualiaDB v0.0.41 • WGSL Forge • Implementation: etalon-wgsl-forge + qualia-core-db::wgsl_forge::etalon_bridge • CLI: qualia shader …