metrale_scheduler/lib.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2#![deny(warnings)]
3#![deny(clippy::all)]
4
5//! 2026-09-25: The scheduler's I/O contract (SBIO).
6//!
7//! The core (in the server crate) hands device work to a [`DeviceIo`] as
8//! [`StepPlan`]s and [`Effect`]s, and can reach the model itself through
9//! [`DeviceIo::model`]. The clock is a [`ClockIo`], swap files a [`SpillIo`].
10//! [`driver::run`] is the scheduler loop.
11//!
12//! [`ScriptedDeviceIo`] wraps a router and answers the decode lane from a
13//! script, so a test can drive the real core with chosen tokens.
14//! [`TracingDeviceIo`] wraps a router and logs each call.
15//!
16//! Owner: scheduler.
17//! Invariants:
18//! - The sequence state, the device logits handle and the model are type
19//! parameters, never a concrete model type, anywhere in this crate.
20
21pub mod clock;
22pub mod device;
23pub mod driver;
24pub mod effect;
25pub mod plan;
26pub mod scripted;
27pub mod spill;
28pub mod trace_device;
29pub mod types;
30
31pub use clock::{ClockIo, SystemClock};
32pub use device::DeviceIo;
33pub use driver::{Core, LaneVerdict, TickPlan, run};
34pub use effect::{Effect, EffectOutcome};
35pub use plan::{
36 DecodeCtxCommit, DecodeRows, FeedSource, Label, Readback, RowMask, StepOutcome, StepPlan,
37 StepResult,
38};
39pub use scripted::{Fault, ScriptedDeviceIo};
40pub use spill::SpillIo;
41pub use trace_device::{TraceSink, TracingDeviceIo};
42pub use types::{DeviceError, DeviceFacts, Ticket, WaitPolicy};