Entity storage · engineered as a database

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.

01 / query
scenedb · spatial querySIMD · AVX2 / NEON
256 rows / page64B alignedarchetype ECSBundleedge-cachedAVX2NEONu64 handles6× f32 AABBWorld ↔ GPUdelta-syncswap-and-popGpuBufferRegistryscatter-writeC0 coreno allocation256 rows / page64B alignedarchetype ECSBundleedge-cachedAVX2NEONu64 handles6× f32 AABBWorld ↔ GPUdelta-syncswap-and-popGpuBufferRegistryscatter-writeC0 coreno allocation
02 / the stackselect a layer

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.

01

Storage

CPU · soa pages

Fixed-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.

CellStoragePagePageLayoutLivenessMask
03 / zero boilerplatederive, don't write

Wired, nothing

A / 01Spatial query
src/main.rs
1use pulsar_scenedb::{SpatialCell, Aabb, Handle};
2
3let mut cell = SpatialCell::new(256).unwrap();
4
5let handle: Handle = cell.alloc(Aabb {
6 min: [0.0, 0.0, 0.0],
7 max: [1.0, 1.0, 1.0],
8}).unwrap();
9
10let 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)
B / 02Derive macros
component.rs
1use pulsar_scenedb_derive::{SceneStore, Replicate};
2use pulsar_scenedb::Handle;
3use pulsar_scenedb::ReplicationEncoding::*;
4use pulsar_scenedb::ReplicationCondition::*;
5
6/// A fully wired engine component: SceneStore generates Pod + GPU
7/// 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],
14
15 /// Owned by the controlling client; the server re-broadcasts.
16 #[replicate(encoding = Pod, condition = ClientAuthority)]
17 look_direction: [f32; 2],
18
19 /// GPU mirror + network-replicated every frame (handle index only).
20 #[gpu]
21 #[replicate(encoding = GpuHandle, condition = Always)]
22 skinned_mesh: Handle,
23
24 /// One-shot RPC: play an animation on all clients.
25 #[replicate(encoding = Event, condition = Multicast)]
26 on_play_animation: AnimationEvent,
27}
28
29// On a World with a GPU mirror attached, #[gpu] fields auto-register on
30// first insert and flush inside step(); no manual dispatch calls.
31world.insert(world.spawn(), Character { ..Default::default() });
04 / deployopen source · MIT

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.