Reanimate a real fly brain.
This is the wiring of one real male fruit fly: 166,700 neurons, mapped by electron microscopy. We ran it as a simulated brain, stitched it to a physics fly body and dropped it into a platformer level.
It walked the level, fired its tongue neuron at coins and jumped clear of enemies. Then we started cutting the wires our code had plugged into it. How much of it was really the fly?
Short answer: its own wiring did the walking and the stopping; spotting danger was our code. See the numbers
New here? Take the five-minute tour: seven steps, each one click.
Live
The whole brain, on the table.
All 166,700 neurons and 25,582,837 connections of the MaleCNS wiring map, running live on your graphics card. It is the same neuron model as the recorded runs, with the same settings. No body and no level this time: just the brain, our electrodes, and your scalpel.
- Checked spike for spike against our simulator
- About 40 MB to download, once
- Needs WebGPU (Chrome, Edge or Firefox)
What happens here is the model's answer to your input. We have not checked these one by one.
Disconnecting is Shiu et al.'s silencing: the cells still fire, but their spikes reach no one.
The numbers on these cards come from four runs of each experiment in this engine (1 s each,
1.5 s with the stripes, 2 s for bitter, 6 s for what outlives the stripes), each with different random input (npm run
cards re-measures them; its last run is in engine/live_cards.jsonl).
Your run will differ a little.
The brain alone: no body, no level, and no learning.
Neuroscientists find a circuit's key cells by silencing them one kind at a time and watching what breaks. Your graphics card can do that here while you watch. It reruns an experiment for each cell type with the most synapses onto a read-out neuron, twice, with that type silenced, and ranks what happens. To screen any cell type, watch it under "Any cell type" and press Screen it: it runs with the inputs that are on.
Each bar is the average of 2 runs (0.5 s each, 0.8 s with the stripes) on your graphics card, with that cell type silenced in Shiu et al.'s way: the cells still fire, but their spikes reach no one. The candidates are the cell types with the most excitatory synapses onto the read-out in MaleCNS. Rows marked "our input cells" are the cells our electrode drives, a check that the screen works. All of this is the model's answer.
Start here
A five-minute tour.
For students, teachers, and anyone who has seen a "fruit fly brain plays…" clip. Each step opens the app in the right place and says what to look for. Every step is also a link you can send to a class.
- 1
Reanimate a recorded run
Every wire is plugged. A real fly's wiring, in a simulated body, walks the level, touches coins and jumps the enemies. Its escape neuron fired before contact for 48 of 48 enemies. It looks like a player.
Open it - 2
Cut our shortcut
With SENSES cut, our code no longer spots the enemies for it. Its escape neuron now warns it in time for 0 of 48. The danger detection was ours.
Open it - 3
Cut our walking trigger
With WALK cut, its own walking neurons decide when to walk. 16 of 16 flies start walking on their own when the sky stripes move, and stop at every coin. With the wiring scrambled, no fly ever takes a step.
Real wiring Scrambled - 4
Put the whole brain on the table
All 166,700 neurons running live on your graphics card. The first time, press "Assemble the brain" (about 40 MB). The same moving stripes then switch on its walking neurons in front of you. To hear them, set Listen (above the read-outs) to the walking neurons: one click per spike.
Open it - 5
What keeps it still?
Stripes and sugar together: the walking neurons stay off. Disconnect the two stop-signal candidates our code watched, and they still stay off. Something else in the wiring is holding it still.
Open it - 6
Find the backup route
Snip every direct connection from the danger cells to the escape neurons, and the right escape neuron still fires. The screen silences 40 cell types one at a time and ranks which ones it needs. Then ask your own question: watch PVLP151 under Any cell type and press Screen it to see what the relay itself needs.
Run the screen - 7
Check our work
The controls and their limits, the tests we pre-registered, and the live engine checked spike for spike against the simulator that made the recordings.
Results
Results
What its own wiring did, and what our code did.
The four setups' numbers come from pre-registered runs: each plan was written before its runs existed, and an independent check recomputes them from the raw per-fly records. The escape tests further down come from the initial simulation phase's reports. Counts are shown as k/n.
The four setups, 16 flies per brain
Each setup ran 16 flies on the real wiring and 16 on a scrambled wiring, with the same level, body and code. The Lab replays one recorded fly from each; this table covers all of them.
Escaping enemies: the shortcut, and what happened without it
V2, F and the swat test are the names of pre-registered tests from the November 1–9 simulation phase, the project that made the recorded runs.
The scrambled brain, and what it can and cannot show
The scrambled brain keeps every neuron and each neuron's number of connections in and out, but sends every connection to a random partner (a degree-preserving shuffle). Below, a small piece of the escape circuit: the real links, and the same links after the shuffle.
Why pausing the game would not help
The game already waits for the brain: every 1 ms of game time, the physics, our level code and our eye model step once, and the brain catches up before the next step. Running 64 flies at once, each simulated second took about 56 seconds of computing on a cloud GPU, so every replay you see is already sped up from the brain's own pace.
The live brain, checked against the runs' simulator
The Operating table runs the whole brain in your browser with our WebGPU engine. To check that it is the same model as the recorded runs, we gave it and the runs' own simulator (PyTorch) exactly the same random input, then compared every neuron's spike count in every 50.4 ms window.
Loading the check…
tools/validate_live_ref.py and
tools/validate_live.mjs.Check it yourself
The setups' numbers on this page are recomputed by the checks in the repository. npm run check runs the
honesty lint, the data validation (it recomputes all 35 scoreboard counts from the per-fly records), a syntax check
and the property tests. npm run judge walks the whole app on the live site, npm run perf
times it on a throttled connection, and npm run cards re-measures the experiment cards on the live engine (its last run is in engine/live_cards.jsonl). See the list of checks.
How it works
Four things that were never meant to meet.
Frankenfly stitches a neuroscience dataset, a spiking-neuron simulation, a physics body and a game engine into one loop, then labels every part by who controls it.
Together they run as one loop, in six steps. Each step is labelled by who controls it.
fly
fly
our code
our code
our code
our code
Whose is it?
| Behaviour on screen | The fly's own neurons | Our code |
|---|---|---|
| Walking | When to walk or stand (DNg100 and the stop-signal candidates), only with WALK cut | The walking program that moves the legs; with WALK plugged, it also decides when to walk |
| Jumping over an enemy | The escape neuron's spike (GF) | The jump and landing assist; with SENSES plugged, spotting the enemy |
| The tongue at a coin | The tongue motor neuron's spikes (MN9) | The coin rule that switches its sugar cells on; the tongue animation |
| Starting to walk | Its walking neurons respond to motion | The moving sky stripes that give it that motion; our eye model |
| Operating table | Which cells fire, and how hard, once input arrives | Which sensory cells get input, and how much (our electrodes, set by you); any snip, disconnect or scramble |
The live brain on your GPU
- The data. All 25,582,837 connections of MaleCNS v1.0 among its 166,700 neurons, rebuilt exactly as the runs built them and checked against their graph hash. The neurons are renumbered so that connected cells sit close (by cell type, then by position), and each neuron's targets are delta-coded. That makes about 39 MB to download, plus 2.7 MB of recorded stripe input. Your browser caches them after the first visit.
- The engine. The same model and settings as the runs. Every connection has the same 1.8 ms delay, so the engine runs 18 steps of 0.1 ms in one pass. Every neuron updates on its own GPU thread, and then one workgroup per firing neuron delivers its spikes to its targets. On our test laptop's built-in graphics (Intel Iris Xe) it kept up with real time, even at hundreds of thousands of spikes per second.
- Our electrodes. Random (Poisson) spikes into the cells you pick, at the rate you set: the same kind of input as Shiu et al. and our recorded runs. Moving stripes plays back, every 1.8 ms, the rate our eye model gave each of its 13,579 motion cells during the 1 s of moving sky stripes in a recorded run (run 2, fly 88001). That fly started walking about 0.23 s in, so the later part also carries its own motion.
- Any cell type. Drive or watch any of the 11,751 cell types named in MaleCNS. That covers 164,506 of the 166,700 neurons, from the photoreceptors to the leg motor neurons. What you find there is the model's answer to your input; we have not checked it one by one.
- The silencing screen. One read-out neuron's strongest input cell types (by synapse count in MaleCNS), silenced one type at a time with the same input each time: two short runs per type, ranked by what is left of the read-out. It is the in-silico version of a classic lab method, and it runs as fast as your graphics card allows.
- Surgery. Scramble sends every connection to a random partner, so every neuron keeps its number of connections in and out. Snip zeroes the chosen direct connections. Disconnect is Shiu et al.'s silencing: the cells still fire, but their spikes reach no one.
Limits
- A simulated brain on a wiring map is a model. MaleCNS gives the connections, not their exact strengths; the model estimates them from synapse counts and one global scale (0.6), fixed before the game.
- No learning, no rewards, no training on the level. Also no noise floor, no tiring and no neuromodulation.
- Our eye model and motion detector are far simpler than a fly's eyes; the escape result without the shortcut is a limit of that front end.
- Each setup has 16 + 16 flies; the Lab replays one of each.
- On the Operating table, driving the bitter cells sets off runaway activity across the brain. Real flies do not do that; it shows the limits above. The recorded runs never used those cells.
Credits and licences
- Brain map: MaleCNS v1.0, Berg et al., Cell 2026, CC BY 4.0 (Janelia FlyEM).
- Neuron model: Shiu et al. 2024 (Nature), reimplemented by us in PyTorch.
- Body: NeuroMechFly v2 via FlyGym (NeLy-EPFL), Apache License 2.0.
- Level models: Quaternius (Platformer Game Kit, Ultimate Monsters), CC0. Sky: Poly Haven, CC0.
- three.js and the meshoptimizer decoder (MIT). Fonts: Space Grotesk and JetBrains Mono (SIL Open Font License).
Development timeline
The simulation pipeline, the eight recorded runs and the level replay were built between 1 and 9 November 2026, inside the hackathon's submission period, for a video about the same experiment. The subsequent interactive application was developed specifically for Kiroween: the Lab, the brain jar, the switchboard, the scoreboard and the data checks, and the Operating table with its WebGPU engine and its check against the runs' simulator. Details: DEVELOPMENT_HISTORY.md · source: GitHub.