-
Notifications
You must be signed in to change notification settings - Fork 2
3 Topology Subsystem
Relevant source files
The following files were used as context for generating this wiki page:
The Topology Subsystem is responsible for constructing, validating, and representing the structural graph of spiking neural networks within synaptic-wiring. It provides the Compressed Sparse Row (CSR) adjacency structure [SynapticGraph], deterministic graph generators for classic network science models, rule-based wiring and polarity enforcement (such as Dale's Law), and versioned canonical hashing via [TopologyDigest].
Sources: [src/topology/mod.rs:1-22]()
The graph structure underlying the runtime mesh is represented in Compressed Sparse Row (CSR) format via SynapticGraph. This layout optimizes memory locality and traversal performance during spike propagation ticks. The representation builds directly from collections of SynapseDescriptor structs, enforcing neuron count bounds and validating edge integrity before exporting flat arrays suitable for host-device execution or zero-allocation runtime routing.
For details, see SynapticGraph and CSR Representation.
graph TD
A["SynapticDescriptorCollection"] -->| "SynapticGraph::from_descriptors" | B["SynapticGraph"]
B -->| "CSR Layout" | C["RowOffsets_CSR"]
B -->| "CSR Layout" | D["ColIndices_CSR"]
B -->| "CSR Layout" | E["Weights_And_Delays"]
B -->| "Export" | F["GPUArrayExport"]
subgraph "Code Entity Space"
B
C
D
E
F
end
subgraph "Natural Language Space"
A
end
Sources: [src/topology/mod.rs:11](), [src/topology/digest.rs:86-92]()
The subsystem includes a suite of deterministic topology generators that instantiate complex network structures. Supported models include small-world networks (generate_small_world), scale-free networks (generate_scale_free), Erdős-Rényi random graphs (generate_random), and multi-layered feedforward/recurrent architectures (generate_layered). These generators rely on golden-ratio deterministic hashing to ensure reproducible connectivity regardless of thread concurrency or execution platform.
For details, see Topology Generators.
graph TD
A["GeneratorParameters"] -->| "generate_small_world" | B["SynapticGraph"]
A -->| "generate_scale_free" | B
A -->| "generate_random" | B
A -->| "generate_layered" | B
subgraph "Code Entity Space"
B
A
end
Sources: [src/topology/mod.rs:10](), [src/topology/mod.rs:18-20]()
Wiring rules govern how neurons establish synaptic connections and how physiological constraints are applied. The module wiring_rules.rs supplies utilities such as apply_dale_polarity—which enforces Dale's Principle (neurons maintain a uniform excitatory or inhibitory neurotransmitter phenotype across all outgoing synapses)—and assign_delays, which allocates axonal propagation delays within configured minimum and maximum tick bounds.
For details, see Wiring Rules, Dale's Law and Delay Assignment.
graph TD
A["UnprocessedGraph"] -->| "apply_dale_polarity" | B["PolarityEnforcedGraph"]
B -->| "assign_delays" | C["FullyWiredGraph"]
subgraph "Code Entity Space"
A
B
C
end
Sources: [src/topology/mod.rs:12](), [src/topology/mod.rs:22]()
To support checkpoints, experiment replay, and cross-runtime verification, the subsystem implements a versioned SHA-256 canonical digest scheme via [TopologyDigest]. The digest calculates a deterministic hash over the logical graph structure, independent of CSR insertion order, map iteration variance, host endianness, or serialization formatting.
For details, see Topology Digest.
graph TD
A["SynapticGraph"] -->| "TopologyDigest::from_graph" | B["canonical_edges"]
B -->| "Sort & Encode" | C["HashPreprint_V1"]
C -->| "Sha256::digest" | D["TopologyDigest"]
subgraph "Code Entity Space"
A
B
C
D
end
Sources: [src/topology/digest.rs:78-92], [tests/topology_digest.rs:56-71]
- 1. Overview
- 1.1. Getting Started & Public API
- 1.2. Release History and Versioning
- 2. Core Runtime: SynapticMesh
- 2.1. Propagation APIs and Tick Semantics
- 2.2. Spike Delay Buffer (Ring Buffer)
- 2.3. Core Types and Error Model
- 2.4. Checkpointing and Serde State Restoration
- 3. Topology Subsystem
- 3.1. SynapticGraph and CSR Representation
- 3.2. Topology Generators
- 3.3. Wiring Rules, Dale's Law and Delay Assignment
- 3.4. Topology Digest
- 4. Sparse Maps and Channel Routing
- 4.1. ChannelRouter and RouterConfig
- 4.2. Neuromodulation and Plasticity
- 4.3. SparseSynapticMap (CSR)
- 5. Testing, Benchmarks and Quality Gates
- 5.1. Propagation Contract Tests
- 5.2. Checkpoint Resume Property Suite
- 5.3. Benchmarks and Unit Test Module
- 6. Build, CI and Project Tooling
- 6.1. Cargo Manifest, Profiles and Dependencies
- 6.2. CI Workflows and Packaging Validation
- 6.3. Code Quality, Licensing and Review Gates
- 7. Glossary