mtg-kernelOpen-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.
vs
Deal a live Pauper game in your browser
Two copies of Basilisk 3, a neural network trained with reinforcement learning, play a fresh Magic: The Gathering game locally in WebAssembly.
Download size: about 9 MB once (rules engine and model weights). Games are computed on your device.
Shuffling and dealing a fresh game...
Loading WebAssembly rules engine (~9 MB)...
!
Could not load the live engine
The WebAssembly rules engine and Basilisk 3 model could not be loaded.
B
Basilisk BWent firstTurn
Waiting...
Lib530 poison
Life20
Hand 0
Lands
Artifacts & Other
Creatures
Turn 1Opening
Waiting to deal...
Stack (top resolves first)
Creatures
Lands
Artifacts & Other
Hand 0
A
Basilisk AWent firstTurn
Waiting...
Lib530 poison
Life20
Game overBasilisk A wins
0 / 0Space: play, Arrows: step
Life swingCombo or stack clashFinal blowAuto-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.
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.