A real fly brain · in your browser · no install

You drive a fly by firing its real neurons.

Scientists mapped every neuron in a fruit fly's brain. This puts that whole map — plus its spinal cord and its body — live in your browser tab. Press a key, a real neuron fires, the spike spreads through the real wiring, and the fly walks. The cascade is real; the leg rhythm it drives is hand-written, and we tell you which is which.

▸ Launch the simulator How does it work?
needs a WebGPU browser (Chrome · Edge · recent Safari) — first visit streams ~300 MB, then it's cached
139,255
brain neurons
23,188
spinal-cord neurons
20M+
wired connections
67
body parts · real physics
The 30-second version

A whole animal nervous system, end to end, running on your GPU.

A real fly's brain was reconstructed neuron-by-neuron from electron microscopy — the FlyWire project. We loaded that exact wiring diagram into the browser and turn it into a living simulation: each neuron charges up, fires when it hits threshold, and passes the spike on to whatever it's connected to. The same rule, 139,255 times, every millisecond.

The brain talks to the fly's spinal cord (a second real connectome), and what the spinal cord decides steers a physically simulated body. Press a key and you inject current into specific command neurons, then watch the consequences ripple all the way down to the legs. What comes out of the connectome is a walking speed and a turn — the stepping rhythm itself is a hand-written tripod gait, not neuron-by-neuron muscle control.

And in this default view the body is moved by that speed and turn directly, rather than being pushed along by its own legs. So the brain really does decide where the fly goes; the legs you see stepping are not what carries it there. There is a switch that turns the shortcut off — with it off, the connectome-driven fly pivots on the spot and covers almost no ground. The one thing that does walk on its legs is the trained policy below, and even that leans on a stabiliser.

What's actually inside

Four real datasets, wired together.

01
Brain
FlyWire connectome — the full reconstructed brain of an adult fly: 139,255 neurons and ~15 million connections (Dorkenwald et al. 2024, Nature). Runs as a leaky integrate-and-fire network in a fused WebGPU kernel.
02
Spine
Janelia MANC connectome — the fly's ventral nerve cord, its "spinal cord": 23,188 neurons, 5.2 million connections. A second live network that turns brain commands into a walking drive.
03
Body
TuragaLab flybody — a physically accurate fruit-fly model with 67 body parts and 111 muscles, simulated with real physics (MuJoCo) compiled to run in the browser.
04
Eyes
A tiny 64×16 retina rendered from the fly's own head position each frame, fed back into the brain's optic neurons — so the fly can actually see the target it's walking toward.

The brain and the spine are joined by name, not by wire: a command neuron called DNa01 in the brain is matched to the neuron with the same name in the spinal cord. Biology motivates the match — that cell really does keep its body in the brain and send its axon down the cord — but the two maps come from two different flies (a female brain, a male nerve cord), and no reconstructed connection crosses between them. What crosses is a number: the brain neuron's recent firing rate, averaged over its left and right copies and scaled by a constant we picked, dropped into the spinal neurons that share its name. The spiking on either side is real; the handoff is ours. Past the spinal cord it changes again: the motor neurons set a walking speed and a turn, the choice of forward or backward comes from a small hand-wired spine rather than from the real one, and a hand-written leg rhythm does the actual stepping.

There is also a second mode that hands the legs to a trained walking policy published with the body model. With the push we normally give the body switched off, the forward motion is genuinely the legs' doing — the fly covers 2.019 cm per simulated second against a 2.0 cm/s command, pushing off the ground. Staying upright is not: a stabiliser bleeds off the fly's pitch and roll on every physics substep, and with that switched off too it topples over and gets nowhere (0.068 cm per simulated second). The forward motion is earned; the balance is propped up. It is also worth being clear about what the policy is: a neural network someone trained with reinforcement learning, not the fly's own brain — the connectome plays no part in it.

Straight about it

What this is — and what it deliberately isn't.

What it is

  • A whole-animal nervous system — brain, spine, and body — running end to end in a browser tab, no install.
  • Built from real, published data: two connectomes, a physical body model, and a trained policy, each peer-reviewed.
  • Reproducible by design — every shared run re-executes the same neurons deterministically.

What it isn't

  • Not a replacement for scientific simulators (NEST, Brian2, NEURON) — those are faster, more detailed, validated.
  • Not biophysically detailed: neurons are simple integrate-and-fire units — no ion channels or neuromodulation.
  • Not quantitatively validated whole-brain, and it runs slower than real time. Full list in LIMITATIONS.md.
How to play

Race the fly to the target, on as few spikes as you can.

Each key fires a famous descending neuron — a command cell that carries instructions from brain to body. Tap them to steer:

Q W forward E backward R turn A escape jump S looming dodge F backward (MDN) SPACE new round M science view

Reach the red target in the least time × fewest spikes. When you win, you get a replay link — whoever opens it watches the exact same simulation re-run: same target, your same keystrokes, against the same brain. You're sharing a brain trace, not a video.

How fast — honestly

Slower than real time. The only one behind a single URL.

The brain kernel is limited by memory speed, not math. We benchmarked it against the scientific standards on the same M2 Pro laptop — biological-time rate, higher is faster:

NEST 3.10 (C++)
0.67 kHz
Rust (multicore)
0.45 kHz
webgpu-fly
0.25 kHz

The original 1 kHz real-time target was unreachable for all three on that hardware — so we report what we measured, not what we hoped. The point was never "faster than NEST." It's a real fly brain on a phone in 30 seconds — the part the others can't do. Full disclosure in LIMITATIONS.md.

Why this one's different

Other groups simulate fly brains too. None of them open in a tab.

Part of a research line

One front of a broader effort: Geant4-class simulators, ported to WebGPU, in a browser tab.

webgpu-fly is built by Ahmet Barış Günaydın, an independent researcher. It shares its thesis — and its kernel-fusion and viewer machinery — with these sibling projects:

The honest part

This isn't the fastest fly-brain simulator — it's the most reachable one. It trades scientific completeness for a real connectome on a phone in 30 seconds. Treat it as a teaching, demonstration, and intuition-building tool — not a validated platform for publishing fly-brain dynamics.

The full, honest list of what's simplified, untested, or approximate — the performance ceiling, the LIF simplifications, the brain→spine→body approximations, the browser matrix — lives in LIMITATIONS.md.

Press a key. Fire a real neuron.

▸ Launch the simulator