Symbolic Pareto Evolutionary Algorithm for Research

Closed forms, evolved.No neural nets. No black boxes.

SPEAR evolves closed-form mathematical laws from data, then compiles them to verified WebAssembly and MISRA-C:2012 with machine-checked parity. Formulas you can read, audit, and deploy on a microcontroller — and an MCP server so your LLM can drive the whole engine mid-conversation.

oscilloscope · gaussian_cdf — exact vs evolved
×11,500 vs Monte-Carlo · 1000 draws EXACT — MSE ≤ 1e-33 max err … exact σevolved
0
evolved kernels in the registry — activations, physics, finance, quantum, audio, shaders
0
ship a second, cheaper fast slot — two validated operating points per law
0
laws solved to machine precision — MSE ≤ 1e-12, many at exactly zero
0
evolved law vs Monte-Carlo on the Gaussian CDF — solved exact, loops replaced by O(1) formulas
Live, in your browser

The discovered formulas, plotted against the truth. Right here.

No screenshots. The amber curves below are the actual evolved champions, evaluated client-side against the exact laws they replace — same expressions the WASM exports run.

— speed vs exact
The ledger

Every kernel. Every record. Click anything.

The full registry, straight from spear-hall-of-fame.json. Search, filter, sort — open a row for its precise & fast formulas, costs and solver replacements.

Kernel Grade Record Cost Speed
Agent-native · Model Context Protocol

Your LLM already knows how to evolve kernels.

SPEAR ships a standard MCP server: Claude Desktop, Cursor, Windsurf — any MCP client — gets the engine as five native tools. Below, a real session: the numbers in the tool result are being computed right now by the actual champion formula, in this page.

discover

Evolve a replacement kernel for any target — multi-variable, GPU cost profiles, seconds not sprints.

list_kernels

Browse the registry: records, speedups, exact-solve status.

get_kernel

Precise/fast formulas, MISRA-C, torch export, cost breakdown.

evaluate_kernel

Evaluate any kernel at specific inputs, either operating point.

run_benchmark

Launch discovery passes on selected tasks from chat.

stdio transport

Zero daemon, zero API keys — a plain subprocess.

claude_desktop_config.json {
  "mcpServers": {
    "spear-kernels": {
      "command": "npx",
      "args": ["tsx", "/path/to/superspear/src/mcp/server.ts"]
    }
  }
}

Then just ask: "Discover a fast algebraic replacement for silu on [−6, 8]"

agent session — spear-kernels MCP
The method

Evolution, not approximation.

A population of algebraic trees competes on accuracy ↔ parsimony under NSGA-II. Transcendental ops are allowed but priced honestly (~20 ALU/SFU units vs 1 for a multiply), so the search is biased toward cheap deployable algebra — and bandwidth-bound GPU targets can drop that price to ~1 unit (transcendentalCost), removing the bias entirely. An out-of-distribution gate rejects formulas that only interpolate; past champions seed every new run. Same seed ⇒ same formulas.

01

Data

Seeded datasets; exact-law baselines priced as cost-model references.

02

Evolve

NSGA-II GP + heritage bootstrap from the champion ledger.

03

Attack

OOD extrapolation gate — off-support blow-ups rejected.

04

Verify

Holdout scoring, MISRA lint, gcc, C↔WASM parity.

05

Export

torch, CUDA C, strict MISRA-C99, hand-rolled WASM.

06

Re-inject

Champions join the ledger and warm up the next generation.

The honest multipliers

Cheap O(1) formulas beat loops.

Where practitioners normally run an iterative solver, SPEAR finds a closed form. Solver bills counted fully, in the same ALU/SFU units — slower results reported as measured, never hidden.

Gaussian CDF

×11,500 vs Monte-Carlo

1000 Box–Muller draws → one erf evaluation at 4 units. Rediscovered exactly: MSE ≤ 1e-33, level 5.

46,000 → 4 units · EXACT

Kerr deflection + spin

×185 vs RK4 geodesic

RK4 integration, 200 steps → closed forms at 13–18 units; spin case exact to 7.5e-10. Fast slots at 4–5 units.

10.49/(s+b) · 5 units

Damped oscillation

×200 vs RKF45

Adaptive 300-step solve → polynomial envelope × carrier.

(t−16.4)(t−8.3)·cos(2.996t)

2-link IK elbow

×6 vs Newton-DLS

8 damped least-squares iterations → the analytic inverse, exact to 4e-32.

atan identity · 52 units

Evolve your own kernel.

Same seed ⇒ same data, same formulas, same metrics. Every record replayable, every export parity-audited, every formula yours to ship.

$ npx tsx scripts/hall-of-fame.ts 777888 500
# rediscovers the RC-circuit record from one integer