Your sceneis a .
SceneDB is a high-performance, cross-device ECS and spatial database built in Rust: a full archetype ECS on paged SoA storage, SIMD spatial queries, streaming residency, and network replication primitives baked into the data layer. One API for CPU-only and GPU-mirrored worlds: #[gpu] is a placement annotation on the same programming model.
Layers of
From the archetype ECS and cache-friendly pages to the frame phase machine, each layer is a bounded unit with a single responsibility, and the replication suite rides on top of the frame boundary.
Storage
CPU · soa pagesFixed-capacity pages of 256 rows with 64-byte aligned columns. Swap-and-pop compaction at frame boundaries rearranges physical rows without breaking stable u64 handles.
Wired, nothing
1use pulsar_scenedb::{SpatialCell, Aabb, Handle};23let mut cell = SpatialCell::new(256).unwrap();45let handle: Handle = cell.alloc(Aabb {6 min: [0.0, 0.0, 0.0],7 max: [1.0, 1.0, 1.0],8}).unwrap();910let mut results = vec![0u32; cell.rows_in_use() as usize];11let hit_count = cell.query_aabb(12 &Aabb { min: [-1.0; 3], max: [2.0; 3] },13 &mut results,14);15// results[0] == 0 (the handle's row passed the query)
1use pulsar_scenedb_derive::{SceneStore, Replicate};2use pulsar_scenedb::Handle;3use pulsar_scenedb::ReplicationEncoding::*;4use pulsar_scenedb::ReplicationCondition::*;56/// A fully wired engine component: SceneStore generates Pod + GPU7/// dispatch, Replicate generates the replication schema.8#[derive(SceneStore, Replicate, Default)]9#[repr(C)]10struct Character {11 /// Server-authoritative position, plain memcpy on the wire.12 #[replicate(encoding = Pod, condition = ServerAuthority)]13 position: [f32; 3],1415 /// Owned by the controlling client; the server re-broadcasts.16 #[replicate(encoding = Pod, condition = ClientAuthority)]17 look_direction: [f32; 2],1819 /// GPU mirror + network-replicated every frame (handle index only).20 #[gpu]21 #[replicate(encoding = GpuHandle, condition = Always)]22 skinned_mesh: Handle,2324 /// One-shot RPC: play an animation on all clients.25 #[replicate(encoding = Event, condition = Multicast)]26 on_play_animation: AnimationEvent,27}2829// On a World with a GPU mirror attached, #[gpu] fields auto-register on30// first insert and flush inside step(); no manual dispatch calls.31world.insert(world.spawn(), Character { ..Default::default() });
Store the worldin
Add the crate to your Cargo.toml and turn your scene into a database. Spatial queries, streaming residency, and replication included. No framework lock-in.