Data Model
Stable object graph from App through Figure, 2D/3D axes, and series types. Python proxies mirror this hierarchy over IPC.
System topology, runtime modes, project structure, and core design decisions.
Full-size diagrams for runtime topology, rendering, data model, and live topics.
Stable object graph from App through Figure, 2D/3D axes, and series types. Python proxies mirror this hierarchy over IPC.
State mutations on the app thread become draw lists on the render thread. Uploads, SPIR-V shaders, and ImGui share the Vulkan swapchain pass.
Clients talk to spectra-backend, which owns session state and routes IPC to one or more spectra-window Vulkan agents.
How components are arranged in the default in-process binary versus the multiproc daemon + agent layout.
One build/spectra process owns UI managers, plot state, and the Vulkan render thread. Best for desktop apps and lowest latency.
Clients connect over Unix sockets to spectra-backend; window agents handle Vulkan and ImGui. Default for Python show() and orchestrated sessions.
| Mode | Description | When to Use |
|---|---|---|
| In-process | UI, renderer, and plotting state in one process | Desktop apps, low-latency interactive use |
| Multi-process | Backend daemon + window/agent processes via IPC protocol | Isolation, orchestration, Python-driven sessions |
| Condition | Mode |
|---|---|
AppConfig::socket_path is set | Multiproc (connects to spectra-backend) |
SPECTRA_SOCKET env var is set | Multiproc |
| Neither | Inproc (default, single-process) |
#ifdef).SPECTRA_RUNTIME_MODE, AppConfig::socket_path, or SPECTRA_SOCKET pick inproc vs multiproc at startup.
std::mutexWindowManagerFigureId typedef with FigureRegistry replaces positional indexingrequest_id correlation, seq ordering, snapshot + diffVK_ERROR_OUT_OF_DATE_KHRvkDeviceWaitIdle() inside the frame loopspectra/
├── include/spectra/ # Public headers: spectra.hpp, easy.hpp, math3d.hpp,
│ # plot_style.hpp, axes.hpp, axes3d.hpp, series.hpp,
│ # series3d.hpp, fwd.hpp, ...
├── src/
│ ├── core/ # Figure, Axes, Axes3D, Series, Series3D, layout, coords
│ ├── render/ # Renderer, TextRenderer, abstract Backend interface
│ │ └── vulkan/ # VulkanBackend, device, swapchain, pipeline, buffers,
│ │ # WindowContext
│ ├── gpu/shaders/ # GLSL 450: line, scatter, grid, text, surface3d, mesh3d
│ ├── anim/ # Animator, easing, frame scheduler, frame profiler
│ ├── ui/ # App, WindowManager, FigureManager, DockSystem,
│ │ # ThemeManager, CommandRegistry, ShortcutManager,
│ │ # UndoManager, TransitionEngine, TimelineEditor,
│ │ # KeyframeInterpolator, AnimationCurveEditor,
│ │ # CameraAnimator, ModeTransition, Inspector,
│ │ # DataInteraction, AxisLinkManager, DataTransform,
│ │ # RecordingExport, Workspace, PluginAPI, CsvLoader
│ ├── ipc/ # IPC protocol: message types, TLV codec, transport
│ ├── daemon/ # spectra-backend: FigureModel, SessionGraph,
│ │ # ClientRouter, ProcessManager
│ └── agent/ # spectra-window: agent main loop, snapshot→Figure
├── python/
│ ├── spectra/ # Python package: Session, Figure, Axes, Series,
│ │ # easy API, codec, transport
│ ├── examples/ # Python example scripts
│ └── tests/ # Python test suite (50+ tests)
├── examples/ # 40+ C++ example programs
├── tests/
│ ├── unit/ # 1,200+ unit tests (Google Test)
│ ├── golden/ # Golden image tests (2D + 3D phases)
│ ├── bench/ # Performance benchmarks (100+)
│ └── util/ # MultiWindowFixture, ValidationGuard, GpuHangDetector
├── docker/ # Docker Compose + Dockerfile
├── packaging/ # AppImage, AUR, Homebrew, shell completions
├── third_party/ # stb_image, stb_image_write, stb_truetype, VMA
├── plans/ # Architecture plans, roadmap, UI redesign spec
├── cmake/ # CompileShaders, EmbedShaders, EmbedAssets, config
├── .github/workflows/ # CI + Release pipeline
├── version.txt # Single source of truth: 0.1.0
├── Makefile # Developer workflow shortcuts
└── CMakeLists.txt # Root build configuration
WindowContext extraction, per-window swapchain, figure registry, tear-off UX.
Read plan →TLV protocol, session management, codec layers, backend daemon design.
Read plan →The codebase is organized into independent modules — see plans/agents_plan.md for the module decomposition.
std::mutexinclude/spectra/ minimal; implementation in src/ctest before submitting# Development workflow
make build test # Build + run tests
make format # clang-format
make pip-dev # Python dev install
cd docker && docker compose up --build spectra-xvfb