DesktopFly simulates a real fly brain from FlyWire data on macOS

DesktopFly simulates a real fly brain from FlyWire data on macOS

A developer released DesktopFly (repository name desktop-fly), an open source macOS app that shows a 3D fruit fly living on the desktop. The fly is not animated by hand-authored rules; its behavior comes from a live 1 kHz leaky integrate and fire (LIF) simulation of a 668 neuron circuit with about 19,000 real synaptic connections, all drawn from the FlyWire v783 connectome, a real map of a fly brain's wiring.

The app's brain window renders 23,210 real neuron soma positions (out of 139,255 total in FlyWire v783), color coded by super class, with live spikes flashing at their real locations. Two glowing yellow markers mark the Giant Fibers, the escape command neurons. The simulated circuit names its components explicitly: 104 LC4 and 210 LPLC2 looming-detector visual neurons, 2 DNp01/Giant Fiber escape command neurons, 4 DNa01 and DNa02 steering neurons, 2 DNp09 forward-walking neurons, 6 DNg11 grooming neurons, 4 MDN backward-walking ("moonwalker") neurons, and 6 DNp02/DNp04/DNp11 escape-maneuver wing neurons, plus their 330 strongest partner neurons including proprioceptive and wind-sensing cells.

The headline behavior is the escape response: when the cursor approaches quickly, that motion becomes looming input to the real LC4/LPLC2 cells, and the fly only takes off once the Giant Fiber neuron actually spikes through its real synapses. About 1,200 synapses of feedforward inhibition push back against that signal, which the README says is why slow approaches are tolerated while a fast lunge triggers escape in about 4 milliseconds, matching the real animal. Because FlyWire only maps a brain, not a body, the fly's physical body (tripod gait, wing beat, altitude-scaled flight, grooming and sleep postures) is procedural, layered on top of the neural simulation rather than derived from connectome data.

The fly also reads the desktop environment: window top edges act as ledges it can land and walk on or ride as you drag a window, a new window appearing nearby feeds the looming pathway so the circuit decides whether to flee a dialog box, clicks near the fly startle it through a wind-to-Giant-Fiber pathway, and keystrokes register only as timing (an idle-time API that knows when keys were pressed, never which ones). It follows a circadian rhythm with dawn and dusk activity peaks, a midday lull and night quiescence, sleeps with a raised arousal threshold when idle at night, and runs faster when the Mac itself runs hotter, since flies are ectotherms. The brain window is interactive too: hovering pauses its rotation, and clicking a region "optogenetically" stimulates the roughly 60 nearest circuit neurons for 400 milliseconds, so clicking the Giant Fiber triggers escape, clicking DNg11 triggers grooming, and clicking one side's DNa01/DNa02 makes the fly turn.

The app requires macOS 13 or later and Xcode Command Line Tools with Swift 5.9 or later, needs no macOS permissions or entitlements since everything it senses (cursor position, window frames, clicks treated as taps, thermal state) is permission-free to read, and runs on a transparent, click-through overlay that never intercepts mouse or keyboard input. It builds from source via a shell script, ships with compact pre-derived data files, and can rebuild them from a roughly 60 MB download of raw FlyWire Codex dumps and a Python ETL script. It includes a circuit-invariant test suite and a 17-check end-to-end behavior test suite that stimulates neurons and checks the body's reaction, plus offscreen snapshot commands for the fly and the brain view.

The project's own "Honesty section" is explicit about what is real data and what is a modeling choice layered on top: the connectome supplies wiring, not physiology. The LIF dynamics, the neurotransmitter signs used in the simulation, a gap-junction boost on two pathways into the Giant Fiber, synaptic delays and the translation of cursor movement into a looming value are standard modeling choices; everything about who connects to whom, and how strongly, comes from FlyWire data. The application code is released under the MIT license; the derived data files in the data folder are FlyWire-derived and licensed CC BY-NC 4.0. The README asks anyone using the project to cite the two Nature papers behind the FlyWire connectome: Dorkenwald et al., "Neuronal wiring diagram of an adult brain," and Schlegel et al., "Whole-brain annotation and multi-connectome cell typing of Drosophila," both published in Nature 634 in 2024.

Key facts

  • The app simulates a 668-neuron circuit with about 19,000 real synaptic connections from the FlyWire v783 connectome, running at 1 kHz as a leaky integrate and fire model.
  • The brain window renders 23,210 of the connectome's 139,255 mapped neuron soma positions, with live spikes shown at their real locations.
  • A fast cursor lunge triggers the fly's escape response through the real Giant Fiber neuron in about 4 milliseconds, while about 1,200 feedforward-inhibition synapses let slow approaches pass without triggering it.
  • It requires macOS 13 or later and Xcode Command Line Tools with Swift 5.9 or later, needs no macOS permissions, and runs on a transparent click-through overlay.
  • Code is MIT licensed; the derived FlyWire data files are CC BY-NC 4.0, and the README asks users to cite two 2024 Nature papers describing the FlyWire connectome.

Why it matters

Most "desktop pet" apps script their animal's behavior by hand. DesktopFly instead wires a real, published neural connectome, FlyWire v783, into a running spiking simulation and lets the resulting circuit dynamics decide what the fly does. That makes it a rare consumer-facing demonstration of connectome data actually driving behavior in real time, rather than just being visualized as a static graph.

Who it affects

It is aimed at macOS users who want a novelty desktop companion, and at developers or neuroscience-adjacent hobbyists curious about connectome-driven simulation; it has no relevance to production AI systems or businesses, and the app itself carries no commercial angle beyond its open source license.

How to use it

DesktopFly is free and open source: the application code is MIT licensed, while the derived connectome data files shipped in the data folder are CC BY-NC 4.0. Building it requires macOS 13 or later plus Xcode Command Line Tools with Swift 5.9 or later; a user clones the repository and runs a build script, then launches the app from a menu bar icon. No macOS permissions or entitlements are needed, since everything the app senses, cursor position, window frames, clicks, and thermal state, is accessible without them. Users who want to rebuild the underlying data files from scratch can download roughly 60 MB of raw FlyWire Codex dumps and run the included Python ETL script.

How solid is it

The project includes its own automated verification: a circuit-invariant test suite (for example, confirming the Giant Fiber stays silent at rest and that loom latency is about 4 milliseconds) and a 17-check end-to-end behavior test suite that stimulates specific neurons and checks that the fly's body reacts correctly. The project's own "Honesty section" draws a clear line between the two: connectivity, who connects to whom and how strongly, comes directly from FlyWire data, while the simulation's dynamics, such as the leaky integrate and fire model, neurotransmitter signs, a gap-junction boost on certain pathways, synaptic delays, and how cursor movement is translated into a looming signal, are standard modeling choices layered on top rather than measurements from the connectome itself.

Risks and caveats

The connectome gives wiring, not physiology, by the project's own account, so the fly's specific timing and thresholds reflect modeling choices as much as biological measurement. The article gives no release date or version history for the app, no author name in the text itself, no support for platforms other than macOS, no performance or resource-usage figures such as CPU or GPU load, battery impact, or frame rate, and no user adoption or download figures.

“The connectome gives wiring, not physiology.”

— the project's README, "Honesty section"