> ## Documentation Index
> Fetch the complete documentation index at: https://klyne-research.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Enigma

> GPU compute for Apple Metal

<div style={{ maxWidth: "900px", margin: "0 auto", padding: "0 2rem" }}>
  <div style={{ textAlign: "center", padding: "6rem 0 3.5rem", display: "flex", flexDirection: "column", alignItems: "center" }}>
    <img src="https://mintcdn.com/klyne-research/EnpSkQuBFXsfijCE/logo/enigma-mark.png?fit=max&auto=format&n=EnpSkQuBFXsfijCE&q=85&s=07ffcae164992c70bedecb4598c1f7d3" alt="Enigma" width="96" noZoom style={{ marginBottom: "2rem" }} data-path="logo/enigma-mark.png" />

    <h1 style={{ fontSize: "clamp(2.75rem, 5vw, 4.25rem)", fontWeight: "300", letterSpacing: "-0.02em", lineHeight: "1.1", margin: "0 0 1.25rem", textAlign: "center" }}>
      Write. Compile. Run.<br /><span style={{ fontWeight: "700" }}>GPU Kernels on Apple Metal.</span>
    </h1>

    <p style={{ fontSize: "1.1rem", opacity: 0.5, maxWidth: "480px", margin: "0 0 2rem", lineHeight: "1.65", textAlign: "center" }}>
      Python-first GPU compute for Apple Silicon. CuTe-style layout algebra. Compiles to Metal.
    </p>

    <div style={{ width: "100%", maxWidth: "420px", margin: "0 0 2rem" }}>
      ```bash theme={null}
      pip install enigma-dsl
      ```
    </div>

    <div style={{ display: "flex", gap: "0.75rem", justifyContent: "center", flexWrap: "wrap" }}>
      <a href="/getting-started/installation" style={{ padding: "0.7rem 1.5rem", background: "#65a30d", color: "#fff", borderRadius: "0.5rem", fontWeight: "600", fontSize: "0.9375rem", textDecoration: "none" }}>Get started →</a>
      <a href="/getting-started/first-kernel" style={{ padding: "0.7rem 1.5rem", borderRadius: "0.5rem", fontWeight: "500", fontSize: "0.9375rem", textDecoration: "none", border: "1px solid #444" }}>First kernel</a>
    </div>
  </div>

  <CardGroup cols={3}>
    <Card title="Getting Started" icon="rocket" href="/getting-started/installation">
      Install Enigma and run your first kernel end-to-end.
    </Card>

    <Card title="Programming Guide" icon="book-open" href="/programming-guide/kernels-and-jit">
      Kernel anatomy, layout algebra, ops, and atomics.
    </Card>

    <Card title="API Reference" icon="brackets-curly" href="/api-reference/compile">
      Complete signatures for `compile()` and `MetalRuntime`.
    </Card>
  </CardGroup>

  <div style={{ marginTop: "3.5rem", borderTop: "1px solid #222", paddingTop: "3rem" }}>
    <p style={{ textAlign: "center", fontSize: "0.7rem", fontWeight: "700", letterSpacing: "0.14em", textTransform: "uppercase", opacity: 0.35, marginBottom: "1.5rem" }}>
      QUICK LOOK
    </p>

    ```python theme={null}
    import enigma
    import numpy as np

    @enigma.kernel
    def add(A: enigma.f32, B: enigma.f32, C: enigma.f32):
        tid = enigma.thread_position_in_grid
        C[tid] = A[tid] + B[tid]

    compiled = enigma.compile(add)
    rt = enigma.MetalRuntime()

    n = 4096
    a = np.random.randn(n).astype(np.float32)
    b = np.random.randn(n).astype(np.float32)

    raw = rt.execute(compiled, [a, b], output_size=n * 4, grid=(n, 1, 1), threads=(256, 1, 1))
    out = np.frombuffer(raw, dtype=np.float32)
    np.testing.assert_allclose(out, a + b, rtol=1e-5)
    ```
  </div>

  <div style={{ marginTop: "3.5rem", paddingBottom: "5rem" }}>
    <CardGroup cols={2}>
      <Card title="Concepts" icon="lightbulb" href="/concepts/architecture">
        Compilation pipeline, execution model, and memory model explained.
      </Card>

      <Card title="Examples" icon="play" href="/examples/vector-add">
        Vector add, parallel reduction, tiled GEMM — runnable end-to-end.
      </Card>

      <Card title="Debugging" icon="bug" href="/debugging/common-errors">
        Common errors, IR dumps, and Metal source inspection.
      </Card>

      <Card title="Release Notes" icon="clock" href="/release-notes/index">
        Track the latest changes to Enigma.
      </Card>
    </CardGroup>
  </div>
</div>
