nox-py-dev
Skill553 starsChanged 5 months agoApache-2.0View on GitHub
Contribute to the Elodin Python SDK (nox-py). Use when editing PyO3 bindings in libs/nox-py/, adding new Python API surface, modifying the JAX integration, working on component/system compilation, or changing the Python package in python/elodin/.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bevySkill
- branch-regressionSkill
- elodin-alephSkill
- elodin-craneliftSkill
- elodin-dbSkill
- elodin-devSkill
- elodin-editor-devSkill
- elodin-headless-captureSkill
- elodin-monte-carloSkill
- elodin-nixSkill
- elodin-simulationSkill
- elodin-tracySkill
- gltf-asset-optimizationSkill
- kdl-to-python-schematicSkill
- qa-test-planSkill
- rustSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 107
Add PyO3 #[pyclass] bindings
- Very specific: line 109
Add Python-side type alias in python/elodin/__init__.py
- Distinctive: line 110
Test: spawn an entity with the component, verify it appears in the editor
- Very specific: line 115
Add the Python decorator in python/elodin/__init__.py
- Very specific: line 116
Ensure it composes with | (pipe operator)
- Distinctive: line 117
Test: write a simulation using the new decorator, verify output
- Very specific: line 121
Add the mode in exec.rs (or world_builder.rs for world-level API)
- Very specific: line 123
Add Python API in world_builder.rs
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
nox-py Development
nox-py is the Elodin Python SDK — PyO3 bindings that bridge Python simulations to the Rust ECS engine (in nox-py/src/), the NOX tensor compiler (→ cranelift / JAX), and Impeller telemetry.
Build & Test
just install py
# Run tests
pytest libs/nox-py/tests/
# Quick verification with an example
elodin editor examples/three-body/main.pyRebuild the wheel after any Rust changes. Python-only changes in python/elodin/ are picked up immediately.
Architecture
Python user code
│
▼
python/elodin/__init__.py ← Python API surface, decorators, Query/GraphQuery
│
▼
libs/nox-py/src/lib.rs ← PyO3 module registration
│
├── world_builder.rs ← World creation, spawn, run
├── system.rs ← System compilation pipeline
├── component.rs ← Component types and metadata
├── archetype.rs ← Archetype definitions
├── query.rs ← Query system (map, map_seq)
├── graph.rs ← GraphQuery and edge_fold
├── spatial.rs ← SpatialTransform, SpatialMotion, SpatialForce, SpatialInertia
├── entity.rs ← EntityId management
├── exec.rs ← WorldExec enum (Iree/Jax), profiling, DB integration
├── jax_exec.rs ← JaxExec, JaxWorldExec (JAX JIT per-tick execution)
├── step_context.rs ← StepContext for pre/post step callbacks
├── impeller_client.rs ← Impeller client for DB connection
├── asset.rs ← Mesh, Material, GLB asset handling
├── linalg.rs ← Linear algebra utilities
├── ukf.rs ← Unscented Kalman Filter
├── s10.rs ← S10 recipe integration
└── error.rs ← Error types and Python exception mapping
│
▼
libs/nox/ ← Tensor library, symbolic backend
│
▼
libs/cranelift-mlir/ ← Pure Rust StableHLO runtimePython API Surface
python/elodin/__init__.py
The main API module. Exports:
- Decorators:
@system,@map,@map_seq - Types:
World,Query,GraphQuery,Component,Archetype,Body - Spatial types:
SpatialTransform,SpatialMotion,SpatialForce,SpatialInertia,Quaternion - Built-in components:
WorldPos,WorldVel,Inertia,Force,WorldAccel - Utilities:
six_dof(),Panel,GraphEntity,Mesh,Material,Edge
python/elodin/jaxsim.py
JAX-only execution mode. Compiles the simulation world into pure JAX functions for RL training and jax.vmap batching.
python/elodin/egm08.py / python/elodin/j2.py
Earth gravity models. EGM08 is a high-fidelity spherical harmonics model; J2 is simple oblate Earth.
Key Rust Modules
world_builder.rs
Central orchestrator. Handles World.spawn(), World.insert(), World.run(), World.build(), World.to_jax(). This is where simulation execution modes branch.
system.rs
Compiles Python-defined systems into executable computations via cranelift (default) or JAX. Handles the @system, @map, @map_seq decorator logic on the Rust side. System composition (pipe |) is implemented here.
exec.rs
Defines WorldExec enum with Cranelift(CraneliftWorldExec) and Jax(JaxWorldExec) variants. Both implement the same interface for tick execution, profiling, and DB integration. The backend parameter in w.run() / w.build() selects between the cranelift and JAX execution modes.
jax_exec.rs
JAX backend: compiles Noxpr graph → jax.jit() callable, then executes each tick by calling the JAX function via PyO3. Slower than cranelift but supports all JAX operations and the GPU.
component.rs
Maps Python Component annotations to component schemas. Handles type inference, metadata, and the ComponentType / PrimitiveType hierarchy.
spatial.rs
PyO3 bindings for spatial vector algebra types. Each type wraps a nox tensor and exposes Python-friendly constructors, accessors, and arithmetic operators.
graph.rs
Graph query implementation. edge_fold is the core operation — it iterates edges, queries left/right entity components, and accumulates results.
Adding a New Feature
New Component Type
- Define the Rust type in
component.rsor a new module - Add PyO3
#[pyclass]bindings - Export in
lib.rsmodule registration - Add Python-side type alias in
python/elodin/__init__.py - Test: spawn an entity with the component, verify it appears in the editor
New System Decorator
- Implement the Rust compilation logic in
system.rs - Add the Python decorator in
python/elodin/__init__.py - Ensure it composes with
|(pipe operator) - Test: write a simulation using the new decorator, verify output
New Execution Mode
- Add the mode in
exec.rs(orworld_builder.rsfor world-level API) - Wire CLI support in
apps/elodin/if needed - Add Python API in
world_builder.rs
Dependencies
| Crate | Purpose |
pyo3 | Python ↔ Rust bindings |
numpy | NumPy array interop (via pyo3-numpy) |
| nox-py (Rust core) | ECS world, component storage, system execution |
nox | Tensor library, spatial math |
impeller | Telemetry protocol |
stellarator | Async runtime for DB connections |
tokio | Async runtime (for some I/O paths) |
Key References
- Full SDK documentation: libs/nox-py/README.md
- Python API reference: docs/public/content/reference/python-api.md
- nox-py Rust source: libs/nox-py/src/
- Impeller protocol: libs/impeller/
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

