# Enki

> A pure-Rust heterogeneous GPU compute platform that compiles idiomatic Rust functions just-in-time to run on GPUs or CPU cores.

Enki is a Rust framework from the enkiruntime GitHub owner for writing a compute function once and running it on either CPU cores or a GPU. The README describes it as an alpha-stage (v0.1) systems research project that works on stable Rust without nightly toolchains, foreign shading languages, or descriptor set management.

## What It Is

Enki is a heterogeneous compute platform built on Vulkan 1.3. Developers annotate standard Rust functions with the `#[nam]` attribute, and Enki compiles them just-in-time to run on GPU hardware. The same function can also be called natively on the CPU, which allows the outputs to be compared for equivalence.

## How the Workflow Operates

A program initializes the headless runtime, allocates data in GPU memory with `gpu_vec!`, and dispatches the kernel over a `Space` inside an `enki.flow` block. The same function can then be run on CPU data and the results asserted equal. A showcase demo renders real-time 3D raymarching and lets the user switch between GPU (Enki) and multi-threaded CPU (Rayon) execution with a keypress.

## Safety and Synchronization Model

The project uses 64-bit Buffer Device Addresses rather than descriptor sets. It pairs Rust's compile-time borrow checker with a runtime BorrowEngine that detects spatial and temporal data race hazards before queue submission. The README states this is a pragmatic safety net and does not claim formal soundness proofs. A dependency solver derives the Vulkan pipeline barriers automatically.

## Requirements and Licensing

Enki needs stable Rust 1.80 or newer and a GPU driver supporting Vulkan 1.3 with buffer device address, timeline semaphore, synchronization2, and 64-bit shader integers. Linux (X11/Wayland) and Windows 10/11 are supported. The framework crates are MIT or Apache-2.0, while the Parsu GPU compiler backend is a pre-compiled binary under a separate license that the README says is free for developers, researchers, and open-source use. Documentation is available in the Enki Book.

## Current Status

The README labels the project alpha-stage, with runtime APIs, compiler lowering passes, and internal data structures subject to change.

## Features
- Just-in-time compilation of Rust functions to GPU
- Dual CPU/GPU execution of the same function
- Runs on stable Rust 1.80+
- Vulkan 1.3 with Buffer Device Addresses, no descriptor sets
- Runtime BorrowEngine for spatial and temporal hazard detection
- Automatic Vulkan pipeline barrier generation
- GPU memory types: GpuVec, Slice, GpuParam, GpuTileMem
- Testing of kernels on CPU threads via rayon without a GPU
- cargo-enki CLI runner
- Real-time graphics and presentation with GLFW and swapchains

## Integrations
Vulkan 1.3, Rayon, glam, GLFW, Cargo

## Platforms
LINUX, WINDOWS, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
0.1

## Links
- Website: https://github.com/enkiruntime/enki
- Documentation: https://enkiruntime.github.io/enki/
- Repository: https://github.com/enkiruntime/enki
- EveryDev.ai: https://www.everydev.ai/tools/enki
