How quantumdevteam/stellarengine works
1. Repository shape
StellarEngine is a monorepo split into three main product areas: Kernel, Engine, and SDK. The design is intentionally hypermodular: the same engine capabilities can be reused in runtime, tools, installers, and editor-like contexts rather than being locked into a single app shape.
2. Kernel = shared contract layer
Kernel/src/Stellar.Kernel defines the stable-facing abstractions and interfaces. It contains core contracts for data containers, registries, identifiers, labels, quantization, contexts, failures, file system access, logging, events, and task scheduling. This is the lowest common dependency for the rest of the repository.
3. Engine = concrete runtime implementations
Engine/src/Modules contains the actual managed implementations of those concepts. Stellar.Core is the main foundational runtime module and provides concrete data structures, global environment support, failure dispatching, registries, and entry-point behavior. Other managed modules build outward from there: file system, logging, event system, task system, time system, stage, network, physics, graphics, UI, assets, and audio.
4. Dependency direction
The dependency boundary is clear: Kernel defines the APIs, Engine implements them. This lets tools and future products depend on the contract layer without needing the full engine runtime, while engine modules can swap or extend implementations as the system evolves.
5. Cross-cutting runtime subsystems
Several systems are shared across the engine surface:
- LoggingSystem for logging formats, logger metadata, and runtime config.
- Failures for typed failure levels, dispatching, catches, and handlers.
- EventSystem for event buses, queues, handlers, and event context.
- TaskSystem for scheduling and threading abstractions.
- Data/Context/Registry for modular state and metadata storage.
These are the coordination backbone for higher-level modules.
6. File and asset boundaries
File access is modeled as a domain/provider abstraction in both Kernel and Engine. Stellar.FileSystem provides concrete providers such as assembly-backed and file-system-backed access. Asset-related configuration appears in the Kernel configuration area, suggesting project assets are a first-class pipeline concern rather than an ad hoc feature.
7. Native engine layer
The repository also includes native code under Engine/src/Native and Engine/src/NativeInterop. This is where platform-specific runtime pieces live, especially for graphics (DX12/OGL), windowing, and physics. The NativeInterop projects are the bridge between managed C# modules and native libraries, so the architecture has a managed core with native acceleration/support at the edges.
8. SDK = authoring, packaging, and project tooling
SDK/src is the developer tooling layer. It contains:
- Stellar.CLI for commands like info, versions, project creation, docs generation, template listing, and SDK installation.
- Stellar.Sdk MSBuild targets and props that integrate Stellar-specific project behavior into .NET builds.
- Stellar.Sdk.Tasks for project/config parsing and generation.
- Stellar.ProjectAnalyzer Roslyn analyzers that validate Stellar project patterns at compile time.
- Stellar.Tools for configuration object models used by tooling.
9. Project configuration and code generation flow
Tooling centers around Stellar project metadata and configuration files. The analyzer and MSBuild tasks read project configuration, validate entry-point usage, and generate build/runtime artifacts such as config or executable metadata. This means project structure is not purely convention-based; it is actively interpreted by the SDK toolchain.
10. Build, packaging, and distribution
Packaging scripts exist for the Engine, Kernel, SDK, CLI, and tools, and the repo includes a custom data/template area plus a workload manifest template. That indicates distribution is split across multiple packages rather than one monolithic release. version.props, the .stellar.project files, and the package scripts form the release/build boundary.
11. Runtime entry-point model
Both Kernel and Engine contain explicit entry-point and stop-context types. This suggests application startup is a controlled framework concern: modules participate through a Stellar entry-point contract rather than through arbitrary Main-style wiring. The analyzer in the SDK likely reinforces this model.
12. Overall diagram perspective
A good architecture diagram should show three tiers of responsibility:
- Kernel: interfaces/contracts and shared models.
- Engine: runtime implementations and native-backed modules.
- SDK: build-time, packaging, validation, and project-authoring tools.
The main data flow is from project configuration and build tooling into generated/runtime engine behavior, while runtime module communication flows through logging, failures, events, task scheduling, and registries.
Main entry points: Stellar.Kernel Contracts · Stellar.Core Core · Modules Feature Modules · Stellar.CLI CLI
Components 20
Kernel
Shared contracts, core models, and stable APIs.
- Contracts · Stable abstractions for data, context, registry, entry-point, failure, logging, files, events, and tasks.
Kernel/src/Stellar.Kernel - Project Config · Project and runtime configuration contracts, including assets and localization metadata.
Kernel/src/Stellar.Kernel/Configuration - Entry Point · Application startup and stop-context abstractions for controlled module launch.
Kernel/src/Stellar.Kernel/EntryPoint - Runtime APIs · Interfaces for data containers, registries, identifiers, labels, quantization, logging, failures, files, events, and tasks.
Kernel/src/Stellar.Kernel
Engine
Managed runtime modules plus native-backed subsystems.
- Core · Foundational managed runtime with data structures, environment support, failure dispatching, registries, and entry-point behavior.
Engine/src/Modules/Stellar.Core - File System · Concrete file access and provider implementations, including assembly-backed and filesystem-backed access.
Engine/src/Modules/Stellar.FileSystem - Logging · Logger formats, metadata, runtime config, and logging build/runtime integration.
Engine/src/Modules/Stellar.LoggingSystem - Failures · Typed failures, levels, dispatching, catches, and handlers.
Engine/src/Modules/Stellar.Core/Failures - Events · Event bus, queues, handlers, and event context infrastructure.
Engine/src/Modules/Stellar.EventSystem - Tasks · Task scheduling and threading abstractions for coordinated execution.
Engine/src/Modules/Stellar.TaskSystem - Data & Registry · Concrete data containers, contexts, identifiers, labels, and registries used across the runtime.
Engine/src/Modules/Stellar.Core/Data - Native Graphics · Native graphics kernels and API implementations for DX12, OpenGL, and window support.
Engine/src/Native - Native Physics · Native physics runtime and wrapper projects for platform-specific acceleration.
Engine/src/Native/Stellar.Native.Physics - Feature Modules · Higher-level managed modules such as stage, network, physics, graphics, UI, assets, audio, and time.
Engine/src/Modules
SDK
Build-time tooling, analyzers, and authoring support.
- CLI · Commands for project creation, documentation, versions, info, and SDK installation.
SDK/src/Stellar.CLI - MSBuild SDK · Props, targets, workload setup, and build integration for Stellar projects.
SDK/src/MSBuild/Stellar.Sdk - Build Tasks · Project parsing, config generation, executable generation, and MSBuild helper tasks.
SDK/src/MSBuild/Stellar.Sdk.Tasks - Project Analyzer · Compile-time validation of Stellar project patterns and entry-point usage.
SDK/src/Roslyn/Stellar.ProjectAnalyzer - Tools Models · Configuration objects and environment models consumed by SDK tooling.
SDK/src/Stellar.Tools - Templates · Template workload manifest and distribution data used by SDK and tooling packaging.
Data/Template/SDK
Connections 29
- Contracts → Runtime APIs: defines · Kernel surfaces stable runtime interfaces for all subsystems.
- Contracts → Project Config: includes · Configuration contracts live alongside the core API boundary.
- Contracts → Entry Point: includes · Entry-point and stop-context contracts define controlled startup.
- Core → Data & Registry: owns · Core provides the concrete data and registry backbone.
- Core → Failures: dispatches · Core includes failure dispatching and handler orchestration.
- Core → Events: coordinates · Event handling is part of the runtime coordination layer.
- Core → Tasks: schedules · Task scheduling is exposed as a first-class runtime service.
- Core → File System: uses · Core depends on file access abstractions and providers.
- Core → Logging: uses · Core and modules rely on shared logging infrastructure.
- Feature Modules → Core: builds on · Feature modules extend the foundational runtime.
- Feature Modules → Native Graphics: bridges · Graphics-related features connect to native rendering backends.
- Feature Modules → Native Physics: bridges · Physics features connect to native physics backends.
- File System → Contracts: implements · Managed file system providers implement Kernel file contracts.
- Logging → Contracts: implements · Logging runtime fulfills Kernel logging contracts.
- Failures → Contracts: implements · Failure types and dispatching implement the shared failure API.
- Events → Contracts: implements · Event buses, handlers, and contexts implement event contracts.
- Tasks → Contracts: implements · Task scheduler and thread abstractions implement task contracts.
- Data & Registry → Contracts: implements · Data containers, context, registry, identifier, and label structures implement shared contracts.
- Native Graphics → File System: loads · Native graphics pieces are packaged and consumed through engine runtime boundaries.
- Native Physics → Core: supports · Native physics supports the managed runtime layer.
- MSBuild SDK → Contracts: targets · Build integration consumes the Kernel contract layer.
- Build Tasks → Tools Models: parses · Tasks operate on tooling configuration models.
- Build Tasks → Project Config: reads · Build tasks interpret Stellar project configuration.
- Project Analyzer → Entry Point: validates · Analyzer enforces Stellar entry-point conventions.
- Project Analyzer → Project Config: validates · Analyzer checks project configuration shape and usage.
- CLI → Build Tasks: invokes · CLI commands reuse project generation and parsing logic.
- CLI → MSBuild SDK: supports · CLI supports SDK installation and project workflow.
- MSBuild SDK → Templates: packages · MSBuild integration uses template and workload assets for distribution.
- CLI → Templates: scaffolds · Project creation and docs commands rely on template data.