How a fly-inspired reflex became a Circuit strangers can inspect and challenge
Part three of an open research sequence: a Drosophila looming-escape reflex compiled into hard Boolean logic — 74 NAND …

How a fly-inspired reflex became a Circuit that strangers can inspect, challenge, and try to beat
Important scope: C3S is not a fly brain, a biological validation study, an onchain AI system, or a claim that the full stateful core is already deployed as a persistent production Tapeout machine.

Research Sequence
This is the third note in an open research sequence.
- Part I — When Experience Becomes Circuit: can a learned rule survive the removal of weights, gradients, and floating-point machinery?
- Part II — When Instinct Becomes Circuit: can a biological wiring resource constrain what a small machine should be faithful to?
- Part III — this release: where can such a machine become a public research object—inspectable, reproducible, challengeable, and improvable by people who did not build it?
The first note argued that a model is not the final artifact. If a learned behavior matters, it should survive hardening, synthesis, and verification as the implementation that actually runs.
The second note made the harder correction. A connectome is not an executable mind. It is a structural resource. It can constrain a behavioral hypothesis, but it does not supply all the dynamics, encoders, calibration choices, or evidence needed to claim biological truth.
This third note is where those two ideas become executable.
Tapeout does not need to become a cloud for intelligence. It can become a public laboratory for bounded behavior. C3S is the first open experiment in that laboratory.
By a bounded behavior, I mean one with explicit inputs, assumptions, state, outputs, costs, and known failure modes—small enough that another researcher can replay it, reject it, compile it differently, or produce a cheaper implementation under the same declared contract.
That may sound smaller than “putting intelligence onchain.” It is.
It is also a much better place to begin.
The missing object: not a model, not a demo, but a public machine
Most research chains break apart at the moment they become interesting.
Source data sits in one repository. A behavioral hypothesis lives in a paper. Calibration is hidden in a notebook. A learned model is summarized by a headline metric. A logic netlist exists somewhere else. A demo proves that something moved on a screen. Then the entire argument is compressed into a sentence nobody can productively challenge.
C3S was built to keep those layers apart.
The first artifact is a deliberately narrow Drosophila looming-escape model called LoomEscape-16. It uses MaleCNS as a synaptic-resolution wiring resource and looming-escape literature as a behavioral constraint source.
The implementation does not claim that the source data tells us the complete fly nervous system. It does not. It exposes where the missing choices begin:
- source-derived pathway counts;
- explicit assumptions about how those counts contribute to feature drive;
- an explicit calibration procedure;
- a finite teacher;
- a hard logic realization;
- tests that distinguish compiler correctness from behavioral fidelity and biological interpretation.
This turns an evocative biological story into something much more useful: a behavioral contract another person can attack with a precise objection.
The current release has a 16-bit input representation, a 2-bit action output, and a small stateful motor core. The exact synthesized policy uses 74 NAND gates at depth 11. The exact stateful core uses 173 NAND gates and 6 LATCHes. The repository checks the policy across all 65,536 input rows and the core across 8,388,608 finite input/state transitions.
That does not establish that the continuous teacher is biologically correct. It establishes a different, narrower fact: the hard Circuit faithfully implements the quantised teacher over the declared finite domain.
That distinction is the entire point.
A bounded behavior should expose its mechanism, not only its gate count
It is easy to show a gate count. It is harder—and more valuable—to show why the behavior appears at all.
In the continuous LoomEscape teacher, short- versus long-mode takeoff is not an opaque output label. It emerges from a timing race between a candidate parallel pathway, the Giant Fiber pathway, and a small motor program.
The parallel path usually crosses first. The behavioral mode is then determined by whether the Giant Fiber crosses before a four-tick, or 20 ms, wing-raise program completes. The transition is therefore a temporal mechanism, not a generic classification score.

This matters because it tells the next researcher where disagreement belongs.
If the behavior is wrong, the criticism need not stop at “the Circuit is wrong.” It can target the sensory encoding, the threshold calibration, the motor-state assumption, the literature constraint, or the mapping from source wiring to teacher. A bounded machine is useful precisely because its errors can be located.
https://brucelanlan.github.io/c3s-reflex-circuits/demo/
Calibration is part of the claim, so it should be visible
The connectome-derived counts constrain relative feature drive. They do not independently determine the Giant Fiber threshold, the parallel threshold, or the wing-raise duration.
Those values should not be hidden as aesthetic tuning choices.
For LoomEscape-16, they are selected through an explicit grid search under declared constraints C1–C3. Across 1,105 tested parameter combinations, 89 satisfy those criteria. The selected teacher—Giant Fiber threshold 4.25, parallel threshold 6.0, and a four-tick wing-raise program—is one visible admissible point in that space.
This is not a weakness that needs to be concealed. It is the public claim.
Another researcher can reject the heuristic, select a different admissible point, add a stronger quantitative target, or show that the family of constraints itself is too weak. The research object remains useful because it makes that disagreement operational.
https://x.com/Blonskr/status/2092551495392825791
The first hard result is a negative one
We also trained Differentiable Logic Gate Network (DLGN) candidates against the same policy.
DLGNs are compelling because they use differentiable training to select Boolean operations, then harden into logic after the soft optimization machinery is removed. In a sparse or sampled regime, that may be an important way to discover compact logic that no one can tabulate by hand.
LoomEscape-16 is not such a regime.
Its 16-bit teacher can be enumerated completely. Once the target is visible across all 65,536 rows, exact synthesis does not need to guess it.


The learned experiments are one-run-per-size, seed-0 experiments. They do not prove that DLGNs are generally inferior.
They prove something more useful:
A learned model should not receive a free engineering premium simply because it was learned. The synthesis method has to match the information regime.
When the whole behavior can be specified, exact synthesis is the correct baseline. When the behavior is high-dimensional, sampled, or expensive to evaluate, learned search may become useful. But a candidate still has to survive hardening, synthesis, and verification of the machine that actually runs—not just validation of the soft model that trained well.
That is a research question worth bringing to Tapeout: under what information conditions does learning improve the post-synthesis behavior/cost frontier?
What the measured wiring actually constrains
The easiest version of this project would have said: “we used a connectome, so the model is biologically grounded.”
That would be meaningless.
Instead, C3S asks a counterfactual question. Four counts per side enter the teacher: LC4 and LPLC2 inputs to the Giant Fiber, and LC4 and LPLC2 inputs to the candidate parallel pathway. If those measured counts are moved into the wrong slots, can the same literature-derived behavior still be recovered after recalibration?
The answer is selective.
All 18 permutations that move the dominant parallel LC4 count out of its measured slot become non-calibratable under C1–C3. All 5 permutations that keep that count in its slot remain calibratable. The measured wiring therefore supports one narrow ordinal structural constraint: under this teacher, the candidate parallel pathway is dominated by LC4 input.
https://github.com/BruceLanLan/c3s-reflex-circuits
The result does not identify the full pathway, prove the Giant Fiber’s detailed input balance, or validate the continuous model in vivo. Five wrong permutations remain calibratable because the other free parameters can absorb them. With thresholds fixed, almost every wrong wiring breaks the declared behavior—but that coupling is not identifiable from qualitative targets alone.
This is exactly what a public bounded-machine artifact should do: make a claim narrower than a grand biological narrative, but sharper than a vague gesture toward “bio-inspired AI.”
A public machine should survive a challenge set it did not tune on
The point of a bounded artifact is not only that it can be compressed. It is that it can be challenged.
Before the controls were run and before evaluation, C3S generated a family of 48 looming stimuli with a random salt and committed its SHA-256 digest. After the teacher, encoding, calibration, and Circuits were frozen, the exact core was evaluated against that once-sealed family.
The exact core preserved escape behavior in every episode. It agreed with the continuous teacher on short- versus long-mode takeoff in 42 of 48 cases, or 0.875, with a mean absolute takeoff timing error of one tick (5 ms).
https://x.com/BruceBlue/status/2098315194145657149
The “once” matters. The family was committed before evaluation, then published on 13 September 2026. It is now fully reproducible but no longer blind for any later model change.
That is not an administrative detail. It is the beginning of a research culture.
The next question does not have to be “did the Circuit fail?” It can be more precise: is the encoding too coarse, is the teacher boundary too brittle, does another admissible calibration generalize better, or is there a smaller valid implementation under the same behavior contract?
This is why challenge sets, counterexamples, and lower-cost reimplementations should become first-class research inputs rather than private arguments in a group chat.
Why this belongs on Tapeout, not only on GitHub
GitHub is where people inspect code. It is necessary.
But a repository alone does not naturally make fabrication identity, common cost, public reuse, and valid counterexamples part of the same object.
Tapeout’s model is interesting because it already treats NAND/LATCH construction, fabrication and Circuit artifacts as public protocol objects. Its Proof of Design task model frames improvement as a lower-cost valid implementation under a shared task, while prior verified designs remain visible rather than disappearing.
That does not turn Tapeout into a general research platform overnight. It does not make large computation cheap, solve liveness, solve oracle trust, validate biological hypotheses, or make every Circuit safe for autonomous execution.
What it can do is provide a credible final surface for a particular kind of research object:

The current C3S release establishes the upstream research discipline and a Tapeout-compatible byte layout/reference evaluator. It does not establish that the complete stateful system is already live as a persistent production Tapeout machine. Circuit Containers, V2 component slots, and any C3S-specific Proof of Design task are separate protocol directions or research proposals, not assumptions needed for the evidence reported here.
That separation is not a weakness. It is how a research program earns its claims.
A research agenda for Tapeout
C3S should not remain a single fly-inspired artifact. It should become the first demonstration of what researchers can do when a bounded behavior has a public destination.
- Bring a teacher: a small safety policy, control rule, protocol state machine, mechanism-design constraint, or other behavior whose inputs, state, outputs, and failure modes can be specified.
- Bring a proof: a SAT/BMC result, an equivalence certificate, a minimal counterexample, or a stronger behavioral constraint.
- Bring a backend: an FPGA map, a standard-cell experiment, an alternative evaluator, or a semantic-hash scheme that tests whether the same behavior survives a different execution substrate.
- Bring a counterexample: a broken assumption, a leaky encoder, a more demanding challenge set, or a lower-cost valid Circuit.
The invitation is not “come build an application around a protocol.”
It is:
Bring a teacher, a proof, a backend, or a counterexample. If it survives the evidence chain, it can become a Circuit other people can study, challenge, compose, and improve.
That is the kind of open research network Tapeout should be trying to grow.
What C3S claims—and what it does not
The strongest version of this project is also the smallest honest version.
C3S claims that a source-constrained behavioral teacher can be made explicit, reduced to hard Boolean logic, checked over a declared finite domain, and published with enough evidence that strangers can reproduce, reject, or improve it.
C3S does not claim biological validity, a complete nervous-system simulation, a general verdict on DLGNs, physical FPGA/ASIC realization, a persistent production deployment, or a solved system for agent authority and economic execution.
That restraint is not marketing modesty. It is the reason the artifact can compound.
The next frontier is not putting a model onchain.
It is giving a small behavior enough public evidence that strangers can disagree with it productively—and enough fabrication discipline that a better version has somewhere to go.
- Repository: https://github.com/BruceLanLan/c3s-reflex-circuits
- Live demo: https://brucelanlan.github.io/c3s-reflex-circuits/demo
- Start here: Run pytest -q; then read README.md, docs/EVALUATION.md, and docs/LIMITATIONS.md before making claims about the result.
#TapeOut #OpenSource #OpenScience

References
[1] Janelia — Male CNS Connectome
[2] Ache et al., Current Biology, 2019 — looming size and velocity encoding
[3] C3S Reflex Circuits — source, artifacts, controls, and evaluation
[4] Petersen et al., Differentiable Logic Gate Networks, NeurIPS 2022
[5] Tapeout public formula and task model
[6] Tapeout V2 component-slot preview