2026-10-30 14:19:21 +03:00
|
|
|
//! UCI engine supervisor.
|
2026-10-18 01:54:06 +03:00
|
|
|
//!
|
2026-10-30 14:19:21 +03:00
|
|
|
//! The protocol is a state machine without I/O ([`protocol`]); a transport drives
|
|
|
|
|
//! it. On a computer the engine is a child process started without a shell:
|
|
|
|
|
//! stdout and stderr are read by two dedicated threads, a supervisor thread
|
|
|
|
|
//! feeds the machine. The UI talks to it through the non-blocking
|
|
|
|
|
//! [`EngineHandle`] and polls [`EngineEvent`]s every frame; the [`Waker`]
|
|
|
|
|
//! callback is invoked after each new event. WebAssembly in a browser has no
|
|
|
|
|
//! processes, so there is no process transport there.
|
2026-10-18 01:54:06 +03:00
|
|
|
//!
|
|
|
|
|
//! Search boundary: UCI has no request ids. A new `position`/`go` is written
|
|
|
|
|
//! only after the previous search ended with `bestmove` and a subsequent
|
|
|
|
|
//! `isready`/`readyok` round trip, so output of an old search can never be
|
|
|
|
|
//! attributed to a newer [`SearchId`]. Rapid requests are coalesced: only the
|
|
|
|
|
//! latest pending request is started, the others are reported as
|
|
|
|
|
//! [`EngineEvent::Superseded`]. No dependency on egui or chess-core:
|
|
|
|
|
//! positions are strings (FEN / UCI moves).
|
|
|
|
|
|
|
|
|
|
mod error;
|
2026-10-30 14:19:21 +03:00
|
|
|
mod events;
|
2026-10-18 01:54:06 +03:00
|
|
|
pub mod parse;
|
2026-10-30 14:19:21 +03:00
|
|
|
#[cfg(not(target_family = "wasm"))]
|
|
|
|
|
mod process;
|
|
|
|
|
// The machine is built where a transport drives it.
|
|
|
|
|
#[cfg(not(target_family = "wasm"))]
|
|
|
|
|
mod protocol;
|
2026-10-18 01:54:06 +03:00
|
|
|
mod types;
|
|
|
|
|
|
|
|
|
|
pub use error::EngineError;
|
2026-10-30 14:19:21 +03:00
|
|
|
pub use events::{EngineEvent, TerminationReason, Waker};
|
|
|
|
|
#[cfg(not(target_family = "wasm"))]
|
|
|
|
|
pub use process::{Engine, EngineConfig, EngineHandle};
|
2026-10-18 01:54:06 +03:00
|
|
|
pub use types::{
|
|
|
|
|
EngineInfo, EngineOption, EnginePosition, EngineScore, OptionKind, PositionBase, Score,
|
|
|
|
|
ScoreBound, SearchId, SearchInfo, SearchLimits, Side, Timeouts, WhiteEval, WhiteScore,
|
|
|
|
|
};
|