Skip to content

Tech Stack and Build

MasterLaplace edited this page Feb 27, 2026 · 3 revisions

Tech Stack & Build

Languages & Tools

Language / Tool Usage
C++23 Full engine — all 16 modules (-fno-rtti, -fno-exceptions)
C17 Linux kernel module (lpl_kmod.c), network protocol
Vulkan Rendering pipeline (ported from VkWrapper), ImGui integration
CUDA GPU physics kernels (legacy — port pending)
xmake Build system — orchestrates all modules as static libraries

Prerequisites

  • Linux with kernel headers (for the kernel module)
  • xmake ≥ 2.9.0
  • GCC 13+ or Clang 17+ (C++23 support)
  • Vulkan SDK (vulkan-headers, vulkan-loader, vulkan-hpp)
  • ImGui (auto-fetched by xmake with GLFW + Vulkan backends)
  • NVIDIA CUDA Toolkit (optional — automatic CPU fallback)

Repository Layout

LplPlugin/
├── xmake.lua             ← Root orchestrator (project settings, module includes)
├── core/                 ← Platform abstraction, types, assertions
│   ├── include/lpl/core/ ← Public headers
│   ├── src/              ← Implementation
│   └── xmake.lua         ← Module build config (lpl-core)
├── math/                 ← Vec3, Quat, Fixed32, CORDIC, BoundaryBox
├── memory/               ← PinnedAllocator, pool allocators
├── container/            ← FlatAtomicsHashMap, Morton encoding
├── concurrency/          ← ThreadPool, SpinLock
├── ecs/                  ← EntityRegistry, Partition (SoA chunks)
├── physics/              ← WorldPartition, collision, octree
├── net/                  ← UDP transport (kernel / socket), protocol
├── gpu/                  ← CUDA lifecycle, physics kernels (stubs)
├── input/                ← InputManager (keys, axes, neural)
├── render/               ← Vulkan pipeline, ImGui
├── audio/                ← Spatial audio (stub)
├── haptic/               ← Haptic feedback (stub)
├── bci/                  ← OpenBCI driver, FFT, SignalMetrics, Riemannian
│   ├── include/lpl/bci/
│   ├── src/
│   └── tests/
├── serial/               ← Serial port abstraction
├── engine/               ← Top-level facade (depends on ALL modules)
├── kernel/               ← Linux kernel module (lpl_kmod.c)
├── apps/                 ← Executables
│   ├── server/           ← lpl-server (headless, authoritative)
│   ├── client/           ← lpl-client (Vulkan desktop)
│   └── benchmark/        ← lpl-benchmark (CPU benchmark suite)
└── _legacy/              ← Previous-generation prototype (reference)
    ├── apps/
    ├── engine/
    ├── kernel/
    ├── plugins/
    ├── shared/
    ├── Makefile
    └── README.md

Each module follows the pattern: <module>/include/lpl/<module>/ for public headers, <module>/src/ for implementations, with .inl files for inline function bodies.

Build Targets

Target Command Description
All xmake build -j$(nproc) Build all 16 modules + 3 executables
Server xmake build lpl-server Headless authoritative server
Client xmake build lpl-client Vulkan desktop client
Benchmark xmake build lpl-benchmark CPU benchmark (ECS, physics, containers)
Clean xmake clean Remove all build artifacts
Reconfigure xmake f -c Clean configuration and cache

Build Modes

xmake f -m debug      # Debug symbols, no optimization, LPL_DEBUG
xmake f -m release    # -O fastest, stripped, NDEBUG
xmake f -m profile    # Debug symbols + -O fastest, LPL_PROFILE

Build Options

Option Description
--renderer=y/n Enable/disable Vulkan renderer (useful for headless server)
--cuda=y/n Enable/disable CUDA GPU physics kernels

Kernel Module Targets

xmake kmod-build      # Build the lpl_kmod.ko module
xmake kmod-install    # Load the module (insmod) and set /dev/lpl0 permissions
xmake kmod-uninstall  # Unload the module (rmmod)
xmake kmod-logs       # Show recent kernel logs
xmake kmod-clean      # Clean kernel build artifacts

Running

xmake run lpl-server
xmake run lpl-client
xmake run lpl-benchmark

Compiler Flags

Flag Rationale
-fno-rtti No runtime type information — smaller binary, faster dispatch
-fno-exceptions No C++ exceptions — deterministic control flow, zero overhead
VULKAN_HPP_NO_EXCEPTIONS Vulkan C++ bindings without exceptions
-std=c++23 Concepts, std::expected, consteval, structured bindings
-Werror -Wall -Wextra Zero-tolerance for warnings

Architecture | Next: Modules

Clone this wiki locally