Stochastic & Neuromorphic Computing  /  Reference  /  Polyglot & parity

Polyglot & parity
one substrate, five languages, bit for bit

The core stochastic substrate is written more than once. There is a readable Python reference, and accelerated Rust, Julia, Go and Mojo kernels — all held to the same numerical contract and checked bit-for-bit. You prototype in Python and make it fast without rewriting the science, and a kernel that drifts from the reference is caught as a failure, not shipped as a speed-up.

One substrate, many languages

Each backend earns its place on a different axis, and none is allowed to change the answer. Python is the reference the others are measured against; the compiled languages exist for throughput and reach, selected per workload — not as forks of the maths.

LanguageRoleWhy it earns a place
Pythonreferencereadable, the ground truth every kernel is checked against
RustSIMD enginememory-safe vectorised kernels with a mature FFI
Mojonative kernelsPython-syntax code that compiles to native speed
Juliascientificfast array maths and a scientific-computing ecosystem
Goconcurrencysimple, well-behaved parallelism for network-level work
SIMD dispatch across five ISAs

The hot inner operation of stochastic computing — count the ones in a packed word (popcount) after a bitwise AND — is exactly what vector units accelerate. The Rust engine carries a hand-written kernel for each major instruction set and picks the best one the CPU actually has at run time, falling back to portable code when none is present. Choose a target below to see what dispatches.

Bit-exact parity is the contract

A faster kernel is only useful if it computes the same thing. The primitives — Bernoulli and Sobol bitstreams, pack/unpack, bitwise AND, popcount, the encoder and averager — are held bit-identical between the Python reference and the compiled kernels, and the neuron models are checked the same way. Parity is a committed test, so a SIMD popcount that disagrees with the portable one, or a Rust neuron that drifts from Python, fails the build.

Deeper: parity as evidence
This is the same discipline as the source-fidelity work: a model is validated against its DOI-anchored contract in Python, and then the acceleration is validated against Python. The two together mean a green build says both "the science is right" and "every fast path agrees with the science". It is why switching a workload from the Python path to a Rust or Mojo kernel changes the wall-clock and nothing else — and why the polyglot layer strengthens the credibility of the whole toolkit rather than fragmenting it.
The engine, in crates

The Rust side is not a monolith but a set of focused crates — a core_engine for the substrate, plus neuro_symbolic, spike_stats_core, stochastic_doctor_core, evo_substrate_core, autonomous_learning and a tinysc_riscv target — each with its own tests, composed through the same Python bridge. The same modular substrate carries the hyperdimensional and neuro-symbolic layers, so they inherit the parity guarantees too.

A note on numbers

This page deliberately quotes no speed-up figures. Throughput depends on the machine, the ISA and the workload, and the honest place for those numbers is the benchmarks page, where each is tied to a committed artefact and its measurement conditions. What is claimed here is narrower and stronger: that the fast paths exist across five languages and are held bit-for-bit consistent with a readable reference.