fly-xox-malecns / source /README.md
n4ze3m's picture
Store reproduction and web application source
eaf91fb verified
|
Raw History Blame
5.09 kB

Fly XOX

A tic-tac-toe experiment using the retained MaleCNS v1.0 fruit-fly wiring, with internal parameters trained on Vast.ai and full-graph inference written in WebGPU.

This folder contains source only. Do not install dependencies or download model data here.

See PROGRESS.md for current infrastructure, the USD 5 budget, results, and resume instructions.

Pilot result

One training seed; 1,200 optimizer updates on an RTX 3090. Best checkpoint selected using validation only.

Evaluation Result
Held-out optimal moves, before training 62.82%
Held-out optimal moves, after training 91.67%
Uniform random expected optimal-move rate 56.91%
Held-out positions 468
Validation positions 492
Training positions 3,560
Trainable internal parameters 500,100
Peak allocated CUDA memory 1.01 GB

Rotations and reflections of player-relative board states stay in the same split. The exact solver supplies labels only during training/evaluation. Browser inference has no solver or policy lookup fallback.

Opponent / fly order Wins Draws Losses
Random / first 474 26 0
Random / second 425 70 5
Minimax / first 0 500 0
Minimax / second 0 480 20

These complete games can traverse training boards; they are not a second unseen-data test. Perfect play is not established.

What is biological, engineered, and trained

  • Measured structure: 166,700 retained neurons, 25,582,938 directed neuron-pair connections, 124,177,617 retained synaptic contacts. All released edges between retained neurons remain.
  • Engineered input: 27 symbolic board channels, fixed random mapping into 17,937 sensory neurons. No optical vision claim.
  • Engineered dynamics: signed, incoming-normalized contact weights; four recurrent softsign rate updates; zero initial state each move. Approximate transmitter signs, without receptor-specific dynamics or biological timing.
  • Trained inside the graph: per-neuron incoming gains, offsets, and leak rates. Effective connection strengths change while topology stays fixed.
  • Fixed output: random projection from 2,048 downstream neurons selected using training response variance. Neither input nor output adapter is trained.

This is not a recreated living fly or a validated model of biological learning. The pilot does not show that fly wiring outperforms a conventional network or shuffled wiring.

Remote reproduction

Use a CUDA-enabled remote container with Python 3.11 and PyTorch 2.8.0. From /workspace/fly-xox:

bash remote/bootstrap.sh
python train/test_core.py
python -u train/pilot.py --updates 1200 --seconds 2400
python train/evaluate_games.py
python train/export.py
XDG_RUNTIME_DIR=/tmp python train/verify_webgpu.py

Vulkan loader/driver support is needed for the WGSL check. The pilot used wgpu 0.24.0 with software Vulkan because the NVIDIA Vulkan adapter was not exposed. The exact WGSL matched PyTorch on 12 positions (maximum logit error ~5e-6, identical selected moves). This is not browser end-to-end verification or a browser GPU speed measurement.

Web application

web/ is a dependency-free HTML/CSS/JavaScript app with WGSL compute shaders. Serve the directory over authenticated HTTPS (or localhost) with the remote export in web/model/.

  • Browser requests a compatible WebGPU adapter, checks its buffer limits, downloads SHA256-checked chunks, and uploads them to GPU memory.
  • Each move executes the complete retained graph. Legal-move masking and game rules are ordinary application code.
  • Activity bars are actual sampled model rate states; captions are scripted jokes.
  • The float32 export is ~225 MB. Browser/device memory requirements and GPU speed must be measured; mobile compatibility is not promised.
  • Model load happens only after pressing Wake the fly. Do not automatically open/load the model on the development computer under the user's no-download constraint.
  • Keep the pilot private. Never embed a Hugging Face access token into browser code.

Storage and attribution

Private artifact destination: https://huggingface.co/n4ze3m/fly-xox-malecns

Remote uploader reads an existing authorized token from stdin and uploads directly from Vast. It verifies private visibility and required paths. Do not delete the rented disk before verifying the saved artifacts.

MaleCNS data: HHMI Janelia/FlyEM, University of Cambridge, MRC Laboratory of Molecular Biology, Google Research, and collaborators. Dataset and licensing, CC BY 4.0. Source URLs, retention policies, and SHA256 hashes are recorded in the exported manifest. This implementation was informed by the published descriptions of Fly OCR, DOOMFLY, and Flyhard; it does not reproduce their dynamics or claim their validation.

Original project source is MIT licensed; dataset rights remain separate.