Skip to main content

Python SDK for Axicor Spiking Neural Network Engine — Zero-Copy UDP Data Plane

Project description

Axicor Python SDK

Official Python interface for the Axicor Spiking Neural Network (SNN) Engine.

CRITICAL: THE 10ms BUDGET & ZERO-GARBAGE LAW

Axicor operates on a hard real-time BSP (Barrier Synchronization) cycle. You have exactly 10ms to complete your observation-action loop.

You MUST NOT perform any heap allocations (creating new numpy arrays, tuples, or large objects) inside the hot loop. Triggering the Python Garbage Collector (GC) will cause a micro-stutter, resulting in dropped UDP packets and Biological Amnesia (loss of brain state).

Zero-Garbage Production Pattern

The Correct Way (Zero-Allocation)

import numpy as np
from axicor.encoders import PopulationEncoder

# 1. PRE-ALLOCATE everything outside the loop. Reused every tick.
encoder = PopulationEncoder(variables_count=4, neurons_per_var=16, batch_size=20)
# ✅ Pre-allocate buffer once
frame_buf = np.zeros(encoder.total_bytes + 20, dtype=np.uint8)

while True:
    obs = env.get_observation()
    # 2. ✅ encode_into() writes directly into the pre-allocated buffer
    # Offset=20 leaves space for the C-ABI ExternalIoHeader
    encoder.encode_into(obs, frame_buf, offset=20)
    
    # 3. Send via zero-copy UDP
    client.send(frame_buf)

The Wrong Way (Triggers GC)

while True:
    obs = env.get_observation()
    # ❌ WRONG: This creates a NEW array object every tick.
    # This triggers malloc() and will eventually force a GC pause.
    frame = encoder.encode(obs)
    client.send(frame)

Installation

pip install axicor-client

License

Dual-licensed under MIT or Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axicor_client-0.1.0.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axicor_client-0.1.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file axicor_client-0.1.0.tar.gz.

File metadata

  • Download URL: axicor_client-0.1.0.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for axicor_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3238d884276478c18b3d32fe21e07da7b3446b46b47b55482e73afd58cef15dc
MD5 d05bd42b935e90b834ce8a1f78c5a665
BLAKE2b-256 7a3de3927ea6837bf8397322b3c4f009713b490d377a7d0b911fc83bb0ba4125

See more details on using hashes here.

File details

Details for the file axicor_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: axicor_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for axicor_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa333b38418b03f6cf4fd61b56f4e19586f66c5a1bc0d64645da519d96644822
MD5 ca81b28749035720de3ecb49d38463c8
BLAKE2b-256 19a5aaa8d20c0bb1e93f8a19c4e40e742b20bcc5cbdfd18651ec236665cb3fc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page