Documentation

Hesper

Hesper: Verified WebGPU Inference Engine #

This module serves as the root of the Hesper library, a type-safe GPU programming framework for Lean 4 with formal verification capabilities.

Features #

Module Organization #

Production Readiness #

References #

@[extern lean_hesper_init]

Initialize the Hesper WebGPU engine.

This function must be called before any GPU operations. It performs the following:

  1. Initializes the Dawn WebGPU implementation and procedure table
  2. Creates a Dawn native instance
  3. Discovers all available GPU adapters on the system (Vulkan, Metal, D3D12)
  4. Prints adapter information to stdout

Returns: A WebGPU Instance handle for subsequent GPU operations.

Example:

def main : IO Unit := do
  let inst ← Hesper.init
  -- Use inst for GPU operations

Backend Support:

  • Linux: Vulkan 1.3+
  • macOS: Metal 3
  • Windows: D3D12

Note: This is an FFI function implemented in native/bridge.cpp.