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,4 +1,4 @@
|
||||
# Blueprint → compilat: composite inlining — Implementation Plan
|
||||
# Blueprint → flat graph: composite inlining — Implementation Plan
|
||||
|
||||
> **Parent spec:** `docs/specs/0012-blueprint-compile-composites.md`
|
||||
>
|
||||
@@ -13,10 +13,10 @@ prove an SMA-cross composite runs bit-identically to today's hand-wired graph (C
|
||||
**Architecture:** A new module `crates/aura-engine/src/blueprint.rs` sits *above*
|
||||
`Harness::bootstrap`. `Blueprint::compile()` recursively inlines every `Composite`
|
||||
(append interior nodes at an offset, rewrite interior edges, fan input roles out,
|
||||
resolve the one output port), producing the same flat compilat a hand-wiring would.
|
||||
resolve the one output port), producing the same flat graph a hand-wiring would.
|
||||
The run loop, `bootstrap`'s signature, and `Edge`/`Target`/`SourceSpec`/`Node` are
|
||||
untouched; bootstrap's existing kind- and Kahn-cycle-check validate the lowered
|
||||
compilat. Optimisation passes (C23) are explicitly out of scope.
|
||||
flat graph. Optimisation passes (C23) are explicitly out of scope.
|
||||
|
||||
**Tech Stack:** Rust, `aura-engine` (depends on `aura-core`; `aura-std` is a
|
||||
dev-dependency reachable from tests). No new external dependencies (C16).
|
||||
@@ -57,12 +57,12 @@ Create `crates/aura-engine/src/blueprint.rs` with exactly this content:
|
||||
```rust
|
||||
//! The construction layer (C9/C19/C23): a named, param-generic graph-as-data
|
||||
//! (`Blueprint`) that **compiles** to the flat, type-erased instance the run loop
|
||||
//! already runs (the *compilat*). The unit of reuse is the [`Composite`]: a
|
||||
//! already runs (the *flat graph*). The unit of reuse is the [`Composite`]: a
|
||||
//! nestable sub-graph fragment exposing one output port (C8) and named input
|
||||
//! roles, which `compile` **inlines** into the flat `(nodes, sources, edges)` the
|
||||
//! unchanged [`crate::Harness::bootstrap`] consumes.
|
||||
//!
|
||||
//! 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,
|
||||
@@ -479,7 +479,7 @@ In `crates/aura-engine/src/blueprint.rs`, add the `CompileError` enum immediatel
|
||||
after the `Composite` impl block (before `pub struct Blueprint`):
|
||||
|
||||
```rust
|
||||
/// 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 {
|
||||
@@ -489,7 +489,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),
|
||||
}
|
||||
@@ -499,9 +499,9 @@ Then add the `compile` and `bootstrap` methods inside `impl Blueprint` (after
|
||||
`new`):
|
||||
|
||||
```rust
|
||||
/// Lower to the flat compilat: inline every composite (recursive), offset
|
||||
/// Lower to the flat graph: inline every composite (recursive), offset
|
||||
/// interior indices, rewrite edges, and fan input roles out. The run loop and
|
||||
/// `bootstrap`'s data model are unchanged; the lowered compilat is wired by raw
|
||||
/// `bootstrap`'s data model are unchanged; the lowered flat graph is wired by raw
|
||||
/// index (C23).
|
||||
// The flat triple is exactly `Harness::bootstrap`'s argument list; naming it
|
||||
// would be a speculative type alias this cycle (same call as the CLI's sample).
|
||||
@@ -533,7 +533,7 @@ Then add the `compile` and `bootstrap` methods inside `impl Blueprint` (after
|
||||
Ok((flat_nodes, flat_sources, flat_edges))
|
||||
}
|
||||
|
||||
/// Compile, then hand the flat compilat to the unchanged `Harness::bootstrap`.
|
||||
/// Compile, then hand the flat graph to the unchanged `Harness::bootstrap`.
|
||||
pub fn bootstrap(self) -> Result<Harness, CompileError> {
|
||||
let (nodes, sources, edges) = self.compile()?;
|
||||
Harness::bootstrap(nodes, sources, edges).map_err(CompileError::Bootstrap)
|
||||
@@ -544,7 +544,7 @@ Finally add the free lowering helpers and the `ItemLowering` enum at the end of
|
||||
file (after the `impl Blueprint` block, before `#[cfg(test)] mod tests`):
|
||||
|
||||
```rust
|
||||
/// 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.
|
||||
|
||||
@@ -29,7 +29,7 @@ v0.9.1, new `graph.rs`), `docs/design/INDEX.md` (C8 refinement note).
|
||||
- Modify: `crates/aura-std/src/sma.rs:22-46`, `sub.rs:27-47`, `exposure.rs:23-39`, `sim_broker.rs:59-85`, `add.rs:36-56`, `lincomb.rs:42-66`, `recorder.rs:31-58` — `label()` overrides.
|
||||
- Test: `crates/aura-std/src/sma.rs:48` (tests module) — disambiguation test.
|
||||
- Modify: `crates/aura-engine/src/blueprint.rs` — `Composite.name` field (54-59), widened `Composite::new` (64-71), accessors on `Composite` (61-90) and `Blueprint` (115-161), and the 7 `Composite::new` call sites (356, 433, 481, 513, 527, 541, 631).
|
||||
- Create: `crates/aura-cli/src/graph.rs` — the ascii-dag adapter (`render_blueprint`, `render_compilat`).
|
||||
- Create: `crates/aura-cli/src/graph.rs` — the ascii-dag adapter (`render_blueprint`, `render_flat_graph`).
|
||||
- Modify: `crates/aura-cli/Cargo.toml:12-15` — add `ascii-dag = "0.9.1"`.
|
||||
- Modify: `crates/aura-cli/src/main.rs` — imports (9-14), `mod graph;`, sample builders, `graph` dispatch arm + usage strings (114-126). `sample_harness` (42-78) and `run_sample` (83-112) are NOT touched.
|
||||
- Test: `crates/aura-cli/src/main.rs:128-168` (tests module) — render tests.
|
||||
@@ -274,7 +274,7 @@ to:
|
||||
/// Build a composite from its authored name, interior items, interior edges
|
||||
/// (local indices), input roles, and output port. 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>,
|
||||
@@ -409,7 +409,7 @@ ascii-dag = "0.9.1"
|
||||
//! The `aura graph` ASCII-DAG adapter (#13): turns the engine's graph-as-data
|
||||
//! (C9) into an `ascii_dag::Graph` rendered to a `String`. Two views:
|
||||
//! `render_blueprint` draws composites as named cluster boxes (pre-inline);
|
||||
//! `render_compilat` draws the flat post-inline graph (boundaries dissolved,
|
||||
//! `render_flat_graph` draws the flat post-inline graph (boundaries dissolved,
|
||||
//! C23). Rendering reads structure + node `label()`s only — never `eval`.
|
||||
//!
|
||||
//! ascii-dag borrows its node/subgraph labels as `&'a str`, so each function
|
||||
@@ -541,7 +541,7 @@ pub fn render_blueprint(bp: &Blueprint) -> String {
|
||||
|
||||
/// Compiled view: the flat post-inline graph (no clusters; boundaries dissolved,
|
||||
/// C23). Each `Box<dyn Node>` labels itself; node display id = node index.
|
||||
pub fn render_compilat(nodes: &[Box<dyn Node>], sources: &[SourceSpec], edges: &[Edge]) -> String {
|
||||
pub fn render_flat_graph(nodes: &[Box<dyn Node>], sources: &[SourceSpec], edges: &[Edge]) -> String {
|
||||
let mut labels: Vec<String> = nodes.iter().map(|n| n.label()).collect();
|
||||
let source_base = labels.len();
|
||||
for src in sources {
|
||||
@@ -669,7 +669,7 @@ to:
|
||||
let bp = sample_blueprint();
|
||||
let out = if compiled {
|
||||
let (nodes, sources, edges) = bp.compile().expect("valid sample blueprint");
|
||||
graph::render_compilat(&nodes, &sources, &edges)
|
||||
graph::render_flat_graph(&nodes, &sources, &edges)
|
||||
} else {
|
||||
graph::render_blueprint(&bp)
|
||||
};
|
||||
@@ -729,7 +729,7 @@ In `crates/aura-cli/src/main.rs`, inside the existing `#[cfg(test)] mod tests` (
|
||||
fn compiled_view_dissolves_the_composite_boundary() {
|
||||
let bp = sample_blueprint();
|
||||
let (nodes, sources, edges) = bp.compile().expect("valid sample");
|
||||
let out = graph::render_compilat(&nodes, &sources, &edges);
|
||||
let out = graph::render_flat_graph(&nodes, &sources, &edges);
|
||||
// node labels survive inlining...
|
||||
assert!(out.contains("SMA(2)") && out.contains("SMA(4)"), "labels lost:\n{out}");
|
||||
// ...but the composite cluster name does NOT (boundary dissolved, C23)
|
||||
@@ -748,7 +748,7 @@ In `crates/aura-cli/src/main.rs`, inside the existing `#[cfg(test)] mod tests` (
|
||||
- [ ] **Step 2: Run the tests to verify they pass**
|
||||
|
||||
Run: `cargo test -p aura-cli blueprint_view_shows_cluster_and_param_labels compiled_view_dissolves_the_composite_boundary swapped_sma_inputs_render_differently`
|
||||
Expected: PASS (all three). (`render_blueprint`/`render_compilat`/`sample_blueprint` already exist from Task 4; this task only adds tests + the test-only swapped builder.)
|
||||
Expected: PASS (all three). (`render_blueprint`/`render_flat_graph`/`sample_blueprint` already exist from Task 4; this task only adds tests + the test-only swapped builder.)
|
||||
|
||||
- [ ] **Step 3: Freeze the full-byte golden snapshots**
|
||||
|
||||
@@ -773,7 +773,7 @@ Then run: `cargo run -q -p aura-cli -- graph --compiled`, and add the twin:
|
||||
fn compiled_view_golden() {
|
||||
let bp = sample_blueprint();
|
||||
let (nodes, sources, edges) = bp.compile().expect("valid sample");
|
||||
let out = graph::render_compilat(&nodes, &sources, &edges);
|
||||
let out = graph::render_flat_graph(&nodes, &sources, &edges);
|
||||
let expected = "<<paste the exact captured `aura graph --compiled` stdout here>>";
|
||||
assert_eq!(out, expected, "compiled render drifted; re-capture if intended");
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ params into one flat, path-qualified, inspectable param-space.
|
||||
declare their tunable knobs. `aura-engine` gains a read-only `Blueprint::param_space()`
|
||||
that walks the graph-as-data (using the already-public `Composite::name()` as path
|
||||
prefix) in the same deterministic depth-first order `lower_items` uses — a parallel
|
||||
projection that leaves `compile`/`inline_composite` (and the compilat) untouched.
|
||||
projection that leaves `compile`/`inline_composite` (and the flat graph) untouched.
|
||||
|
||||
**Tech Stack:** Rust workspace — `aura-core` (node contract), `aura-std` (7 nodes),
|
||||
`aura-engine` (blueprint/compile). Param identity is positional (slot), name a
|
||||
@@ -320,7 +320,7 @@ the build names any remaining `NodeSchema` literal missing `params`, add
|
||||
Run: `cargo test -p aura-engine`
|
||||
Expected: PASS — all pre-existing tests (incl. the bit-identical
|
||||
`composite_sma_cross_runs_bit_identical_to_hand_wired` and the golden render tests)
|
||||
stay green: the compilat is unchanged, only schema literals gained an empty field.
|
||||
stay green: the flat graph is unchanged, only schema literals gained an empty field.
|
||||
|
||||
---
|
||||
|
||||
@@ -515,7 +515,7 @@ and `LinComb::schema` are clippy-clean).
|
||||
- **Do not touch** `compile`, `inline_composite`, `lower_items`, or any edge/wiring
|
||||
logic. `param_space()` is a *parallel* read-only projection that mirrors the
|
||||
inliner's traversal order; it must not share or alter it. The spec's correctness
|
||||
rests on the compilat staying bit-identical (every existing golden / bit-identical
|
||||
rests on the flat graph staying bit-identical (every existing golden / bit-identical
|
||||
test stays green by construction).
|
||||
- **fieldtests/ are out of scope** — they are excluded crates (own `Cargo.toml`),
|
||||
not in `--workspace`, and are frozen cycle-archive snapshots. They construct the
|
||||
|
||||
@@ -467,7 +467,7 @@ param-driven path plus no-param wrappers. The arity is checked up front via
|
||||
self.compile_with_params(&[])
|
||||
}
|
||||
|
||||
/// Compile under an injected vector, then hand the flat compilat to the
|
||||
/// Compile under an injected vector, then hand the flat graph to the
|
||||
/// unchanged `Harness::bootstrap`.
|
||||
pub fn bootstrap_with_params(self, params: Vec<Scalar>) -> Result<Harness, CompileError> {
|
||||
let (nodes, sources, edges) = self.compile_with_params(¶ms)?;
|
||||
@@ -640,7 +640,7 @@ and inside the composite loop:
|
||||
}
|
||||
```
|
||||
|
||||
(`render_compilat` / the compiled-view renderer operates on built flat nodes via
|
||||
(`render_flat_graph` / the compiled-view renderer operates on built flat nodes via
|
||||
`Node::label()` and is unchanged.)
|
||||
|
||||
- [ ] **Step 2: Sample blueprint → factories (`main.rs`)**
|
||||
@@ -665,7 +665,7 @@ and inside the composite loop:
|
||||
(`main.rs:230`): the blueprint view is now param-generic and identical for both
|
||||
orderings, so the swap is not observable there. Re-express the swap as a different
|
||||
injected vector (`vec![Scalar::I64(4), Scalar::I64(2), Scalar::F64(0.5)]`) and
|
||||
assert the **compiled** view differs (`render_compilat` of the compiled flat nodes
|
||||
assert the **compiled** view differs (`render_flat_graph` of the compiled flat nodes
|
||||
shows `SMA(4)`/`SMA(2)` swapped), not the blueprint view. Rename the test to its
|
||||
new premise (e.g. `swapped_param_vector_changes_the_compiled_render`).
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ top-level item — a composite labelled by `name()`, opaque) plus a definitions
|
||||
block where each distinct composite type (deduped by `name()`, collected
|
||||
recursively) renders its interior once with `[in:k]`/`[out]` port markers. The
|
||||
old `ItemDisplay`/`producer_id`/`consumer_ids`/subgraph machinery and the
|
||||
nested-composite `unimplemented!` are removed. `render_compilat` is untouched.
|
||||
nested-composite `unimplemented!` are removed. `render_flat_graph` is untouched.
|
||||
|
||||
**Tech Stack:** `crates/aura-cli/src/graph.rs` (render), `crates/aura-cli/src/main.rs`
|
||||
(tests), `ascii-dag` flat `RenderMode::Vertical`, the `aura_engine`
|
||||
@@ -161,7 +161,7 @@ imports (lines 12-14) with:
|
||||
//! views. `render_blueprint` shows the authored structure — a flat main graph
|
||||
//! wiring the harness with each composite as a single opaque node, plus a
|
||||
//! `where:` section that defines each distinct composite type once (its interior
|
||||
//! with `[in:k]`/`[out]` port markers). `render_compilat` shows the flat
|
||||
//! with `[in:k]`/`[out]` port markers). `render_flat_graph` shows the flat
|
||||
//! post-inline graph (boundaries dissolved, C23). Rendering reads structure +
|
||||
//! node `label()`s only — never `eval`.
|
||||
//!
|
||||
@@ -178,7 +178,7 @@ use aura_engine::{Blueprint, BlueprintNode, Composite, Edge, SourceSpec};
|
||||
|
||||
(`Composite` is added — named by the new helpers; `Target` is dropped — no longer
|
||||
named after the `ItemDisplay` collapse. `Edge`/`SourceSpec`/`Node` remain: they are
|
||||
`render_compilat`'s parameter types.)
|
||||
`render_flat_graph`'s parameter types.)
|
||||
|
||||
- [ ] **Step 4: Rewrite `graph.rs` — replace `ItemDisplay`/`producer_id`/`consumer_ids`/`render_blueprint` (old lines 16-132)**
|
||||
|
||||
@@ -233,7 +233,7 @@ pub fn render_blueprint(bp: &Blueprint) -> String {
|
||||
}
|
||||
|
||||
/// Build and render a flat (no-subgraph) ascii-dag graph from owned labels and
|
||||
/// edge pairs — the same idiom `render_compilat` uses.
|
||||
/// edge pairs — the same idiom `render_flat_graph` uses.
|
||||
fn render_flat(labels: &[String], edges: &[(usize, usize)]) -> String {
|
||||
let mut g = Graph::with_mode(RenderMode::Vertical);
|
||||
for (id, l) in labels.iter().enumerate() {
|
||||
@@ -376,7 +376,7 @@ Run: `cargo test --workspace`
|
||||
Expected: PASS, 0 failed. In particular the four must-stay-green tests
|
||||
(`compiled_view_dissolves_the_composite_boundary`, `compiled_view_golden`,
|
||||
`swapped_param_vector_changes_the_compiled_render`,
|
||||
`run_sample_is_deterministic_and_non_trivial`) remain green — `render_compilat` is
|
||||
`run_sample_is_deterministic_and_non_trivial`) remain green — `render_flat_graph` is
|
||||
untouched, so `compiled_view_golden` is byte-identical.
|
||||
|
||||
Run: `cargo clippy --workspace --all-targets -- -D warnings`
|
||||
|
||||
@@ -15,7 +15,7 @@ composite boundary (`NodeSchema.output: Vec<FieldSpec>`, `Edge::from_field`
|
||||
selects a column, leaf multi-output already works). This cycle replaces the
|
||||
single `OutPort` with a `Vec<OutField>` and lifts the three `field == 0` caps at
|
||||
the boundary (`inline_composite` nested arm, `rewrite_edge` composite arm). Names
|
||||
live at the blueprint boundary only and are dropped in the compilat (C23); C8/C7/C4
|
||||
live at the blueprint boundary only and are dropped in the flat graph (C23); C8/C7/C4
|
||||
are untouched — one port, one row, K columns.
|
||||
|
||||
**Tech Stack:** `crates/aura-engine/src/blueprint.rs` (type + compile logic),
|
||||
@@ -72,7 +72,7 @@ with:
|
||||
/// 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,
|
||||
@@ -547,14 +547,14 @@ Run: `cargo test -p aura-cli blueprint_view_golden`
|
||||
Expected: FAIL first (golden drift: `[out]` → `[out:cross]`), then PASS after the
|
||||
literal is re-captured.
|
||||
|
||||
- [ ] **Step 9: Confirm the compilat golden is byte-identical (main.rs:505–530)**
|
||||
- [ ] **Step 9: Confirm the flat graph golden is byte-identical (main.rs:505–530)**
|
||||
|
||||
`compiled_view_golden` pins the flat compilat render; per C23 names are dropped at
|
||||
`compiled_view_golden` pins the flat graph render; per C23 names are dropped at
|
||||
inline, so it must **not** change (acceptance criterion 6 — the regression guard).
|
||||
|
||||
Run: `cargo test -p aura-cli compiled_view_golden`
|
||||
Expected: PASS with **no** edit to the golden literal. If it drifts, a name leaked
|
||||
into the compilat — a bug to fix, not a golden to re-capture.
|
||||
into the flat graph — a bug to fix, not a golden to re-capture.
|
||||
|
||||
- [ ] **Step 10: Full CLI test + clippy**
|
||||
|
||||
@@ -617,7 +617,7 @@ Expected: PASS — zero warnings.
|
||||
- [ ] `cargo test --workspace` green (incl. the four new engine capability tests and the re-captured `blueprint_view_golden`).
|
||||
- [ ] `cargo clippy --workspace --all-targets -- -D warnings` green.
|
||||
- [ ] `rg "OutPort" --type rust` returns nothing (type fully retired).
|
||||
- [ ] `compiled_view_golden` unchanged (compilat byte-identical — C23 / acceptance criterion 6).
|
||||
- [ ] `compiled_view_golden` unchanged (flat graph byte-identical — C23 / acceptance criterion 6).
|
||||
- [ ] The MACD PoC re-exports `macd`/`signal`/`histogram`; the run still trades the histogram (via `from_field: 2`).
|
||||
|
||||
The implementation commit closes #40.
|
||||
|
||||
@@ -668,7 +668,7 @@ literal (do not hand-edit field-by-field). Re-run: PASS.
|
||||
|
||||
Run: `cargo test -p aura-cli compiled_view_golden`
|
||||
Expected: PASS with NO edit to the golden (`main.rs:510-535`). The boundary names
|
||||
never reach the compilat (C23); if this golden drifts, STOP — that is a bug, not a
|
||||
never reach the flat graph (C23); if this golden drifts, STOP — that is a bug, not a
|
||||
golden to re-capture.
|
||||
|
||||
- [ ] **Step 9: Confirm MACD run determinism is unchanged**
|
||||
|
||||
@@ -419,7 +419,7 @@ fallback path is the unchanged positional branch.)
|
||||
- [ ] **Step 7: Confirm `compiled_view_golden` is byte-stable**
|
||||
|
||||
Run: `cargo test -p aura-cli compiled_view_golden`
|
||||
Expected: PASS unchanged — the compilat carries no aliases / `#` identifiers
|
||||
Expected: PASS unchanged — the flat graph carries no aliases / `#` identifiers
|
||||
(C23 guard). If it fails, the render change leaked into the compiled view — stop
|
||||
and inspect; do not re-capture this golden.
|
||||
|
||||
@@ -636,7 +636,7 @@ signatures (type initial + alias initials + recursive input signatures) — do n
|
||||
hide an unnamed configuration axis: a collision is a `CompileError`
|
||||
(`IndistinguishableFanIn`) when at least one colliding source carries an
|
||||
unaliased param slot. Genuinely-interchangeable sources (equal signatures, no
|
||||
param) stay legal. Construction-phase only; the compilat stays name-free (C23).
|
||||
param) stay legal. Construction-phase only; the flat graph stays name-free (C23).
|
||||
The graph view renders each fan-in input as the shortest sibling-unique prefix
|
||||
of its source signature.
|
||||
```
|
||||
|
||||
@@ -482,7 +482,7 @@ In `crates/aura-engine/src/harness.rs`, next to `SourceSpec` (≈49), add:
|
||||
|
||||
```rust
|
||||
/// 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.
|
||||
@@ -1093,7 +1093,7 @@ is preserved). `macd_blueprint` (264-) return type → `Composite`.
|
||||
and `Harness::bootstrap(nodes, sources, edges)` → `Harness::bootstrap(flat)`.
|
||||
|
||||
`render_compiled` (336-337): signature `bp: Blueprint` → `bp: Composite`; body
|
||||
`let flat = bp.compile_with_params(point).expect("valid blueprint"); graph::render_compilat(&flat.nodes, &flat.sources, &flat.edges, color)`.
|
||||
`let flat = bp.compile_with_params(point).expect("valid blueprint"); graph::render_flat_graph(&flat.nodes, &flat.sources, &flat.edges, color)`.
|
||||
|
||||
`run_sample`/`sample_harness` (the bootstrap at main.rs:53): same `FlatGraph`
|
||||
threading as `run_macd`.
|
||||
@@ -1114,7 +1114,7 @@ In `crates/aura-cli/src/graph.rs`:
|
||||
- Match arms `BlueprintNode::Leaf` → `Primitive` at **118, 212-213, 325, 337, 399-400**.
|
||||
- `factory: &LeafFactory` param at **250** → `&PrimitiveBuilder` (its `.params()`/
|
||||
`.label()` calls are unchanged).
|
||||
- The `sources: &[SourceSpec]` param at 482 (render_compilat) is unchanged
|
||||
- The `sources: &[SourceSpec]` param at 482 (render_flat_graph) is unchanged
|
||||
(`FlatGraph.sources` is still `Vec<SourceSpec>`).
|
||||
|
||||
- [ ] **Step 5: Migrate aura-cli's `#[cfg(test)]` module**
|
||||
|
||||
@@ -15,7 +15,7 @@ the CLI render layer: (A) thread the root composite as the fan-in stub context
|
||||
(`stub_ctx` drops its `Option`; both `render_graph` callers pass `&Composite`),
|
||||
and (B) build root entries from `role.name` instead of `format!("source:{kind}")`.
|
||||
The existing `slot_source`/`fan_in_identifiers`/`signature_of` are reused verbatim
|
||||
(no new stub path). `render_compilat` is untouched (the compiled view keeps
|
||||
(no new stub path). `render_flat_graph` is untouched (the compiled view keeps
|
||||
`[source:F64]` — names dissolve post-inline, C23). Behaviour-preserving for the
|
||||
run path (C1); read-only render (C9); no engine change.
|
||||
|
||||
@@ -50,7 +50,7 @@ captured from the live `aura graph` / `aura graph --macd` output.
|
||||
add a `[src]` role-name-passthrough assertion.
|
||||
|
||||
**Explicitly OUT of scope (do not touch):**
|
||||
- `crates/aura-cli/src/graph.rs:486-505` (`render_compilat`) — the negative-control
|
||||
- `crates/aura-cli/src/graph.rs:486-505` (`render_flat_graph`) — the negative-control
|
||||
path; must stay byte-identical so `compiled_view_golden` does not move.
|
||||
- `crates/aura-cli/src/main.rs:564-589` (`compiled_view_golden`) — its expected
|
||||
block (`[source:F64]`, `[SimBroker(0.0001)]`) must NOT be edited.
|
||||
|
||||
@@ -572,7 +572,7 @@ And delete the `render_compiled` helper (lines 358-363):
|
||||
/// (C23) view — the shared body of the `--compiled` paths.
|
||||
fn render_compiled(bp: Composite, point: &[Scalar], color: graph::Color) -> String {
|
||||
let flat = bp.compile_with_params(point).expect("valid blueprint");
|
||||
graph::render_compilat(&flat.nodes, &flat.sources, &flat.edges, color)
|
||||
graph::render_flat_graph(&flat.nodes, &flat.sources, &flat.edges, color)
|
||||
}
|
||||
```
|
||||
If `is_terminal`/`IsTerminal` was imported only for the `color` binding, its `use`
|
||||
@@ -605,7 +605,7 @@ which dies with the file).
|
||||
|
||||
In `crates/aura-cli/src/main.rs`'s `#[cfg(test)] mod tests`, delete these test
|
||||
functions in full (each asserts retired ascii-dag output and references
|
||||
`graph::render_blueprint` / `graph::render_compilat` / `graph::Color`):
|
||||
`graph::render_blueprint` / `graph::render_flat_graph` / `graph::Color`):
|
||||
```text
|
||||
blueprint_view_main_graph_shows_composite_as_opaque_node (~409-425)
|
||||
blueprint_view_defines_each_composite_once (~427-435)
|
||||
|
||||
@@ -485,7 +485,7 @@ In the C23-related prose at :359-366 and :813-851: strike the `ParamAlias`
|
||||
param-overlay from the named-projection set (the param projection is retired;
|
||||
`Role.name` input roles and `OutField.name` outputs remain). Note that node names
|
||||
join the same non-load-bearing debug-symbol class (construction-time identity,
|
||||
dropped at lowering; the compilat stays wired by raw index). Remove the sentence
|
||||
dropped at lowering; the flat graph stays wired by raw index). Remove the sentence
|
||||
referencing the dangling-alias `BadInteriorIndex` compile check (:362-364) — that
|
||||
path is gone with the overlay.
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@ distinguishability check, if ever wanted, is decoupled from param-space injectiv
|
||||
|
||||
At the sentence "Identity is **positional** (the slot, C23 'by index, not name');
|
||||
… same-type siblings in one composite share a name, uniqueness is at the slot",
|
||||
add the refinement: identity in the **compilat** stays positional (C23, unchanged),
|
||||
add the refinement: identity in the **flat graph** stays positional (C23, unchanged),
|
||||
but the `param_space()` **name projection** — the authoring / by-name address space
|
||||
— must be **injective** for a blueprint to compile (cycle 0032). Two layers:
|
||||
positional wiring below, injective name address space above.
|
||||
@@ -477,9 +477,9 @@ positional wiring below, injective name address space above.
|
||||
- [ ] **Step 3: Note the C23 amendment**
|
||||
|
||||
Record that the injectivity check is part of bootstrap-as-compilation; node names
|
||||
stay non-load-bearing (dropped at lowering, compilat wired by raw index). The check
|
||||
stay non-load-bearing (dropped at lowering, flat graph wired by raw index). The check
|
||||
reads the boundary name projection; it does not make names load-bearing in the
|
||||
compilat.
|
||||
flat graph.
|
||||
|
||||
- [ ] **Step 4: Verify the ledger still builds as docs (sanity)**
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ resolves every name against each node's cached `NodeSchema` by exactly-one-match
|
||||
(the `PrimitiveBuilder::bind` posture, but fallible) and hands the resolved
|
||||
`Vec<Edge>`/`Vec<Role>`/`Vec<OutField>` to the unchanged `Composite::new`. A new
|
||||
`impl From<Composite> for BlueprintNode` lets `add` accept nested composites.
|
||||
Names never reach the compilat (C23 holds by construction).
|
||||
Names never reach the flat graph (C23 holds by construction).
|
||||
|
||||
**Tech Stack:** Rust, `aura-engine` (blueprint/harness), `aura-core` (NodeSchema/
|
||||
PortSpec/FieldSpec/ScalarKind), `aura-std` nodes for tests.
|
||||
@@ -105,7 +105,7 @@ Create `crates/aura-engine/src/builder.rs` with:
|
||||
//!
|
||||
//! 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
|
||||
|
||||
@@ -324,7 +324,7 @@ Expected: PASS (`1 passed`).
|
||||
deliberately under-wired `strategy` (LinComb's two `term` inputs never fed) only to
|
||||
read its flat param order. Fully wire it: fan `fast_slow`'s output into both LinComb
|
||||
terms, and add a covering root role for `strategy`'s `price` input. Wiring changes no
|
||||
node and no param, so the asserted `space == from_compilat` equality is unchanged.
|
||||
node and no param, so the asserted `space == from_flat` equality is unchanged.
|
||||
|
||||
**Files:**
|
||||
- Modify: `crates/aura-engine/src/blueprint.rs:1877`
|
||||
@@ -611,7 +611,7 @@ never consumers, so only interior input slots are subject to the rule. There is
|
||||
optional-input concept**: every declared input port is required (no shipped node runs
|
||||
meaningfully without one; an unwarmed mode-A input is *wired-but-not-yet-valued*, not
|
||||
unwired). The check is **index-based and name-free** — it touches no name machinery
|
||||
and emits nothing into the compilat, so C23 is untouched (it proves the existing
|
||||
and emits nothing into the flat graph, so C23 is untouched (it proves the existing
|
||||
raw-index wiring is total and single-valued). Inherited identically by the raw
|
||||
`Composite::new` path and the `GraphBuilder::build()` path (both compile via
|
||||
`compile_with_params`).
|
||||
|
||||
Reference in New Issue
Block a user