Skip to main content

logicaffeine_compile/spatial/
mod.rs

1//! The **spatial IR** — the one program every spatial backend lowers FROM.
2//!
3//! A [`ir::SpatialProgram`] is a graph of *stages* (loads, stores, multicast receives, tile compute, scalar
4//! dataflow bodies) connected through *bounded buffers* by typed *handshakes* (FIFO, semaphore pair,
5//! barrier, valid/ready, token), placed onto a described mesh of *sites* ([`target::SpatialTarget`]) and
6//! choreographed by a per-engine *schedule* of [`ir::ChoreoOp`]s. Its meaning is the executable token
7//! semantics in [`eval`] (the golden oracle every lowering is proven against), and every verified program
8//! carries a [`certificate::ChoreographyCertificate`] (deadlock-freedom + buffer bounds + per-PE SAT).
9//!
10//! The stakeholder's three words are three passes over this IR, never per-backend code: `size_buffers`
11//! (buffering), `fuse_readers` (reader fusion / multicast), `synthesize_handshakes` (semaphore
12//! choreography). A lowering reads only the IR and its target — the "choreography census" locks assert
13//! that every semaphore / circular buffer / kernel a backend emits is the image of an IR object.
14//!
15//! A REWRITE of this IR — a pass, a legalization, an imported placement — is answerable to
16//! [`equiv::equivalent_under`]: two programs, one corpus, a typed [`equiv::Divergence`] when they part
17//! company. Structure is deliberately not consulted, because a legalization's whole job is to change it.
18
19pub mod certificate;
20pub mod clock;
21pub mod cost;
22pub mod d5005;
23pub mod decode;
24pub mod decode_chip;
25pub mod decode_engine;
26pub mod describe;
27pub mod equiv;
28pub mod eval;
29pub mod fit;
30pub mod fpga_decode;
31pub mod handoff;
32pub mod int8_model;
33pub mod ir;
34pub mod link;
35pub mod lower;
36pub mod part;
37pub mod passes;
38pub mod pipeline;
39pub mod programs;
40pub mod streamed;
41pub mod rdu_chip;
42pub mod residency;
43pub mod roofs;
44pub mod serving;
45pub mod shim;
46pub mod target;
47pub mod tensor_parallel;
48pub mod value_range;
49pub mod wide_int;
50pub mod work;