Runtime and benchmark
CSDK-Sim runs fixed-step box physics from a C99 API. A task defines bodies, a seed, an action budget and a success condition. The runtime applies actions, advances a known number of ticks and reports reward and termination.
Spatial Bench evaluates policies on matched scenarios and seeds. It projects test body poses into an authored scene and captures synchronized Metal color, metric depth and object IDs. Recorded actions can be replayed with fresh simulation state and compared against the recorded observations.
Run a task from Python
Download and extract the package for macOS 26.1 or later on Apple silicon. With Python 3 installed, run this from the directory containing the extracted CSDK-Sim folder. The sample uses the runtime’s built-in reach-target task.
Download Spatial SDK for macOS
PYTHONPATH="$PWD/CSDK-Sim/python" python3 - <<'PY'
from crescent_spatial import Sim
with Sim("CSDK-Sim/lib/libCrescentSpatial.dylib") as sim:
sim.reset(42)
sim.step(4)
view = sim.entities()
print("tick", view.step_index, "bodies", view.count)
sim.impulse(2, (1.5, 0.0, 0.0))
feedback = sim.step(4)
print("reward", feedback.reward)
PY
The C/C++ build links Crescent::Spatial from find_package(CrescentSpatial CONFIG REQUIRED). Set CMAKE_PREFIX_PATH to the extracted SDK. Read borrowed entity and camera views before stepping or closing the instance.
From World to a recorded run
Follow the editor walkthrough · Python and C API · Spatial Bench workflows
- Set up the scene in World. Place the camera, box colliders and target. The world supplies geometry, materials and lighting.
- Define the benchmark pair. Select the agent body and obstacle, set the target and seeds, then export a suite. A pair can change a single obstacle while holding the task and camera fixed.
- Run the policy. Use a local model or a compatible model endpoint. The runner records outcomes, camera fingerprints and actions for each episode.
- Verify and compare. Replay archived actions with the matching simulator, renderer and scene. Inspect the first shared camera input that produced a different decision.
The Editor Preview includes the experiment tools and the Metal renderer. The standalone Spatial SDK runs headless physics tasks from Python or C/C++.
Choose how a policy receives observations
Read entity observations or collision-camera planes from the standalone runtime. Call the fixed-step C API from your own process.
A trusted policy library borrows renderer buffers. The tested SmolVLM2 adapter can prepare and consume image input on Metal.
Send a camera frame to a compatible Chat Completions vision endpoint and validate the returned action. Replay uses the archived actions.
Closing Route benchmark
At a fixed tick, a blue barrier closes the route from the red cargo box to the green destination. The open and closing cases share starting conditions. This gives the evaluator one controlled change to observe.
On one Apple M4, four paired SmolVLM2 trials produced the same 84 camera inputs and actions across the tested paths. The optimized Metal adapter encoded each repeated image once and kept both original positions in the model input.
| Path | Median | P95 |
|---|---|---|
| Local HTTP | 388.7 ms | 419.0 ms |
| In-process CPU staging | 396.0 ms | 420.4 ms |
| Metal, two vision passes | 393.2 ms | 433.5 ms |
| Metal, one vision pass | 283.3 ms | 299.7 ms |
The two Metal modes use the same adapter and model files. Reusing the image encoding lowered the median about 28% on this run. The measured interval includes policy preparation and inference and begins after camera capture.
Download measured results and phase timingsWhat ships in the Spatial SDK
The archive contains the standalone libCrescentSpatial.dylib, C headers, CMake targets, Python bindings, a sample task and third-party license files. A relocated C99 client and independent-process replay were tested against the exported library.
The Editor Preview includes Spatial Bench and the renderer used for scene-backed Metal observations. Local vision runs use a compatible llama.cpp server, GGUF weights and a matching projector. Use the Spatial SDK archive for headless physics.
See developer packages