docs,engine: drop coined "compilat", use FlatGraph / "flat graph"
"Compilat" (German "Kompilat") was a coined noun for the product of the
bootstrap compilation — neither English nor a natural fit. The runtime
artifact already has a code identifier for exactly this thing: the
`FlatGraph` struct (harness.rs). Replace the coinage with that identifier:
- prose mentions -> "flat graph" (mirrors the type, reads plainly)
- definitional anchors -> `FlatGraph` (C11, C23, the running-graph line)
- `render_compilat` -> `render_flat_graph` (historical render symbol;
keeps the `render_blueprint` / `render_flat_graph`
source-vs-product pairing)
- `intra-compilat` -> `intra-graph`
- `from_compilat` (test) -> `from_flat`
"compilation" / "re-compilation" / "bootstrap-as-compilation" (the process,
ordinary English) are deliberately left untouched. Behaviour-preserving:
only comments, design ledger, specs/plans, one test-local variable and its
assert messages change. Full workspace test suite green; clippy clean.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! The construction layer (C9/C19/C23): a named, param-generic graph-as-data
|
||||
//! ([`Composite`]) that **compiles** to the flat, type-erased instance the run loop
|
||||
//! already runs (the *compilat*, a [`crate::FlatGraph`]). The unit of reuse is the
|
||||
//! already runs (a [`crate::FlatGraph`]). The unit of reuse is the
|
||||
//! [`Composite`]: a nestable sub-graph fragment exposing an output record (one port,
|
||||
//! K re-exported fields; C8) and input roles (each open, or — at the root —
|
||||
//! source-bound). `compile` **inlines** the nesting into the flat `FlatGraph` the
|
||||
@@ -8,7 +8,7 @@
|
||||
//! blueprint (there is no separate `Blueprint` type — a fully source-bound composite
|
||||
//! is the runnable root).
|
||||
//!
|
||||
//! The compilat is wired by raw index, **not by name** (C23): a composite's
|
||||
//! The flat graph is wired by raw index, **not by name** (C23): a composite's
|
||||
//! boundary dissolves at compile time; field/role names, where kept, are
|
||||
//! non-load-bearing debug symbols (as `FieldSpec.name` already is). This module
|
||||
//! adds no optimisation pass (CSE/DCE, sweep-invariant hoisting are deferred,
|
||||
@@ -25,7 +25,7 @@ use crate::{GridSpace, RunReport, SweepFamily};
|
||||
/// One re-exported field of a composite's output record: an interior
|
||||
/// `(node, output-field)` surfaced at the boundary under `name`. `name` is a
|
||||
/// non-load-bearing render/debug symbol (C23) — like `FieldSpec.name` and
|
||||
/// `Composite.name`, it does not reach the compilat.
|
||||
/// `Composite.name`, it does not reach the flat graph.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct OutField {
|
||||
pub node: usize,
|
||||
@@ -157,7 +157,7 @@ impl Composite {
|
||||
/// Build a composite from its authored name, interior items, interior edges
|
||||
/// (local indices), input roles, and output record. The `name` is a
|
||||
/// non-load-bearing render symbol (the cluster title for #13); it does not
|
||||
/// reach the compilat (the boundary dissolves at inline, C23).
|
||||
/// reach the flat graph (the boundary dissolves at inline, C23).
|
||||
pub fn new(
|
||||
name: impl Into<String>,
|
||||
nodes: Vec<BlueprintNode>,
|
||||
@@ -473,7 +473,7 @@ fn resolve(space: &[ParamSpec], bound: &[(String, Scalar)]) -> Result<Vec<Scalar
|
||||
Ok(point)
|
||||
}
|
||||
|
||||
/// A construction-phase fault, caught before the flat compilat reaches
|
||||
/// A construction-phase fault, caught before the flat graph reaches
|
||||
/// `Harness::bootstrap`.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum CompileError {
|
||||
@@ -483,7 +483,7 @@ pub enum CompileError {
|
||||
RoleKindMismatch { role: usize },
|
||||
/// The output port names a missing interior node or output field.
|
||||
OutputPortOutOfRange,
|
||||
/// The lowered flat compilat failed `Harness::bootstrap`'s checks (kind
|
||||
/// The lowered flat graph failed `Harness::bootstrap`'s checks (kind
|
||||
/// mismatch, bad index, or directed cycle).
|
||||
Bootstrap(BootstrapError),
|
||||
/// An injected param value's scalar kind does not match the slot's declared
|
||||
@@ -631,7 +631,7 @@ fn collect_params(items: &[BlueprintNode], prefix: &str, out: &mut Vec<ParamSpec
|
||||
}
|
||||
}
|
||||
|
||||
/// How one blueprint item resolved into the flat compilat. Edges and source
|
||||
/// How one blueprint item resolved into the flat graph. Edges and source
|
||||
/// targets to/from an item are resolved through this.
|
||||
enum ItemLowering {
|
||||
/// A leaf lowered to exactly one flat node at this index.
|
||||
@@ -701,10 +701,10 @@ fn inline_composite(
|
||||
flat_edges: &mut Vec<Edge>,
|
||||
) -> Result<ItemLowering, CompileError> {
|
||||
// `name` is the non-load-bearing render symbol (#13); it dissolves at inline
|
||||
// (C23 — the boundary does not reach the compilat), so it is not destructured.
|
||||
// (C23 — the boundary does not reach the flat graph), so it is not destructured.
|
||||
// Node names join the same non-load-bearing debug-symbol class: they qualify the
|
||||
// param-space path at construction but are dropped at lowering — the injected
|
||||
// scalar `params: &[Scalar]` arg drives `lower_items` below; the compilat stays
|
||||
// scalar `params: &[Scalar]` arg drives `lower_items` below; the flat graph stays
|
||||
// wired by raw index.
|
||||
let Composite { name: _, nodes, edges, input_roles, output } = c;
|
||||
let item_count = nodes.len();
|
||||
@@ -1901,16 +1901,16 @@ mod tests {
|
||||
// the same blueprint, actually compiled to its flat node array; each flat
|
||||
// node's own declared params, concatenated in flat-node order
|
||||
let flat = bp.compile_with_params(&[Scalar::I64(2), Scalar::I64(4), Scalar::F64(0.5)]).expect("harness compiles");
|
||||
let from_compilat: Vec<ParamSpec> =
|
||||
let from_flat: Vec<ParamSpec> =
|
||||
flat.signatures.iter().flat_map(|s| s.params.clone()).collect();
|
||||
|
||||
// same count, same per-slot kind, same order — the projection mirrors the
|
||||
// compilation (names differ: param_space path-qualifies, the raw node does
|
||||
// not, so compare on the load-bearing axis, kind-by-slot)
|
||||
assert_eq!(space.len(), from_compilat.len(), "param count must match the compilat");
|
||||
assert_eq!(space.len(), from_flat.len(), "param count must match the flat graph");
|
||||
assert_eq!(
|
||||
space.iter().map(|p| p.kind).collect::<Vec<_>>(),
|
||||
from_compilat.iter().map(|p| p.kind).collect::<Vec<_>>(),
|
||||
from_flat.iter().map(|p| p.kind).collect::<Vec<_>>(),
|
||||
"per-slot param kinds must line up with the compiled flat-node order",
|
||||
);
|
||||
// the realistic harness's concrete space: two SMA lengths (I64) + Exposure
|
||||
@@ -2060,16 +2060,16 @@ mod tests {
|
||||
// the same blueprint, compiled to its flat node array; each flat node's
|
||||
// own declared params, concatenated in flat-node order
|
||||
let flat = bp.compile_with_params(&[Scalar::I64(2), Scalar::I64(4), Scalar::F64(1.0), Scalar::F64(-1.0)]).expect("nested composite compiles");
|
||||
let from_compilat: Vec<ParamSpec> =
|
||||
let from_flat: Vec<ParamSpec> =
|
||||
flat.signatures.iter().flat_map(|s| s.params.clone()).collect();
|
||||
|
||||
// same count, same per-slot kind, same order — the nested projection
|
||||
// mirrors the compilation (names differ: param_space path-qualifies, the
|
||||
// raw node does not, so compare on the load-bearing axis, kind-by-slot)
|
||||
assert_eq!(space.len(), from_compilat.len(), "param count must match the compilat");
|
||||
assert_eq!(space.len(), from_flat.len(), "param count must match the flat graph");
|
||||
assert_eq!(
|
||||
space.iter().map(|p| p.kind).collect::<Vec<_>>(),
|
||||
from_compilat.iter().map(|p| p.kind).collect::<Vec<_>>(),
|
||||
from_flat.iter().map(|p| p.kind).collect::<Vec<_>>(),
|
||||
"per-slot param kinds must line up with the compiled flat-node order, under nesting",
|
||||
);
|
||||
// pin the concrete shape: two Sma lengths (I64), Sub none, two LinComb
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//!
|
||||
//! A fluent, additive authoring surface that wires a blueprint by typed node
|
||||
//! handles and port/field *names*, resolving them to the raw-index `Composite`
|
||||
//! at a single fallible `build()`. The compilat stays index-wired (C23): names
|
||||
//! at a single fallible `build()`. The flat graph stays index-wired (C23): names
|
||||
//! are resolved at the authoring boundary and never reach `FlatGraph` — the same
|
||||
//! posture param-name resolution already has (`Binder`, blueprint.rs). Resolution
|
||||
//! mirrors `PrimitiveBuilder::bind`'s collect-then-reject (node.rs), but returns
|
||||
|
||||
@@ -52,7 +52,7 @@ pub struct SourceSpec {
|
||||
}
|
||||
|
||||
/// The flat, type-erased, index-wired output of `Composite::compile` — the target
|
||||
/// `Harness::bootstrap` consumes (C23's "compilat", now a named type). `signatures[i]`
|
||||
/// `Harness::bootstrap` consumes (C23's "flat graph", now a named type). `signatures[i]`
|
||||
/// is the static signature of `nodes[i]` (gathered from each primitive's builder at
|
||||
/// lowering); `bootstrap` reads kinds/output from it and `nodes[i].lookbacks()` for
|
||||
/// buffer depth. `sources` are the lowered bound roles, in role-declaration order.
|
||||
|
||||
Reference in New Issue
Block a user