A 3D fruit fly on macOS desktop powered by the real FlyWire connectome

Aug 19, 2026 04:50 AM - 4 weeks ago 3

DesktopFly — a 3D consequence fly

A 3D consequence alert that lives connected your macOS desktop — driven by a unrecorded spiking simulation of the existent FlyWire connectome. It walks crossed your windows, grooms, sleeps, and decides to flee your cursor pinch the aforesaid neurons a existent alert uses.

 23,210 existent neuron positions, spikes flashing

The fly's encephalon window: 23,210 existent neuron soma positions from FlyWire v783, with unrecorded spikes flashing astatine existent neuron locations. The 2 glowing yellow markers are the Giant Fibers — the flight bid neurons. Click immoderate region to stimulate it.

  • 23,210 neuron soma positions (of 139,255 successful FlyWire v783) render the rotating encephalon window, colored by super-class (FlyWire's coarse cell-type grouping).
  • A 668-neuron circuit pinch ~19,000 existent synaptic connections (synapse counts, signed by neurotransmitter prediction) runs arsenic a 1 kHz leaky-integrate-and-fire (LIF) simulation:
    • LC4 (104) + LPLC2 (210) looming-detector ocular neurons
    • DNp01 / Giant Fiber (GF) (2) — the flight bid neuron
    • DNa01 + DNa02 (4) steering neurons · DNp09 (2) guardant walking
    • DNg11 (6) grooming · MDN (4) backward stepping ("moonwalker")
    • DNp02/DNp04/DNp11 (6) escape-maneuver (wing) neurons
    • their 330 strongest partners, including ascending (proprioceptive) and sensory (wind) neurons
  • Escape is not scripted. Your cursor's attack becomes looming input to the existent LC4/LPLC2 cells; the alert takes disconnected only erstwhile the Giant Fiber actually spikes done its existent synapses — ~1,200 synapses of feedforward inhibition push back, which is why slow approaches are tolerated and fast lunges trigger flight successful ~4 ms, conscionable for illustration the existent animal.

The assemblage itself is procedural (FlyWire is simply a encephalon connectome — nary body geometry exists), pinch a tripod gait, visible wing-beat, altitude-scaled flight, grooming, and slumber postures.

Requirements: macOS 13+, Xcode Command Line Tools (Swift 5.9+). No permissions aliases entitlements needed — everything it senses (cursor, model frames, clicks-as-taps, thermal state) is permission-free.

git clone https://github.com/DenisSergeevitch/desktop-fly.git cd desktop-fly ./build.sh ./DesktopFly

A 🪰 point appears successful the paper bar; discontinue from there. The alert wanders your desktop connected a transparent, click-through overlay — it ne'er intercepts your mouse aliases keyboard.

item effect
Pause / Resume freeze the world
Show/Hide Brain toggle the unrecorded encephalon window
Escape Test (loom) inject a looming stimulus, watch the GF fire
Move to Next Display hop the alert crossed monitors (shown erstwhile >1 display)
Add / Remove Fly extra flies (only alert #1 carries the brain)
Scare Flies startle everyone

The encephalon model is interactive: hovering pauses the rotation; clicking a region "optogenetically" stimulates the ~60 nearest circuit neurons for 400 ms. The fly's guidance is immoderate the existent web does downstream — click the Giant Fiber and it escapes; click DNg11 and it grooms; click one side's DNa01/02 and it turns.

How existent neurons thrust the body

body behavior driven by
escape takeoff DNp01 elephantine fibre spike
walk vs. rest, stepping speed DNp09 rate
steering DNa01+DNa02 left−right complaint difference
grooming DNg11 rate
backward scoot MDN burst
nervous darting LC4/LPLC2 organization rate
wing-beat effort, threat wing-raise DNp02/04/11 rate
spontaneous takeoff whole-population arousal

The loop besides closes body→brain: the gait hit feeds the circuit's real ascending (proprioceptive) neurons successful shape pinch the legs, and accelerated cursor motion stimulates its sensory (wind) partners.

Desktop ecology (all permission-free macOS senses)

  • Window terrain: model apical edges are ledges — the alert lands connected them, walks on them, rides a model you drag, and startles erstwhile 1 closes under its feet.
  • Window looms: a model appearing adjacent the alert feeds the looming pathway; the circuit decides whether to fly your dialogs.
  • Clicks are substrate taps; clicking adjacent to the alert startles it through the wind→GF pathway. Typing is vibration (idle-time API — knows when keys were pressed, ne'er which).
  • Circadian rhythm: dawn/dusk activity peaks, midday siesta, night quiescence. Sleep: idle astatine nighttime → it sleeps, breathing slowly, with raised arousal threshold; it grooms aft waking.
  • Temperature: flies are ectotherms — a basking Mac is simply a faster fly.

data/ ships pinch compact derived files. To rebuild them from the raw FlyWire Codex dumps (~60 MB download):

mkdir -p /tmp/flywire && cd /tmp/flywire B=https://storage.googleapis.com/flywire-data/codex/data/fafb/783 curl -O "$B/classification.csv.gz" -O "$B/coordinates.csv.gz" \ -O "$B/connections.csv.gz" -O "$B/consolidated_cell_types.csv.gz" cd - && python3 etl.py /tmp/flywire
./DesktopFly --simtest # circuit invariants: GF silent astatine rest, 4 sclerosis loom latency, ... ./DesktopFly --behaviortest # 17 end-to-end checks: stimulate neurons -> assemblage reacts ./DesktopFly --snapshot f.png # offscreen alert render ./DesktopFly --brainshot b.png # offscreen encephalon render

What's modeled vs. measured

Honesty section: the connectome gives wiring, not physiology. The LIF dynamics, neurotransmitter signs (ACh+, GABA−, Glu−), the gap-junction boost on LC→GF and wind→GF (documented electrical coupling), synaptic delays, and the sensory transduction (cursor → looming value) are modular modeling choices layered connected the existent graph. Everything downstream of the sensory neurons — who connects to whom, and really powerfully — is FlyWire data.

Code is MIT. The files successful data/ are derived from FlyWire (FAFB v783) and are CC BY-NC 4.0 — spot data/DATA_LICENSE.md. If you usage this, cite:

  • Dorkenwald, S. et al. Neuronal wiring sketch of an big brain. Nature 634, 124–138 (2024). https://doi.org/10.1038/s41586-024-07558-y
  • Schlegel, P. et al. Whole-brain note and multi-connectome compartment typing of Drosophila. Nature 634, 139–152 (2024). https://doi.org/10.1038/s41586-024-07686-5
More