# syntax-programmer/prp-engine architecture

> Architecture diagram of the GitHub repository syntax-programmer/prp-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/syntax-programmer/prp-engine
- Repository: https://github.com/syntax-programmer/prp-engine

## Overview

This is a modular C systems library: application code can use Forge’s entity-component-system API, Helix window management, Diopter’s rendering interfaces, and reusable core, container, allocator, and math facilities. The clearest documented runtime workflow is invoking FECS through its public API; its implementation references world and compiler internals. Helix exposes window operations backed by platform implementations. No README was provided, and many source files were not sampled, so the graph shows only relationships supported by the source index or excerpts; it does not assume a larger application flow.

Main entry points: [`Forge/Internals/FECS.c`](https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/FECS.c) (FECS runtime), [`Forge/Internals/World-Compiler/Src`](https://github.com/syntax-programmer/prp-engine/tree/main/Forge/Internals/World-Compiler/Src) (World compiler), [`Forge/Internals/FECS-World/World-Internals.h`](https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/FECS-World/World-Internals.h) (World internals), [`Math/Transcendental.h`](https://github.com/syntax-programmer/prp-engine/blob/main/Math/Transcendental.h) (Transcendentals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_forge["Forge ECS"]
  node_fecs_api["FECS API<br/>[FECS.h]"]
  node_fecs_runtime["FECS runtime<br/>[FECS.c]"]
  node_fecs_world["World internals<br/>[World-Internals.h]"]
  node_world_ops["World operations"]
  node_compiler["World compiler"]
  node_parser["World parser<br/>[Parser.c]"]
end

subgraph group_window["Helix Windows"]
  node_helix_api["Window API<br/>[Window.h]"]
  node_helix_window["Window operations<br/>[Window.c]"]
  node_window_backends["Platform backends"]
end

subgraph group_render["Diopter Rendering"]
  node_rhi["Rendering interface<br/>[DRHI.c]"]
  node_vulkan["Vulkan backend<br/>[Vulkan.c]"]
end

subgraph group_runtime["Core Runtime"]
  node_core_defs["Core definitions<br/>[Defs.h]"]
  node_platform["Platform support<br/>[Platform.h]"]
  node_diagnostics["Assertions<br/>[Assert.h]"]
  node_logging["Logging<br/>[Log.h]"]
  node_time["Time utilities<br/>[Time.h]"]
  node_threading["Threading<br/>[Thread.h]"]
end

subgraph group_memory["Memory Containers"]
  node_allocators["Allocators"]
  node_arrays["Array containers<br/>[Arr.h]"]
  node_dynamic_array["Dynamic arrays<br/>[DSArr.h]"]
  node_bitmap["Bitmaps<br/>[Bitmap.h]"]
  node_string_array["String arrays<br/>[StringArr.h]"]
  node_byte_buffer["Byte buffer<br/>[ByteBffr.h]"]
end

subgraph group_math["Math"]
  node_math_float["Scalar math<br/>[Float.h]"]
  node_math_trans["Transcendentals<br/>[Transcendental.h]"]
  node_math_vec2["2D vectors<br/>[Vec2.h]"]
  node_math_vec3["3D vectors<br/>[Vec3.h]"]
  node_math_vec4["4D vectors<br/>[Vec4.h]"]
  node_math_matrices["Matrices"]
  node_math_quat["Quaternions<br/>[Quat.h]"]
end

node_app(("Application code"))

node_app -->|"calls"| node_fecs_api
node_fecs_api -.->|"implemented by"| node_fecs_runtime
node_fecs_runtime -->|"uses"| node_fecs_world
node_fecs_runtime -->|"uses"| node_compiler
node_fecs_runtime -->|"implements"| node_fecs_api
node_fecs_runtime -->|"uses"| node_logging
node_parser -->|"uses internals"| node_compiler
node_app -->|"calls"| node_helix_api
node_helix_window -->|"implements"| node_helix_api
node_helix_window -->|"uses"| node_window_backends
node_app -.->|"uses"| node_rhi
node_app -.->|"uses"| node_vulkan
node_core_defs -->|"includes"| node_platform
node_core_defs -->|"uses types"| node_platform
node_fecs_runtime -->|"references"| node_fecs_world
node_fecs_world -->|"uses"| node_bitmap
node_fecs_world -->|"uses"| node_string_array
node_compiler -->|"uses internals"| node_fecs_world
node_compiler -->|"uses"| node_arrays
node_compiler -->|"uses"| node_byte_buffer
node_math_float -->|"uses"| node_math_trans
node_math_vec2 -->|"uses"| node_math_float
node_math_vec2 -->|"uses"| node_math_trans
node_math_vec3 -->|"uses"| node_math_float
node_math_vec3 -->|"uses"| node_math_trans
node_math_vec4 -->|"uses"| node_math_float
node_math_vec4 -->|"uses"| node_math_trans
node_math_matrices -->|"uses"| node_math_vec2
node_math_matrices -->|"uses"| node_math_vec3
node_math_matrices -->|"uses"| node_math_vec4
node_math_quat -->|"uses"| node_math_vec3
node_math_quat -->|"uses"| node_math_trans

click node_fecs_api "https://github.com/syntax-programmer/prp-engine/blob/main/Forge/FECS.h"
click node_fecs_runtime "https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/FECS.c"
click node_fecs_world "https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/FECS-World/World-Internals.h"
click node_world_ops "https://github.com/syntax-programmer/prp-engine/tree/main/Forge/Internals/FECS-World/Src"
click node_compiler "https://github.com/syntax-programmer/prp-engine/tree/main/Forge/Internals/World-Compiler/Src"
click node_parser "https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/World-Compiler/Src/Parser.c"
click node_helix_api "https://github.com/syntax-programmer/prp-engine/blob/main/Helix/Window.h"
click node_helix_window "https://github.com/syntax-programmer/prp-engine/blob/main/Helix/Internals/Window.c"
click node_window_backends "https://github.com/syntax-programmer/prp-engine/tree/main/Helix/Internals/Backends/Src"
click node_rhi "https://github.com/syntax-programmer/prp-engine/blob/main/Diopter/DiopterRHI/DRHI.c"
click node_vulkan "https://github.com/syntax-programmer/prp-engine/blob/main/Diopter/DiopterVulkan/Vulkan.c"
click node_core_defs "https://github.com/syntax-programmer/prp-engine/blob/main/Core/Defs.h"
click node_platform "https://github.com/syntax-programmer/prp-engine/blob/main/Core/Platform.h"
click node_diagnostics "https://github.com/syntax-programmer/prp-engine/blob/main/Core/Diagnostics/Assert/Assert.h"
click node_logging "https://github.com/syntax-programmer/prp-engine/blob/main/Core/Logging/Log.h"
click node_time "https://github.com/syntax-programmer/prp-engine/blob/main/Core/Time/Time.h"
click node_threading "https://github.com/syntax-programmer/prp-engine/blob/main/Core/Threading/Thread.h"
click node_allocators "https://github.com/syntax-programmer/prp-engine/tree/main/Allocators"
click node_arrays "https://github.com/syntax-programmer/prp-engine/blob/main/Containers/Arr.h"
click node_dynamic_array "https://github.com/syntax-programmer/prp-engine/blob/main/Containers/DSArr.h"
click node_bitmap "https://github.com/syntax-programmer/prp-engine/blob/main/Containers/Bitmap.h"
click node_string_array "https://github.com/syntax-programmer/prp-engine/blob/main/Containers/StringArr.h"
click node_byte_buffer "https://github.com/syntax-programmer/prp-engine/blob/main/Containers/ByteBffr.h"
click node_math_float "https://github.com/syntax-programmer/prp-engine/blob/main/Math/Float.h"
click node_math_trans "https://github.com/syntax-programmer/prp-engine/blob/main/Math/Transcendental.h"
click node_math_vec2 "https://github.com/syntax-programmer/prp-engine/blob/main/Math/Vector/Vec2.h"
click node_math_vec3 "https://github.com/syntax-programmer/prp-engine/blob/main/Math/Vector/Vec3.h"
click node_math_vec4 "https://github.com/syntax-programmer/prp-engine/blob/main/Math/Vector/Vec4.h"
click node_math_matrices "https://github.com/syntax-programmer/prp-engine/tree/main/Math/Matrix"
click node_math_quat "https://github.com/syntax-programmer/prp-engine/blob/main/Math/Quaternion/Quat.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fecs_api,node_fecs_runtime,node_fecs_world,node_world_ops,node_compiler,node_parser toneBlue
class node_helix_api,node_helix_window,node_window_backends toneAmber
class node_rhi,node_vulkan toneMint
class node_core_defs,node_platform,node_diagnostics,node_logging,node_time,node_threading toneRose
class node_allocators,node_arrays,node_dynamic_array,node_bitmap,node_string_array,node_byte_buffer,node_app toneIndigo
class node_math_float,node_math_trans,node_math_vec2,node_math_vec3,node_math_vec4,node_math_matrices,node_math_quat toneTeal
```

## Components

### Forge ECS

- [FECS API](https://github.com/syntax-programmer/prp-engine/blob/main/Forge/FECS.h): `Forge/FECS.h`
- [FECS runtime](https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/FECS.c): `Forge/Internals/FECS.c`
- [World internals](https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/FECS-World/World-Internals.h): `Forge/Internals/FECS-World/World-Internals.h`
- [World operations](https://github.com/syntax-programmer/prp-engine/tree/main/Forge/Internals/FECS-World/Src): `Forge/Internals/FECS-World/Src`
- [World compiler](https://github.com/syntax-programmer/prp-engine/tree/main/Forge/Internals/World-Compiler/Src): `Forge/Internals/World-Compiler/Src`
- [World parser](https://github.com/syntax-programmer/prp-engine/blob/main/Forge/Internals/World-Compiler/Src/Parser.c): `Forge/Internals/World-Compiler/Src/Parser.c`

### Helix Windows

- [Window API](https://github.com/syntax-programmer/prp-engine/blob/main/Helix/Window.h): `Helix/Window.h`
- [Window operations](https://github.com/syntax-programmer/prp-engine/blob/main/Helix/Internals/Window.c): `Helix/Internals/Window.c`
- [Platform backends](https://github.com/syntax-programmer/prp-engine/tree/main/Helix/Internals/Backends/Src): `Helix/Internals/Backends/Src`

### Diopter Rendering

- [Rendering interface](https://github.com/syntax-programmer/prp-engine/blob/main/Diopter/DiopterRHI/DRHI.c): `Diopter/DiopterRHI/DRHI.c`
- [Vulkan backend](https://github.com/syntax-programmer/prp-engine/blob/main/Diopter/DiopterVulkan/Vulkan.c): `Diopter/DiopterVulkan/Vulkan.c`

### Core Runtime

- [Core definitions](https://github.com/syntax-programmer/prp-engine/blob/main/Core/Defs.h): `Core/Defs.h`
- [Platform support](https://github.com/syntax-programmer/prp-engine/blob/main/Core/Platform.h): `Core/Platform.h`
- [Assertions](https://github.com/syntax-programmer/prp-engine/blob/main/Core/Diagnostics/Assert/Assert.h): `Core/Diagnostics/Assert/Assert.h`
- [Logging](https://github.com/syntax-programmer/prp-engine/blob/main/Core/Logging/Log.h): `Core/Logging/Log.h`
- [Time utilities](https://github.com/syntax-programmer/prp-engine/blob/main/Core/Time/Time.h): `Core/Time/Time.h`
- [Threading](https://github.com/syntax-programmer/prp-engine/blob/main/Core/Threading/Thread.h): `Core/Threading/Thread.h`

### Memory Containers

- [Allocators](https://github.com/syntax-programmer/prp-engine/tree/main/Allocators): `Allocators`
- [Array containers](https://github.com/syntax-programmer/prp-engine/blob/main/Containers/Arr.h): `Containers/Arr.h`
- [Dynamic arrays](https://github.com/syntax-programmer/prp-engine/blob/main/Containers/DSArr.h): `Containers/DSArr.h`
- [Bitmaps](https://github.com/syntax-programmer/prp-engine/blob/main/Containers/Bitmap.h): `Containers/Bitmap.h`
- [String arrays](https://github.com/syntax-programmer/prp-engine/blob/main/Containers/StringArr.h): `Containers/StringArr.h`
- [Byte buffer](https://github.com/syntax-programmer/prp-engine/blob/main/Containers/ByteBffr.h): `Containers/ByteBffr.h`

### Math

- [Scalar math](https://github.com/syntax-programmer/prp-engine/blob/main/Math/Float.h): `Math/Float.h`
- [Transcendentals](https://github.com/syntax-programmer/prp-engine/blob/main/Math/Transcendental.h): `Math/Transcendental.h`
- [2D vectors](https://github.com/syntax-programmer/prp-engine/blob/main/Math/Vector/Vec2.h): `Math/Vector/Vec2.h`
- [3D vectors](https://github.com/syntax-programmer/prp-engine/blob/main/Math/Vector/Vec3.h): `Math/Vector/Vec3.h`
- [4D vectors](https://github.com/syntax-programmer/prp-engine/blob/main/Math/Vector/Vec4.h): `Math/Vector/Vec4.h`
- [Matrices](https://github.com/syntax-programmer/prp-engine/tree/main/Math/Matrix): `Math/Matrix`
- [Quaternions](https://github.com/syntax-programmer/prp-engine/blob/main/Math/Quaternion/Quat.h): `Math/Quaternion/Quat.h`

### Other components

- **Application code**

## Connections

- Application code → FECS API: calls (evidence: `Forge/FECS.h`)
- FECS API → FECS runtime: implemented by (evidence: `Forge/Internals/FECS.c`)
- FECS runtime → World internals: uses (evidence: `Forge/Internals/FECS.c`)
- FECS runtime → World compiler: uses (evidence: `Forge/Internals/FECS.c`)
- FECS runtime → FECS API: implements (evidence: `Forge/Internals/FECS.c`)
- FECS runtime → Logging: uses (evidence: `Forge/Internals/FECS.c`)
- World parser → World compiler: uses internals (evidence: `Forge/Internals/World-Compiler/Src/Parser.c`)
- Application code → Window API: calls (evidence: `Helix/Window.h`)
- Window operations → Window API: implements (evidence: `Helix/Internals/Window.c`)
- Window operations → Platform backends: uses (evidence: `Helix/Internals/Window.c`)
- Application code → Rendering interface: uses
- Application code → Vulkan backend: uses
- Core definitions → Platform support: includes (evidence: `Core/Defs.h`)
- Core definitions → Platform support: uses types (evidence: `Core/Defs.h`)
- FECS runtime → World internals: references (evidence: `Forge/Internals/FECS.c`)
- World internals → Bitmaps: uses (evidence: `Forge/Internals/FECS-World/World-Internals.h`)
- World internals → String arrays: uses (evidence: `Forge/Internals/FECS-World/World-Internals.h`)
- World compiler → World internals: uses internals
- World compiler → Array containers: uses
- World compiler → Byte buffer: uses
- Scalar math → Transcendentals: uses (evidence: `Math/Vector/Vec2.h`)
- 2D vectors → Scalar math: uses (evidence: `Math/Vector/Vec2.h`)
- 2D vectors → Transcendentals: uses (evidence: `Math/Vector/Vec2.h`)
- 3D vectors → Scalar math: uses (evidence: `Math/Vector/Vec3.h`)
- 3D vectors → Transcendentals: uses (evidence: `Math/Vector/Vec3.h`)
- 4D vectors → Scalar math: uses (evidence: `Math/Vector/Vec4.h`)
- 4D vectors → Transcendentals: uses (evidence: `Math/Vector/Vec4.h`)
- Matrices → 2D vectors: uses (evidence: `Math/Matrix/Mat2/Mat2.h`)
- Matrices → 3D vectors: uses (evidence: `Math/Matrix/Mat3/Mat3.h`)
- Matrices → 4D vectors: uses (evidence: `Math/Matrix/Mat4/Mat4.h`)
- Quaternions → 3D vectors: uses (evidence: `Math/Quaternion/Quat.h`)
- Quaternions → Transcendentals: uses (evidence: `Math/Quaternion/Quat.h`)
