Symmetra Script

Getting Started

Get a Symmetra engine running in minutes. TypeScript compiles to CUDA — no build step, no VM, no GC. Measured at 40–80K req/s sustained · ~150–250µs median latency on a single RTX 5070 (Windows, loopback), with handlers on 128 of its 6,144 CUDA cores. Beta software — results vary by hardware.

1. System Requirements

NVIDIA GPU — RTX 2070 or newer

Compute capability sm_75+ required. RTX 2070 = sm_75 · RTX 3080 = sm_86 · RTX 4090 = sm_89 · RTX 5070 = sm_89. Check with nvidia-smi.

NVIDIA Driver 525+

Symmetra bundles NVRTC — you do not need the full CUDA Toolkit. Only the driver. Download from nvidia.com/drivers.

OS — Windows 10/11 or Linux

Windows: build 19041+ · Linux: Ubuntu 20.04+ (glibc 2.31+), x86_64 only.

macOS is not supported

Symmetra requires NVIDIA CUDA, which NVIDIA discontinued on macOS in 2019 (CUDA 10.2 was the last release, and it only ran on old Mac Pro cards Apple stopped selling in 2013). No current Mac — Intel or Apple Silicon — has an NVIDIA GPU or a CUDA driver, so there's no code path that could work. This isn't a missing package; it's a hardware/driver dead end. If Apple Silicon GPU support becomes possible another way, we'll revisit it.

Visual C++ Redistributable (Windows only)

Most systems have this. If sym doctor reports a missing DLL, install from aka.ms/vc_redist.

2. Download an Engine

Symmetra engines are pre-built, ready-to-run packages available from the Engine Catalog. Choose your engine, select your platform, and download — no CLI installation required.

Engine Catalog

Browse available Turing machine engines. Each card shows platform-specific download buttons and post-download setup instructions for Windows (.msi, .zip) and Linux (.deb, .rpm, .tar.gz).

→ Browse Engines

After downloading — Windows .zip portable

Expand-Archive rule60-v1.0.0-windows-x64.zip -DestinationPath .\rule60
.\rule60\sym.exe doctor

After downloading — Linux .tar.gz

tar -xzf rule60-v1.0.0-linux-x64.tar.gz
cd rule60 && ./sym doctor

sym doctor verifies your GPU, CUDA driver, and reports anything missing with clear instructions.

3. Your First Server

Create server.ts:

import { serve, Router } from '@symmetra/http';

const app = new Router();

app.get('/ping', (ctx) => {
  ctx.json({ message: 'pong', gpu: true });
});

serve(app, { port: 8080 });

Run it:

sym ./server.ts

Output:

Symmetra 1.0.0  ·  RTX 5070 sm_89  ·  NVRTC JIT 47ms
Listening on :8080  ·  1 route compiled
Press Ctrl-C to stop.

Test it:

curl http://localhost:8080/ping
# {"message":"pong","gpu":true}

What just happened

  1. esbuild stripped TypeScript types from your file (~3 ms)
  2. The Symmetra compiler walked the JS AST and generated CUDA C++ source
  3. NVRTC JIT-compiled the CUDA C++ to PTX for your GPU (~47 ms, once at startup)
  4. The GPU kernel was launched — your handler now runs entirely in VRAM
  5. TCP accept() + recv() runs on CPU (unavoidable); data is immediately pinned to VRAM

Nothing runs on CPU after startup except TCP I/O.

4. GPU Compute in Handlers

.map(), .filter(), .reduce() on GpuBuffer compile to __global__ CUDA kernels. Each call creates one thread per element:

app.post('/transform', async (ctx) => {
  // body<Float32Array>() returns a GpuBuffer — already in VRAM, zero-copy
  const data = await ctx.body<Float32Array>();

  // Compiles to a __global__ kernel: (data.length / 256) blocks
  const result = data.map(x => x * x + Math.sin(x));

  ctx.json(result);
});

The generated CUDA kernel:

__global__ void transform(const float* in, float* out, int n) {
    int tid = blockIdx.x * blockDim.x + threadIdx.x;
    if (tid >= n) return;
    float x = in[tid];
    out[tid] = x * x + sinf(x);   // Math.sin → sinf (CUDA intrinsic)
}

5. VRAM Key-Value Cache

import { serve, Router } from '@symmetra/http';
import { KvStore } from '@symmetra/kv';

const kv  = new KvStore({ maxMb: 512 });
const app = new Router();

app.get('/item/:id', async (ctx) => {
  // kv.get reads from VRAM — no Redis, no DRAM round-trip
  const item = await kv.get<Item>(ctx.params.id);
  if (!item) { ctx.status(404).json({ error: 'not found' }); return; }
  ctx.json(item);
});

app.put('/item/:id', async (ctx) => {
  const body = await ctx.json<Item>();
  await kv.set(ctx.params.id, body, { ttlMs: 60_000 });
  ctx.json({ ok: true });
});

serve(app, { port: 8080 });

6. Standard Libraries

All packages ship as TypeScript type definitions. The implementations run inside sym — no npm install required at runtime.

@symmetra/db — Database

import { postgres } from '@symmetra/db';

const pg = postgres({ host: 'localhost', database: 'myapp', user: 'u', password: 'p' });

app.get('/users', async (ctx) => {
  const result = await pg.query<{ id: number; name: string }>('SELECT id, name FROM users');
  ctx.json(result.rows);
});

@symmetra/crypto — Auth & Cryptography

import { jwt, password } from '@symmetra/crypto';

app.post('/login', async (ctx) => {
  const { email, pass } = await ctx.json<{ email: string; pass: string }>();
  if (!await password.verify(pass, user.passwordHash)) {
    ctx.status(401).json({ error: 'invalid credentials' }); return;
  }
  const token = await jwt.sign({ sub: String(user.id) }, process.env.JWT_SECRET!, { expiresIn: 86400 });
  ctx.json({ token });
});

@symmetra/net — HTTP Client

import { http } from '@symmetra/net';

app.get('/proxy', async (ctx) => {
  const response = await http.get('https://api.example.com/data', { timeout: 5000 });
  ctx.json(response.json());
});

Node.js import remapping

The compiler automatically remaps Node.js built-ins to Symmetra equivalents. Existing Node.js code typically works without modification:

Node.js importRemapped to
import fs from 'fs'@symmetra/fs
import { createHash } from 'crypto'@symmetra/crypto
import { EventEmitter } from 'events'@symmetra/core GpuEventEmitter
import path from 'path'Built-in GPU path utilities
import { fetch } from 'node-fetch'@symmetra/net
import os from 'os'GPU system info API

7. CLI Reference

CommandDescription
sym ./server.tsCompile TypeScript + run on GPU
sym build ./server.tsCompile to sym.ptx (ahead-of-time)
sym doctorVerify GPU, CUDA driver, NVRTC, PATH
sym benchRun GPU benchmark and report throughput
sym versionPrint version and GPU info

Options

FlagDescription
--port <n>Override the port from serve()
--streams <n>CUDA stream pool size (default: 32)
--verboseShow generated CUDA C++ and NVRTC output

Need Help?