-
Notifications
You must be signed in to change notification settings - Fork 2
2 Core Runtime SynapticMesh
Relevant source files
The following files were used as context for generating this wiki page:
The SynapticMesh is the primary top-level orchestrator of the synaptic-wiring codebase, defined in [src/mesh.rs:37-63](). It bridges structural network topology with temporal delay mechanics, converting instantaneous source spikes into time-delayed synaptic currents over discrete simulation ticks.
This page serves as a high-level parent guide to the core runtime subsystem. Detailed technical breakdowns, API contracts, ring buffer mechanics, error handling, and serialization are documented in the respective child sections below.
The runtime coordinates three principal components: the SynapticMesh orchestrator itself, the SynapticGraph topology container, and the SpikeDelayBuffer ring buffer.
graph TD
SM["SynapticMesh"] --> SG["SynapticGraph"]
SM --> SDB["SpikeDelayBuffer"]
SM --> T["TickCounter"]
subgraph Code_Entities
SM["SynapticMesh (src/mesh.rs)"]
SG["SynapticGraph (src/topology/graph.rs)"]
SDB["SpikeDelayBuffer (src/delay.rs)"]
end
Sources: src/mesh.rs:37-63, src/topology/graph.rs:1-50, src/delay.rs:1-50
The core execution path is driven by propagate, propagate_into, and graded variant methods that advance the network simulation by a single tick [src/mesh.rs:174-200]. These APIs support zero-allocation execution paths for fixed-rate simulation loops by allowing callers to reuse pre-allocated output buffers.
For full details on return contracts, zero-allocation requirements, and error atomicity, see Propagation APIs and Tick Semantics.
Sources: src/mesh.rs:174-200
Temporal axonal delays are managed via a dedicated ring buffer implementation located in [src/delay.rs](). This component handles the injection of incoming spikes, advancement of the ring pointer per tick, and the draining of delayed spikes ready for synaptic integration. It enforces strict capacity and max_delay validation rules.
For full details on the buffer design, inject/drain algorithms, and capacity bounds, see Spike Delay Buffer (Ring Buffer).
Sources: src/delay.rs:1-100
Underpinning the runtime are fundamental descriptors and type definitions located in [src/types.rs]() and [src/error.rs](). These include identifiers like NeuronId, Polarity, DelayTicks, structural SynapseDescriptor configurations, and the unified MeshError enumeration governing fallible operations.
For full details on descriptor fields, type constraints, and error variants, see Core Types and Error Model.
Sources: src/types.rs:1-50, src/error.rs:1-50
SynapticMesh implements serde::Serialize and serde::Deserialize via proxy structures to support deterministic checkpointing and state restoration [src/mesh.rs:30-116]. Deserialization routines perform strict invariant validation, ensuring that neuron counts match, buffer capacities satisfy maximum delays, and simulation timestamps are synchronized.
For full details on proxy layouts, deserialization validation, and JSON/postcard formats, see Checkpointing and Serde State Restoration.
Sources: src/mesh.rs:30-116
sequenceDiagram
participant Caller as "Caller"
participant Mesh as "SynapticMesh"
participant Buffer as "SpikeDelayBuffer"
participant Graph as "SynapticGraph"
Caller->>Mesh: "propagate(spikes)"
Mesh->>Buffer: "advance_and_drain()"
Buffer-->>Mesh: "active_spikes"
Mesh->>Graph: "csr_matrix_multiplication()"
Graph-->>Mesh: "synaptic_currents"
Mesh->>Buffer: "inject(new_spikes)"
Mesh-->>Caller: "currents_vector"
Sources: src/mesh.rs:174-250, src/delay.rs:50-150, src/topology/graph.rs:50-120
- 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