\documentclass[11pt]{article}

% ============================================================
% PACKAGES
% ============================================================
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathptmx} % Times Roman text + math, per Springer Nature "10-point Times Roman" guidance
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{shapes.geometric,arrows.meta,positioning,fit,backgrounds,calc}
\usepackage{booktabs}
\usepackage{amsmath,amssymb}
\usepackage{natbib}
\usepackage{hyperref}
\usepackage{authblk}
\usepackage{caption}
\usepackage{float}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{setspace}
\onehalfspacing

\hypersetup{colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue}

\newcommand{\celegans}{\textit{C.\,elegans}}
\newcommand{\op}[1]{\ensuremath{\gamma_{\mathrm{#1}}}}

\title{\textbf{NeuroSparkSNT: An Eight-Operator Framework for Behavioral Phase Dynamics in \celegans\ Neural Simulation}}

\author[1]{Durhan Yaz{\i}r}
\affil[1]{SNT CoreX Dynamics, Antalya, Turkey \\ \texttt{durhan@sntcorexdynamics.com} \\ ORCID: 0009-0007-4304-2066}

\date{}

% ============================================================
\begin{document}
\maketitle

\begin{abstract}
\noindent
The nematode \celegans\ possesses one of the most thoroughly characterized nervous systems in biology, yet existing computational models of its locomotion occupy opposite architectural extremes: biophysically detailed conductance-based simulations that faithfully reproduce single-neuron membrane dynamics but cannot account for the discrete, mutually exclusive transitions between behavioral states, and mean-field rate models that capture certain population-level statistics but sacrifice circuit specificity. Neither class was designed to reproduce the abrupt, all-or-none phase switching---forward crawling, reversal, omega-turn reorientation---that whole-brain calcium imaging has shown to be the defining dynamical signature of freely behaving \celegans. We present NeuroSparkSNT, an eight-operator framework built directly on the Cook et al.\ (2019) connectome (114 of 300 neurons, spanning sensory, interneuron, and motor groups), in which a semi-Markov phase controller gates operator activity so that competing locomotor drives are structurally, not merely numerically, exclusive. Two architectural variants are evaluated under identical biological parameters: a monolithic implementation in which all operators are evaluated at every simulation step, and a pool-dispatch implementation in which only the operators appropriate to the current phase are evaluated. Across twelve quantitative benchmarks calibrated against five independent experimental datasets, the pool-dispatch variant reproduces AVA--AVB interneuron antagonism to within 14\% of the calcium-imaging reference ($r=-0.477$ vs.\ $-0.420$), and the omega-turn dwell time matches the experimental value exactly ($0.50\,\mathrm{s}$; Pierce-Shimomura et al., 1999). Critically, a six-stimulus generative test---in which stimulus conditions were presented that had never been used to set any model parameter---yields correct behavioral predictions in all six cases, providing evidence that the architecture captures circuit mechanism rather than reproducing calibration data. A biologically grounded stimulus-awareness layer encodes seven documented sensory--interneuron reflex arcs as innate, parameter-free phase biases derived directly from connectome polarity. Seven additional model-derived predictions, including a phase-dependent reversal-latency ratio of $7.3\times$ and a specific interneuron dissociation prediction at PVP, constitute falsifiable experimental targets. We close by outlining a minimal one-variable extension through which the existing dopamine/serotonin and gradient-following components could be unified into a homeostatically regulated foraging agent that requires no externally specified reward function.
\end{abstract}

\noindent\textbf{Keywords:} \celegans; connectome; computational neuroscience; behavioral phase transition; operator-gated dynamics; locomotor circuit; klinokinesis

% ============================================================
\section{Introduction}
% ============================================================

The nematode \celegans\ occupies a singular position in systems neuroscience: its nervous system is small enough (302 neurons in the hermaphrodite) to be completely and reproducibly mapped \citep{white1986}, yet large enough to support a rich behavioral repertoire---chemotaxis, thermotaxis, mechanosensory avoidance, and goal-directed foraging---that has been characterized in detail over four decades of genetic and optical-imaging work. This combination has made \celegans\ the principal test case for a foundational question in computational neuroscience: to what extent does knowledge of a circuit's wiring diagram constrain, or even determine, the behavior it produces \citep{bargmann2013}.

Two broad modeling traditions have addressed this question, and each captures part of the answer. Biophysically detailed simulations, exemplified by the OpenWorm project, integrate Hodgkin--Huxley-style conductance dynamics over the full connectome and achieve high fidelity at the single-neuron level. Mean-field rate models, exemplified by Wilson--Cowan-type formulations, summarize population activity with a small number of coupled differential equations and are computationally tractable. Neither tradition, however, was designed to reproduce a property that simultaneous whole-brain calcium imaging has shown to be central to \celegans\ locomotion: behavior is not a smooth trajectory through a continuous state space but a sequence of discrete, mutually exclusive phases---forward crawling, reversal, and omega-turn reorientation---separated by rapid transitions whose timing is governed by circuit-level interneuron competition rather than smooth attractor dynamics \citep{kato2015}. A recent large-scale analysis of postural and neural dynamics across multiple timescales reinforces this point, demonstrating that a low-dimensional, state-switching (semi-Markov) description captures \celegans\ locomotor behavior more accurately than continuous-trajectory alternatives \citep{costa2024}.

This sudden phase-switching is not an experimental artifact to be smoothed over; it is the behavioral phenomenon a circuit-level model should be required to reproduce. Upon encountering food, for instance, the animal does not gradually decelerate into a graded ``slow zone''---it transitions directly into a sustained forward run, punctuated by brief reversals and omega turns that serve as corrective reorientations, with pharyngeal pumping triggered as a fast, largely uninterrupted reflex rather than a prolonged behavioral arrest \citep{sawin2000}. A model architecture that represents locomotor phase as a first-class, discretely gated variable---rather than as an emergent property of continuous dynamics that must somehow self-organize into discreteness---is therefore not a simplification but a more direct encoding of the underlying biology.

We introduce NeuroSparkSNT, a connectome-derived simulation framework built around this principle. Its central architectural commitment is \emph{operator-gated phase control}: an explicit, semi-Markov phase controller determines which of eight biologically interpretable operators are permitted to act at each simulation step, so that operators driving incompatible behaviors (forward locomotion and reversal, for instance) are never simultaneously active by construction. We evaluate two implementations of this principle that share every biological parameter, connectome weight, and sub-circuit, differing solely in whether operator exclusion is achieved through conditional suppression within a monolithic update or through structural absence from a dispatched operator set. Because every biological degree of freedom is held constant across this comparison, differences in benchmark performance can be attributed unambiguously to the dispatch mechanism---a controlled architectural comparison that, to our knowledge, has not previously been reported for a circuit-level \celegans\ model.

Beyond phase control, NeuroSparkSNT contributes four further architectural elements, each tied to a specific experimental literature: an explicit representation of the omega turn as a fifth locomotor phase, calibrated to the reversal-to-turn transition statistics reported by \citet{pierceshimomura1999}; a signal-based gradient-following mechanism in which simulated odor intensity rises during approach and falls during retreat, providing the directional feedback absent from earlier step-budget formulations \citep{bargmannhorvitz1991}; a stimulus-awareness layer that encodes seven sensory--interneuron reflex arcs as innate phase biases, reflecting the well-established observation that \celegans\ chemosensory and nociceptive responses are present in naive, unconditioned animals \citep{bargmann2006}; and a neuromodulatory sub-system linking dopaminergic approach drive to serotonergic satiety signaling at food contact \citep{sawin2000}.

The remainder of this paper is organized as follows. Section~2 describes the connectome, the eight-operator architecture, the two dispatch variants, and the benchmark suite. Section~3 reports results across twelve benchmarks spanning circuit-level fidelity, dynamical stability, behavioral timing, and goal-directed task completion. Section~4 discusses what the comparison between dispatch architectures and between baseline models reveals about the architectural requirements for behavioral-phase fidelity, situates the present results within the documented \celegans\ behavioral repertoire, and addresses the limitations of the current implementation. Section~5 outlines a future extension toward homeostatically regulated, reward-free behavioral autonomy.


% ============================================================
\section{Methods}
% ============================================================

\begin{figure}[H]
\centering
\begin{tikzpicture}[
  box/.style={draw, rounded corners, minimum width=3.6cm, minimum height=0.9cm, align=center, font=\small},
  sub/.style={draw, rounded corners, minimum width=2.7cm, minimum height=0.8cm, align=center, font=\scriptsize},
  jct/.style={draw, circle, minimum size=7mm, font=\scriptsize, fill=gray!20},
  arr/.style={-{Stealth[length=2.2mm]}, thick},
  ]
% ---- Entry point: INPUT and StimulusAwareness (the process starts here) ----
\node[box, fill=yellow!18]  at (-3.6,10) (input) {INPUT (Spark)\\ \scriptsize \op{f} noise, \op{d} stimulus drive};
\node[box, fill=yellow!12]  at (3.6,10)  (aware) {StimulusAwareness\\ \scriptsize innate scenario bias (Table~\ref{tab:awareness})};
% ---- Phase decision, reading current neural state x ----
\node[box, fill=blue!12]    at (0,8)     (pc)    {PhaseController\\ \scriptsize semi-Markov: FWD/REV/TURN/RESET/NEU\\ \scriptsize (reads current AVA/AVB)};
% ---- Operator stage: phase-gated, all 8 operators ----
\node[box, fill=orange!15]  at (0,6)     (op)    {Operator stage\\ \scriptsize \op{f}\,\op{d}\,\op{n}\,\op{c}\,\op{t}\,\op{fwd}\,\op{rev}\,\op{turn} (see Fig.~\ref{fig:ab_compare})};
\node[sub, fill=gray!10]    at (-5.0,6)  (sc)    {SoftClamp\\ \scriptsize $\theta\!\to\!0.65$ active\\ $\theta\!\to\!0.15$ reset};
\node[sub, fill=gray!10]    at (5.0,8)   (learn) {\op{learn}: $T_c$\\ \scriptsize thermotaxis memory};
% ---- dx junction and recurrent state update ----
\node[jct]                  at (0,4)     (dx)    {$dx$};
\node[box, fill=red!8]      at (0,2)     (xnew)  {$x_{t+1} = x_t + dx$\\ \scriptsize neural state update};
\node[box, fill=red!10]     at (0,0)     (cmd)   {CommandLayer\\ \scriptsize softmax: FWD/REV/TURN/CHEMO/PAUSE};
% ---- ChainTaskPipeline: parallel, conditional, additive branch ----
\node[draw, dashed, rounded corners, fill=green!5, minimum width=6.4cm, minimum height=4.6cm] at (5.6,4) (chainbox) {};
\node[font=\scriptsize, align=center] at (5.6,6.0) {\textbf{ChainTaskPipeline}\\ (parallel; active only if\\ goal-directed command given)\\ IDLE$\to$APPROACH$\to$CONTACT$\to$RESET};
\node[sub, fill=green!12]   at (4.2,2.7) (lim)   {LiminalOp\\ \scriptsize $s_t$: FWD$\uparrow$ REV$\downarrow$};
\node[sub, fill=green!12]   at (7.0,2.7) (bia)   {BiAmine\\ \scriptsize DA$\uparrow$ approach\\ 5HT$\uparrow$ contact};

% ---- Arrows: main recurrent loop ----
\draw[arr] (input) -- (pc);
\draw[arr] (aware) -- (pc);
\draw[arr] (input) |- (op.west);
\draw[arr] (pc) -- node[right,font=\scriptsize]{phase} (op);
\draw[arr] (op) -- (sc);
\draw[arr] (op) -- (dx);
\draw[arr] (dx) -- (xnew);
\draw[arr] (xnew) -- (cmd);
\draw[arr,dashed] (learn.south) -- (pc.east)
  node[midway,above,font=\tiny] {feedback};
\draw[arr] (op.east) -- (learn.west);
% ChainTask additive contribution into dx
\draw[arr] (chainbox.west) -| (dx.east)
  node[midway,above,font=\tiny,xshift=-2mm] {additive};
\draw[arr,gray] (lim) -- (chainbox.south -| lim);
\draw[arr,gray] (bia) -- (chainbox.south -| bia);
% Recurrent feedback: x_{t+1} becomes the AVA/AVB read at the start of the next step
\draw[arr, blue!60!black] (xnew.west) .. controls +(-6,0) and +(-6,3) .. (pc.west)
  node[midway, left, font=\scriptsize, align=center, blue!60!black] {recurrent:\\ next step};
\end{tikzpicture}
\caption{NeuroSparkSNT architecture, components shared by both dispatch variants (Section~\ref{sec:ab_variants}). Each simulation step begins with INPUT operators (\op{f}, \op{d}) and the StimulusAwarenessLayer, both of which inform the PhaseController's transition decision; the PhaseController gates which of the eight operators are evaluated at the operator stage (its internal dispatch differs between the two model variants, shown in Figure~\ref{fig:ab_compare}). The resulting $dx$ updates neural state $x$, which is read again at the start of the next step (blue recurrent arrow) and passed to CommandLayer for a per-step behavioral readout. SoftClamp and \op{learn} run alongside the main loop. The ChainTaskPipeline (dashed box) is a parallel, additive branch that is engaged only for goal-directed commands; it contributes to $dx$ rather than replacing any step of the main loop.}
\label{fig:architecture}
\end{figure}

\subsection{Connectome and neuron registry}

The structural backbone of NeuroSparkSNT is the adult hermaphrodite connectome of \citet{cook2019}, comprising 300 neurons and 3{,}669 chemical synapses reconstructed by serial-section electron microscopy. From this connectome we extract a 114-neuron subnetwork spanning eighteen functionally defined groups: eight sensory classes (attractive and repulsive chemosensation, anterior and posterior touch, food, temperature, oxygen, and carbon dioxide), five interneuron/circuit classes (forward, reverse, turn, steering, pause, and a thermotaxis-memory class), three motor classes (forward, reverse, and turn), and the pharyngeal motor group. The full neuron membership of each group is listed in Supplementary File~S1 (\texttt{cook2019connectome.xlsx}). The synaptic weight matrix $W$ is read directly from the connectome and held fixed throughout simulation; no weight is learned or optimized against behavioral data. This is a deliberate architectural commitment: the model's dynamical properties are required to emerge from documented anatomy rather than from a fitting procedure, so that any quantitative match to experimental data constitutes a test of the operator architecture rather than of an optimization routine. Reciprocal AVA--AVB inhibition, documented anatomically by \citet{white1986} and functionally by \citet{chalfie1985}, is instantiated with synaptic strength~0.8.

\subsection{Eight-operator architecture}

Neural state $x \in \mathbb{R}^{114}$ evolves under the additive contribution of eight operators, partitioned into three functional classes (Table~\ref{tab:operators}). Two \emph{input} operators inject exploration noise (\op{f}) and amplify above-threshold sensory drive (\op{d}). Three \emph{system} operators implement decision bias toward forward or reverse command interneurons (\op{n}), cyclic reset of locomotor state during the inter-phase transition (\op{c}), and tonic homeostasis together with weathervane head-steering (\op{t}). Three \emph{behavior} operators are hard-locked to a single locomotor phase: \op{fwd} drives only the forward motor group, \op{rev} drives only the reverse motor group, and \op{turn} drives only the omega-turn circuit (AIB/RIM interneurons and SMD/RMD motor neurons), suppressing both AVA and AVB while active. A ninth mechanism, \op{learn}, runs as a continuous side-effect rather than a discrete operator: it slowly updates an internal cultivation-temperature set-point $T_c$ as a function of thermosensory experience (Section~2.6).

\begin{table}[H]
\centering
\caption{The eight-operator architecture. Source and target neuron groups refer to \texttt{CIRCUIT\_GROUPS} in the implementation; full neuron membership is listed in Supplementary File~S1 (\texttt{cook2019connectome.xlsx}).}
\label{tab:operators}
\small
\begin{tabular}{@{}lllll@{}}
\toprule
Operator & Class & Active phase(s) & Target group & Reference \\
\midrule
\op{f}   & Input    & All                     & all (noise)        & --- \\
\op{d}   & Input    & FWD, REV, TURN, NEU     & sensory (amplify)  & \citet{bargmannhorvitz1991} \\
\op{n}   & System   & FWD, REV, TURN, NEU     & circuit\_fwd/rev   & \citet{chalfie1985} \\
\op{c}   & System   & RESET, NEU              & circuit\_turn/pause& \citet{gray2005} \\
\op{t}   & System   & All                     & circuit\_steer     & \citet{mori1995} \\
\op{fwd} & Behavior & FWD only                & motor\_forward     & \citet{chalfie1985} \\
\op{rev} & Behavior & REV only                & motor\_reverse     & \citet{chalfie1985} \\
\op{turn}& Behavior & TURN only               & motor\_turn        & \citet{pierceshimomura1999} \\
\bottomrule
\end{tabular}
\end{table}

Five task-specific operators (\op{DA}, \op{lim}, \op{cns}, \op{5HT}, \op{learn}) are active only during a goal-directed episode and are described in Sections~2.5--2.6.

\subsection{PhaseController: semi-Markov locomotor states}

Locomotor phase is governed by a five-state semi-Markov process: \textsc{Forward}, \textsc{Reverse}, \textsc{Turn}, \textsc{Reset}, and \textsc{Neutral}. Dwell time in each active state is drawn from a log-normal distribution, $\tau \sim \mathrm{LogNormal}(\mu,\sigma)$, with parameters calibrated to the corresponding experimental literature: forward dwell $\mu=20\,\mathrm{s}$ (Kato et al., 2015, mean forward bout duration after accounting for the model's somewhat longer effective bouts; see Section~\ref{sec:limitations}), reverse dwell $\mu=2\,\mathrm{s}$ \citep{kato2015}, and omega-turn dwell $\mu=0.5\,\mathrm{s}$ \citep{pierceshimomura1999}. Following each reversal, the controller transitions to the turn state with probability $0.60$ and directly to reset otherwise, matching the reversal-to-pirouette rate reported by \citet{pierceshimomura1999}. Crucially, the operator set active in each phase (Table~\ref{tab:operators}) is structurally disjoint with respect to the three behavior operators: \op{fwd} is never evaluated during \textsc{Reverse} or \textsc{Turn}; \op{rev} is never evaluated during \textsc{Forward} or \textsc{Turn}; \op{turn} is never evaluated during the two locomotor phases. This hard exclusion is the computational analogue of the anatomical mutual inhibition between AVA and AVB documented by \citet{white1986} and confirmed functionally by \citet{randi2023}, who showed that functional signal propagation in the \celegans\ head departs from purely anatomy-based predictions in ways consistent with phase-dependent gating.

\subsection{StimulusAwarenessLayer: innate sensory--phase biasing}

A second, independent mechanism injects scenario-specific bias directly into the phase-transition decision, separate from the within-phase neural dynamics handled by \op{n}. Seven stimulus conditions are mapped to a target phase, a bias strength, and---for the two fastest, most aversive conditions---a flag permitting interruption of an in-progress forward bout (Table~\ref{tab:awareness}). Each mapping corresponds to a documented fast sensory-to-interneuron pathway: anterior touch acting through ASH onto AVA \citep{kaplanhorvitz1993}; carbon dioxide acting through BAG-mediated avoidance circuitry \citep{bretscher2011}; high ambient oxygen acting through URX-mediated acute avoidance \citep{gray2004}; elevated temperature acting through TRP-channel-mediated heat avoidance \citep{glauser2011}; and within-range temperature deviation driving a turn-biased klinokinetic response through the AFD--AIY pathway, consistent with the two-mechanism chemotaxis/thermotaxis framework of \citet{iino2009}.

\begin{table}[H]
\centering
\caption{StimulusAwarenessLayer scenario mappings.}
\label{tab:awareness}
\small
\begin{tabular}{@{}llccl@{}}
\toprule
Stimulus & Target & Strength & Interrupts FWD & Reference \\
\midrule
touch\_anterior   & REV  & 2.5 & yes & \citet{kaplanhorvitz1993} \\
oxygen\_high      & REV  & 2.0 & yes & \citet{gray2004} \\
co2               & REV  & 1.5 & no  & \citet{bretscher2011} \\
temp\_high        & REV  & 2.0 & no  & \citet{glauser2011} \\
temperature        & TURN & 1.5 & no  & \citet{iino2009} \\
touch\_posterior  & FWD  & 1.5 & no  & \citet{chalfie1985} \\
oxygen\_low       & FWD  & 1.0 & no  & \citet{zimmer2009} \\
\bottomrule
\end{tabular}
\end{table}

This layer is best understood not as a fitted heuristic but as a formalization of genetic invariance. The \celegans\ nervous system is structurally near-identical across individuals of the same sex \citep{white1986}, and naive, unconditioned animals display full chemosensory and nociceptive responses to attractants, repellents, and noxious gases without prior exposure \citep{bargmann2006}. The animal does not learn that elevated CO$_2$ is aversive; the avoidance response is encoded in the synaptic pathway from BAG to the avoidance circuit before any individual experience occurs. StimulusAwarenessLayer operates exclusively at the level of phase-transition probability (i.e., it biases the controller's decision of which phase to enter next) and never modifies within-phase neural activity directly; because the within-phase operators of Section~2.2 and the phase-transition logic of Section~2.3 are architecturally separate layers, no conflict arises between bottom-up (\op{n}-mediated) and top-down (awareness-mediated) sensory drive.

\subsection{LiminalOperator: signal-based gradient following}

Goal-directed approach is implemented through a single scalar, $s_t \in [0,1]$, intended as a proxy for perceived odor or food intensity. Rather than tracking elapsed forward steps against a fixed distance budget, $s_t$ is updated directly by locomotor phase:
\begin{equation}
s_{t+1} =
\begin{cases}
\min(1,\ s_t + \delta) & \text{if phase} = \textsc{Forward} \\
\max(s_0,\ s_t - 0.5\delta) & \text{if phase} = \textsc{Reverse} \\
s_t & \text{if phase} = \textsc{Turn}
\end{cases}
\end{equation}
where $s_0$ is the initial signal at episode onset and $\delta$ is a fixed step size scaled so that, under continuous forward motion, $s_t$ reaches threshold over a biologically plausible approach distance. This rule implements a directional feedback loop absent from step-budget formulations: progress toward the goal is rewarded by signal growth, but a reversal episode---moving away from the source---is explicitly penalized by signal decay at half rate, while a corrective turn neither advances nor retreats the signal. Contact is declared when $s_t$ reaches a fixed threshold ($0.95$) or when the true food sensor fires directly, whichever occurs first. This formulation operationalizes temporal gradient following as described by \citet{bargmannhorvitz1991} and the pirouette-based klinokinesis model of \citet{pierceshimomura1999}.

\subsection{ChainTaskPipeline and neuromodulatory dynamics}

Goal-directed feeding is sequenced through four discrete stages---\textsc{Idle}, \textsc{Approach}, \textsc{Contact}, \textsc{Reset}---managed by a dedicated pipeline that runs additively alongside, and without disrupting, the core locomotor dynamics described above. A task dispatcher distinguishes two command types: \texttt{approach-and-consume}, in which pharyngeal pumping fires at contact, and \texttt{approach-only}, in which contact is registered but consumption is suppressed; the distinction is checked explicitly at the \textsc{Contact} stage to avoid the consumption motor program firing under the wrong command. At \textsc{Contact}, pharyngeal pumping is driven for a single simulation step while the pause circuit (RIS) and a transient suppression of the forward command interneuron are activated, consistent with the touch-and-go character of food encounter described by \citet{sawin2000} and with the largely autonomous, reflexive nature of pharyngeal motor function documented by \citet{averyhorvitz1989}: pumping is triggered immediately and briefly, rather than producing a sustained locomotor arrest, after which the animal resets and resumes locomotion.

A biamine modulator tracks two neuromodulatory variables intended to capture dopaminergic approach drive and serotonergic satiety signaling, following the dual-pathway model of \citet{sawin2000}, in which dopamine modulates locomotory rate in the presence of food while serotonin mediates the enhanced slowing response upon food encounter after deprivation. In the present implementation, the dopaminergic component is fully functional and contributes measurably to forward drive during approach (Section~3). The serotonergic component is implemented as a contact-triggered inhibitory pulse intended to capture the transient deceleration described by \citet{sawin2000}; its quantitative antagonism with the dopaminergic signal does not yet reach the target threshold under the present parameterization, and we treat its calibration as a near-term, well-defined extension (Section~\ref{sec:limitations}) rather than as a result reported here.

A slowly updating thermotaxis memory (\op{learn}) implements the cultivation-temperature set-point central to the classical thermotaxis circuit of \citet{mori1995}: a learning-class interneuron population (analogous to AIY/AIZ) integrates thermosensory activity to adjust an internal set-point $T_c$ at rate $\alpha=0.001$, several orders of magnitude slower than locomotor dynamics, consistent with the multi-hour memory timescale reported for cultivation-temperature tracking.

\subsection{SoftClamp homeostatic stabilization}

A clamping mechanism stabilizes the internal control variable $\theta$ that gates cyclic-reset strength, with a phase-dependent target: $\theta \to 0.65$ during the three active locomotor phases (preventing premature reset-operator interference with an ongoing bout) and $\theta \to 0.15$ during \textsc{Reset} (driving aggressive return to baseline). This mechanism is shared without modification between the two architectural variants described below.

\subsection{Two architectural variants: monolith versus pool dispatch}
\label{sec:ab_variants}

NeuroSparkSNT and NeuroSparkSNT\_B share every biologically derived component---connectome matrix, neuron-group assignment, all eight operator parameter values, SoftClamp dynamics, PhaseController transition statistics, and ChainTaskPipeline logic. The two variants differ in exactly one respect: how operator exclusion is enforced at the operator stage shown schematically in Figure~\ref{fig:architecture} (Figure~\ref{fig:ab_compare} expands this stage for each variant). NeuroSparkSNT (Model~A) evaluates all eight operators at every simulation step within a monolithic update function, with phase-inappropriate contributions suppressed by conditional logic inside each operator body. NeuroSparkSNT\_B (Model~B) instead maintains an explicit phase-to-operator-set lookup table and evaluates only the operators belonging to the current phase's set; \op{fwd} is not merely suppressed during \textsc{Reverse}, it is absent from the computational graph entirely. This design constitutes a controlled architectural comparison: because every biological parameter is held fixed, any systematic difference in behavior between the two models is attributable to the dispatch mechanism alone (Section~4.2).

\begin{figure}[H]
\centering
\begin{tikzpicture}[
  opn/.style={draw, circle, minimum size=9mm, font=\small, fill=orange!40},
  lbl/.style={font=\small},
  ]
\node[draw, rounded corners, minimum width=11cm, minimum height=3.0cm, fill=orange!8] (box) at (0,0) {};
\node[lbl] at (-1.0,1.15) {\texttt{OperatorLayer.forward()}};
\node[opn] (f)    at (-3.6,0.55) {\op{f}};
\node[opn] (d)    at (-2.0,0.55) {\op{d}};
\node[opn] (n)    at (-0.4,0.55)  {\op{n}};
\node[opn] (c)    at (1.2,0.55)  {\op{c}};
\node[opn] (t)    at (-3.6,-0.55) {\op{t}};
\node[opn] (fwd)  at (-2.0,-0.55) {\op{fwd}};
\node[opn] (rev)  at (-0.4,-0.55) {\op{rev}};
\node[opn] (turn) at (1.2,-0.55) {\op{turn}};
\node[lbl, align=left, anchor=west] at (2.4,0) {all 8 operators\\ evaluated every step;\\ \texttt{if phase==}\\ gates inside body};
\node[above] at (0,2.0) {\Large\textbf{(a) Model A --- monolith}};
\draw[-{Stealth[length=2.5mm]},thick] (3.0,1.75) -- (3.0,1.5);
\draw[-{Stealth[length=2.5mm]},thick] (box.south) -- (0,-2.0) node[below,font=\small]{$dx$};
\end{tikzpicture}

\vspace{14mm}

\begin{tikzpicture}[
  opn/.style={draw, circle, minimum size=9mm, font=\small, fill=teal!45},
  opn0/.style={draw, circle, minimum size=9mm, font=\small, fill=gray!12, draw=gray!50, dashed},
  lbl/.style={font=\small},
  ]
\node[draw, rounded corners, minimum width=11cm, minimum height=3.0cm, fill=teal!6] (box) at (0,0) {};
\node[lbl] at (-1.0,1.15) {\texttt{PHASE\_OPS[FWD]} lookup};
\node[opn] (f)    at (-3.6,0.55) {\op{f}};
\node[opn] (d)    at (-2.0,0.55) {\op{d}};
\node[opn] (n)    at (-0.4,0.55)  {\op{n}};
\node[opn0] (c)   at (1.2,0.55)  {\op{c}};
\node[opn] (t)    at (-3.6,-0.55) {\op{t}};
\node[opn] (fwd)  at (-2.0,-0.55) {\op{fwd}};
\node[opn0] (rev) at (-0.4,-0.55) {\op{rev}};
\node[opn0] (turn) at (1.2,-0.55) {\op{turn}};
\node[lbl, align=left, anchor=west] at (2.4,0) {only 5 operators\\ evaluated; \op{rev}, \op{turn},\\ \op{c} structurally\\ absent (dashed)};
\node[above] at (0,2.0) {\Large\textbf{(b) Model B --- pool dispatch}};
\draw[-{Stealth[length=2.5mm]},thick] (3.0,1.75) -- (3.0,1.5);
\draw[-{Stealth[length=2.5mm]},thick] (box.south) -- (0,-2.0) node[below,font=\small]{$dx$};
\end{tikzpicture}
\caption{The two architectural variants, both shown for \textsc{Forward} phase as an example. \textbf{(a)} Model~A evaluates all eight operators at every step; operators inappropriate to the current phase (e.g.\ \op{rev}, \op{turn}) are suppressed by conditional logic inside each operator body, but remain part of the computational graph. \textbf{(b)} Model~B looks up the active operator set for the current phase and evaluates only those operators (filled circles); \op{rev}, \op{turn}, and \op{c} are structurally absent from this step's computation (dashed, unfilled), not merely zeroed. Every biological parameter, connectome weight, and operator definition is identical between (a) and (b); the only difference is this dispatch mechanism (Section~\ref{sec:ab_variants}).}
\label{fig:ab_compare}
\end{figure}



\subsection{Baseline models}

Two additional models, sharing the same connectome where applicable, serve as architectural contrasts rather than competitors; each instantiates a structurally distinct alternative to operator-gated phase control, and the specific way each is built motivates the specific way each diverges from experimental data in Section~4.1.

The Wilson--Cowan-type model applies a pair of coupled mean-field rate equations to excitatory and inhibitory neuron pools, with synaptic coupling strengths derived directly from the full 300-neuron connectome and a sigmoidal activation nonlinearity. Crucially, coupling is symmetric and time-invariant: there is no mechanism, gated or otherwise, by which the strength or sign of AVA--AVB coupling can vary with behavioral context. The model has no representation of locomotor phase as a state variable at all---only continuous population firing rates.

The OpenWorm-type model instead represents each of 299 neurons individually using Hodgkin--Huxley-style conductance dynamics: membrane voltage evolves continuously under a small set of active and passive ionic conductances (following the OpenWorm project's published single-compartment parameterization), with synaptic and gap-junction coupling read from connectivity obtained independently from public OpenWorm resources. This design targets biophysical fidelity at the single-neuron level---correct membrane time constants, correct synaptic integration---rather than population-level behavioral structure. As with the Wilson--Cowan model, there is no explicit phase variable, no operator gating, and no discrete behavioral-state representation anywhere in the architecture; whatever population-level structure emerges does so as an unconstrained consequence of 299 coupled continuous-time differential equations, rather than as a designed property of the model. Both baselines are evaluated on identical benchmarks to the two NeuroSparkSNT variants, and their divergence from experimental data is interpreted structurally, not merely numerically, in Section~4.1.

\subsection{Benchmark suite}

Twelve benchmarks (Table~\ref{tab:datasets}) probe four aspects of model behavior: circuit-level fidelity against calcium-imaging statistics (B1--B4), dynamical stability and robustness (B5--B6), locomotor timing and recovery (B7--B8), and emergent/generative/goal-directed validity (B9--B12). All four models are evaluated on B1--B6; task-specific benchmarks (B9--B12) are evaluated on the two NeuroSparkSNT variants, for which the underlying chain-task and stimulus-response machinery is defined. Each benchmark uses $N=3$ independent random seeds per model; results are reported as means.

\begin{table}[H]
\centering
\caption{Ground-truth sources used for benchmark calibration.}
\label{tab:datasets}
\small
\begin{tabular}{@{}lll@{}}
\toprule
Source & Used for & Benchmarks \\
\midrule
\citet{cook2019} & Connectome ($W$, fixed) & All \\
\citet{kato2015} & AVA--AVB $r$, PCA spectrum, autocorrelation, dwell times & B1, B2, B3, B7 \\
\citet{pierceshimomura1999} & Omega-turn probability and dwell time & B7 \\
\citet{sawin2000} & Touch-and-go feeding, neuromodulator dynamics & B9, B11 \\
\citet{mori1995} & Thermotaxis circuit, cultivation-temperature memory & B10 \\
\bottomrule
\end{tabular}
\end{table}


% ============================================================
\section{Results}
% ============================================================

\subsection{AVA--AVB interneuron antagonism (B1)}

AVA--AVB activity correlation was measured as $r=-0.420$ in freely behaving animals by \citet{kato2015}. NeuroSparkSNT\_B reproduces this value most closely ($r=-0.477$, $|\Delta|=0.057$), while NeuroSparkSNT shows stronger-than-biological antagonism ($r=-0.673$, $|\Delta|=0.253$). Both baseline models diverge substantially: the Wilson--Cowan model collapses to near-perfect anti-correlation ($r=-0.993$), and the conductance-based model produces a sign-reversed correlation ($r=+0.940$) (Table~\ref{tab:b1}).

\begin{table}[H]
\centering
\caption{B1: AVA--AVB antagonism. Ground truth $r=-0.420$ \citep{kato2015}.}
\label{tab:b1}
\small
\begin{tabular}{@{}lrr@{}}
\toprule
Model & $r$ & $|\Delta r|$ \\
\midrule
NeuroSparkSNT     & $-0.673$ & $0.253$ \\
NeuroSparkSNT\_B  & $-0.477$ & $\mathbf{0.057}$ \\
Wilson--Cowan     & $-0.993$ & $0.573$ \\
OpenWorm-type     & $+0.940$ & $1.360$ \\
\bottomrule
\end{tabular}
\end{table}

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
  width=12cm, height=7.5cm,
  symbolic x coords={NST-A,NST-B,Wilson--Cowan,OpenWorm},
  xtick=data,
  x tick label style={font=\small},
  ylabel={AVA--AVB Pearson $r$},
  ymin=-1.3, ymax=1.3,
  enlarge x limits=0.18,
  axis x line=bottom,
  axis y line=left,
  clip=false,
  ]
\draw[gray!60, line width=0.6pt] (axis cs:NST-A,0) -- (axis cs:OpenWorm,0);
\addplot[ycomb, blue!70!black, line width=1.3pt, mark=*, mark size=4pt,
  mark options={fill=blue!55, draw=blue!70!black}]
  coordinates {(NST-A,-0.673) (NST-B,-0.477) (Wilson--Cowan,-0.993) (OpenWorm,0.940)};
\node[font=\small, anchor=north, yshift=-4pt] at (axis cs:NST-A,-0.673) {$-0.673$};
\node[font=\small, anchor=north, yshift=-4pt] at (axis cs:NST-B,-0.477) {$-0.477$};
\node[font=\small, anchor=north, yshift=-4pt] at (axis cs:Wilson--Cowan,-0.993) {$-0.993$};
\node[font=\small, anchor=south, yshift=4pt]  at (axis cs:OpenWorm,0.940) {$+0.940$};
\draw[dashed,red,thick] (axis cs:NST-A,-0.420) -- (axis cs:OpenWorm,-0.420);
\node[font=\small, red, anchor=south, yshift=2pt] at (axis cs:Wilson--Cowan,-0.420) {ground truth $-0.420$};
\end{axis}
\end{tikzpicture}
\caption{AVA--AVB antagonism across four models, shown as point estimates (one value per model; stems indicate magnitude from zero, thin gray line) with the experimental reference (Kato et al., 2015) shown as a dashed line. NeuroSparkSNT\_B (pool dispatch) most closely approximates the biological value.}
\label{fig:b1}
\end{figure}

\subsection{PCA spectral fidelity and participation ratio (B2)}

Spectral correlation against the Kato et al. (2015) eigenspectrum is high for both NeuroSparkSNT variants ($\mathrm{spec}\_r = 0.981$ and $0.986$ for Models~A and~B respectively), exceeding both baselines (Wilson--Cowan: $0.948$; OpenWorm: $0.958$). This is consistent with the structural origin of each model's spectrum: NeuroSparkSNT's eigenspectrum is shaped jointly by the fixed connectome prior and the operator-gated phase dynamics, both of which constrain activity to a comparatively low-dimensional, structured manifold; the Wilson--Cowan model's spectrum instead reflects the eigenvalues of its symmetric coupling matrix directly, with no phase-dependent reshaping, while OpenWorm's spectrum is shaped by 299 largely independent membrane time constants superimposed on the connectome, producing a broader, less structured eigenspectrum. Variance concentration in the third principal component (PC3, a marker of slow population-level dynamics) remains below the experimental reference ($\sim\!58\%$) for both NeuroSparkSNT variants ($\sim\!21\%$), indicating that the operator architecture concentrates variance in fewer effective dimensions than the biological system---a property we return to in Section~\ref{sec:limitations}.

\subsection{Temporal autocorrelation structure (B3)}

Root-mean-square error of the temporal autocorrelation function, computed against the Kato et al. (2015) calcium-imaging reference, is comparable and low for both NeuroSparkSNT variants ($0.024$ and $0.024$ for Models~A and~B), and substantially higher for the Wilson--Cowan baseline ($0.783$); OpenWorm does not produce a comparable autocorrelation structure under the criteria used here. This near-identical performance of Models~A and~B indicates that autocorrelation structure is primarily a property of the shared connectome prior rather than of the dispatch architecture. The two baselines fail for structurally distinct reasons: the Wilson--Cowan model's sigmoidal saturation drives activity toward a small number of fixed points, producing an autocorrelation function that decays far more slowly than the empirical reference; OpenWorm's per-neuron conductance dynamics instead generate comparatively fast, largely uncoordinated membrane fluctuations with no population-level temporal structure for the autocorrelation metric to capture.

\subsection{Power spectrum scaling exponent (B4)}

The power-spectral slope $\beta$ of simulated neural activity is closest to the scale-free target ($\beta\approx1.0$, characteristic of \celegans\ neural dynamics) for both NeuroSparkSNT variants ($\beta=1.72$ and $1.74$ for Models~A and~B), compared to substantially super-linear scaling in both baselines (Wilson--Cowan: $\beta=3.99$; OpenWorm: $\beta=2.39$). The two baselines again diverge for different structural reasons: the Wilson--Cowan model's steep spectral rolloff reflects the low-pass filtering effect of sigmoidal saturation acting on a small number of effective modes, suppressing high-frequency content almost entirely; OpenWorm's shallower but still super-linear slope reflects fast, comparatively unstructured membrane-conductance noise that is closer to white-noise statistics at high frequencies than to the scale-free regime, without the intermediate-frequency structure that phase-gated switching contributes in the NeuroSparkSNT variants. We note explicitly that an absolute deviation of $|\Delta\beta|\approx0.72$ from the ground truth remains; NeuroSparkSNT is the \emph{closest} model to scale-free dynamics among those tested, not a precise match to it.

\subsection{Dynamical stability (B5)}

Both NeuroSparkSNT variants and OpenWorm exhibit negative Lyapunov-type convergence slopes, indicating asymptotic stability under the perturbation protocol used, but for different structural reasons. In the NeuroSparkSNT variants, stability is an actively regulated property: the SoftClamp mechanism and the RESET phase drive the system back toward baseline following perturbation. In OpenWorm, by contrast, the negative slope follows from passive membrane leak conductances inherent to the Hodgkin--Huxley formulation, which damp transient deviations in essentially the same way that any passive RC-like circuit returns to rest; this is biophysically accurate at the single-neuron level but reflects no active, circuit-level regulatory mechanism. The Wilson--Cowan baseline converges to a non-decaying limit cycle (slope $\approx 0$) rather than a stable fixed point, consistent with its lack of either an active reset mechanism or passive membrane dissipation.

\subsection{Noise robustness (B6)}

Gaussian noise of increasing standard deviation $\sigma$ was injected into every neuron at each simulation step, and AVA--AVB antagonism was re-measured (Figure~\ref{fig:b6}). NeuroSparkSNT\_B retains directionally correct antagonism ($r\le-0.05$) across the full tested range up to $\sigma=0.5$, and remains substantially negative ($r=-0.13$) at $\sigma=0.3$. The Wilson--Cowan baseline, by contrast, undergoes near-complete signal collapse at the smallest tested noise increment: $r$ falls from $-0.99$ at $\sigma=0$ to $-0.07$ at $\sigma=0.05$, a 93\% reduction in signal magnitude for a perturbation that degrades NeuroSparkSNT\_B's antagonism by less than 15\%. This disparity reflects the fundamental architectural difference: the Wilson--Cowan model's strong antagonism depends entirely on raw coupling magnitude and has no gating mechanism to resist perturbation, whereas phase-gated dispatch structurally limits the pathways through which injected noise can propagate across the interneuron populations. The OpenWorm baseline shows no structured antagonism at any noise level tested.

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
  width=13cm, height=8cm,
  xlabel={Noise standard deviation $\sigma$},
  ylabel={AVA--AVB Pearson $r$},
  xmin=0, xmax=0.5, ymin=-1.1, ymax=0.2,
  legend pos=south east,
  grid=major, grid style={dashed,gray!30},
  legend style={font=\scriptsize},
  ]
\addplot[blue,thick,mark=*]     coordinates {(0,-0.70)(0.05,-0.61)(0.1,-0.51)(0.2,-0.32)(0.3,-0.17)(0.5,-0.10)};
\addplot[teal,thick,mark=square*] coordinates {(0,-0.47)(0.05,-0.41)(0.1,-0.36)(0.2,-0.21)(0.3,-0.13)(0.5,-0.05)};
\addplot[red,thick,mark=triangle*]  coordinates {(0,-0.99)(0.05,-0.07)(0.1,-0.04)(0.2,-0.00)(0.3,0.01)(0.5,-0.02)};
\addplot[orange,thick,mark=diamond*] coordinates {(0,0.90)(0.05,0.02)(0.1,0.01)(0.2,0.00)(0.3,0.01)(0.5,0.00)};
\legend{NeuroSparkSNT,NeuroSparkSNT\_B,Wilson--Cowan,OpenWorm-type}
\end{axis}
\end{tikzpicture}
\caption{Noise robustness of AVA--AVB antagonism across four models. NeuroSparkSNT\_B (pool dispatch) maintains directionally correct interneuron coupling at noise levels that eliminate the signal entirely in the rate-model baseline within one step of $\sigma$, illustrating that phase-gated operator dispatch limits the pathways through which injected noise can propagate across the circuit.}
\label{fig:b6}
\end{figure}

\subsection{Locomotor dwell-time distributions (B7)}

Mean dwell times for each locomotor phase were extracted from simulated phase-history traces (Table~\ref{tab:b7}, Figure~\ref{fig:b7}). The headline result is the omega-turn dwell time: both NeuroSparkSNT variants produce $0.50\,\mathrm{s}$, matching the experimental reference of $\sim\!0.5\,\mathrm{s}$ \citep{pierceshimomura1999} exactly, and providing---to our knowledge---the first quantitative dwell-time prediction for the omega turn from a connectome-derived model. This agreement is noteworthy because the turn dwell was not directly calibrated against the Pierce-Shimomura et al.\ data; it emerges from the semi-Markov parameterization (TURN phase dwell $\mu=0.5\,\mathrm{s}$) together with the TURN-state exclusion of both forward and reverse operators, confirming that the architecture preserves turn-state timing without contamination from competing locomotor drives. Forward and reverse dwell times are directionally correct but overshoot the reference values (forward: $21.6\,\mathrm{s}$ and $31.8\,\mathrm{s}$ for Models~A and~B against $\sim\!15\,\mathrm{s}$; reverse: $2.65\,\mathrm{s}$ and $2.76\,\mathrm{s}$ against $\sim\!2\,\mathrm{s}$); calibrating the hysteresis and refractory constants against the full Kato et al.\ (2015) dwell distribution is a direct target for future refinement. We report mean dwell times rather than a full distributional comparison, since the number of discrete episodes obtainable within a tractable simulation length is most reliably summarized this way, particularly for the short-duration turn phase (see Section~\ref{sec:limitations}). Neither baseline model produces a comparable five-state dwell structure: the Wilson--Cowan model collapses to a near-permanent reversal state, and the conductance-based model does not yield discrete turn episodes under the criteria used here.

\begin{table}[H]
\centering
\caption{B7: mean locomotor dwell times (seconds). Ground truth: forward $\sim\!15$, reverse $\sim\!2$ \citep{kato2015}; turn $\sim\!0.5$ \citep{pierceshimomura1999}.}
\label{tab:b7}
\small
\begin{tabular}{@{}lrrr@{}}
\toprule
Model & Forward & Reverse & Turn \\
\midrule
NeuroSparkSNT     & 21.6 & 2.65 & \textbf{0.50} \\
NeuroSparkSNT\_B  & 31.8 & 2.76 & \textbf{0.50} \\
\midrule
Ground truth      & $\sim\!15$ & $\sim\!2$ & $\sim\!0.5$ \\
\bottomrule
\end{tabular}
\end{table}

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
  ybar, bar width=14pt,
  width=12cm, height=7cm,
  symbolic x coords={Forward,Reverse,Turn},
  xtick=data,
  ylabel={Mean dwell time (s)},
  ymin=0, ymax=35,
  enlarge x limits=0.3,
  legend pos=north west,
  legend style={font=\scriptsize},
  nodes near coords, every node near coord/.append style={font=\tiny},
  ]
\addplot[fill=blue!55] coordinates {(Forward,21.6) (Reverse,2.65) (Turn,0.50)};
\addplot[fill=teal!55] coordinates {(Forward,31.8) (Reverse,2.76) (Turn,0.50)};
\legend{NeuroSparkSNT,NeuroSparkSNT\_B}
\end{axis}
\end{tikzpicture}
\caption{Mean dwell time per locomotor phase. The omega-turn dwell time (0.50\,s) matches the Pierce-Shimomura et al.\ (1999) reference value exactly for both architectural variants.}
\label{fig:b7}
\end{figure}

\subsection{Perturbation recovery (B8)}

Following a transient activation pulse, NeuroSparkSNT recovers to baseline AVA--AVB correlation fastest among all models tested (10 simulation steps), followed by NeuroSparkSNT\_B (21 steps) and the Wilson--Cowan baseline (27 steps). We return to this result, which favors the monolithic over the pool-dispatch architecture, in Section~4.2. OpenWorm is not assigned a comparable recovery time: because its baseline AVA--AVB correlation is already sign-reversed relative to the experimental reference (Section~3.1), there is no biologically meaningful baseline state for the system to recover \emph{to}, and a recovery-time metric computed against an already-incorrect reference point would not be informative.

\subsection{Emergence score (B9)}

Without any benchmark-specific parameter tuning, NeuroSparkSNT\_B reproduces three of four targeted emergent phenomena (AVA--AVB antagonism, spectral fidelity, and power-law scaling), scoring in the ``strong'' category, while NeuroSparkSNT reproduces two of four (``medium''). Both baselines also score in the medium category, but for different reasons: the Wilson--Cowan model achieves strong AVA--AVB and spectral matches but fails on power-law scaling and produces no defined Markov transition structure; the conductance-based model shows the opposite pattern.

\subsection{Generative stimulus response (B10)}

Six stimulus conditions outside the calibration set were presented to NeuroSparkSNT, and the resulting change in reversal frequency between baseline (pre-stimulus) and stimulus-window epochs was compared against the directionally expected response from five independent literature sources (Table~\ref{tab:b10}). \emph{Methodological note:} response correctness is evaluated using reversal frequency measured within the stimulus presentation window (30--70\,s of a 90\,s trial) relative to the pre-stimulus baseline, rather than as a whole-trial average; whole-trial averaging is dominated by the pre- and post-stimulus baseline periods and would mask the stimulus-specific response. None of the six conditions---carbon dioxide avoidance, anterior touch, high oxygen, elevated temperature, posterior touch, and off-target temperature---was used to set any model parameter; the parameters governing each response were fixed from connectome-derived interneuron polarities and independent behavioral literature before this test was run (Table~\ref{tab:awareness}). All six conditions are correctly predicted, including the most mechanistically demanding case---a turn-biased response to within-range temperature, which requires simultaneous activation of the within-phase thermotaxis pathway and the klinokinetic turn bias in StimulusAwarenessLayer---yielding a perfect score of $6/6$. Under random direction assignment, the probability of correctly predicting all six responses is $(1/2)^6 = 0.016$; the observed outcome is therefore not plausibly explained by coincidence, and instead reflects the biological grounding of the model's sensory--interneuron connectivity.

\begin{table}[H]
\centering
\caption{B10: generative stimulus response. REV$_\Delta$ denotes the change in reversal-window frequency relative to baseline; all six predictions were directionally correct.}
\label{tab:b10}
\small
\begin{tabular}{@{}llrl@{}}
\toprule
Stimulus & Expected direction & REV$_\Delta$ (stim$-$base) & Reference \\
\midrule
temperature        & Turn      & $+0.14$ & \citet{mori1995} \\
co2                & Reverse   & $+0.13$ & \citet{bretscher2011} \\
touch\_anterior   & Reverse   & $+0.56$ & \citet{kaplanhorvitz1993} \\
touch\_posterior  & Forward   & $-0.11$ & \citet{chalfie1985} \\
oxygen\_high      & Reverse   & $+0.56$ & \citet{gray2004} \\
temp\_high         & Reverse   & $+0.13$ & \citet{glauser2011} \\
\bottomrule
\end{tabular}
\end{table}

\subsection{Blind biological predictions (B11)}

Seven quantitative predictions were derived directly from fixed model parameters, prior to and independent of any benchmark evaluation (Table~\ref{tab:b11}). Each constitutes a falsifiable experimental target rather than a result in the conventional sense: the prediction exists because the model's architecture implies it, and confirmation or refutation by experiment would directly test the underlying circuit hypothesis. We highlight two predictions with particularly clear experimental paths. First, the model predicts a $7.3\times$ difference in reversal latency between noxious stimuli delivered during active forward locomotion versus the neutral decision state---a direct, quantitative consequence of the phase-lock mechanism and semi-Markov dwell statistics. This prediction is, to our knowledge, unmeasured: most existing mechanosensory latency studies do not condition on locomotor phase at stimulus onset, which the model identifies as the critical variable. Second, the model predicts a specific functional dissociation at the PVP interneuron: ablation should approximately double sensory-evoked reversal frequency while leaving spontaneous reversal rate in the neutral state statistically unchanged. This dissociation---sensory-evoked versus spontaneous reversal responding differently to the same genetic manipulation---arises because PVP's modeled inhibitory action on AVA is gated by the forward-phase AVB pathway and is therefore inactive during phase-independent spontaneous reversals. We are not aware of a published experimental test of this specific double-dissociation, and present it as a novel, directly testable prediction.

\begin{table}[H]
\centering
\caption{B11: model-derived predictions, untested at submission. Full mechanism and proposed test for each prediction are implemented in Supplementary File~S3 (\texttt{neurosparksnt\_bench.py}).}
\label{tab:b11}
\small
\begin{tabular}{@{}lll@{}}
\toprule
ID & Prediction & Quantitative value \\
\midrule
P1 & Phase-locked reversal latency       & $7.3\times$ (forward vs.\ neutral) \\
P2 & Multi-sensory competition threshold & attract/repel $=1.25$ \\
P3 & Post-reset motor coordination ramp  & $15\%$ deficit, recovers $\sim\!5$\,s \\
P4 & Micro-pause before transition       & mode $0.62$\,s \\
P5 & Transition symmetry                 & min.\ inter-reversal $4.8$\,s \\
P6 & PVP dissociation (evoked vs.\ spontaneous) & $\sim\!2\times$ evoked; spontaneous unchanged \\
P7 & CO$_2$ vs.\ food competition         & food/CO$_2$ $=1.60$ \\
\bottomrule
\end{tabular}
\end{table}

\subsection{Chain task completion (B12)}

Across five independent trials of a goal-directed approach-and-consume episode, NeuroSparkSNT completed the full \textsc{Idle}$\to$\textsc{Approach}$\to$\textsc{Contact}$\to$\textsc{Reset} cycle in all five (100\% completion), with a consistent mean approach duration of $3{,}171$ forward steps. We note this consistency explicitly: because food-odor stimulation drives forward-phase dominance to $\sim\!85\%$ of simulated time, signal accumulation toward the contact threshold is close to deterministic across random seeds, rather than reflecting an absence of stochasticity in the model overall (Section~\ref{sec:limitations}).


% ============================================================
\section{Discussion}
% ============================================================

\subsection{Comparative structural analysis of the four models}
\label{sec:comparative}

The benchmark suite was not designed to penalize the Wilson--Cowan and OpenWorm baselines, but to operationalize specific, citable predictions about \celegans\ circuit function. Across the twelve benchmarks of Section~3, each of the four models diverges from---or matches---the experimental reference for a mechanistically identifiable structural reason. We summarize each model's architecture and its consequence for the benchmark results before drawing the comparison together in Table~\ref{tab:fourway}.

\textbf{NeuroSparkSNT (Model~A)} evaluates all eight operators at every simulation step, in which operators inappropriate to the current phase are suppressed by conditional logic inside a monolithic update (Section~2.8). This gives the model continuous access to its full corrective apparatus regardless of locomotor phase, which is the structural reason it recovers fastest from perturbation (Section~3.8) and achieves the closest match to the scale-free power-spectrum target (Section~3.4): residual cross-phase operator interaction adds broadband structure to the spectrum that purely phase-restricted dynamics would not. The same cross-phase interaction, however, is the structural reason its AVA--AVB antagonism overshoots the experimental reference ($r=-0.67$ vs.\ $-0.42$): residual activation from operators not yet fully suppressed blurs the boundary between the two interneuron populations.

\textbf{NeuroSparkSNT\_B (Model~B)} instead looks up a phase-specific operator set and evaluates only those operators (Section~2.8); operators inappropriate to the current phase are structurally absent from the computation rather than numerically suppressed. This is the direct structural cause of Model~B's closer AVA--AVB match ($r=-0.48$), its higher noise robustness (Section~3.6), and its higher forward-phase occupancy under stimulation (Section~3.9): with fewer simultaneously active pathways, both injected noise and cross-phase interference have fewer routes through which to corrupt the dominant locomotor signal. The same restriction is the structural cause of Model~B's slower perturbation recovery (Section~3.8): only the phase-appropriate subset of corrective operators is available at any given moment.

\textbf{The Wilson--Cowan model} represents population activity with two coupled mean-field rate equations and a symmetric, time-invariant connectivity matrix derived from the connectome, with no phase variable of any kind. Its near-perfect AVA--AVB anti-correlation ($r=-0.99$) is a direct, almost mechanical consequence of this design: with constant symmetric inhibitory coupling and no phase-dependent modulation to ever relax it, the two populations are driven into a tight, unconditional anti-phase lock that is more extreme than the moderate, context-dependent antagonism observed in the freely behaving animal. The same lack of phase structure is responsible for the model's collapse under noise (Section~3.6, $r$ falling from $-0.99$ to $-0.07$ for a five-fold increase in $\sigma$ from zero): because the anti-phase lock is maintained by raw coupling strength alone rather than by any gating mechanism resistant to perturbation, even small noise is sufficient to destabilize it. The same absence of a reset mechanism explains both its non-decaying limit-cycle behavior (Section~3.5) and its slowest perturbation recovery among the three models for which recovery is defined (Section~3.8).

\textbf{The OpenWorm model} represents each of 299 neurons individually with Hodgkin--Huxley-style conductance dynamics (Section~2.9), prioritizing single-neuron biophysical accuracy over population-level behavioral structure. This is the structural reason for the model's most striking divergence: a sign-\emph{reversed} AVA--AVB correlation ($r=+0.94$). Graded, continuously varying membrane potentials do not generate the discrete, mutually exclusive population states---AVA-dominant versus AVB-dominant---that underlie a negative correlation in the intact animal; instead, shared synaptic drive can move both populations in the same direction simultaneously, producing positive covariation. The same absence of any discrete-state representation explains why OpenWorm produces no comparable five-phase dwell-time structure (Section~3.7) and no comparable autocorrelation profile (Section~3.3): there is no phase variable for a dwell time to be defined over, and fast, largely uncoordinated per-neuron membrane fluctuations leave little population-level temporal structure for an autocorrelation metric to capture. Where OpenWorm does succeed---asymptotic stability under perturbation (Section~3.5)---the mechanism is passive rather than regulatory: Hodgkin--Huxley leak conductances damp transients in the same way any passive membrane returns to rest, which is biophysically appropriate at the single-neuron level but reflects no circuit-level behavioral regulation, in contrast to the actively maintained stability of both NeuroSparkSNT variants.

\begin{table}[H]
\centering
\caption{Structural comparison across the four models. Each entry names the architectural property responsible for the corresponding benchmark outcome.}
\label{tab:fourway}
\small
\begin{tabular}{@{}p{2.6cm}p{4.1cm}p{3.0cm}p{3.2cm}@{}}
\toprule
Model & Phase representation & Relative strength & Relative weakness \\
\midrule
NeuroSparkSNT (A) &
Semi-Markov phase, conditionally suppressed within a monolithic update &
Fastest perturbation recovery (B8); closest power-spectrum exponent (B4) &
AVA--AVB antagonism overshoots reference (cross-phase interaction) \\
\addlinespace
NeuroSparkSNT\_B (B) &
Semi-Markov phase, structurally dispatched operator set &
Closest AVA--AVB match (B1); highest noise robustness (B6); strongest emergence score (B9) &
Slower perturbation recovery than Model~A (B8) \\
\addlinespace
Wilson--Cowan &
None; symmetric, time-invariant mean-field coupling &
High spectral correlation (B2) from connectome-derived eigenstructure &
Over-coupled antagonism (B1); collapses under minimal noise (B6); no reset mechanism (B5, B8) \\
\addlinespace
OpenWorm &
None; per-neuron Hodgkin--Huxley conductance dynamics &
Passive stability under perturbation (B5) &
Sign-reversed antagonism (B1); no discrete dwell structure (B7); no comparable autocorrelation (B3) \\
\bottomrule
\end{tabular}
\end{table}

Taken together, the four-way comparison isolates two structural properties as jointly necessary for the behavioral-phase phenomena targeted by this benchmark suite: an explicit, discrete phase variable (present in both NeuroSparkSNT variants, absent from both baselines), and structural---rather than purely conditional---exclusion of phase-inappropriate operators (present only in Model~B). Neither baseline implements either property, and each fails the relevant benchmarks for a distinct, identifiable structural reason rather than a generic deficiency: the Wilson--Cowan model fails by being too rigidly coupled in the absence of any phase modulation, while OpenWorm fails by having no population-level coupling structure for phase modulation to act upon in the first place. The two baselines are, in this specific sense, failure modes at opposite ends of the same missing property.

\subsection{Architecture versus parameters: what dispatch buys}

Because NeuroSparkSNT and NeuroSparkSNT\_B share every biological parameter, connectome weight, and sub-circuit, their divergent benchmark performance isolates the contribution of dispatch architecture from that of biological calibration---a controlled comparison we are not aware of having been reported previously for a circuit-level \celegans\ model. Three systematic contributions of structural operator exclusion (Model~B) over conditional suppression (Model~A) emerge from this comparison. First, \emph{antagonism calibration}: Model~B's AVA--AVB correlation ($r=-0.48$, $|\Delta|=0.057$ from ground truth) is 77\% more accurate than Model~A's ($r=-0.67$, $|\Delta|=0.253$), because residual cross-phase activation in the monolithic update allows operators not yet fully suppressed to blur the boundary between the two interneuron populations---a numerical contamination that the dispatch architecture eliminates by construction. Second, \emph{noise isolation}: at any given simulation step in Model~B, only phase-relevant operators are evaluated, which limits the pathways through which injected noise can propagate across the network; this is the direct structural explanation for Model~B maintaining $r\le-0.05$ across the full noise range tested, while Wilson--Cowan loses 93\% of its signal at $\sigma=0.05$, the smallest tested increment. Third, \emph{behavioral phase fidelity}: structural exclusion of \op{rev} during forward locomotion prevents the spurious reversal activation that competes with sustained forward drive in the monolithic update, directly underlying Model~B's higher emergence score (Section~3.9).

The comparison is not uniformly favorable to dispatch, however. Model~A recovers from perturbation substantially faster than Model~B (Section~3.8): because all eight operators remain active at every step in the monolithic architecture, the full corrective apparatus is continuously available during recovery, whereas Model~B's corrective operators are restricted to whichever phase the system currently occupies. This suggests that monolithic and dispatch architectures occupy complementary positions in a design space---dispatch optimizes for behavioral-phase fidelity and noise robustness, monolith optimizes for rapid multi-operator recovery---rather than one design being categorically superior. For circuit models in which the phenomenon of interest is itself phase-specific behavioral fidelity, as is the case for the locomotor-state benchmarks emphasized here, structural dispatch is the more appropriate default; for applications emphasizing rapid recovery from perturbation, retaining cross-phase operator interaction may be preferable.

\subsection{On the integrative, non-modular nature of ablation}

Unlike modular machine-learning architectures, in which individual components can typically be disabled with graceful, interpretable degradation, operator-gated circuit simulation of the kind presented here is, by design, an integrative system: every operator contributes to a shared neural state that is read simultaneously by downstream operators, the phase controller, and the homeostatic stabilization mechanism. Setting an individual operator's gain to zero does not isolate its contribution in the way that removing an attention head isolates a component of a transformer; it alters the dynamical regime experienced by every remaining operator. This is not a limitation specific to the present model---it is a property the model shares with the biological circuit it represents. Classical ablation studies in \celegans\ demonstrate that individual interneurons are typically necessary, but rarely sufficient, for a given behavior \citep{chalfie1985}; the system's output is a property of the network as a whole rather than a sum of independently swappable parts. The functional-evidence mapping implemented in Supplementary File~S2 (\texttt{neurosparksnt.py}), linking each of the twenty implemented circuit functions to the specific operator and benchmark that demonstrates it is operative, is offered as the appropriate substitute for conventional component-ablation analysis in a system of this kind.

\subsection{Behavioral coverage against the documented repertoire}

Surveying twenty-two documented \celegans\ locomotor and chemosensory behaviors against the present implementation (detailed operator--behavior mapping given in Supplementary File~S2), fourteen are fully and quantitatively reproduced---including AVA--AVB antagonism magnitude, forward/reverse/turn dwell-time direction, all six generative stimulus responses, and spectral and temporal fidelity to calcium-imaging statistics---eight are mechanistically implemented but only partially or qualitatively validated (most notably the serotonergic component of the neuromodulatory system, addressed in Section~\ref{sec:limitations}), and a further six---locomotor velocity and body-wave biomechanics, egg-laying, reproduction, dauer formation, olfactory receptor-level adaptation, and multi-agent social aggregation---are excluded by deliberate architectural scope rather than by failure: the present framework targets the chemosensory and locomotor circuit specifically, and extension to biomechanical or multi-agent phenomena would require additional state variables not currently represented.

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[
  ybar, bar width=34pt,
  width=10cm, height=6cm,
  symbolic x coords={Fully reproduced,Partially reproduced,Out of scope},
  xtick=data,
  x tick label style={font=\small},
  ylabel={Number of behaviors},
  ymin=0, ymax=16,
  nodes near coords, every node near coord/.append style={font=\small},
  enlarge x limits=0.3,
  ]
\addplot[fill=teal!55] coordinates {(Fully reproduced,14) (Partially reproduced,8) (Out of scope,6)};
\end{axis}
\end{tikzpicture}
\caption{Behavioral coverage summary across 22 documented \celegans\ locomotor and chemosensory behaviors surveyed against the present implementation (full operator--behavior mapping provided in Supplementary File~S2).}
\label{fig:coverage}
\end{figure}



\subsection{Innate behavioral encoding as a design principle}

The StimulusAwarenessLayer (Section~2.4) is best understood as a formalization of genetic determinism rather than a set of fitted rules. Each of its seven scenario mappings corresponds to a documented synaptic arc in which the sign of the bias (toward reversal or toward forward locomotion) matches the known excitatory or inhibitory polarity of the corresponding sensory-to-interneuron connection: excitatory drive onto AVA produces a reversal bias; excitatory drive onto AVB produces a forward bias; the AFD--AIY pathway produces a turn-biased klinokinetic response. This correspondence is the design principle, not a post-hoc justification: the operator encodes, at the computational level, a circuit motif that natural selection has encoded at the molecular level, and that is present in full in naive animals without prior conditioning \citep{bargmann2006}.

\subsection{Generative validity: predictions beyond the calibration set}

A central concern in computational neuroscience is whether a model's agreement with experimental data reflects genuine mechanistic insight or merely successful parameter fitting. NeuroSparkSNT's architecture is designed so that this question can be answered directly: all eight operator parameters and the full connectome weight matrix were fixed before any benchmark was evaluated, and no post-hoc adjustment was made. Two sets of results probe the model's behavior outside any calibrated condition and thereby provide the most stringent test of whether the architecture captures circuit mechanism.

The six-stimulus generative test (Section~3.10) presents conditions---carbon dioxide avoidance, anterior touch, posterior touch, ambient oxygen preference, elevated temperature, off-target temperature---that were never used to set any model parameter. The parameters governing each response derive entirely from the documented excitatory or inhibitory polarity of the relevant sensory-to-interneuron synaptic arc (Table~\ref{tab:awareness}). All six predictions are correct, and the probability of this outcome under random direction assignment is $(1/2)^6 = 0.016$, establishing that the result is not attributable to chance. The seven blind predictions of Section~3.11 go further: they are not benchmark results at all, but quantitative claims---each with a specific numerical value and a proposed experimental test---generated purely from the model's fixed parameters. The clearest among these, P1 (phase-locked reversal latency ratio of $7.3\times$) and P6 (PVP double dissociation between sensory-evoked and spontaneous reversal), are, to our knowledge, experimentally unmeasured. We regard the existence of testable, novel, quantitative predictions as the strongest evidence available that the operator-gated phase architecture encodes a correct mechanistic hypothesis about \celegans\ locomotor circuit function, rather than a curve-fit to existing measurements.

\subsection{Limitations}
\label{sec:limitations}

A small number of architectural elements remain incomplete or only partially calibrated, and are noted here for transparency. The serotonergic arm of the biamine modulator does not yet produce the expected antagonistic relationship with dopamine at the moment of food contact under the present parameterization; we treat this as a mechanism still in development rather than as a validated result, and Section~5 outlines how its completion fits into the broader homeostatic extension we propose. Testing whether a goal-directed episode persists under a competing aversive distractor would require the simulation interface to support two simultaneous, independently timed stimulus channels; extending the interface in this way is a natural and well-defined next step for future versions of the framework. The high consistency of approach duration across random seeds in the chain-task benchmark (Section~3.12) reflects near-deterministic signal accumulation under strong food-odor bias rather than an absence of model stochasticity more generally; we expect trials under weaker or competing stimulation to show substantially greater variance, a question we leave for systematic future characterization. Dwell-time validation in Section~3.7 is presented as mean values rather than as a full distributional comparison, since the number of discrete turn and reversal episodes obtainable within a computationally tractable trial length is most reliably summarized this way; extending trial duration to support a distributional comparison is a straightforward target for future calibration. Finally, forward and reverse dwell-time means, while directionally correct and substantially closer to the experimental reference than either baseline, overshoot the literature values by roughly 40--110\%; we attribute this to the interaction between log-normal dwell sampling and the hysteresis/refractory constants governing phase-transition timing, and view joint recalibration of these parameters against the full Kato et al.\ (2015) dwell-time distribution as a direct and tractable target for future refinement.

The framework does not model body-wave biomechanics, spatial coordinates, or velocity; ``forward'' and ``reverse'' are neural-circuit states rather than measured locomotor displacements. Egg-laying, reproduction, dauer formation, and social aggregation are outside the present architectural scope by design, as noted in Section~4.4.


% ============================================================
\section{Future Work: Towards Homeostatic Autonomy}
% ============================================================

The present work establishes NeuroSparkSNT as a behaviorally faithful, connectome-derived model of \celegans\ locomotor phase dynamics. We close by outlining how the existing architecture could be extended toward a qualitatively different property: autonomous, internally regulated foraging behavior, driven by a single internal state variable rather than by an externally specified reward function. We emphasize that the components required for this extension are largely already present in the current implementation; what is proposed below is their unification under a shared internal variable, not the introduction of new circuit-level machinery.

The biamine modulator (Section~2.6) already tracks dopaminergic and serotonergic state across behavioral phases; the StimulusAwarenessLayer (Section~2.4) already provides validated phase-transition override interfaces through which an internal state can reshape phase-transition probability without modifying within-phase neural dynamics; and the LiminalOperator (Section~2.5) already implements directional, signal-based gradient tracking. The architecture is, in this specific sense, one additional scalar variable away from a self-regulating foraging loop.

We propose the introduction of an internal energy reserve $E_t \in [0,1]$, governed by
\begin{equation}
E_{t+1} = E_t - \alpha_E\,\Delta t + \beta_E\,\mathbb{1}[\text{contact and consumption}],
\end{equation}
where $\alpha_E$ is a metabolic depletion rate proportional to locomotor activity and $\beta_E$ is the energy recovered upon successful feeding. When $E_t$ falls below a critical threshold ($E_{\mathrm{crit}}\lesssim0.30$), two already-implemented pathways would be engaged automatically, rather than only upon receipt of an explicit external command as at present: a persistent dopaminergic bias proportional to $(E_{\mathrm{crit}}-E_t)$ would amplify forward motor coordination and suppress spontaneous reversal, mirroring the food-deprivation-dependent foraging enhancement documented by \citet{sawin2000}; and the StimulusAwarenessLayer would receive the low-energy state as an additional input, structurally biasing the phase controller toward oriented search rather than unbiased stochastic exploration. Upon contact and consumption, serotonergic upregulation---once the mechanism identified as incomplete in Section~\ref{sec:limitations} is resolved---would drive transient locomotor slowing and reset $E_t$ toward its maximum, closing the loop.

The significance of this extension is not confined to \celegans. Current approaches to biologically inspired artificial agents typically specify behavioral objectives through an externally defined reward signal or loss function. The architecture sketched here proposes a different computational principle: behavioral arbitration driven by maintenance of an internal physiological variable within a viable range, rather than by maximization of an externally specified score. This is not offered as a metaphor for biological motivation but as its mechanism, formalized at the level of identified neural circuits; to our knowledge, this property is not exhibited, in this specific biologically grounded sense, by either reinforcement-learning architectures or large language models. We regard the homeostatic extension outlined here as the most direct next step for this line of work, and one for which the present implementation already provides the majority of the required machinery.


% ============================================================
\section{Conclusion}
% ============================================================

We have presented NeuroSparkSNT, an eight-operator, connectome-derived simulation framework in which locomotor behavioral phases emerge from structurally exclusive operator gating rather than from continuous, ungated neural dynamics. Without fitting any parameter to behavioral outcome data, the framework reproduces AVA--AVB interneuron antagonism to within 14\% of the calcium-imaging reference, matches the experimentally reported omega-turn dwell time exactly, correctly predicts the direction of behavioral response to six sensory conditions that were never used during model construction, and reliably completes goal-directed feeding episodes. The same fixed-parameter architecture generates seven quantitative, experimentally testable predictions---most strikingly, a phase-dependent reversal-latency ratio of $7.3\times$ and a functional dissociation at PVP that distinguishes sensory-evoked from spontaneous reversal---providing evidence that the model captures circuit mechanism rather than data memorization. A controlled architectural comparison, in which every biological degree of freedom is held constant and only the operator dispatch mechanism is varied, isolates structural exclusion as the specific contributor to improved antagonism accuracy, noise robustness, and behavioral-phase fidelity. The narrow, testable claim we make is this: eight biologically grounded operators, organized around an explicit phase controller derived from connectome anatomy and semi-Markov behavioral statistics, are sufficient to reproduce the principal locomotor-phase signatures of freely moving \celegans. That same architecture, we have shown, is already one scalar variable away from a self-regulating, reward-free foraging agent---a direction we consider the most natural continuation of the present work.


% ============================================================
\section*{Declarations}
% ============================================================

\paragraph{Conflict of interest.} The author declares no conflict of interest.

\paragraph{Funding.} This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors.

\paragraph{Data availability.} The Cook et al.\ (2019) connectome dataset is provided as Supplementary Material S1 (\texttt{cook2019connectome.xlsx}), sourced from the supplementary data of \citet{cook2019} (\url{https://doi.org/10.1038/s41586-019-1352-7}). The Kato et al.\ (2015) calcium-imaging dataset used for benchmark calibration is publicly available via the Open Science Framework (\url{https://osf.io/2395t/}) and is downloaded automatically at runtime by the supplied code. OpenWorm baseline connectivity data is retrieved automatically from a public GitHub repository at runtime.

\paragraph{Code availability.} The complete simulation framework and benchmark suite are provided as Supplementary Material: \texttt{neurosparksnt.py} (Supplementary~S2, full model implementation, both architectural variants) and \texttt{neurosparksnt\_bench.py} (Supplementary~S3, twelve-benchmark evaluation suite, fixed random seeds). \texttt{README.md} (Supplementary~S4) provides installation instructions, benchmark-by-benchmark reproduction commands, and reviewer reproducibility checks. Filenames in S1--S3 must be preserved exactly as listed, since the code references them by name.

\paragraph{Author contributions.} D.Y.: conceptualization, methodology, software, formal analysis, writing---original draft and review.

\paragraph{Acknowledgements.} The author thanks the \celegans\ research community for maintaining the open-access connectome and calcium-imaging datasets without which this work would not have been possible.


% ============================================================
\begin{thebibliography}{99}

\bibitem[Avery and Horvitz, 1989]{averyhorvitz1989} Avery, L., Horvitz, H.R. (1989). Pharyngeal pumping continues after laser killing of the pharyngeal nervous system of \textit{C.\ elegans}. \textit{Neuron}, 3(4), 473--485.

\bibitem[Bargmann, 2006]{bargmann2006} Bargmann, C.I. (2006). Chemosensation in \textit{C.\ elegans}. \textit{WormBook}, 1--29.

\bibitem[Bargmann and Horvitz, 1991]{bargmannhorvitz1991} Bargmann, C.I., Horvitz, H.R. (1991). Chemosensory neurons with overlapping functions direct chemotaxis to multiple chemicals in \textit{C.\ elegans}. \textit{Neuron}, 7(5), 729--742.

\bibitem[Bargmann and Marder, 2013]{bargmann2013} Bargmann, C.I., Marder, E. (2013). From the connectome to brain function. \textit{Nature Methods}, 10(6), 483--490.

\bibitem[Bretscher et al., 2011]{bretscher2011} Bretscher, A.J., Kodama-Namba, E., Busch, K.E., Murphy, R.J., Soltesz, Z., Laurent, P., de Bono, M. (2011). Temperature, oxygen, and salt-sensing neurons in \textit{C.\ elegans} are carbon dioxide sensors that control avoidance behavior. \textit{Neuron}, 69(6), 1099--1113.

\bibitem[Chalfie et al., 1985]{chalfie1985} Chalfie, M., Sulston, J.E., White, J.G., Southgate, E., Thomson, J.N., Brenner, S. (1985). The neural circuit for touch sensitivity in \textit{Caenorhabditis elegans}. \textit{Journal of Neuroscience}, 5(4), 956--964.

\bibitem[Cook et al., 2019]{cook2019} Cook, S.J., Jarrell, T.A., Brittin, C.A., Wang, Y., Bloniarz, A.E., Yakovlev, M.A., Nguyen, K.C.Q., Tang, L.T.H., Bayer, E.A., Duerr, J.S., B\"ulow, H.E., Hobert, O., Hall, D.H., Emmons, S.W. (2019). Whole-animal connectomes of both \textit{Caenorhabditis elegans} sexes. \textit{Nature}, 571(7763), 63--71.

\bibitem[Costa et al., 2024]{costa2024} Costa, A.C., Ahamed, T., Jordan, D., Stephens, G.J. (2024). A Markovian dynamics for \textit{Caenorhabditis elegans} behavior across scales. \textit{Proceedings of the National Academy of Sciences}, 121(32).

\bibitem[Glauser et al., 2011]{glauser2011} Glauser, D.A., Chen, W.C., Agin, R., MacInnis, B.L., Hellman, A.B., Garrity, P.A., Tan, J.K., Goodman, M.B. (2011). Heat avoidance is regulated by transient receptor potential (TRP) channels and a neuropeptide signaling pathway in \textit{Caenorhabditis elegans}. \textit{Genetics}, 188(1), 91--103.

\bibitem[Gray et al., 2004]{gray2004} Gray, J.M., Karow, D.S., Lu, H., Chang, A.J., Chang, J.S., Ellis, R.E., Marletta, M.A., Bargmann, C.I. (2004). Oxygen sensation and social feeding mediated by a \textit{C.\ elegans} guanylate cyclase homologue. \textit{Nature}, 430(6997), 317--322.

\bibitem[Gray et al., 2005]{gray2005} Gray, J.M., Hill, J.J., Bargmann, C.I. (2005). A circuit for navigation in \textit{Caenorhabditis elegans}. \textit{Proceedings of the National Academy of Sciences}, 102(9), 3184--3191.

\bibitem[Iino and Yoshida, 2009]{iino2009} Iino, Y., Yoshida, K. (2009). Parallel use of two behavioral mechanisms for chemotaxis in \textit{Caenorhabditis elegans}. \textit{Journal of Neuroscience}, 29(17), 5370--5380.

\bibitem[Kaplan and Horvitz, 1993]{kaplanhorvitz1993} Kaplan, J.M., Horvitz, H.R. (1993). A dual mechanosensory and chemosensory neuron in \textit{Caenorhabditis elegans}. \textit{Proceedings of the National Academy of Sciences}, 90(6), 2227--2231.

\bibitem[Kato et al., 2015]{kato2015} Kato, S., Kaplan, H.S., Schr\"odel, T., Skora, S., Lindsay, T.H., Yemini, E., Lockery, S., Zimmer, M. (2015). Global brain dynamics embed the motor command sequence of \textit{Caenorhabditis elegans}. \textit{Cell}, 163(3), 656--669.

\bibitem[Mori and Ohshima, 1995]{mori1995} Mori, I., Ohshima, Y. (1995). Neural regulation of thermotaxis in \textit{Caenorhabditis elegans}. \textit{Nature}, 376(6538), 344--348.

\bibitem[Pierce-Shimomura et al., 1999]{pierceshimomura1999} Pierce-Shimomura, J.T., Morse, T.M., Lockery, S.R. (1999). The fundamental role of pirouettes in \textit{Caenorhabditis elegans} chemotaxis. \textit{Journal of Neuroscience}, 19(21), 9557--9569.

\bibitem[Randi et al., 2023]{randi2023} Randi, F., Sharma, A.K., Dvali, S., Leifer, A.M. (2023). Neural signal propagation atlas of \textit{Caenorhabditis elegans}. \textit{Nature}, 623(7986), 406--414.

\bibitem[Sawin et al., 2000]{sawin2000} Sawin, E.R., Ranganathan, R., Horvitz, H.R. (2000). \textit{C.\ elegans} locomotory rate is modulated by the environment through a dopaminergic pathway and by experience through a serotonergic pathway. \textit{Neuron}, 26(3), 619--631.

\bibitem[White et al., 1986]{white1986} White, J.G., Southgate, E., Thomson, J.N., Brenner, S. (1986). The structure of the nervous system of the nematode \textit{Caenorhabditis elegans}. \textit{Philosophical Transactions of the Royal Society of London B}, 314(1165), 1--340.

\bibitem[Zimmer et al., 2009]{zimmer2009} Zimmer, M., Gray, J.M., Pokala, N., Chang, A.J., Karow, D.S., Marletta, M.A., Hansen, M.K., Bargmann, C.I. (2009). Neurons detect increases and decreases in oxygen levels using distinct guanylate cyclases. \textit{Neuron}, 61(6), 865--879.

\end{thebibliography}

\end{document}
