From 80091a4f1d9a5b98bb2bbdae45cde24f300d307e Mon Sep 17 00:00:00 2001 From: freeman-1984-coder <219325749+freeman-1984-coder@users.noreply.github.com> Date: Sun, 13 Sep 2026 13:28:07 +0900 Subject: [PATCH] Prepare v0.5 alpha with verified CUDA and complete validation artifacts --- MANIFEST.in | 2 +- README.md | 8 ++-- docs/README.zh-CN.md | 6 ++- docs/api.md | 2 +- docs/cuda.md | 6 +-- docs/development-goal.md | 7 ++-- docs/release-v0.5.0a1.md | 46 ++++++++++++++++++++++ docs/releasing.md | 10 +++-- docs/roadmap.md | 8 ++-- docs/validation/release-v05-installed.json | 27 +++++++++++++ pyproject.toml | 2 +- site/api.html | 2 +- site/contribute.html | 2 +- site/demos.html | 6 +-- site/foraging.html | 2 +- site/fullbrain.html | 6 +-- site/index.html | 4 +- site/llms.txt | 4 +- site/male-cns-escape.html | 2 +- site/models.html | 2 +- site/reflex.html | 2 +- src/flybrain/__init__.py | 2 +- 22 files changed, 119 insertions(+), 39 deletions(-) create mode 100644 docs/release-v0.5.0a1.md create mode 100644 docs/validation/release-v05-installed.json diff --git a/MANIFEST.in b/MANIFEST.in index f82fe75..317f511 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,7 @@ recursive-include examples *.py *.gd *.uid *.godot *.tscn *.md recursive-include scripts *.py *.mjs recursive-include models *.json *.md recursive-include tests *.py *.json -recursive-include docs *.md +recursive-include docs *.md *.json *.xml *.txt *.csv recursive-include site *.json *.html *.css *.txt *.xml *.js *.wav .nojekyll recursive-include .github *.yml *.md include packages/js/package.json packages/js/package-lock.json packages/js/tsconfig.json diff --git a/README.md b/README.md index f0fe01a..3542ea3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # flybrain-sdk -> Development branch: [experimental CUDA backend](docs/cuda.md). [Full FlyWire benchmark](docs/validation/flywire-full-a16.md): 139,255 neurons, all 16.85M source rows, CPU/CUDA parity and 10 seconds of continuous simulation on A16-8Q. CUDA median 11.55 seconds per simulated second (not real time). [Train an external reflex readout](examples/REFLEX_TRAINING.md). Released v0.4.0a4 is CPU-only. +**No CUDA required.** A Python SDK for connecting small connectome simulations to games and experiments, starting with a working NumPy CPU backend. +> **0.5 alpha:** [optional CUDA, tested on NVIDIA hardware](docs/cuda.md), a separately versioned [synaptic mV engine](docs/synaptic-dynamics.md), and reproducible [full-brain GPU experiments](https://freeman-1984-coder.github.io/flybrain-sdk/odor-calibration.html). CPU remains the default. Full-brain navigation and real-time performance are not established. -**No CUDA required.** A Python SDK for connecting small connectome simulations to games and experiments, starting with a working NumPy CPU backend. **Full-brain sensory result:** [The GPU odor probe activates the input cells but exposes a propagation limit in the benchmark weight preset](docs/validation/flywire-odor-a16.md). Numerical parity does not establish biological behavior. [Published report](https://freeman-1984-coder.github.io/flybrain-sdk/fullbrain.html#olfaction). @@ -29,7 +29,7 @@ brain.step(100) print(brain.action().to_dict()) ``` -**0.4 alpha:** the bundled offline demo is a hand-authored 12-neuron circuit. A separate 3.8 MB MaleCNS model now runs 313 real source neurons and 20,607 anatomical edges with explicitly assumed LIF parameters. [Model card and reproducible recipe](models/male-cns-escape-v1/README.md). This development branch adds an experimental CUDA runtime; WASM remains unimplemented. No GPU, credentials, or network access are needed to run the toy demo after installation. +**0.5 alpha:** the bundled offline demo is a hand-authored 12-neuron circuit. A separate 3.8 MB MaleCNS model now runs 313 real source neurons and 20,607 anatomical edges with explicitly assumed LIF parameters. [Model card and reproducible recipe](models/male-cns-escape-v1/README.md). This release includes an experimental CUDA runtime; WASM remains unimplemented. No GPU, credentials, or network access are needed to run the toy demo after installation. ## Make your own demo @@ -86,7 +86,7 @@ pytest The package is **not yet published to PyPI**. Install directly from GitHub without cloning: ```sh -python -m pip install "flybrain-sdk @ git+https://github.com/freeman-1984-coder/flybrain-sdk.git" +python -m pip install "flybrain-sdk @ git+https://github.com/freeman-1984-coder/flybrain-sdk.git@v0.5.0a1" ``` Normal installation needs only NumPy at runtime. Offline operation means the demo makes no network requests; initial dependency installation needs an existing wheel cache or internet access. diff --git a/docs/README.zh-CN.md b/docs/README.zh-CN.md index a965805..1667188 100644 --- a/docs/README.zh-CN.md +++ b/docs/README.zh-CN.md @@ -1,5 +1,7 @@ # flybrain-sdk:无需 CUDA 的果蝇连接组仿真 SDK +**0.5 alpha:** 可选 CUDA 已通过 NVIDIA A16 实机验证;新增完整 FlyWire 脑的 GPU 实验、独立验证的突触 LIF 模型,以及气味输入和恢复期的公开记录。CPU 仍然默认可用,无需 CUDA。[GPU 使用说明](cuda.md) · [全脑气味对比](https://freeman-1984-coder.github.io/flybrain-sdk/odor-calibration.html)。全脑实验尚未证明可靠觅食或实时性能。 + 0.4 新增:统一 Session 循环、可替换输入/输出/环境、避障和声音模板、完整过程回放,以及可继续生成的 WAV。试用[示例与音频](https://freeman-1984-coder.github.io/flybrain-sdk/demos.html),查看[接入指南](demo-kits.md)。示例页是明确标注的录制回放;实验室仍是浏览器现场仿真。 @@ -23,7 +25,7 @@ print(brain.action().to_dict()) ``` 支持按 ID/注释选择细胞、直接注入电流、只观察指定细胞,以及可恢复的静默干预。 -新检查点保存自定义输出和刺激,继续兼容旧检查点。CUDA/WASM 尚未实现。 +新检查点保存自定义输出和刺激,继续兼容旧检查点。0.5 alpha 增加可选 CUDA;WASM 仍未实现。 详见 [API](api.md)、[模型卡](../models/male-cns-escape-v1/README.md) 和 [整体设计](rfcs/0001-open-runtime-and-demo-kits.zh-CN.md)。 @@ -55,7 +57,7 @@ paths = fetch_model("flywire-v783", assets=["neuron_ids"]) 真实连接组是神经连接数据,还需要参数、感觉/动作映射和转换器,才能成为 可直接加载的仿真模型。目前没有宣称全脑实时运行、学习能力或真实果蝇行为。 -WASM/CUDA 只预留接口。欢迎通过 Issue 和 Pull Request 一起完善;无需 GPU。 +WASM 仍只预留接口,CUDA 为可选实验后端。欢迎通过 Issue 和 Pull Request 一起完善;无需 GPU。 [英文首页](../README.md) · [贡献指南](../CONTRIBUTING.md) · [真实数据接入计划](real-data.md) diff --git a/docs/api.md b/docs/api.md index d235091..a9b2a5a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -139,7 +139,7 @@ accepts an observation with `offer(seq, observation)`, then commits the actual engine control with `acknowledge(seq, applied)`. Only one action may be pending. Identical pending offers reuse their result without reintegrating the brain. `snapshot()` is allowed at acknowledged boundaries; `from_snapshot(data, backend=None)` restores -the built-in linear encoder and rate readout. In this CUDA development branch, +the built-in linear encoder and rate readout. In version 0.5 alpha, pass `backend="cpu"` or `backend="cuda"` to select the restore device explicitly. The engine must checkpoint its own world at the matching sequence. See the [Godot example](../examples/godot/README.md) diff --git a/docs/cuda.md b/docs/cuda.md index 3cb6cd0..b63e0f2 100644 --- a/docs/cuda.md +++ b/docs/cuda.md @@ -1,6 +1,6 @@ # Experimental CUDA backend — A16 hardware validation passed -This development branch implements a CuPy/CUDA reference backend. **All 12 required hardware cases passed on a Vultr NVIDIA A16-2Q on 2026-09-12 UTC.** The published v0.4.0a4 remains CPU-only. This is experimental compatibility support, not a speedup claim: the 313-cell model took 2.64 seconds per simulated second on this GPU, versus 0.108 seconds on the same host CPU. See [the measured report](validation/a16-20260912.md). +Version 0.5 alpha includes a CuPy/CUDA reference backend. **All 12 required hardware cases passed on a Vultr NVIDIA A16-2Q on 2026-09-12 UTC.** The older v0.4.0a4 release is CPU-only. This is experimental compatibility support, not a speedup claim: the 313-cell model took 2.64 seconds per simulated second on this GPU, versus 0.108 seconds on the same host CPU. See [the measured report](validation/a16-20260912.md). ## Optional installation @@ -70,9 +70,9 @@ This command starts remote compute and can incur charges. As checked on 2026-09- The runner definition was checked against the local Modal SDK without invoking any remote function. It remains untested remotely. [Modal GPU documentation](https://modal.com/docs/guide/gpu) describes device selection. Recheck container termination and actual billed usage before considering the rental step finished. -## Game integration (development branch only) +## Game integration (0.5 alpha) -The draft now includes the v0.4.0a4 Godot and project-generation changes. +CUDA integrates with the Godot and project-generation APIs introduced in v0.4.0a4. `make_demo(..., backend="cuda")` selects CUDA for Python sessions. `ExternalController.from_snapshot(data, backend="cpu")` explicitly restores a GPU checkpoint onto CPU, or vice versa with `backend="cuda"`. The new hardware diff --git a/docs/development-goal.md b/docs/development-goal.md index dabe8e6..bb2d4d2 100644 --- a/docs/development-goal.md +++ b/docs/development-goal.md @@ -13,7 +13,7 @@ streaming audio and validated biological learning remain future work. The live browser game now shares the JS CPU core and is checked against Python feedback. Basic composable sessions, recorded dodge/sonification kits and full feedback replay are implemented. CUDA passed actual A16 validation and merged into main, while -the last tagged release (v0.4.0a4) remains CPU-only. +the older v0.4.0a4 release is CPU-only; version 0.5 integrates the CUDA engines. Acceptance criteria: @@ -56,7 +56,8 @@ not. A recorded negative outcome is not evidence of learned or reliable foraging The [historical delivery audit](completion-audit-2026-09-10.md) predates CUDA validation. Current evidence is in [CUDA](cuda.md), [full-brain validation](fullbrain-validation.md) -and [synaptic dynamics](synaptic-dynamics.md). The remaining delivery gate is an -integrated release with final packaging, clean-install and public-site verification. +and [synaptic dynamics](synaptic-dynamics.md). Integrated-release closure requires +final packaging, clean-install and public-site verification according to the +[release checklist](releasing.md). The [odor gain pilot](odor-calibration-pilot.md) is a separately documented research experiment, not a substitute for that release gate. diff --git a/docs/release-v0.5.0a1.md b/docs/release-v0.5.0a1.md new file mode 100644 index 0000000..09f05f2 --- /dev/null +++ b/docs/release-v0.5.0a1.md @@ -0,0 +1,46 @@ +# flybrain-sdk 0.5.0a1 + +**No CUDA required.** This alpha integrates optional, actual-device-tested CUDA +with the CPU SDK, real MaleCNS model, browser demos and Godot adapter. +Install from the GitHub release wheel or the `v0.5.0a1` tag; there is no PyPI/NPM +publication. CUDA additionally needs a compatible NVIDIA driver and CuPy. + +## Included + +- CPU-default `FlyBrain` API with on-demand, checksum-verified real model downloads, + direct cell input/observation, custom readouts, silencing and complete checkpoints. +- Optional CUDA backend with 12 passing actual A16 hardware cases. The 313-cell + workload was slower on GPU; small models should generally stay on CPU. +- Experimental synaptic mV CPU/CUDA engines, checked against Brian2 and five actual + GPU cases. These explicitly require mV weights; existing dimensionless models + and checkpoints keep their meaning. +- Full FlyWire numerical and sensory experiments, a GPU voxel recording, and an + eight-run odor gain pilot. All source neurons and aggregate edges are retained. + Original records, source hashes, assumptions and negative results are public. +- Editable demo generation, verified session replay and the Godot CPU/CUDA bridge. + Generated project requirements pin this public Git tag. +- Source distributions include the JSON/XML/CSV/text validation evidence referenced + by the documentation, in addition to reports, examples and model recipes. + +## Limits + +The packaged ready real model is still the 313-neuron MaleCNS subgraph with assumed +LIF dynamics. Full FlyWire loading is an explicit research-script/data-download +workflow, not a ready catalog model or a `FlyBrain.load()` preset. Its complete +network was run on GPU, but biological physiology, reliable foraging and real-time +performance have not been established. The voxel and reflex web pages replay +recorded experiments; the circuit lab and game sandbox execute the JS CPU runtime. +WASM and biological synaptic plasticity remain unimplemented. + +The odor pilot changed no behavior default. Its one-seed comparison could not +establish a responsive navigation preset by scaling all contact weights alone. +A temporary early side response must not be described as banana identification. + +## Evidence + +- [Actual CUDA validation](cuda.md) and [full FlyWire benchmark](fullbrain-validation.md). +- [Synaptic dynamics and independent reference](synaptic-dynamics.md). +- [Full-brain voxel experiment](validation/flywire-voxel-a16.md). +- [All eight odor gain conditions](validation/odor-gain-pilot-a16.md). +- [Release procedure](releasing.md), including clean-wheel installation, + source-archive completeness and post-tag generated-project installation. diff --git a/docs/releasing.md b/docs/releasing.md index 593cf49..d29c8c9 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -4,11 +4,15 @@ The repository name and package name are provisional. PyPI/NPM name availability and account ownership must be checked before attempting registry publication. This project currently supports installation from GitHub and release wheels. -1. Run CI, quickstart, `python -m build` and `python -m twine check dist/*`. -2. Install the built wheel in a clean environment, outside the checkout; verify the +1. Update version in `pyproject.toml` and `src/flybrain/__init__.py`; write release notes. +2. Run CI, quickstart, `python -m build` and `python -m twine check dist/*`. +3. Install the built wheel in a clean environment, outside the checkout; verify the toy, registry catalog, and checkpoint roundtrip are included and usable. -3. Update version in `pyproject.toml` and `src/flybrain/__init__.py`; write release notes. + Verify that the source archive includes referenced validation JSON/XML/CSV/text + evidence, not only the Markdown reports. Check optional CUDA imports without CuPy. 4. Create a version tag and GitHub release, attaching the wheel and source distribution. + After the tag is public, install a generated demo's `requirements.txt` in another + clean environment and run it: project generation pins this exact public tag. 5. Configure PyPI trusted publishing under the real package owner before publishing to PyPI. Start on TestPyPI if needed. Never put publishing tokens into this repo. diff --git a/docs/roadmap.md b/docs/roadmap.md index 32033e6..42e61e4 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap -## Verified in current source; next release pending +## Version 0.5.0a1 - Optional CUDA backend passed actual NVIDIA A16 conformance checks. CPU remains the default and does not require CuPy. See [CUDA evidence](cuda.md). @@ -14,8 +14,8 @@ - [Odor gain pilot protocol](odor-calibration-pilot.md) separates transient side responses from persistent activity before further behavioral calibration. -The released v0.4.0a4 remains CPU-only. An integrated CUDA release still requires -packaging and clean-install verification at its final release commit. Raw full-brain +The older v0.4.0a4 release is CPU-only. Version 0.5 integrates the verified CUDA +engines; see the [release checklist](releasing.md) for distribution checks. Raw full-brain loading remains a research-script workflow, not a `FlyBrain.load()` catalog entry. ## Available in 0.4.0a4 @@ -92,7 +92,7 @@ proposed architecture; proposal-only APIs are not current API documentation. - Extend Godot, add Unity and richer game examples. - Compact sparse-array model/checkpoint format for large graphs. - WASM reference implementation and TypeScript package. -- Publish the integrated optional CUDA release after clean-install checks. +- Improve the optional CUDA backend with separately benchmarked batching. - Explore learning/plasticity separately from the fixed-connectome MVP. Open issues and propose focused milestones; these are directions, not release-date promises. diff --git a/docs/validation/release-v05-installed.json b/docs/validation/release-v05-installed.json new file mode 100644 index 0000000..31faa8d --- /dev/null +++ b/docs/validation/release-v05-installed.json @@ -0,0 +1,27 @@ +{ + "version": "0.5.0a1", + "python": "3.12.14", + "numpy": "2.5.3", + "installed_from_wheel": true, + "cuda_absent": true, + "toy_continuation_ticks": 100, + "explicit_download_required": true, + "download_and_load_seconds": 1.594029749976471, + "bundle_sha256": "sha256:ff38cfff0c76345cc2f250e992f95b0bf19863b434d8f97f926da6975cb93a35", + "neurons": 313, + "edges": 20607, + "model_fingerprint": "47a0c91b3eba9c606c29faef58fe15c8846fc049c4314a5e3b6912ab22c5e68a", + "real_continuation_ticks": 100, + "paired_continuation_check_seconds": 3.8312330830376595, + "real_action": { + "walk": 0.0, + "turn_left": 0.0, + "turn_right": 0.0, + "jump": 0.5526662751885896 + }, + "corrupt_cache_rejected": true, + "cuda_error": "CUDA requires a working NVIDIA driver, visible GPU and compatible CuPy. Install the appropriate cupy-cuda12x or cupy-cuda13x wheel. CPU remains available without them. Cause: No module named 'cupy'", + "synaptic_inflight_replay_ticks": 50, + "generated_requirement_pins_release": true, + "status": "passed" +} diff --git a/pyproject.toml b/pyproject.toml index 340cd71..7bcce57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "flybrain-sdk" -version = "0.5.0.dev0" +version = "0.5.0a1" description = "CPU-first connectome simulation for games and experiments. No CUDA required." readme = "README.md" requires-python = ">=3.9" diff --git a/site/api.html b/site/api.html index fd0675c..0eccaed 100644 --- a/site/api.html +++ b/site/api.html @@ -4,7 +4,7 @@ - +
Developer guide / Python

From install to action.

Python 3.9+ and NumPy. No CUDA required. The package is currently installed from source; it has not yet been published to PyPI.

Terminal
git clone https://github.com/freeman-1984-coder/flybrain-sdk.git
 cd flybrain-sdk
 python -m venv .venv
diff --git a/site/contribute.html b/site/contribute.html
index 5945818..15ce27d 100644
--- a/site/contribute.html
+++ b/site/contribute.html
@@ -4,7 +4,7 @@
 
 
 
-
+
 
Community / Open source

Build with us.
No GPU needed.

Fork the repository, make a focused change and open a pull request. Contributions are reviewed before merging, and pull requests run automated tests.

Useful first contributions

  • Add a versioned model URL with size, license, attribution and checksum.
  • Build a small MaleCNS/FlyWire subgraph importer with tests and a model card.
  • Extend the Godot adapter or add Unity and other environments.
  • Port the LIF reference core to WASM and compare traces with Python.
  • Improve examples, translations and error messages.

The contribution loop

  1. Open an issue for a substantial design change, or pick an existing issue.
  2. Fork, branch and install the Python development dependencies.
  3. Make the change and add meaningful tests or examples.
  4. Run tests and the quickstart, then open a pull request.
Validation
python -m pip install -e ".[dev]"
 pytest
 python examples/quickstart.py
diff --git a/site/demos.html b/site/demos.html
index 0c0c076..0219d9c 100644
--- a/site/demos.html
+++ b/site/demos.html
@@ -4,14 +4,14 @@
 
 
 
-
+
 
Demo kits / Same core / No CUDA required

Observe. Connect.
Make it your own.

One Python session loop connects neural activity to a small game environment or synthesized sound. Run a preset, inspect the inputs and controls, then replace an adapter.

Choose the experience: the game sandbox and circuit lab run live simulations. The demos below are verified recordings from Python; playback controls inspect a run without recalculating its brain.

Full-brain voxel world · recorded GPU experiment

All 139,255 FlyWire neurons run on an A16 GPU and control a ground body through an explicit DNa02 readout. Compare the actual trajectory with a silenced-input control. It moves, but curves away from food; no successful navigation or training is claimed.

Watch the voxel experiment →

Full FlyWire brain · CUDA benchmark

All 139,255 proofread neurons and 16.85 million source rows on a real NVIDIA GPU. CPU/CUDA numerical checks, throughput, checkpoint replay and continuous simulation; this is a full-graph software benchmark, not a trained game policy.

Read the measured results →

Reflex School · reward-trained readout

A fixed real 313-neuron circuit, three learned external action weights, and an actual A16 GPU run. On 80 balanced held-out two-choice trials, accuracy changed from 50% to 100%. This is readout learning, not biological plasticity.

Compare before and after →

Godot connectome game adapter

No CUDA required. Run an actual Godot 4 scene with the Python CPU SDK. Godot owns obstacles and movement; a replaceable encoder and neural readout supply steering. Includes pause, paired world/brain saves, restore and stop-on-disconnect behavior.

-
Python 3.9+ and Godot 4.7.2 · two terminals
git clone --branch v0.4.0a4 https://github.com/freeman-1984-coder/flybrain-sdk.git
+
Python 3.9+ and Godot 4.7.2 · two terminals
git clone --branch v0.5.0a1 https://github.com/freeman-1984-coder/flybrain-sdk.git
 cd flybrain-sdk
 python -m pip install -e .
 python examples/godot/bridge.py
@@ -19,7 +19,7 @@ 

Full-brain voxel world · recorded GPU experiment

All 139,255 FlyWire godot --path examples/godot

Alternatively import examples/godot/project.godot in Godot and press F5. Wait for the bridge to print its ready address, then click Run / pause. The artificial toy works offline after installation. For the real 313-cell model, restart the bridge with --model male-cns-escape-v1 --download.

The scene advances 20 ms per acknowledged action, independently of rendering. Save completes any outstanding action before writing a checkpoint. Restore both the brain and the world together. The local HTTP bridge is a development example; it is not a hosted multiplayer service.

-

Godot setup and adapter guide Get the editable scene

+

Godot setup and adapter guide Get the editable scene

Verified with toy and real circuits against Python feedback traces and whole-brain checkpoints. Real anatomical wiring uses assumed LIF dynamics and engineered steering; no trained avoidance or biological fidelity is claimed.

Neural dodge

A player moves left or right as obstacles descend. Neural outputs determine steering; the environment reports the movement actually applied. Both recordings use the same seed, real 313-cell model and six-second duration.

Watch the neural run Compare silenced outputs

diff --git a/site/foraging.html b/site/foraging.html index a918c99..010ea3e 100644 --- a/site/foraging.html +++ b/site/foraging.html @@ -22,7 +22,7 @@

把完整脑,放进一个小世界。

0 / 2000 ms
绿色:实际轨迹黄色:食物气味源拖动场景:旋转观察角度

这一帧,脑子输出了什么?

等待实际记录。

如何读这个实验

比较正常神经输入和关闭嗅觉入口的同初始状态对照。轨迹来自实际记录;网页不会让角色自动朝向香蕉。

结果以记录为准,包括没有接近或接触食物的情况。

比较四档突触强度下的气味响应与恢复 →

-

哪些是连接组,哪些是我们的假设?

全部脑神经元和连接来自 FlyWire v783。输入只覆盖一个 DM1 食物气味通道,不代表完整香蕉气味或视觉识别。脑模型采用简化的突触 LIF 动力学。

动作层是未经训练的工程映射:DNa02 两侧放电频率之差控制转向、频率之和控制速度。尤其是速度映射没有生物学验证。身体是地面运动模型,没有飞行、肌肉或六足步态仿真。记录中的移动不等于可靠觅食。

下载全部帧与参数 · 复现方法与限制 · 开源仓库

+

哪些是连接组,哪些是我们的假设?

全部脑神经元和连接来自 FlyWire v783。输入只覆盖一个 DM1 食物气味通道,不代表完整香蕉气味或视觉识别。脑模型采用简化的突触 LIF 动力学。

动作层是未经训练的工程映射:DNa02 两侧放电频率之差控制转向、频率之和控制速度。尤其是速度映射没有生物学验证。身体是地面运动模型,没有飞行、肌肉或六足步态仿真。记录中的移动不等于可靠觅食。

下载全部帧与参数 · 复现方法与限制 · 开源仓库

怎么知道该刺激哪些嗅觉神经元?

香蕉图标在这里标记气味源的位置。我们没有让模型识别画面中的香蕉,也还没有重建香蕉的多种挥发物混合气味。

当前输入依据是:乙酸乙酯可以激活 Or42b 嗅觉通路,相关神经元投射到 DM1。我们根据固定版本的 FlyWire 细胞注释,选择左侧 35 个、右侧 33 个 ORN_DM1 神经元;它们只是入口,全脑的 139,255 个神经元仍参与计算。

diff --git a/site/fullbrain.html b/site/fullbrain.html index d78885c..8c9b498 100644 --- a/site/fullbrain.html +++ b/site/fullbrain.html @@ -29,7 +29,7 @@

实际资源占用

测试卡显存 7.82 GiB;结束时 CuPy 内存

这里比较的是累计脉冲。刺激刚开始时存在短暂的左右差异,因此不能断言完全没有方向信息。另外,双侧刺激停止后的 200 毫秒内,下降神经元仍新增了 859 次脉冲;这种持续活动需要进一步校准,不能直接称作生物记忆。

新引擎通过 5 组真实 GPU 检查;完整图在 200 个有嗅觉输入的时间步中,5 个检查点的全体神经元电压、突触状态和频率最大差异为 0。全脑状态连同输入随机数状态,恢复后 20 步完全重现。同机 204 项软件测试通过,零跳过。

每组包含 100 毫秒静息、500 毫秒刺激、200 毫秒恢复,以 0.1 毫秒步长运行。每组实际耗时约 102–104 秒,包含记录开销。这不是实时模拟,也不与上方不同参数的旧基准直接比较。输入是 Or42b/DM1 单通道食物气味近似,尚未校准为香蕉的真实化学剂量。

-

下载新模型五组原始记录 来源、参数与复现证据 ↗

+

下载新模型五组原始记录 来源、参数与复现证据 ↗

Full FlyWire synaptic CUDA experiment: sensory-only input reaches ALPN, MBON and descending populations; matched no-odor and silenced-input controls remain silent. DNa02 laterality does not reverse with stimulus side. Navigation is not established.

旧基准配置:为什么信号停在入口

2026 年 9 月 13 日,在 NVIDIA A16-8Q 上运行相同的完整 139,255 神经元网络,只刺激经标注确认的 68 个 ORN_DM1 感觉神经元。每组从同一静息状态开始,包含 100 毫秒静息、500 毫秒刺激和 200 毫秒恢复。

@@ -38,9 +38,9 @@

实际资源占用

测试卡显存 7.82 GiB;结束时 CuPy 内存

结果:入口刺激和关闭操作有效,但这组参数没有产生下游放电。嗅觉投射神经元在采样时刻观察到的最高电压约 0.252,阈值为 1;有微弱膜电位响应,不等于完全没有信号。

原因已经定位到基准测试的权重配置:每个神经元的输入连接绝对权重之和被归一化到 2.5。在当前不应期下,即使上游以允许的最高频率同步放电,无外部电流的下游电压上限也只有 0.918,低于阈值 1。因此不能靠提高气味强度解决,也不能把之前的数值测试当作已验证的感觉—动作模型。

这次 GPU 环境中 181 项软件测试通过。数值验证通过与行为验证通过是不同的结论。上方的新模型实验已经补充并验证突触衰减、传递延迟与感觉刺激;本节保留旧配置的负面结果,便于复现和比较。

-

下载五组完整实验记录 参数诊断与复现说明 ↗

+

下载五组完整实验记录 参数诊断与复现说明 ↗

Full-brain olfactory CUDA probe: sensory inputs fire, downstream spiking absent with the benchmark normalization. This is a recorded negative functional result, not live inference, banana recognition, or successful navigation.

-

开发者如何复现

使用实验分支 feat/cuda-reference,按复现指南下载官方数据并安装可选 CUDA 依赖。

+

开发者如何复现

使用 v0.5.0a1 版本,按复现指南下载官方数据并安装可选 CUDA 依赖。

python scripts/validate_fullbrain.py \
   --data-dir data \
   --output results/fullbrain.json
diff --git a/site/index.html b/site/index.html index 3a04e9e..5365176 100644 --- a/site/index.html +++ b/site/index.html @@ -4,7 +4,7 @@ - +
Python SDK / Open source / Alpha

No CUDA
required.

Bring a neural circuit into your game.
Load a model. Give it input. Read an action.

Play the live sandbox Python quickstart View source ↗
CPU readyMIT licensedOffline demo
quickstart.py
from flybrain import FlyBrain
 
 brain = FlyBrain.load("toy", backend="cpu")
@@ -17,4 +17,4 @@
 brain.save("brain.checkpoint.json")
 restored = FlyBrain.restore(
     "brain.checkpoint.json"
-)
What runs today: a synthetic offline circuit and an opt-in, 313-neuron real MaleCNS subgraph on your CPU. Select cells, inject currents, inspect activity and bind your own output channels. Try it in the browser, export a recording for Python replay, or download an editable HTML demo. The real model uses assumed dynamics. The experimental CUDA branch now has a complete FlyWire brain benchmark: 139,255 neurons. Watch the full-brain GPU voxel recording: neural output drives movement, but the current readout does not reach food. The released v0.4 alpha remains CPU-only; WASM is planned.
A small API, from input to action

Keep the game loop yours.

01 / STIMULATE

Send a sensory signal

Food, looming on the left or right, and touch are mapped to explicit inputs in the demo circuit.

02 / STEP

Advance neural time

Run fixed simulation ticks on NumPy. Inspect voltages, spikes and firing rates. No GPU setup.

03 / ACT

Read motor intensity

Bind your own named output channels, or use the toy walk, turn and jump values. Save an experiment and continue its trajectory.

A model catalog, not a giant install

Download only what you want to use.

Source URLs, versions, sizes and licenses live in a lightweight catalog. Assets stream to a local cache when you explicitly request them.

Model sourceTodayDownload
Toy LIF circuitRunnable, syntheticIncluded
MaleCNS escape circuitRunnable, experimental real subgraph3.8 MB, SHA256 verified
MaleCNS v1.0Raw connectome dataChoose connections, annotations or transmitters
FlyWire v783Raw connectome dataChoose connections or neuron IDs

Explore model downloads and limitations →

Build in the open

The next circuit could be yours.

Contribute a model source, a real-data importer, an engine adapter or a WASM implementation. You can start with a laptop and a focused pull request.

Start contributing
\ No newline at end of file +)
What runs today: a synthetic offline circuit and an opt-in, 313-neuron real MaleCNS subgraph on your CPU. Select cells, inject currents, inspect activity and bind your own output channels. Try it in the browser, export a recording for Python replay, or download an editable HTML demo. The real model uses assumed dynamics. The optional CUDA backend has a complete FlyWire brain benchmark: 139,255 neurons. Watch the full-brain GPU voxel recording: neural output drives movement, but the current readout does not reach food. Version 0.5 alpha includes experimental CUDA support; CPU stays the default and WASM is planned. Compare the full-brain odor gain pilot.
A small API, from input to action

Keep the game loop yours.

01 / STIMULATE

Send a sensory signal

Food, looming on the left or right, and touch are mapped to explicit inputs in the demo circuit.

02 / STEP

Advance neural time

Run fixed simulation ticks on NumPy. Inspect voltages, spikes and firing rates. No GPU setup.

03 / ACT

Read motor intensity

Bind your own named output channels, or use the toy walk, turn and jump values. Save an experiment and continue its trajectory.

A model catalog, not a giant install

Download only what you want to use.

Source URLs, versions, sizes and licenses live in a lightweight catalog. Assets stream to a local cache when you explicitly request them.

Model sourceTodayDownload
Toy LIF circuitRunnable, syntheticIncluded
MaleCNS escape circuitRunnable, experimental real subgraph3.8 MB, SHA256 verified
MaleCNS v1.0Raw connectome dataChoose connections, annotations or transmitters
FlyWire v783Raw connectome dataChoose connections or neuron IDs

Explore model downloads and limitations →

Build in the open

The next circuit could be yours.

Contribute a model source, a real-data importer, an engine adapter or a WASM implementation. You can start with a laptop and a focused pull request.

Start contributing
\ No newline at end of file diff --git a/site/llms.txt b/site/llms.txt index caed068..a1a9108 100644 --- a/site/llms.txt +++ b/site/llms.txt @@ -5,7 +5,7 @@ Working: NumPy CPU backend, synthetic 12-neuron toy, sensory/motor APIs, schema-2 JSON checkpoints, direct current injection, annotation selection, custom output channels, selected observations, reversible silencing, and a -3.8 MB opt-in real MaleCNS subgraph with assumed LIF dynamics. SDK 0.4.0a4. +3.8 MB opt-in real MaleCNS subgraph with assumed LIF dynamics. SDK 0.5.0a1. Also working: JavaScript CPU runtime, interactive browser circuit lab, standalone HTML demo export and Python replay of browser stimulus/intervention recordings. Also working: Python Session with replaceable current encoders, rate readouts and @@ -23,7 +23,7 @@ Raw MaleCNS/FlyWire downloads also remain available. Not yet implemented: calibrated biological models, full-brain real-time guarantees, WASM, biological learning or plasticity. No PyPI or NPM publication yet. -Experimental development branch (not v0.4.0a4): optional CuPy CUDA backend passed +Version 0.5 alpha adds optional CuPy CUDA support (older v0.4.0a4 is CPU-only). It passed 12/12 actual NVIDIA A16-2Q hardware tests. Small circuits are slower on CUDA. Full FlyWire v783 test on A16-8Q: all 139,255 proofread neurons and all 16,847,997 source neuron-pair/neuropil rows (54,492,922 contacts), no extra pruning. diff --git a/site/male-cns-escape.html b/site/male-cns-escape.html index 12762a1..315d967 100644 --- a/site/male-cns-escape.html +++ b/site/male-cns-escape.html @@ -4,7 +4,7 @@ - +

Try this circuit in your browser

Model card · experimental

A real circuit.
No CUDA required.

MaleCNS LC4 / LPLC2 / giant-fiber subgraph: 313 neurons, 20,607 directed edges and 79,112 reconstructed contacts. A 3.8 MB optional download with fixed source IDs and SHA256 verification.

Real anatomy, assumed dynamics. This model uses simplified LIF equations, artificial current inputs and an experimental GF rate readout. It is not a recovered biological brain or a demonstration of learned behavior.

Run on your laptop

Python · SDK 0.2 alpha
from flybrain import FlyBrain
 
 brain = FlyBrain.load("male-cns-escape-v1", download=True)
diff --git a/site/models.html b/site/models.html
index ec0f48e..8e6e29a 100644
--- a/site/models.html
+++ b/site/models.html
@@ -4,7 +4,7 @@
 
 
 
-
+
 
Model catalog

Small install.
Explicit downloads.

The SDK includes versioned source URLs and metadata. It never downloads biological data during import or toy loading.

Inspect first, then download
from flybrain import list_models, model_info, fetch_model
 
 print([(m["id"], m["status"]) for m in list_models()])
diff --git a/site/reflex.html b/site/reflex.html
index 3f02dfa..89d1661 100644
--- a/site/reflex.html
+++ b/site/reflex.html
@@ -13,7 +13,7 @@ 

同一回路,学会不同的动作。

来袭在左,

01 / 还没学会

零权重读出;平局默认向右。

02 / 奖励训练之后

连接回路不变,仅更新 3 个读出权重。

1 / 80

-

奖励如何改变动作

绿线:训练集动作准确率 · 蓝线:实际采样奖励。先固定训练轮数,再做一次留出评估。

这个实验说明什么

这是一个简单的两选一反射任务。学到的是外部读出,不是果蝇突触可塑性。关卡之间重置神经状态;留出集改变刺激强度与干扰,尚未证明复杂游戏中的泛化能力。

画面是保存下来的真实实验动作的示意回放。80ms 的神经反应被放慢展示,页面不会连接或租用 GPU,也不在浏览器里重新训练。

下载训练记录 · 下载动作权重 · CUDA 验证报告 · 复现实验源码

开发分支已在 A16-2Q 上通过 12 项硬件测试。小回路 CPU 约 0.108 秒、CUDA 约 2.640 秒 / 模拟秒;当前 GPU 实现验证了兼容性,并未加速。已发布 v0.4.0a4 仍为 CPU 版本。

+

奖励如何改变动作

绿线:训练集动作准确率 · 蓝线:实际采样奖励。先固定训练轮数,再做一次留出评估。

这个实验说明什么

这是一个简单的两选一反射任务。学到的是外部读出,不是果蝇突触可塑性。关卡之间重置神经状态;留出集改变刺激强度与干扰,尚未证明复杂游戏中的泛化能力。

画面是保存下来的真实实验动作的示意回放。80ms 的神经反应被放慢展示,页面不会连接或租用 GPU,也不在浏览器里重新训练。

下载训练记录 · 下载动作权重 · CUDA 验证报告 · 复现实验源码

可选 CUDA 后端已在 A16-2Q 上通过 12 项硬件测试。小回路 CPU 约 0.108 秒、CUDA 约 2.640 秒 / 模拟秒;当前 GPU 实现验证了兼容性,并未加速。0.5 alpha 包含可选 CUDA 支持,默认 CPU 安装无需 NVIDIA 设备。