Expand description
§limen-core
Limen Core defines the stable contracts and primitives for the Limen graph-driven, edge inference runtime targeting embedded and resource-constrained systems.
§Design principles
no_stdby default. All code compiles withoutstd. Heap use is gated behind#[cfg(feature = "alloc")]; concurrent primitives behindstd.- No dynamic dispatch in hot paths. Node, edge, memory manager, and scheduler types are monomorphized via generics and const generics.
- Token-based message passing. Edges carry
types::MessageTokenhandles rather than full messages. Message data (header + payload) lives in amemory::manager::MemoryManager, addressed by token. This enables zero-copy routing and heterogeneous memory classes (host, pinned, device). - Stable contracts. The traits defined here are the versioned boundary
between application code and the runtime. Higher-level crates
(
limen-runtime,limen-codegen,limen-node) depend on this crate and can evolve independently without breaking the contract surface.
§Module overview
| Module | What it provides |
|---|---|
types | Newtypes for IDs, timing, QoS, MessageToken, DataType/DType, F16/BF16 |
errors | Error families for queues, nodes, inference, graph, runtime |
memory | MemoryClass, PlacementAcceptance, BufferDescriptor; memory manager traits and impls |
message | MessageHeader, MessageFlags, Message<P>; Payload trait; Tensor; Batch |
policy | Batching, budget, deadline, admission, and per-edge/node policy types |
compute | ComputeBackend / ComputeModel traits for dyn-free inference backends |
edge | Edge SPSC trait; EnqueueResult, EdgeOccupancy; queue implementations |
node | Node trait; StepContext, StepResult, ProcessResult; source/sink/model sub-traits |
graph | GraphApi, ScopedGraphApi; compile-time node/edge access traits; descriptor validation |
scheduling | Readiness, NodeSummary, DequeuePolicy; WorkerScheduler for concurrent execution |
telemetry | Telemetry trait; TelemetryEvent; NodeMetrics, EdgeMetrics, GraphMetrics |
platform | PlatformClock, Span, Timers, Affinity; NoopClock |
runtime | LimenRuntime trait; RuntimeStopHandle |
prelude | Convenience re-exports for all of the above, feature-gated |
§Feature flags
| Flag | Effect |
|---|---|
| (default) | no_std, no heap; fixed-size SPSC queues (SpscArrayQueue) |
alloc | HeapMemoryManager, SpscVecDeque, owned BatchView |
std | implies alloc; ConcurrentMemoryManager, ConcurrentEdge, ScopedEdge, ScopedGraphApi, concurrent telemetry |
spsc_raw | unsafe lock-free ring buffer (SpscRawQueue); requires std |
bench | exposes test nodes, edges, graphs, and runtimes for integration tests |
checked-memory-manager-refs | adds per-slot borrow-state tracking to StaticMemoryManager and HeapMemoryManager |
Modules§
- compute
- Compute backend and model traits (dyn-free, explicit; no defaults).
- edge
- SPSC edge trait, occupancy types, and queue implementations.
- errors
- Error families used across Limen Core.
- graph
- Graph trait hierarchy and typed graph contracts.
- memory
- Memory classes, placement policy, and token-backed message storage.
- message
- Message header, flags, and typed message wrapper.
- node
- Uniform node contract, lifecycle, and step context.
- platform
- Platform abstractions.
- policy
- Policies for batching, budgets, deadlines, admission, and capacities.
- prelude
- Convenience re-exports for crate consumers and codegen output.
- runtime
- Runtime trait and stop-handle for Limen graph executors.
- scheduling
- Scheduling traits: readiness and dequeue policy (EDF hooks).
- telemetry
- Telemetry primitives for Limen runtimes.
- types
- Small shared value types and identifiers used across
limen-core.
Macros§
- event_
message - Constructs an
EventMessagewith guaranteed compile-time validation. - run_
edge_ contract_ tests - Define a set of contract tests for an
Edgeimplementer. - run_
node_ contract_ tests - Expand a canonical suite of node contract tests for a
NodeLinkfactory.