Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Crate map

Where things live, in order of dependency depth.

  • Document — Khora Crate Map v1.0
  • Status — Authoritative
  • Date — May 2026

Contents

  1. The graph at a glance
  2. Foundation crates
  3. Data crates
  4. Lane and agent crates
  5. Control and infrastructure
  6. Public API
  7. Editor
  8. Where things live
  9. Open questions

01 — The graph at a glance

graph LR
    subgraph User
        SDK[khora-sdk]
        ED[khora-editor]
    end
    subgraph Engine
        CTRL[khora-control]
        AGT[khora-agents]
        LANE[khora-lanes]
        IO[khora-io]
        DATA[khora-data]
        CORE[khora-core]
        INFRA[khora-infra]
        TELE[khora-telemetry]
    end
    subgraph Support
        MACRO[khora-macros]
        PLUG[khora-plugins]
    end
    SDK --> CTRL
    SDK --> AGT
    SDK --> IO
    SDK --> INFRA
    SDK --> TELE
    SDK --> DATA
    CTRL --> CORE
    AGT --> CORE
    AGT --> DATA
    AGT --> LANE
    AGT --> IO
    LANE --> CORE
    LANE --> DATA
    IO --> CORE
    IO --> DATA
    IO --> TELE
    DATA --> CORE
    DATA --> MACRO
    INFRA --> CORE
    INFRA --> DATA
    TELE --> CORE
    ED --> SDK
    ED --> AGT
    ED --> IO

Dependencies flow downward only.

02 — Foundation crates

khora-core

The trait floor. Everything builds on it; it depends on nothing else in the workspace.

ModuleContents
lane/Lane trait, LaneContext, slots and refs
agent/Agent trait, AgentId, ExecutionTiming
math/Vec2/3/4, Mat3/4, Quat, Aabb, LinearRgba
physics/PhysicsProvider trait, body and collider types
audio/AudioDevice trait
asset/, vfs/Asset trait, VirtualFileSystem
ui/LayoutSystem trait
scene/Scene file format, serialization types
control/gorna/GORNA types — NegotiationRequest/Response, ResourceBudget
service_registry.rs, context.rsServiceRegistry, EngineContext
renderer/error.rsError hierarchy

khora-macros

Procedural macros. Today: #[derive(Component)], which generates the SerializableX mirror struct, From conversions, and inventory registration glue.

03 — Data crates

khora-data

The ECS and component storage layer.

ModuleContents
ecs/World, Archetype, Query, Page, SemanticDomain, EcsMaintenance
ecs/components/Standard components and the register_components! macro
ui/UI components (UiTransform, UiColor, UiText, UiImage, UiBorder)
assets/Assets<T> registry, AssetHandle<T>
allocators/SaaTrackingAllocator — heap allocation tracking

khora-io

Asset and serialization services. Sits between data storage and the agents that need them.

ModuleContents
vfs/VirtualFileSystem (UUID → metadata, O(1))
asset/AssetService, AssetIo trait, FileLoader, PackLoader, DecoderRegistry
serialization/SerializationService, three strategies (Definition, Recipe, Archetype)

04 — Lane and agent crates

khora-lanes

The hot-path workers. Every algorithm lives here.

FolderLanes
render_lane/SimpleUnlitLane, LitForwardLane, ForwardPlusLane, ShadowPassLane, UiRenderLane, ExtractLane
render_lane/shaders/WGSL files: lit_forward.wgsl, shadow_depth.wgsl, simple_unlit.wgsl, standard_pbr.wgsl, forward_plus.wgsl, ui.wgsl
physics_lane/StandardPhysicsLane, PhysicsDebugLane
audio_lane/SpatialMixingLane
asset_lane/loading/Per-format decoders: glTF, OBJ, WAV, Symphonia (Ogg/MP3/FLAC), texture, font, pack
scene_lane/TransformPropagationLane, scene serialization lanes
ui_lane/StandardUiLane (Taffy layout)
ecs_lane/CompactionLane

khora-agents

Five agents — one per LaneKind.

AgentFolderLaneKind
RenderAgentrender_agent/Render
ShadowAgentshadow_agent/Shadow
UiAgentui_agent/Ui
PhysicsAgentphysics_agent/Physics
AudioAgentaudio_agent/Audio

Plus PhysicsQueryService — an on-demand wrapper over PhysicsProvider for raycasts and debug geometry.

05 — Control and infrastructure

khora-control

The cold-path brain.

ModuleContents
service.rsDccService — agent lifecycle, tick loop
gorna/GornaArbitrator — budget fitting algorithm
analysis.rsHeuristicEngine — nine heuristics, death-spiral detection
scheduler.rsExecutionScheduler — hot-path orchestration
budget_channel.rsBudgetChannel — cold→hot pipe
plugin.rsEnginePlugin — extensible per-phase hooks

khora-infra

Backends. One subfolder per backend, each implementing a khora-core trait. The wgpu, Rapier, CPAL, Taffy choices below are current defaults — alternative backends drop in as new sibling folders without touching the rest of the engine.

FolderBackendImplements
graphics/wgpu/wgpu 28.0RenderSystem (WgpuRenderSystem, WgpuDevice)
physics/rapier/Rapier3DPhysicsProvider
audio/cpal/CPALAudioDevice
ui/taffy/TaffyLayoutSystem
platform/window/winitWindow creation, event loop
platform/input.rswinitInputEvent translation
telemetry/Native APIsGpuMonitor, MemoryMonitor, VramMonitor

khora-telemetry

Observability infrastructure.

ModuleContents
service.rsTelemetryService
metrics/MetricsRegistry, MonitorRegistry

06 — Public API

khora-sdk

The user-facing surface. Everything else is implementation detail.

ModuleContents
lib.rsRe-exports + prelude. Defines WindowConfig, WindowIcon, PRIMARY_VIEWPORT
engine.rsEngineCore — the engine type
game_world.rsGameWorld — safe ECS facade
traits.rsEngineApp, AgentProvider, PhaseProvider, WindowProvider
vessel.rsVessel builder + spawn_plane / spawn_cube_at / spawn_sphere helpers
winit_adapters.rsrun_winit entry point + WinitWindowProvider (default winit-based window)
prelude/Curated re-exports — prelude::*, prelude::ecs::*, prelude::math::*, prelude::materials::*

The walkthrough is in SDK quickstart. The full API surface is in SDK reference.

07 — Editor

khora-editor

The editor application. Built on the SDK, but reaches deeper for performance.

FolderContents
panels/Scene tree, properties, asset browser, viewport, console, GORNA stream
gizmos/Move / rotate / scale, selection outline
ops/High-level scene operations (spawn, despawn, parent, add component)
scene_io/Scene save / load via SerializationService

Visual language and panel anatomy in Editor design system.

08 — Where things live

A flat lookup table for “I want to find X.”

ConcernCrate / module
Lane traitkhora-core::lane
Agent traitkhora-core::agent
Math typeskhora-core::math
GORNA typeskhora-core::control::gorna
ECS World and componentskhora-data::ecs
Tracking allocatorkhora-data::allocators
VFS and asset loadingkhora-io
Serialization strategieskhora-io::serialization
Render pipelineskhora-lanes::render_lane
WGSL shaderskhora-lanes::render_lane::shaders
Physics laneskhora-lanes::physics_lane
Audio laneskhora-lanes::audio_lane
Scene transformskhora-lanes::scene_lane
Agent implementationskhora-agents
Scheduler and GORNAkhora-control
wgpu backendkhora-infra::graphics::wgpu
Rapier backendkhora-infra::physics::rapier
CPAL backendkhora-infra::audio::cpal
Taffy backendkhora-infra::ui::taffy
Resource monitorskhora-infra::telemetry
User-facing APIkhora-sdk
Editor UIkhora-editor
Sandbox appexamples/sandbox

09 — Open questions

  1. Should khora-editor depend on khora-sdk only? Today it reaches into khora-agents and khora-io for performance. Justified, but a violation of the “SDK is the public API” principle.
  2. Plugin crate scope. khora-plugins exists but its API is in flux. Editor extensibility, scripting, and runtime plugin loading all share this crate’s eventual surface.

Next: the data layer that everything sits on. See ECS — CRPECS.