tech demo · MaleCNS v1.0

Fly Swattera real fruit-fly brain in the loop

The fly never sees your hand. It sees the shadow on the table — then ~166k frozen neurons decide whether to freeze or take off.

How a slap becomes an escape

No scripted “if close then jump.” Same looming math the fly’s visual system uses, wired through the real MaleCNS connectome.

01 · stimulus

Shadow only

The hand sprite is decoration. The fly’s input is the table blob: area, growth, coverage of its receptive field.

02 · loom

η = dA/dt / A

Angular expansion rate. Fast-growing shadow = “something is about to hit me.”

03 · cells

LC4 + LPLC2

LC4 tracks angular velocity. LPLC2 tracks size. Together they arm the escape circuit.

04 · burst

DNp01

Giant fiber fires → takeoff in ~50–150 ms. Yellow freeze is your hit window. Wait and it’s gone.

pathway: shadow → LC4 + LPLC2 → DNp01 → takeoff
weights: frozen · never trained to play this game

Diagram: shadow to eta to LC4/LPLC2 to DNp01 escape

one-screen version of the circuit for sharing

32 seconds of the experiment

Mute demo. Watch the thinking log top-right — that’s cell activity, not a bot script.

full muted capture · 1920×1080 · system audio stripped for the web

  • tell
    Yellow freezeLC4/LPLC2 saw loom. Slap now — that’s the skill window.
  • miss
    DNp01 burstGiant fiber takeoff. Hand recoil. Fly lives.
  • ctrl
    T = real vs shuffledSame synapse degrees, random partners. Escape gets worse — that’s the control.
  • ctrl
    H = hide the handSprite off, shadow stays. Proves the fly never needed the art.
REAL WIRINGSHUFFLEDCC BY 4.0 · Berg et al. 2026, Cell

What you see on screen

HUD is the science: title, timer, wiring badge, and a live log of what one fly’s cells are doing.

Gameplay screenshot: hand over blue table, fly thinking log open

Run it locally

Python 3.10–3.12, pygame, flybrain. MaleCNS loads in the background (~260 MB). Until then you get a loom-threshold stand-in on the same shadow numbers.

git clone https://github.com/yava-code/flythegame.git
cd flythegame
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
set FLY_DATA=%CD%\fly-data
flybrain download
python -m flygame --windowed