Skip to main content

murk_obs/
lib.rs

1//! Observation specification and extraction for Murk simulations.
2//!
3//! Defines the observation spec ([`ObsSpec`]) that describes how to
4//! extract flat observation tensors from simulation state for
5//! reinforcement learning agents, and the compiled [`ObsPlan`] that
6//! executes the extraction against any [`SnapshotAccess`](murk_core::SnapshotAccess)
7//! implementor.
8//!
9//! # Architecture
10//!
11//! ```text
12//! ObsSpec ──compile()──► ObsPlan ──execute()──► &mut [f32] + ObsMetadata
13//!    ↓                     ↓
14//!  entries             gather_ops     (pre-computed field indices)
15//!  regions             transforms     (applied at gather time)
16//! ```
17//!
18//! The observation pipeline is decoupled from the arena (Decision N):
19//! `ObsPlan` reads through `&dyn SnapshotAccess`, not `ReadArena` directly.
20
21#![deny(missing_docs)]
22#![deny(rustdoc::broken_intra_doc_links)]
23#![forbid(unsafe_code)]
24
25pub mod cache;
26pub mod flatbuf;
27pub mod geometry;
28pub mod metadata;
29pub mod plan;
30pub mod pool;
31pub mod spec;
32
33pub use cache::ObsPlanCache;
34pub use metadata::ObsMetadata;
35pub use plan::{ObsPlan, ObsPlanResult};
36pub use spec::{ObsDtype, ObsEntry, ObsRegion, ObsSpec, ObsTransform, PoolConfig, PoolKernel};