Maps spec v4 (plan.md) onto files. plan.md is the spec and stays frozen; this file is the map.
flygpt/
βββ plan.md # spec v4 (frozen); README.md is the project front page
βββ handoff.md # living handoff for another agent: state, running jobs, what to do next, rules
βββ conclusions.md # what we found and did not find; every number traced to results/ or graphs/
βββ plan_v1.md # v1 spec (draft): multi-task interference on the whole connectome
βββ pyproject.toml
βββ configs/
β βββ launch.yaml # Β§13 β the one launch config, no grid
β βββ dev_1k.yaml # Β§15 "1k overfits an excerpt" gate; differs only in size/corpus/length
β βββ launch_100k.yaml # launch.yaml with 100k steps (full training of the 5k model)
β βββ full_cns.yaml # Β§10/Β§16-14: every traced neuron in the largest SCC (~160k neurons, 10.4M edges)
β
βββ prepare_data.py # Β§2 download, hash, fix 90/10 split, measure unigram/bigram -> data/shakespeare/split.json
βββ build_graph.py # Β§3-6 extract dense core, build every control Γ seed, degree I/O, diagnostics, path gate
βββ train.py # Β§9 one condition Γ one seed; logs everything Β§9 lists; fixed-prompt generations
βββ claim.py # Β§12 paired differences + pre-registered claim rule
βββ evaluate.py # Β§11 scoreboard: model, params, val loss mean Β± range over seeds
βββ plot.py # Β§9 launch chart from logs: val loss vs step / wall-clock / chars
βββ generate.py # sample from a checkpoint
βββ visualize.py # Β§17 static activity raster (sampled neurons, explanatory only)
βββ export_hf.py # FlyGPT graph/checkpoint -> Hugging Face repo (safetensors bf16 + trust_remote_code)
βββ scripts/launch_cb5k.sh # detached per-GPU queues for real + degree_preserving Γ seeds 1β5
βββ scripts/launch_cns_ddp.sh # whole-CNS: waits for gate + free GPUs, then torchrun DDP on all GPUs, real then scrambled
βββ hf/ # self-contained HF model code copied into exported repos
β βββ configuration_flygpt.py, modeling_flygpt.py # FlyGPTForCausalLM (state carried instead of a KV cache)
β βββ configuration_malecns.py, modeling_malecns.py # MaleCNSConnectome: lossless connectome tensors + subset masks
β
βββ flygpt/
β βββ config.py # Β§13 schema as dataclasses
β βββ data.py # corpus, split, hash, reference losses, seeded TBPTT batches
β βββ connectome/
β β βββ malecns.py # Β§1 MaleCNS v1.0 tables + region filter (Β§3.1)
β β βββ extract.py # Β§3.3 directed-core procedure, artifacts, stats
β β βββ controls.py # Β§4 degree-preserving swaps w/ plateau check, uniform random, Β§4.2 weights
β β βββ interface.py # Β§5 I/O by degree only
β β βββ diagnostics.py # Β§4.1/Β§6 SCC, reciprocity, IβO path lengths, gate
β β βββ synthetic.py # fake connectome for tests and smoke runs
β βββ model.py # Β§7/Β§8 FlyRNN: fused CUDA path (default) or sparse.mm rows=dst; learned leak, degree norm, dense reference; FrozenFly
β βββ kernels.py # Β§8 fused CUDA recurrence via the connectome-kernels package (github.com/QuixiAI/connectome-kernels)
β βββ baselines.py # Β§11 tanh RNN / GRU / tiny Transformer, parameter matching
β βββ analysis.py # Β§12 Ξ_k, sign test, min effect
β βββ checkpoint.py
β
βββ data/
β βββ shakespeare/split.json # committed: corpus sha256, split boundary, vocab, unigram/bigram nats
β βββ fly/ # fetch_malecns.py -> build_edges.py -> edges.parquet + neurons.parquet (gitignored)
β # export_malecns_hf.py -> ~/malecns-hf (full traced connectome as a HF repo)
β
βββ graphs/<graph_name>/ # build_graph.py output. Committed: ids, config, hash, stats, diagnostics, gate.json.
β βββ subgraph_node_ids.txt # Gitignored: *.pt edge tensors (rebuildable, hash-checked).
β βββ subgraph_config.yaml
β βββ subgraph_hash.txt
β βββ subgraph_stats.json
β βββ real/ # edges.pt, input_nodes.txt, output_nodes.txt, diagnostics.json
β βββ degree_preserving_seed<k>/
β βββ gate.json
β
βββ runs/<project>/<graph>/<condition>_seed<k>/ # gitignored: log.jsonl, generations.jsonl, meta.json
βββ checkpoints/<project>/<graph>/<condition>_seed<k>.pt
βββ results/ # scoreboard.md, claim_*.json, plots β generated, committed
βββ notes/decisions.md # Β§21 engineering decisions after the freeze; informal expectations live here only
βββ demo/ # Β§17, gated on a trained model
βββ tests/ # sparse==dense, gradient reach, degree preservation, I/O identity, gate, claim rule, e2e smoke
--condition on train.py selects the graph and model:
| condition | graph | what trains |
|---|---|---|
real |
real subgraph | edges, bias, leak, adapters |
degree_preserving |
rewired, seed k | same |
uniform_random |
rewired, seed k | same (follow-up only) |
frozen |
real subgraph | adapters only (Β§11 reservoir gate) |
rnn / gru / transformer |
none | parameter-matched baseline |
Paired seed k: same data order, same adapter init, same edge-value RNG stream across conditions.
uv venv && uv pip install -e ".[dev]"
pytest # sparse/dense, gradient reach, controls, gate, claim rule, e2e
python prepare_data.py # split.json + reference losses
python data/fly/build_edges.py # foundation: QuixiAI/MaleCNS (pinned revision) -> edges/neurons.parquet
# (python data/fly/fetch_malecns.py && python data/fly/export_malecns_hf.py --out ~/malecns-hf rebuilds that Hub repo from the release)
python build_graph.py configs/dev_1k.yaml # must print "all gates passed"
python train.py configs/dev_1k.yaml --condition frozen # reservoir gate: must beat bigram
python train.py configs/dev_1k.yaml --condition real # 1k overfit gate
python build_graph.py configs/launch.yaml
for k in 1 2 3; do
python train.py configs/launch.yaml --condition real --seed $k &
python train.py configs/launch.yaml --condition degree_preserving --seed $k &
done; wait
python claim.py configs/launch.yaml --seeds 1 2 3 # dev look; the claim needs 5
python evaluate.py configs/launch.yaml && python plot.py configs/launch.yaml
# or all ten runs detached, two GPUs running two seeds back to back:
scripts/launch_cb5k.sh configs/launch.yaml runs/launch_logs
python claim.py configs/launch.yaml --seeds 1 2 3 4 5 # the Β§12 rule
# publish (build order step 11): base_model QuixiAI/MaleCNS
python export_hf.py --ckpt checkpoints/flygpt-v0/cb5k/real_seed1.pt --out ~/flygpt-hf --name QuixiAI/FlyGPTSmoke everything without MaleCNS: python build_graph.py configs/launch.yaml --synthetic.