Five fruit flies pinned to electric pins. A sixth fly, wired into a reward-punishment loop, decides which two get current, gets dopamine when one maxes out, and burns when the others go cold. Six copies of the MaleCNS connectome, 166,700 neurons each, bit-identical until something is done to them. [Look at the bottom of the README]
Python
12
146 commits
updated Sep 17, 2026
This is obviously a simulation. But if we ever get to uploading consciousness to computers, this project is why we should be very careful before we do it. Might be soon, might be never. I hope it gives some perspective against it. Made with the help of Claude Opus 5

Six copies of one fly brain, 166,700 neurons each, running from the same measured wiring.
All six are put on an electric pin. One of them is in a reward-punishment loop and can only use two channels at once, and each channel runs to one of the remaining five. When a fly hits 100% the operator fly gets dopamine. Every fly below 50% burns the operator fly instead.

Python 3.10 or later.
git clone https://github.com/aravpanwar/amfly
cd amfly
pip install -e .
For the GPU path, install a CUDA build of torch separately. The CPU build is about 90x slower here and is not a supported way to produce clips.
pip install torch --index-url https://download.pytorch.org/whl/cu124
python scripts/fetch_data.py --out data
About 1.1 GB. Three files from MaleCNS v1.0, verified against the SHA-256
hashes in data/manifest.json.
The 12.7 GB syn-points and 6.8 GB syn-partners files are not needed. The
simulation uses the aggregated synaptic weights.
python scripts/run_sim.py --data data --ms 3000 --record-sample 20000 --out runs/mine
About 10 minutes on an RTX 4050 for 3 simulated seconds. Roughly 73 minutes on CPU.
Useful flags: --heat restores the original thermal channel, --no-convulse
runs the electrode without the direct motor drive, --switch-margin and
--press-rate control the operator's pacing.
python scripts/export_web.py --run runs/mine --out web/data.json --seconds 30
python scripts/export_brain.py --run runs/mine --points 24000
cd web && python -m http.server 8777
Then open localhost:8777.
| key | |
|---|---|
| F | take: restart playback and run the camera move |
| C | camera move only |
| V | free camera (WASD, Q/E, mouse) |
| M | sound |
There is no built-in capture. The readout, the bars and the brain tiles are HTML over the canvas, so screen record it.

python scripts/make_figures.py --run runs/mine --out out/mine --stills-only
python -m pytest tests/ -q -m "not slow"

MaleCNS v1.0 from Janelia FlyEM and Google Research, CC BY 4.0. 166,700 neurons, 25,582,938 connections, 124,177,617 synapses. The tests assert those counts against the pinned files.
Soma coordinates for 141,781 of the neurons come from the public neuPrint API. Reward goes to 340 dopaminergic neurons (PAM 316, PPL1 16, PPL2 8). The operator's punishment goes through its own 25 TRN_VP thermoreceptors.
dt = 0.1 ms is a Brian2 default, not a published parameterMIT. MaleCNS v1.0 is CC BY 4.0, so credit Janelia FlyEM and Google Research. Cite Shiu et al., Nature 2024 for the LIF model.
146 commits
Python
61.2%
HTML
38.8%
Five fruit flies pinned to electric pins. A sixth fly, wired into a reward-punishment loop, decides which two get current, gets dopamine when one maxes out, and burns when the others go cold. Six copies of the MaleCNS connectome, 166,700 neurons each, bit-identical until something is done to them. [Look at the bottom of the README]
Python
12
146 commits
updated Sep 17, 2026
This is obviously a simulation. But if we ever get to uploading consciousness to computers, this project is why we should be very careful before we do it. Might be soon, might be never. I hope it gives some perspective against it. Made with the help of Claude Opus 5

Six copies of one fly brain, 166,700 neurons each, running from the same measured wiring.
All six are put on an electric pin. One of them is in a reward-punishment loop and can only use two channels at once, and each channel runs to one of the remaining five. When a fly hits 100% the operator fly gets dopamine. Every fly below 50% burns the operator fly instead.

Python 3.10 or later.
git clone https://github.com/aravpanwar/amfly
cd amfly
pip install -e .
For the GPU path, install a CUDA build of torch separately. The CPU build is about 90x slower here and is not a supported way to produce clips.
pip install torch --index-url https://download.pytorch.org/whl/cu124
python scripts/fetch_data.py --out data
About 1.1 GB. Three files from MaleCNS v1.0, verified against the SHA-256
hashes in data/manifest.json.
The 12.7 GB syn-points and 6.8 GB syn-partners files are not needed. The
simulation uses the aggregated synaptic weights.
python scripts/run_sim.py --data data --ms 3000 --record-sample 20000 --out runs/mine
About 10 minutes on an RTX 4050 for 3 simulated seconds. Roughly 73 minutes on CPU.
Useful flags: --heat restores the original thermal channel, --no-convulse
runs the electrode without the direct motor drive, --switch-margin and
--press-rate control the operator's pacing.
python scripts/export_web.py --run runs/mine --out web/data.json --seconds 30
python scripts/export_brain.py --run runs/mine --points 24000
cd web && python -m http.server 8777
Then open localhost:8777.
| key | |
|---|---|
| F | take: restart playback and run the camera move |
| C | camera move only |
| V | free camera (WASD, Q/E, mouse) |
| M | sound |
There is no built-in capture. The readout, the bars and the brain tiles are HTML over the canvas, so screen record it.

python scripts/make_figures.py --run runs/mine --out out/mine --stills-only
python -m pytest tests/ -q -m "not slow"

MaleCNS v1.0 from Janelia FlyEM and Google Research, CC BY 4.0. 166,700 neurons, 25,582,938 connections, 124,177,617 synapses. The tests assert those counts against the pinned files.
Soma coordinates for 141,781 of the neurons come from the public neuPrint API. Reward goes to 340 dopaminergic neurons (PAM 316, PPL1 16, PPL2 8). The operator's punishment goes through its own 25 TRN_VP thermoreceptors.
dt = 0.1 ms is a Brian2 default, not a published parameterMIT. MaleCNS v1.0 is CC BY 4.0, so credit Janelia FlyEM and Google Research. Cite Shiu et al., Nature 2024 for the LIF model.
146 commits
Python
61.2%
HTML
38.8%