Validation status#
Why trust the NEST-compatible family? Because each model is checked against a live NEST install and the comparison is asserted in a test you can run yourself. This page is the trust showcase: how parity is asserted, the tolerance categories that say what counts as a match for what kind of model, the per-family status, and how to run the harness.
The validation harness lives at brainpy_state/_nest_validation/. Every parity
test imports the same comparison engine and the same documented
tolerances, so “did it match NEST?” is asked the same way everywhere.
How parity is asserted#
NEST and JAX draw from independent PRNG streams, so not everything can be compared sample-by-sample. The harness has two comparison modes:
Mode |
When |
How it compares |
Categories |
|---|---|---|---|
trace |
Deterministic drive — same |
Per-sample / max-abs error, with an optional ±1-step recorder alignment. |
A, B, C |
distributional |
PRNG-divergent drive — Poisson input, random connectivity, stochastic neurons. |
A seed-aggregated statistic (the mean over seeds), never per-sample. |
D |
Anything stochastic is therefore compared distributionally — averaged over seeds,
never spike-by-spike. The pass test is the division-free numpy.allclose form
|a − b| ≤ atol + rtol·|reference|, so a zero reference never divides.
Tolerance categories A–E#
The single source of truth for what tolerance for what kind of model is
brainpy_state/_nest_validation/tolerance_conventions.py — importable,
unit-aware constants. The five categories span the comparison space the harness
must cover (membrane-voltage trace, firing rate, weight trajectory,
PSC-amplitude train, F–I curve):
Cat |
Kind |
Example metric |
Tolerance |
Constant |
|---|---|---|---|---|
A |
Adaptive numerical integrator (RKF45) |
|
|
|
B |
Analytic exact propagator |
linear |
|
|
C |
Conductance / coupled / mean-field |
|
|
|
D |
Distributional (PRNG-divergent) |
network firing rate, ISI CV |
seed-mean |
|
E |
Spike-time / event-count |
|
|
|
The A/B/C numbers are absolute (and unit-aware for voltages). CAT_C_RATE is
the deterministic mean-field rate fixed point, compared purely relatively (Hz).
Category D’s multi-seed protocol runs N ≥ 5 seeds per side and compares the
seed-mean; the NEST side offsets its seeds to decorrelate the two PRNG streams.
Per-family parity status#
Each family is validated under the category that fits how it is solved (see
Integration categories). The table lists a representative parity test for
each; browse brainpy_state/_nest_validation/ for the full set.
Family |
Category |
Representative parity test |
|---|---|---|
Current-based IAF ( |
B |
|
Conductance-based IAF ( |
C |
|
AdEx ( |
A |
|
Hodgkin–Huxley ( |
A / C |
|
Izhikevich, GIF, GLIF |
A |
|
Rate models, |
C / D |
|
Brunel / balanced networks |
D |
|
Precise spiking ( |
E |
|
Short-term plasticity (Tsodyks, quantal) |
A (V_m) / D |
|
STDP family |
E (+ documented bands) |
|
Devices (generators, recorders, detectors) |
E / D |
|
Spatial connectivity |
D |
|
The STDP family carries a few documented numerical bands (Clopath ≤ 5 %, dopamine ~0.2 %, and the nearest-neighbour “phantom pre at 0” that is intentionally not reproduced). The direction and ordering of every weight change are exact; only a small magnitude band remains. See STDP parity: where state lives and how spikes pair for the exact numbers and the test that asserts each.
Running the harness#
The parity tests use a requires_nest pytest marker (registered in the
harness conftest.py) that skips cleanly when import nest fails — so
you can run them with or without a NEST install.
# All live-NEST parity tests (skipped where NEST is absent):
python -m pytest brainpy_state/_nest_validation/ -m requires_nest -q
# Everything in the package — harness unit tests always run; the live-NEST
# tests run if NEST is present, else skip:
python -m pytest brainpy_state/_nest_validation/ -q
Without NEST installed, the @requires_nest tests skip and the harness’s own
unit tests (the tolerance conventions and the comparison engine) still pass, so
you can verify the machinery is sound before installing NEST.
Known coverage gaps#
In the spirit of showing evidence rather than hiding caveats, here is the honest scope:
Multi-compartment models (``_mc``).
iaf_cond_alpha_mcis not yet validated against NEST;pp_cond_exp_mc_urbanczikdoes have per-compartment live-NEST parity (used by the Urbanczik dendritic-prediction example).File-backed recording. Recording is in-memory only — there is no file/ascii backend yet, so device tours that exercise NEST’s
record_tobackend axis collapse to the in-memory equivalent.A few legacy single-seed distributional tests. Some early distributional tests use a single realization rather than the full
≥ 5-seed protocol; this is a documented limitation, not a parity failure.
When you find a numerical mismatch against NEST upstream, open an issue with a minimal reproducer at chaobrain/brainpy.state#issues.
See also#
Integration categories — how each family’s ODE (if any) is solved.
Semantic divergences — the semantic-divergence catalog the parity tests back.
STDP parity: where state lives and how spikes pair — the STDP numerical bands and pairing conventions.
NEST-Compatible Neuron Models, NEST-Compatible Synapse Models, NEST-Compatible Plasticity Models, NEST-Compatible Devices — the API reference.
NEST simulator documentation — the authoritative reference for upstream model semantics.