-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Goal: Build a real Sword Art Online (SAO) β a FullDive VR experience where the boundary between physical and virtual worlds disappears, driven by real neural signals.
LplPlugin is a high-performance, data-oriented closed-loop BCI platform written in C++23 (with C for the kernel module). It is organized as 20 independent modules built by xmake, combining a Linux kernel module for zero-copy UDP ingestion, a full ECS simulation engine, a software + Vulkan renderer, and a standalone BCI module (OpenBCI Cyton, 8ch/250Hz) that computes scientifically-grounded neural metrics in real time β feeding back into the simulation loop.
| Metric | Value |
|---|---|
| Language | C++23 (-fno-rtti, -fno-exceptions) |
| Build System | xmake 2.9+ |
| Modules | 20 static libraries + 3 executables |
| Frame time | 62.55 Β΅s average (Phase 1 milestone) |
| Packet loss | 0.00% (1000/1000) |
| Throughput | ~495 pkt/s |
| Physics (50 entities) | 0.055 ms/frame |
| BCI channels | 8 ch / 250 Hz (OpenBCI Cyton) |
| Renderer | Software rasterizer + Vulkan backend |
| Unit tests | 24 / 24 β |
[OpenBCI Cyton β 8 ch / 250 Hz] βββββββββββββββββββββββββββββββ
β USB serial / raw parse [bci/ module]
FFT + SignalMetrics R(t) + RiemannianGeometry Ξ΄_R + D_M
NeuralMetrics::from_state() β ECS ComponentID::NEURAL
β ββββββββββββββββββββββββββββββββββββββββββββββββββ
UDP Packet (port 7777) [net/ + kernel/]
β
Netfilter Hook (kernel module β NF_INET_PRE_ROUTING)
β
RxRingBuffer (mmap'd LplSharedMemory, atomic head/tail)
β
Network::network_consume_packets() β dispatch to WorldPartition chunks
β
SystemScheduler ECS (auto DAG: RingConsume β ClientIO β Physics β Neural)
β
WorldPartition::step()
ββ GPU path: CUDA kernel (PhysicsKernel.cu)
ββ CPU path: physicsTick (current)
β
Inter-chunk migration (backward iteration + swap-and-pop)
β
swapBuffers() β atomic writeβread toggle
β
Network::broadcast_state() β TxRingBuffer β ioctl kick β kernel TX thread β UDP
LplPlugin/
βββ core/ β Platform abstraction, types, assertions, logging
βββ math/ β Vec3, Quat, Fixed32, CORDIC, BoundaryBox
βββ memory/ β PinnedAllocator (CUDA zero-copy), pool allocators
βββ container/ β FlatAtomicsHashMap, Morton encoding, sparse sets
βββ concurrency/ β ThreadPool, SpinLock, atomic utilities
βββ ecs/ β Entity registry, Partition (SoA double-buffered chunks)
βββ physics/ β WorldPartition, collision (AABB, octree broadphase)
βββ net/ β UDP transport (kernel driver / socket fallback), protocol
βββ gpu/ β CUDA physics kernels, GPU lifecycle
βββ input/ β InputManager (keys, axes, neural state per entity)
βββ platform/ β Host backends (clock/display/gpu-memory/input)
βββ render/ β Software + Vulkan renderer, ImGui integration
βββ image/ β 2D software imaging (Surface, Painter, Codec)
βββ scene/ β Scene graph (Scene, Transform2D)
βββ audio/ β Spatial audio (stub)
βββ haptic/ β Haptic/vestibular feedback (stub)
βββ bci/ β OpenBCI driver, FFT, DSP, SignalMetrics, Riemannian, calibration
βββ serial/ β State serialization & deterministic replay
βββ bench/ β Benchmark harness
βββ engine/ β Top-level facade aggregating all modules, game loop
βββ kernel/ β Linux kernel module (lpl_kmod.c)
βββ apps/ β Executables (lpl-server, lpl-client, lpl-benchmark)
βββ samples/ β Example code
Each module is a static library (lpl-<name>) with include/lpl/<name>/ headers and src/ implementations.
- Vision & Objectives β Ultimate goal, scientific ambition, motivation
- Philosophy & Principles β Core design principles (DOD, Zero-Copy, Server-Authoritativeβ¦)
- Architecture β Zero-copy pipeline, memory layout, double buffering, client-server protocol
- Tech Stack & Build β xmake, C++23, prerequisites, build targets
- Modules β All 20 modules (core through engine)
- Architectural Decisions β ADRs with rationale and benchmarks
- Performance Results β Network metrics, frame timing, CPU benchmarks
- Implementation Status β Feature matrix and completion scores
- Executables β Server, client, benchmark
- Roadmap β Phases 1β5 with success criteria
- Future Ideas β RTOS, advanced physics, BCI, NeRF, server meshingβ¦
- Scientific Contributions β Proposed publications, original contributions
- Lessons Learned β Performance, kernel dev, architecture and methodology insights
- References β Inspirations, technologies, academic references
LplPlugin β Zero-Copy Real-Time VR Engine | Author: MasterLaplace | License: GPL-3.0 | Source Code
This project is a marathon, not a sprint.