Hesper is part of the Verilean organization's effort to bring verified computing to GPUs. Patches, bug reports, and discussions are welcome.
- Fork the repository and create a feature branch off
main. - Run the test suite to make sure your environment is healthy:
lake build test-all ./.lake/build/bin/test-all
- Make your changes — see "Code organization" below.
- Add tests for new features (the suites under
Tests/are LSpec-based). - Open a pull request describing what you changed and why.
Hesper/
├── Hesper/ # Core library
│ ├── WGSL/ # Type-safe shader DSL (Types, Exp, DSL, Monad, CodeGen)
│ ├── WebGPU/ # WebGPU bindings (Device, Buffer, Shader, Pipeline)
│ ├── CUDA/ # CUDA PTX backend (Codegen, FFI, Execute)
│ ├── Layers/ # Reusable NN layers (Linear, Attention, RMSNorm, …)
│ ├── Models/ # End-to-end models (BitNet, Gemma 4)
│ ├── Compute.lean # High-level compute API
│ └── Simd*.lean # Portable SIMD (Google Highway)
├── Examples/ # Runnable demos, grouped by topic
├── Tests/ # Unit and integration tests
├── native/ # C++ FFI bridge (Dawn/WebGPU + CUDA driver shim)
├── c_src/ # SIMD CPU implementations
├── docs/
│ ├── tutorial/ # User-facing tutorial (Markdown master → .ipynb)
│ └── research/ # Internal R&D notes, archived
└── lakefile.lean # Lake build configuration
- FFI changes: run the FFI suite via
lake build test-ffi. - DSL changes: run shader-generation tests (
Tests.WGSLDSLTests). - GPU kernels: test on real hardware — compilation alone is not enough.
- SIMD changes: ARM64 (NEON) and x86_64 (AVX2) targets, where available.
- Cross-platform: macOS (Metal), Linux (Vulkan), Windows (D3D12/Vulkan).
- Use GitHub Issues for bugs.
- Use GitHub Discussions for design questions and broader topics.
native/bridge.cpp— FFI boundary; all Lean ↔ C++ data conversion.Hesper/WGSL/Monad.lean— ShaderM monad used to construct kernels.Hesper/WGSL/Execute.lean— Compiles ShaderM → WGSL and runs on the GPU.Hesper/CUDA/Execute.lean— Same path for the PTX/CUDA backend.Tests/FFIBoundaryTests.lean— Reference test for FFI data conversion.
By contributing you agree that your contributions will be licensed under the
same terms as the project (Apache-2.0; see LICENSE).