subetha_core/lib.rs
1//! Substrate for adaptive primitives.
2//!
3//! The four core abstractions actually consumed by the IPC stack:
4//!
5//! - [`HandshakeHeader`] - per-instance generation counter and in-flight tracker.
6//! - [`ObservationRing`] - TLS-local ring buffer for op observations.
7//! - [`migration`] - dual-stack migration protocol primitives.
8//! - [`Marshal`] - type-system contract for "this value can cross an
9//! address-space boundary byte-identically." Stricter than `Send`;
10//! required by every cross-process primitive in `subetha-cxc` that
11//! stores typed values (e.g. `SharedDeque<T>`).
12//!
13//! Plus the architecture catalog ([`Axis`] / [`AxisMask`]) for direction
14//! signatures and the [`cpuid`] helpers for CPU-feature detection.
15//!
16//! Every adaptive primitive in `subetha-pointers` and `subetha-cxc`
17//! carries a `HandshakeHeader` at a known offset.
18
19#![forbid(unsafe_op_in_unsafe_fn)]
20
21// subetha-core was historically `no_std`, but the per-thread sequential id
22// machinery in [`observation::thread_id`] requires `thread_local!`,
23// which is std-only. Every dependent already pulls in std, so the
24// no_std attribute was removed to keep the substrate consistent.
25
26pub mod axis_signature;
27pub mod cpuid;
28pub mod handshake;
29pub mod marshal;
30pub mod migration;
31pub mod observation;
32
33pub use axis_signature::{Axis, AxisMask, Fusion};
34pub use cpuid::{has_movdir64b, has_waitpkg};
35pub use handshake::HandshakeHeader;
36pub use marshal::{Marshal, MarshalError};
37pub use migration::{Generation, MigrationGuard};
38pub use observation::{Observation, ObservationRing, any_observer_armed, thread_id};