A Julia implementation of the concore file-based IPC protocol for closed-loop peripheral neuromodulation control systems.
This repository is the GSoC 2026 prototype for “A Reference Implementation for concore Library in Julia” under ControlCore-Project.
Mentors: Pradeeban Kathiravelu · Mayuresh Kothare · Rahul Jagwani
- Wire-compatible Julia implementation of concore protocol semantics
- Safe parser for cross-process input (
eval-free) - Multiple backends: file, docker-path, shared memory, ZeroMQ
- Compatibility API + explicit
ConCoreContextAPI - Tests, CI, benchmarks, and docs are in this repo
CONTROL-CORE coordinates controller/plant/observer processes through a minimal wire format:
[simtime, value1, value2, ...]
Python, C++, MATLAB, and Verilog implementations already exist. This project adds a Julia implementation for mixed-language studies.
| Feature | Status | Evidence |
|---|---|---|
| Wire compatibility | Implemented, tested | test/test_interop.jl, test/integration/test_wire_compat.jl |
Core protocol (concore_read, concore_write, initval, unchanged) |
Implemented, tested | test/test_protocol.jl, test/test_sync.jl |
| Config/params loading | Implemented, tested | test/test_config.jl |
| Shared memory backend | Implemented, tested | src/shm.jl, test/test_shm.jl |
| ZeroMQ backend | Implemented, tested | src/zmq.jl, test/test_zmq.jl |
| Context API | Implemented, tested | src/types.jl, test/test_context.jl |
| Benchmark harness | Implemented | benchmark/run_benchmarks.jl, benchmark/bench_python_compare.py |
Standalone concoredocker.jl parity |
In progress | standalone/concoredocker.jl |
- Core protocol:
concore_read,concore_write,initval,unchanged - Config loading from
concore.iport,concore.oport,concore.params - Safe numeric parser with numpy-wrapper handling
- Backends:
FileBackend(default)DockerBackend(absolute container paths)SharedMemoryBackend(Mmap)ZeroMQBackend(optional)
- APIs:
- Python-style globals (
Concore.simtime,Concore.delay) ConCoreContextfor explicit state isolation
- Python-style globals (
- Utilities: PID + GraphML parsing
- Observability: latency/throughput metrics collector
using Pkg
Pkg.activate(".")
Pkg.instantiate()using Concore
Concore.delay = 0.01
while Concore.simtime < Concore.maxtime
while unchanged()
ym = concore_read(1, "ym", "[0.0, 0.0]")
end
u = [2.0 * (100.0 - ym[1])]
concore_write(1, "u", u; delta=0)
endusing Concore
ctx = ConCoreContext(delay=0.01, maxtime=200)
while ctx.simtime < ctx.maxtime
while unchanged(ctx)
ym = concore_read(ctx, 1, "ym", "[0.0, 0.0]")
end
u = [2.0 * (100.0 - ym[1])]
concore_write(ctx, 1, "u", u; delta=0)
endDelta convention follows upstream usage: controllers typically use
delta=0; plant models typically usedelta=1.
Python (concore.py) |
Julia (Concore.jl) |
|---|---|
concore.read(port, name, initstr) |
concore_read(port, name, initstr) |
concore.write(port, name, val, delta) |
concore_write(port, name, val; delta) |
concore.initval(str) |
initval(str) |
concore.unchanged() |
unchanged() |
concore.simtime |
Concore.simtime |
concore_read / concore_write are intentionally prefixed to avoid shadowing Julia Base.read / Base.write.
src/
Concore.jl module entry point
protocol.jl read/write/initval/unchanged
parser.jl safe wire parser
types.jl backend and context types
config.jl ports/params/maxtime
docker.jl Docker backend + environment detection
shm.jl shared-memory backend
zmq.jl ZeroMQ backend
observability.jl metrics collector
ConcoreUtils.jl PID + GraphML utils
benchmark/ parser, I/O, loop, SHM, memory, latency, multiprocess
test/ unit + integration suites
demo/ standalone + cross-language demos
docs/ Documenter.jl docs
standalone/ single-file distributions
Run tests:
julia --project=. -e 'using Pkg; Pkg.test()'Build docs:
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
julia --project=docs/ docs/make.jlBenchmarks are reproducible via benchmark/:
julia benchmark/run_benchmarks.jl
julia benchmark/run_benchmarks.jl --with-pythonCurrent runs show Julia ahead on parser/format and loop hot paths (roughly
Numbers are prototype measurements; reproduce from the scripts above.
- Remove SHM remap overhead by keeping mappings alive
- Complete standalone
concoredocker.jlparity with Python interface - Finalize mixed-language Docker demo nodes
- Package benchmark methodology/results as a reproducible artifact
- Upstream integration to main concore dev branch
LGPL-2.1, aligned with upstream concore licensing.