Separating Clock from Shape: Signature Tests for Cross-Simulator Agreement

When the same neural circuit model is run on two simulators, such as NEURON and NEST, the outputs never match spike for spike. Chaotic networks amplify tiny numerical differences, so the field checks agreement with coarse summaries: mean firing rates, interval histograms, voltage distributions. These summaries discard the order in which populations activate and how channels move together, and that is exactly where many solver bugs and time-step artifacts show up. We propose a statistical test that compares whole ensembles of multi-channel simulator trajectories through their path signatures. A path signature is a fixed list of iterated integrals that summarizes the shape of a curve, including which channel moved before which, and it ignores how fast the curve was traversed. Using this test, we can certify whether two backends produce the same dynamics in distribution.

The test also splits any detected disagreement into two parts. The first is a "clock" part: same curve, different timing. The second is a "shape" part: the trajectories really follow a different vector field. The split comes from computing the same test twice, once on the raw path, where signatures ignore timing, and once on the path with time added as an extra channel, where they do not. A modeler who learns that two backends differ only in clock, or differ in shape along the excitatory-to-inhibitory ordering, has something actionable. A modeler who learns only that the rate histograms disagree does not.

Core Claim

A kernel two-sample statistic built on signatures of population-level paths has two properties. First, it detects planted implementation errors and time-step artifacts across simulator backends at shorter simulation lengths and smaller effect sizes than rate, interval, and spectral summaries, at a matched false-alarm rate calibrated on seed-to-seed variability within one backend. Second, the gap between its time-augmented and time-free versions separates pure timing discrepancies from geometric ones, which no existing verification metric does.

The mechanism uses the maximum mean discrepancy between two ensembles of paths, $P$ from backend A and $Q$ from backend B. The maximum mean discrepancy is a distance between distributions computed from average kernel similarities:

$$\mathrm{MMD}^2_k(P,Q)=\mathbb{E}[k(X,X')]+\mathbb{E}[k(Y,Y')]-2\,\mathbb{E}[k(X,Y)],$$

Here $X,X'\sim P$ and $Y,Y'\sim Q$, and $k(X,Y)=\langle S(X),S(Y)\rangle$ is the signature kernel, the inner product of the two paths' signatures $S(\cdot)$. We compute it without expanding the signature by solving the hyperbolic PDE used in SigGPDE and A High Order Solver for Signature Kernels. We compute $D_{\text{shape}}=\mathrm{MMD}^2_{k}$ on the raw paths and $D_{\text{full}}=\mathrm{MMD}^2_{k_t}$ on paths augmented with a time channel. The time-free signature is invariant to monotone reparameterizations Tóth et al., so $D_{\text{shape}}$ is blind to joint time warps, while $D_{\text{full}}$ is not. Both are permutation-tested. A significant $D_{\text{full}}$ with a null $D_{\text{shape}}$ diagnoses a clock discrepancy. A significant $D_{\text{shape}}$ diagnoses a geometric one.

One caveat matters for honesty. Clock-driven spike quantization is not exactly a reparameterization. When it shifts different populations by different amounts, the relative lag is a real geometric change and should, and will, appear in $D_{\text{shape}}$. The decomposition answers a precise question: is there any single global time warp that reconciles the backends? This is the sharpest operational form we can give to the open question of how much divergence is reparameterization and how much is solver drift.

Relation to Prior Work

Three works motivate the gap. Brette et al.'s review of spiking simulators ran four standard networks (current-based integrate-and-fire, conductance-based integrate-and-fire, Hodgkin-Huxley, and voltage-jump) across eight engines. It showed that clock-driven integration can push plastic networks into different attractors, yet it judged agreement only by rates and interval distributions. We keep its benchmarks and its distributional stance, and we replace the summaries with path-level statistics. PyNN made "debugging by comparison" practical by running one script on several backends, but it supplies no criterion for when two outputs agree. We provide that criterion and use PyNN as the harness that generates paired ensembles. Tustison et al. and Lefebvre et al. argue that software acts as a measurement instrument and that pipeline differences can manufacture apparent biomarkers. That is the motivation for an instrument-level check.

Signature work supplies the method but has not been pointed at this problem. CPDA aligns class-conditional path distributions across sensor domains with a signature-spectral kernel. It removes domain shift for prediction, whereas we want to measure and attribute shift without removing it. Deep Signature uses signatures of coarse-grained molecular dynamics trajectories as features for classification, and it treats the simulator output as fixed data. Rough Transformers uses signatures to avoid running numerical solvers. We use them to audit solvers. Kormilitzin et al. motivate why the second signature level matters here: it encodes which of two channels moved first.

Two results constrain the design. Signatures cannot distinguish a path from one that retraces itself (uniqueness). This is why we always include a monotone channel, the cumulative spike count, in the time-free version. Truncated signatures also explode in size with channel count, so we work on population-level channels with the kernel PDE rather than per-neuron explicit features.

Research Program

We build the test as a library on top of PyNN and NeuroML/c302. Each network is mapped to a low-dimensional path, typically 4 to 12 channels. The channels are cumulative spike counts per population, which form a monotone counting path that encodes event order, plus population-mean membrane potential and synaptic conductances where the backend exposes them. Within-backend seed ensembles calibrate the null distribution, and the permutation test is run on the pooled ensembles.

We then analyze three things. The first is power as a function of simulated duration and ensemble size. The second is the decomposition behavior under controlled perturbations. The third is attribution: for explicit low-level signatures in small channel sets, we report which level-2 terms (signed areas between channel pairs) drive $D_{\text{shape}}$. This turns a significant test into a statement such as "inhibition lags excitation more on backend B."

The work proceeds in three stages. The first stage uses synthetic ground truth. We take a single backend and apply known perturbations. Pure global time warps, from resampling or a simulated clock drift, should leave $D_{\text{shape}}$ at null and raise $D_{\text{full}}$. Vector-field errors should raise both. These include an explicit-Euler versus exponential-integrator swap in the Hodgkin-Huxley network, a mis-scaled synaptic time constant, and an off-by-one in delay handling. The second stage uses real cross-backend comparisons: NEST versus NEURON through PyNN on the four Brette benchmarks, at several clock steps and against NEST's precise event-driven mode, plus jNeuroML versus NEURON on the c302 pharyngeal and 8-cell models. The third stage adds plasticity, using an STDP-equipped variant of the conductance-based network. Here we ask whether the signature test flags clock-step divergence from short early windows, before rates visibly separate.

Baselines

The naive reference point is the current practice from Brette et al.: per-population firing-rate, interval-histogram, and voltage-histogram comparisons, each turned into a two-sample test (Kolmogorov-Smirnov or energy distance) with Bonferroni correction. It is the right floor because it is what the community uses and because Brette et al. found it consistent across properly configured simulators. It is run on exactly the same ensembles and windows. We beat it if, at a 5% false-alarm rate on same-backend seed splits, our test detects planted errors with higher power at equal simulated duration, or reaches equal power with substantially less duration. No reported detection-power result was found on Lacuna for these benchmarks, so both numbers will be measured here.

The strongest generic competitor is a classifier two-sample test. A small temporal convolutional network or LSTM is trained to tell backend A trajectories from backend B, and held-out accuracy above chance is the test statistic. It is the most flexible detector a reviewer would propose. It gets the same paths, including time and count channels, a tuning budget matched in wall-clock time to our kernel-bandwidth and truncation search, and a permutation null. We beat it if we match or exceed its power at small ensemble sizes, where classifiers overfit. On the decomposition task, it has no native counterpart. We will give it a fair shot there by retraining it on time-normalized inputs.

A third baseline is MMD with a Gaussian kernel on resampled, flattened trajectories, plus a dynamic-time-warping variant. This tests whether signature geometry matters beyond "use a kernel two-sample test." Two ablations isolate our key ingredients. One drops the time channel or the count channel, testing whether the decomposition and the monotone channel are needed. The other truncates at level 1, giving displacement only, to test whether ordering information in level 2 and above carries the gain.

The closest signature method, CPDA, reports 97.30% accuracy on uWave and 81.82% on HHAR. Those numbers are for domain-adapted classification, not verification, so they are context rather than a target. We will use CPDA's composite kernel as an alternative kernel inside our test.

Why not just…?

Why not just compare firing rates and interval histograms, as everyone does? These summaries are the baseline, and they may suffice for the non-plastic networks, where Brette et al. found them consistent. The case against them is specific. They cannot see cross-population ordering by construction, and in the plastic regime Brette et al. show that small clock-step errors change the eventual attractor. A test that only fires after the attractor has changed is a late alarm. The STDP experiment will show whether path statistics fire earlier. If they do not, that is a publishable negative result and we will report it as such.

Why not just train a classifier to tell the backends apart? This is the real threat for raw detection power, and with large ensembles it may match us. Our claim does not rest on beating it everywhere. It rests on calibrated small-sample behavior, which kernel tests have and trained classifiers lack without held-out splits. It also rests on the clock-versus-shape decomposition and the level-2 attribution, which a classifier does not produce. If the classifier dominates in power at all ensemble sizes, we will reframe the contribution around the decomposition and say so plainly.

Why not just align with dynamic time warping and then use a standard distance? Warping-then-compare handles timing, but it lets each pair choose its own warp, so it can absorb genuine relative-lag errors between populations. It also needs pointwise pairing, which is meaningless for chaotically diverging runs. The planted delay-handling bug in stage one is designed to tell the two apart: our $D_{\text{shape}}$ should detect it, while warped Euclidean distance may hide it.

Why not just run a time-step convergence sweep, as in V&V40? Setzu et al. rely on such sweeps for cardiac models. They verify one solver against itself under refinement, which is complementary to our goal. A sweep does not certify that two different backends agree, and in chaotic networks a refined trajectory does not converge pointwise anyway. We will use the sweep's finest-step ensemble as a reference distribution, so the two approaches are combined rather than opposed.

Decisive Experiments

Three checks would settle the claim. The first is the decomposition check on synthetic warps and planted vector-field errors. If $D_{\text{shape}}$ responds to pure global time warps beyond the null rate, or fails to respond to vector-field errors, the central diagnostic idea fails.

The second is a power-versus-duration curve on the four Brette benchmarks with planted bugs. It compares our test against summary statistics, the classifier test, and Gaussian-kernel MMD at a matched false-alarm rate. The signature advantage should be largest on the conductance-based and Hodgkin-Huxley networks, where channels interact nonlinearly, and smallest on the voltage-jump network.

The third is a real-backend audit: NEST clock-driven at several steps versus NEST precise mode versus NEURON, and jNeuroML versus NEURON on c302. Each discrepancy is reported as clock-only, shape, or none, and shape discrepancies are attributed to channel pairs. Every attribution is checked by reading the backend's integration code or by rerunning with the suspected setting changed.

The STDP variant then tests the earliest-warning claim. We record the shortest window at which each method rejects equivalence between a 0.1 ms clock and the event-driven reference.