SC-NeuroCore

July 30, 2026 · View on GitHub

SC-NeuroCore — Stochastic Computing & Neuromorphic Engine

CI codecov CodeQL PyPI PyPI downloads Total downloads mypy Ruff Typed pre-commit Docs GitHub Sponsors License: AGPL v3 Python 3.10+ Rust OpenSSF Best Practices OpenSSF Scorecard REUSE status Open In Colab

Stochastic computing and neuromorphic hardware co-design toolkit

Version: 3.16.0

SC-NeuroCore is a research-to-hardware software stack for designing spiking and stochastic neural systems, validating their numerical behaviour, and moving selected models toward FPGA, ASIC, and embedded neuromorphic deployment. It combines a Python public API, an optional Rust acceleration engine, SystemVerilog generation paths, benchmark evidence, and polyglot research mirrors for selected kernels.

It is useful when a team needs to answer practical questions such as:

  • Can a stochastic bitstream representation approximate this neural computation within a bounded error budget?
  • Which neuron, synapse, encoder, or network path is numerically appropriate for a target workload?
  • Can a model be converted into auditable hardware artefacts rather than remaining only a Python simulation?
  • Which evidence is available for speed, parity, synthesis, safety-case readiness, or cross-framework comparison?
  • Which capabilities are stable package surfaces and which remain source-checkout research surfaces?

LIF spike raster — 5 neurons, sinusoidal input

Who It Is For

AudiencePrimary value
Neuroscience and SNN researchersReproducible neuron and network experiments with explicit numerical guardrails.
Hardware and FPGA engineersBitstream arithmetic, fixed-point export, RTL generation, and synthesis evidence workflows.
ML and edge-computing teamsSNN training, ANN-to-SNN conversion, acceleration options, and deployment trade-off studies.
Safety, verification, and industrial teamsEvidence bags, fail-closed readiness checks, formal-verification collateral, and documentation boundaries.
Commercial evaluatorsA mapped path from modelling to hardware-oriented evidence, with clear gaps before field deployment.

What Makes It Distinct

  • Stochastic computing first: bitstream encoders, probabilistic arithmetic, Sobol/LFSR sources, and bounded error reasoning are first-class components.
  • Neuromorphic breadth with guardrails: the repository contains a wide neuron/model catalogue, but public docs separate stable package surfaces from opt-in research paths.
  • Hardware-oriented output: selected workflows generate Verilog/SystemVerilog artefacts, synthesis reports, and hardware-readiness evidence instead of stopping at simulation.
  • Evidence-indexed benchmarking: public benchmark claims are tied to committed artefacts under benchmarks/results/ or hardware reports under hdl/reports/.
  • Polyglot parity research: Julia, Go, Mojo, Rust, and Python counterparts exist for selected kernels to test implementation fidelity and performance trade-offs, while the default install remains Python-first.

Application Areas

SC-NeuroCore is positioned for neuromorphic R&D, stochastic accelerator design, edge inference studies, BCI and spike-codec prototyping, safety-case tooling, and hardware/software co-design. It is not a certified medical, automotive, aerospace, or rail product by itself. Domain profiles in the documentation state required evidence and missing evidence explicitly so commercial or regulated deployment work can start from an auditable gap list.

Current Evidence Boundary

SurfaceCurrent status
Public Python packageVersion 3.16.0 package surface with base NumPy/SciPy dependency boundary.
Optional accelerationRust engine and optional heavy backends are opt-in; Python fallbacks remain available.
Hardware evidenceCommitted synthesis and report artefacts exist for selected flows, including the bounded SC Compte ring-connectivity representative; power/energy and physical-device claims require matching committed reports.
BenchmarksOnly committed JSON/CSV/report artefacts are public evidence. Local exploratory runs must not be promoted without raw artefacts.
Polyglot surfacesSource-checkout research and parity surfaces, not default user install requirements.
High-fidelity neurons54 of 155 catalogue models meet the strict five-runtime polyglot-completion bar; see the per-model evidence table.
Regulated deploymentReadiness tooling and evidence categories only; no certification or field approval claim.

Version and Capability Snapshot

SC-NeuroCore Capability Inventory

SurfaceCurrent inventory
Package version3.16.0
Public API exports45
Python model source modules161
Python model classes165
Model documentation pages183
Rust PyO3 model wrappers194
Optional extras28
Python test files4683
Public documentation pages597
GitHub Actions workflows20

Evidence boundary: this snapshot is a static inventory. Performance, coverage, hardware, and scientific-fidelity claims require their own committed evidence artefacts.

Snapshot definitions: Python test files counts every .py support or test module under tests/; Python model classes counts non-private top-level classes in src/sc_neurocore/neurons/models/*.py; Public documentation pages counts Markdown under docs/ after excluding docs/internal/ and docs/_generated/.

Quick Start

pip install sc-neurocore
sc-neurocore info
sc-neurocore --help

The CLI presents Model, Hardware, Studio, and Maintain workflows at the top level; use sc-neurocore COMMAND --help for command-specific options. The complete command guide is in Command-Line Interface.

For biological closed-loop BCI implementations (experimental), install the bioware optional dependencies:

pip install "sc-neurocore[bioware]"
from sc_neurocore import StochasticLIFNeuron

neuron = StochasticLIFNeuron(v_threshold=1.0, tau_mem=20.0, noise_std=0.0)
spikes = sum(neuron.step(0.8) for _ in range(500))
print(f"{spikes} spikes in 500 steps")

Zenith Quickstart

Train biologically plausible rules using PyTorch surrogate autograd, then export the exact layer to hardware:

Bio-hybrid Closed-Loop with ArcaneZenith (Experimental)

The experimental bioware module validates finite MEA frames and maps them through spike detection, 16-bit AER epochs, deterministic stochastic bitstreams, and optogenetic pulse proposals. It includes PCA/K-Means spike sorting, heuristic culture monitoring, an onset-gain pharmacology prototype, and an optional ArcaneZenithCognitiveCore callback. It is research software, not a clinical or tissue-safety controller; see the maintained contract.

import torch
from sc_neurocore.plasticity import create_plasticity_layer
from sc_neurocore._native.learning_bridge import RULE_STDP

# 1. Train entirely in standard DL execution architectures
bcm_layer = create_plasticity_layer(count=128, rule_type=RULE_STDP, backend="torch", autograd=True)
# ... standard cross-entropy loss.backward() loop

# 2. Deploy natively to SC-NeuroCore hardware limits
exascale_layer = create_plasticity_layer(count=128, rule_type=RULE_STDP, backend="rust", weight=bcm_layer.weights.detach().numpy())
exascale_layer.save("hw_layer.scal")

See the full end-to-end integration demo in examples/zenith_hybrid_resnet.py.

# Add only the extras needed for the current workflow.
pip install "sc-neurocore[minimal]"   # explicit v4 minimal profile
pip install "sc-neurocore[core]"      # explicit base profile
pip install "sc-neurocore[nir]"       # NIR interop
pip install "sc-neurocore[training]"  # PyTorch-backed training
pip install "sc-neurocore[studio]"    # local web studio
pip install "sc-neurocore[full]"      # local research environment only

See Install Profiles for the full optional dependency matrix and research-only boundaries.

Rust Engine and Benchmark Evidence

The optional Rust engine provides SIMD-accelerated simulation, 189 Rust PyO3 model wrappers, a 166-model NetworkRunner dispatch list, and fused E-I network simulation. Release automation builds pre-built sc_neurocore_engine wheels with maturin for Python 3.10-3.14 on Linux x86_64/aarch64, macOS, and Windows. Use a matching release wheel first:

python -m pip install sc_neurocore_engine

If no matching wheel exists for your platform or Python version, build the local bridge from a source checkout with a local Rust toolchain:

python -m pip install --require-hashes -r requirements/maturin.txt
cd bridge
python -m maturin develop --release

The committed Brunel balanced-network scaling artefact benchmarks/results/rust_scaling_benchmark.json records 39-202x speedups against Brian2 for its 10K-100K rows. Treat that as workload-specific evidence, not as a blanket claim for every engine path.

The AdEx model also exposes source-bound baseline-Euler simulation through Python, the Rust engine, Julia, Go, and Mojo. Its committed benchmarks/results/bench_adex.json artefact records exact event parity and a 5e-12 voltage-trace envelope; see the AdEx model page for backend and evidence boundaries.

The ExpIF model exposes the Fourcaud-Trocmé candidate-first RK4 recurrence through the same five public paths. Its committed benchmarks/results/local_python_2026-06-16_expif_rk4.json artefact records exact event parity and a 5e-8 voltage-trace envelope; the ExpIF model page states the fitted defaults, Q32.32 co-simulation boundary, and refractory protocol.

NonResettingLIFNeuron now exposes the Kobayashi et al. one-timescale MAT(1) source recurrence across Python, Rust, Julia, Go, and Mojo. The former project exact-relaxation behavior is preserved separately as SCNonResettingAdaptiveLIFNeuron; the MAT(1) model page states the identity, benchmark, Q32.32, and bounded-formal evidence boundaries.

The Lapicque model exposes its exact constant-current RC flow through Python, the factory-default Rust engine boundary, Julia, Go, and Mojo. The measured dispatcher order is Mojo, Julia, Go, compatible Rust, then Python. Its committed benchmarks/results/local_python_2026-06-17_lapicque_exact_flow.json artefact records 20,000 events in every lane over 100,000 steps and a maximum voltage difference of 4.44e-16; the Lapicque model page states the loaded-host benchmark boundary and Q16.16 co-simulation evidence.

The Perfect Integrator exposes its candidate-first non-leaky Euler recurrence through Python, the factory-default Rust engine boundary, Julia, Go, and Mojo. Its source-bound benchmark records bit-exact traces and event counts across all five paths; the Perfect Integrator model page states the loaded-host timing boundary, complete native numeric contract, Q8.8 co-simulation operating point, and the declared fractional-current boundary.

The threshold-linear rate model exposes its memoryless gain * max(0, current - theta) transfer through Python, a configurable Rust engine batch, independent Rust safety, Julia, Go, and Mojo. Its committed source- and binary-bound benchmark requires bit-exact complete rate traces in all five lanes and records only local non-exclusive regression timings. The model page states the continuous- rate, no-spike, and no-RTL boundaries.

When installed, SC-NeuroCore automatically uses the Rust engine for:

  • NetworkRunner: 166-model fused Rayon-parallel simulation loop
  • E-I network: single Rust call for connectivity + Poisson + Euler + spike detection
  • Batch simulate: model dispatch loop in compiled Rust
  • SIMD bitstream ops: 190 Gbit/s popcount (AVX-512)

The pure Python package works without the engine — NumPy fallbacks are used for all operations. Install or build the engine only when you need the performance advantage. See Install Profiles for the base install, optional extras, and source-build path.

pip install sc-neurocore publishes the Python suite under the public sc-neurocore package name. The optional Rust engine remains part of the repository / release-asset / source-build flow rather than a separate PyPI runtime dependency. Source-only extended modules such as analysis, viz, audio, dashboard, and swarm still require a source checkout.

Development Setup

git clone https://github.com/anulum/sc-neurocore.git
cd sc-neurocore
pip install -e ".[dev]"    # editable install with all dev tools
make preflight             # verify setup (lint + tests)

If you are changing the Rust bridge locally, install bridge/ in the same environment or run source-tree commands with PYTHONPATH=src:bridge.

Visual SNN Design Studio (Experimental)

Status: Development preview. The Studio is functional but under active development. API and UI may change between releases until the v4.0 stable API freeze.

A web-based IDE for designing, training, compiling, and deploying spiking neural networks — from ODE equations to FPGA bitstream in a single browser tab.

pip install sc-neurocore[studio]
sc-neurocore studio              # opens browser at http://127.0.0.1:8001
FeatureWhat it does
160-entry Model BrowserBrowse every registered catalogue entry by category, simulate with parameter sliders
18+ Analysis ViewsTrace, phase portrait, ISI, f-I curve, bifurcation, heatmap, STA, frequency response, characterisation dashboard
Compiler InspectorBuild SC IR from equations, verify, emit SystemVerilog
Synthesis DashboardOne-click Yosys synthesis to ice40/ECP5/Gowin/Xilinx, multi-target comparison, resource bars
Training MonitorLive loss/accuracy curves via SSE, 6 surrogate gradients, per-layer spike rates
Network CanvasDrag-and-drop populations and projections (React Flow), NIR export/import
Full PipelineNetwork → simulate → compile → synthesise in one click
Project Save/LoadPersistent workspaces as JSON, server-side storage

No other SNN framework provides a visual design-to-hardware pipeline. snnTorch has Jupyter notebooks. Brian2 has a basic GUI. Neither goes from visual network design to FPGA resource estimation.

FeatureSC-NeuroCore StudioBrian2 GUIsnnTorchNengo GUI
Visual network designYesBasicNoYes
ODE equation editorYesNoNoNo
Live training curvesYesNoTensorBoardNo
Verilog output viewerYesNoNoNo
FPGA synthesisYesNoNoNo
Co-simulation viewYesNoNoNo

Full documentation: Studio Guide

Docker

Docker builds can include the optional Rust acceleration engine when the build profile installs it. Published speed evidence is scoped to committed benchmark artefacts such as benchmarks/results/rust_scaling_benchmark.json:

# Build
make docker-build
# or: docker build -f deploy/Dockerfile -t sc-neurocore:latest .

# Build the offline HDL shipping profile with packaged baseline RTL primitives
# and the hash-locked HDL dependency set. Vivado is not required for this image.
docker build -f deploy/Dockerfile --build-arg INSTALL_EXTRAS=hdl -t sc-neurocore:hdl .

# Run interactive Python shell
make docker-run
# or: docker run --rm -it sc-neurocore:latest

# Smoke test via docker compose
docker compose -f deploy/docker-compose.yml up

Pre-built images are published to GHCR on every release:

docker pull ghcr.io/anulum/sc-neurocore:latest
docker run --rm -it ghcr.io/anulum/sc-neurocore:latest

Architecture

Module Tiers

pip install sc-neurocore ships Core + Simulation + Domain bridges only. Research and extended modules are available from source (pip install -e ".[dev]").

TierModulesShips in wheelStatus
Coreneurons, synapses, layers, sources, utils, recorders, accel, compiler, hdl_gen, hardware, cli, exceptionsYesProduction path; current CI coverage gate is 100%.
Simulationhdc, solvers, transformers, learning, graphs, ensembles, export, pipeline, profiling, models, math, spatial, verification, securityYesStable. Import explicitly.
Industrialsafety_cert, asic_flow, fault_injection, uvm_gen, hypervisor, digital_twin, chiplet, spintronic, memristor, analog_bridgeNoSource-only; see docs/MODULE_INTEGRATION.md for the historical 19-module integration slice.
Extended researchevo_substrate, meta_plasticity, bioware, federated, bci_studio, explainability, neuro_symbolic, stochastic_doctor, model_zooNoSource-only; see docs/MODULE_INTEGRATION.md for the historical 19-module integration slice.
Domain bridgesquantum (Qiskit/PennyLane), bridges/quantum_annealing (Ising/QUBO), adapters/holonomic (JAX), scpn (Petri nets)YesHeavy backends require the [quantum], [annealing], or [jax] extra
Researchrobotics, physics, bio, optics, chaos, sleep, interfacesNoTested. Available from source.
Speculativeresearch/ (eschaton, exotic, meta, post_silicon, transcendent)NoTheoretical. See research/README.md.

The source-only optics surface preserves its historical API through bounded photonic-emitter responsibility modules. FDTD, Meep, netlist, and GDSII work remain Python-only; the engine and executable Rust/Go/Julia/Mojo mirrors cover the coupled-mode crosstalk kernel only. Local timing evidence is explicitly non-isolated and is not a production-throughput claim.

The safety_cert package is a source-only, library-only safety-evidence organiser. It materialises hash-bound reports from explicit inputs; it does not issue certification or regulatory approval.

Architecture Diagram

graph TD
    subgraph "Python API (pip install sc-neurocore)"
        A[BitstreamEncoder] --> B[SCDenseLayer / SCConv2DLayer]
        B --> C[160 Python model classes<br/>156 Python model source modules]
        C --> NET[Network Engine<br/>Population · Projection · 3 Backends]
        C --> ID[Identity Substrate<br/>Persistent SNN · Checkpoint · Director]
        C --> D[STDP / R-STDP Synapses]
        D --> E[BitstreamSpikeRecorder]
    end

    subgraph "Acceleration"
        B --> F{Backend?}
        F -->|CPU| G[NumPy / Numba SIMD]
        F -->|GPU| H[CuPy CUDA]
        F -->|Rust| I[sc_neurocore_engine<br/>Brunel benchmark artefact: 39-202x vs Brian2<br/>193 Rust PyO3 wrappers · 166-model NetworkRunner]
        F -->|MPI| MPI[mpi4py distributed<br/>billion-neuron scale]
    end

    subgraph "Hardware Target"
        I --> J[IR Compiler]
        J --> K[SystemVerilog Emitter]
        J --> K2[MLIR/CIRCT Emitter]
        K --> L[Verilog RTL<br/>AXI-Lite + LIF Core]
        K2 --> L
        L --> M[FPGA Bitstream<br/>Xilinx / Intel]
        L --> V[Formal Verification<br/>61 proof jobs · catalogue + legacy]
    end

    subgraph "Domain Bridges (optional)"
        B --> N[SCPN Petri Nets]
        B --> O[Quantum Hybrid<br/>Qiskit / PennyLane]
        B --> P[HDC/VSA Symbolic Memory]
    end

    style A fill:#2d6a4f,color:#fff
    style I fill:#b5651d,color:#fff
    style L fill:#1a237e,color:#fff
    style M fill:#4a148c,color:#fff
    style O fill:#6a1b9a,color:#fff
    style V fill:#004d40,color:#fff

Core API subset (28 of 45 public exports)

from sc_neurocore import (
    # Neurons
    StochasticLIFNeuron, FixedPointLIFNeuron, FixedPointLFSR,
    FixedPointBitstreamEncoder, HomeostaticLIFNeuron,
    StochasticDendriticNeuron, SCIzhikevichNeuron,
    # Synapses
    BitstreamSynapse, BitstreamDotProduct,
    StochasticSTDPSynapse, RewardModulatedSTDPSynapse,
    # Layers
    SCDenseLayer, SCConv2DLayer, SCLearningLayer,
    VectorizedSCLayer, SCRecurrentLayer, MemristiveDenseLayer,
    SCFusionLayer, StochasticAttention,
    # Utilities
    BitstreamEncoder, BitstreamAverager, RNG,
    generate_bernoulli_bitstream, generate_sobol_bitstream,
    bitstream_to_probability,
    # Sources & Recorders
    BitstreamCurrentSource, BitstreamSpikeRecorder,
)

Hardware (Verilog RTL)

hdl/
  sc_bitstream_encoder.v      -- LFSR-based stochastic encoder (SEED_INIT param)
  sc_bitstream_synapse.v      -- AND-gate SC multiplier
  sc_mux_add.v                -- 2-input MUX (scaled addition)
  sc_cordiv.v                 -- CORDIV stochastic divider (Li et al. 2014)
  sc_dotproduct_to_current.v  -- Popcount -> fixed-point current
  sc_lif_neuron.v             -- Q8.8 leaky integrate-and-fire
  sc_firing_rate_bank.v       -- Spike rate estimator
  sc_dense_layer_core.v       -- Full dense layer pipeline (decorrelated seeds)
  sc_dense_matrix_layer.v     -- N×M weight matrix layer
  sc_axil_cfg.v               -- AXI-Lite register file
  sc_axil_cfg_param.v         -- Parameterized AXI-Lite register file
  sc_axis_interface.v         -- AXI-Stream bulk bitstream I/O
  sc_dma_controller.v         -- DMA for weight upload and output readback
  sc_cdc_primitives.v         -- Clock domain crossing (2-FF sync, Gray, async FIFO)
  sc_dense_layer_top.v        -- Dense layer top wrapper
  sc_neurocore_top.v          -- System top (DMA + AXI + layers)
  sc_aer_encoder.v            -- AER spike encoder (event-driven output)
  sc_event_neuron.v           -- Event-triggered LIF (power ∝ spike rate)
  sc_aer_router.v             -- AER event distribution to target neurons
  tb_sc_*.v (16 testbenches)  -- Self-checking simulation testbenches
  formal/ (61 proof jobs)     -- catalogue dual-axis perfect + legacy SC cores

Formal verification inventory: 61 SymbiYosys proof jobs and 199 formal statements (163 assert, 7 assume, 23 cover) under hdl/formal/ (18 non-catalogue jobs + 43 catalogue jobs under hdl/formal/catalogue/). This counts the git-tracked jobs a clean checkout proves; re-emit the generated catalogue harnesses with tools/emit_catalogue_formal.py.

GPU Acceleration

from sc_neurocore.accel import xp, HAS_CUPY, to_device, to_host
from sc_neurocore.accel.gpu_backend import gpu_vec_mac

# VectorizedSCLayer auto-detects GPU
layer = VectorizedSCLayer(n_inputs=32, n_neurons=64, length=1024)
output = layer.forward(input_values)  # GPU if CuPy available, else CPU

Hardware-Software Co-Simulation

The co-sim flow verifies bit-exact equivalence between the Python model and Verilog RTL:

# 1. Generate stimuli + expected results (Python golden model)
python scripts/cosim_gen_and_check.py --generate

# 2. Run Verilog simulation (requires Icarus Verilog)
iverilog -o tb_lif hdl/sc_lif_neuron.v hdl/tb_sc_lif_neuron.v
vvp tb_lif

# 3. Compare results
python scripts/cosim_gen_and_check.py --check

Reproducibility

Every GitHub Release includes:

  • wheel + sdist — Python distribution artifacts (dist/sc_neurocore-*)
  • SBOM — CycloneDX software bill of materials (sbom.json)
  • Changelog extract — release notes from CHANGELOG.md

Co-simulation traces are generated deterministically from fixed LFSR seeds. To reproduce a published benchmark:

git checkout v3.16.0
pip install -e ".[dev]"
python benchmarks/benchmark_suite.py --markdown > BENCHMARKS.md

For Verilog co-sim trace reproduction, see scripts/cosim_gen_and_check.py and the seed constants in hdl/sc_bitstream_encoder.v.

Key Technical Details

  • LFSR: 16-bit maximal-length, polynomial x^16+x^14+x^13+x^11+1, period 65535
  • Seed strategy: Input encoders 0xACE1 + i*7, weight encoders 0xBEEF + i*13
  • Fixed-point: Q8.8 (DATA_WIDTH=16, FRACTION=8), signed two's complement
  • Overflow: Explicit bit-width masking via _mask() function

Examples

Runnable scripts in examples/:

ScriptDescription
01_basic_sc_encoding.pyBernoulli & Sobol bitstream encoding/decoding
02_sc_neuron_layer.pySCDenseLayer construction, spike trains, and firing-rate summary
03_ir_compile_demo.pyIR graph building, verification, SystemVerilog emission (v3 Rust engine)
04_vectorized_layer.pyVectorizedSCLayer throughput benchmarking
05_scpn_stack.pyFull 7-layer SCPN consciousness stack with inter-layer coupling
06_hdl_generation.pyVerilog top-level generation from a network description
07_ensemble_consensus.pyMulti-agent ensemble orchestration and voting
08_hdc_symbolic_query.pyHyper-Dimensional Computing symbolic memory (v3 Rust engine)
09_safety_critical_logic.pyFault-tolerant Boolean logic with stochastic redundancy (v3 Rust engine)
10_benchmark_report.pyHead-to-head v2/v3 benchmark suite (v3 Rust engine)
11_sc_training_demo.pySurrogate-gradient training of an SC dense layer (v3 Rust engine)
12_load_pretrained_model.pyLoad pretrained ConvSpikingNet and classify MNIST digits
zenith_hybrid_resnet.pyTrain hybrid network with PyTorch autograd → save via Zenith exascale persistence
jax_training_demo.pyJAX JIT surrogate-gradient SNN training on synthetic data
mnist_fpga/demo.pyMNIST classifier: train → quantise Q8.8 → SC simulate → Verilog export
mnist_conv_train.pyConvSpikingNet: 99.49% MNIST (learnable beta/threshold, cosine LR; evidence in benchmarks/results/mnist_conv_accuracy_reproducibility.json)
mnist_surrogate/train.pySurrogate gradient SNN training (FastSigmoid/SuperSpike/ATan, ~95% MNIST)
nir_roundtrip_demo.pyNIR roundtrip: CubaLIF + recurrent connections, build → import → run → export
norse_nir_roundtrip.pyNorse → NIR → SC-NeuroCore roundtrip with real Norse weights
snntorch_nir_roundtrip.pysnnTorch RSynaptic → NIR → SC-NeuroCore roundtrip (CubaLIF + recurrent)
spikingjelly_nir_roundtrip.pySpikingJelly → NIR → SC-NeuroCore roundtrip
ann_to_snn_demo.pyConvert trained PyTorch ANN to rate-coded SNN
delay_training_demo.pyTrain spiking network with learnable per-synapse delays
PYTHONPATH=src:bridge python examples/01_basic_sc_encoding.py

Examples marked (v3 Rust engine) require an available sc_neurocore_engine bridge install. For source-tree runs against local bridge code, use PYTHONPATH=src:bridge or install bridge/ in the same environment.

CI/CD

20 GitHub Actions workflows (.github/workflows/), all third-party actions SHA-pinned:

WorkflowPurpose
audit-cadence.ymlScheduled repository, release-evidence, and policy audits
ci.ymlLint (ruff format + ruff check + bandit) + Test (Python 3.10-3.14, coverage gate enforced in CI) + Build
compiler-e2e.ymlCompiler end-to-end lowering, simulation, and evidence gates
v3-engine.ymlRust engine cargo test + cargo clippy
v3-wheels.ymlCross-platform wheels (Linux, macOS, Windows × Python 3.10–3.14)
docker.ymlBuild & push Docker image to GHCR on release tags
docs.ymlMkDocs → GitHub Pages
publish.ymlPublish sc-neurocore, engine wheels, and engine/ crate releases; retries skip already-published PyPI/crates.io versions
pypi-downloads.ymlDaily PyPI download history on the serialized metrics branch
release.ymlBuild sdist/SBOM/security packet, support tagged-release backfills, and attach release assets to GitHub Release
benchmark.ymlPerformance regression tracking
codeql.ymlCodeQL security analysis (weekly + on push)
fuzz.ymlRust engine fuzzing with nightly cargo-fuzz targets
mlir-circt.ymlMLIR/CIRCT canary for compiler lowering paths
nir-canary.ymlLatest NIR compatibility canary
scorecard.ymlOpenSSF Scorecard
security-scanners.ymlpip-audit, cargo-audit, Semgrep, and release security scans
pre-commit.ymlPre-commit hook validation
yosys-synth.ymlYosys HDL synthesis verification
stale.ymlAuto-label and close stale issues

Benchmarks

Run the benchmark suite:

python benchmarks/benchmark_suite.py           # quick mode
python benchmarks/benchmark_suite.py --full    # thorough (10x)
python benchmarks/benchmark_suite.py --markdown # output BENCHMARKS.md

Sample results (CPU, quick mode):

OperationThroughput
LFSR step2.25 Mstep/s
Bitstream encoder1.88 Mstep/s
LIF neuron step1.15 Mstep/s
vec_and (1024 words)45.67 Gbit/s
gpu_vec_mac (64x32x16w)6.15 GOP/s

Documentation

Live site: anulum.github.io/sc-neurocore

Build docs locally:

pip install mkdocs mkdocs-material mkdocstrings[python]
mkdocs serve

Install Extras

Start with the base package. It installs the Python package plus numpy and scipy; it does not install PyTorch, JAX, Qiskit, PennyLane, Lava, FastAPI, or hardware toolchains.

pip install sc-neurocore              # base package: core simulation, compiler, HDL scaffold
pip install sc-neurocore[minimal]     # explicit v4 minimal profile
pip install sc-neurocore[core]        # explicit base profile
pip install sc-neurocore[training]    # PyTorch-backed training
pip install sc-neurocore[nir]         # NIR import/export
pip install sc-neurocore[studio]      # local web studio
pip install sc-neurocore[bioware]     # biological closed-loop prototypes

Run the dependency-light smoke path with python examples/minimal_smoke_demo.py. It exercises root public imports, stochastic bitstreams, one LIF bitstream pass, and packaged Verilog primitive discovery without quantum, Lava, gdsfactory, PyTorch, JAX, or hardware-only dependencies.

Acceleration and research extras are intentionally opt-in:

pip install sc-neurocore[accel]       # Numba JIT experiments
pip install sc-neurocore[gpu]         # CuPy CUDA experiments
pip install sc-neurocore[jax]         # JAX-backed experiments
pip install sc-neurocore[quantum]     # research-grade Qiskit/PennyLane bridges
pip install sc-neurocore[annealing]   # dimod/neal parity for the Ising/QUBO bridge
pip install sc-neurocore[lava]        # Lava interop experiments
pip install sc-neurocore[research]    # plotting, graph, ONNX, and torch research stack
pip install sc-neurocore[full]        # local research environment only; pulls heavy extras

See Install Profiles before using full. The default package and FPGA scaffold flow do not require those heavy extras.

For development (includes all modules and source-only research code):

pip install -e ".[dev]"               # editable install with pytest, mypy, ruff, hypothesis

Pinned dependency files for reproducible environments:

pip install -r requirements.txt       # runtime only
pip install -r requirements-dev.txt   # runtime + dev tools

Rust Engine (193 PyO3 Wrappers, 166-Model NetworkRunner)

The sc_neurocore_engine crate provides 189 Rust PyO3 model wrappers callable from Python (including ArcaneNeuron), a 166-model NetworkRunner with Rayon-parallel population simulation (100K+ neurons), and SIMD-accelerated primitives with dispatch across five ISAs (AVX-512, AVX2, NEON, SVE, RISC-V V). Rust test totals are maintained by the Rust workspace; public release claims should cite the current cargo test -- --list output or CI evidence before publication.

CrateTestsPurpose
sc_neurocore_engineCI-listedPyO3 SIMD engine, Rust model wrappers, NetworkRunner
tinysc_riscv83RISC-V SC instruction set simulator
core_engine22SC arithmetic core (standalone)
autonomous_learning12Self-modifying plasticity rules
neuro_symbolic28Hyperdimensional computing + predictive coding
stochastic_doctor_core23Bitstream diagnostics engine
CategoryScope
PrimitivesBernoulli + Sobol bitstream, pack/unpack, popcount, SIMD (5 ISAs)
Neurons193 PyO3 model wrappers; 166 canonical models wired into NetworkRunner
NetworkRunner166-model fused simulation loop with CSR projections and Rayon parallelism
SynapsesStatic, STDP, Reward-STDP
LayersDense, Conv2D, Recurrent, Learning, Fusion, Memristive, Attention
NetworksBrunel, GNN, Spike recorder, Connectome, Fault injection
CompilerIR builder/parser/verifier, SystemVerilog + MLIR emitters, IR bridge
DomainHDC, Kuramoto, SSGF geometry
Training6 surrogate gradient functions + property tests

The NetworkRunner and formal inventories above are source-gated by tests/test_public_claims_metrics.py against supported_models(), git-tracked proof jobs, and HDL statements. The Studio figure is the current live list_models() inventory. These are different inventories and are intentionally not collapsed into one “model count”.

Community

Citation

If you use SC-NeuroCore in your research, please cite:

@software{sotek2026scneurocore,
  author    = {Šotek, Miroslav},
  title     = {SC-NeuroCore: A Deterministic Stochastic Computing Framework for Neuromorphic Hardware Design},
  version   = {3.16.0},
  year      = {2026},
  doi       = {10.5281/zenodo.18906614},
  url       = {https://github.com/anulum/sc-neurocore},
  license   = {AGPL-3.0-or-later}
}

See also CITATION.cff for the machine-readable citation metadata.

AI Disclosure

This project uses LLMs for advanced control mechanisms and GitHub handling. All output is reviewed, tested, and verified by the project author.

License

SC-NeuroCore is dual-licensed:

For commercial licensing enquiries, contact protoscience@anulum.li.


ANULUM      Fortis Studio
Developed by ANULUM / Fortis Studio