mtg-kernel Open-source Magic rules and RL in WebAssembly

Watch an AI play Magic against itself, live in your browser

Every game is brand new: dealt from a fresh random seed and played by two copies of Basilisk 3, a neural network trained with reinforcement learning. Nothing is pre-recorded.

Ready to deal a live game in your browser.
B
Basilisk B
Waiting...
Lib 53
Life 20
Turn 1 Opening

Waiting to deal...

A
Basilisk A
Waiting...
Lib 53
Life 20
0 / 0 Space: play, Arrows: step
Life swing Combo or stack clash Final blow Auto-play skips forced plays; arrows reach every step.
Game seed
pending
Matchup
pending
First seat
pending
Computed
pending
Open-source Magic: The Gathering research

A Magic rules engine and a neural-network player, running live in your tab

mtg-kernel is an open-source, deterministic Magic: The Gathering rules engine written in Rust, paired with reinforcement-learning agents. Every game above is dealt from a fresh 64-bit seed inside your browser and played by two copies of Basilisk 3, a neural network trained with reinforcement learning. This is early-stage open research, with no claim of expert or professional-level play.

01 / Runs in your browser

A whole game in about a third of a second

The Rust rules engine and Basilisk 3 run on your device as WebAssembly, with no server. On a desktop browser a full game takes about a third of a second, which is why the page can play five and show you the closest. A shared link replays the exact same game.

How it was built
02 / Open source

A Magic rules engine built for AI research

mtg-kernel is a deterministic rules kernel written in Rust, with a reinforcement-learning stack for training and evaluating bots. A bridge to XMage, an independent Magic engine, gives its rules and its bots an outside point of comparison.

View source on GitHub
03 / Benchmarked

Rated on Spellbench

Basilisk 3 is one of the bots rated on Spellbench, an open benchmark where Magic: The Gathering bots from different engines play each other.

See the ratings