1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! L3 lower-once flat IR for the sui evaluator (docs/SPEED.md L3).
//!
//! Per source file, one [`Program`] `{ exprs: Vec<Ir>, spans, root }` with
//! [`ExprId`]`(u32)` indices, lowered from the rnix/rowan AST **once** by
//! [`lower`] / [`lower_file`]. Phase-1 lowering is 1:1 structural — every
//! rnix `Expr` variant maps to exactly one [`Ir`] variant (parse-error nodes
//! excepted, which return a typed [`LowerError`]), so force order is
//! untouched by construction.
//!
//! # What this slice is (and is not)
//!
//! This crate is the **IR skeleton + total lowering + the differential
//! render harness** only:
//!
//! * [`lower`] is total over the parse surface: every construct either
//! lowers or returns a typed [`LowerError`] naming the construct. No
//! silent gaps, no panics, no placeholder Ok values.
//! * [`render::render_ir`] and [`render::render_ast`] are two *independent*
//! walks emitting one normalized textual form; their equality over the
//! parity corpus + property-generated expressions proves lowering loses
//! nothing (see `tests/differential.rs`).
//!
//! **Eval-through-IR (slice 2)** lives in [`eval_ir`]: a pure-expression-
//! subset evaluator over the flat `Program` with its own minimal mirror
//! value/env/thunk types (see that module's docs for why mirrors), gated by
//! `tests/eval_differential.rs` — every corpus/supplement/seed/generated
//! expression is evaluated on BOTH engines (tree-walker as the semantic
//! oracle) and the rendered results byte-compared, with a typed shrink-only
//! known-gap allowlist. Nothing here is wired into sui-eval; the live
//! engines are untouched.
//!
//! **File-capable eval (slice 3)** adds path literals ([`path`] mirrors of
//! the walker's `canon_abs`/`normalize`/`resolve_import`), `import` through
//! the lower-once [`file_eval`] program cache (parse + lower ONCE per
//! canonical path, typed circular-import detection), and the [`builtins`]
//! bridge — gated by `tests/eval_differential.rs` + `tests/file_differential.rs`.
//!
//! **Pure builtin surface + search paths (slice 4)** completes the [`builtins`]
//! bridge (the whole PURE builtin set natively on `IrValue`; only store-/IO-/
//! derivation-/flake-bound names stay typed missing-builtin gaps) and resolves
//! `<name>` search paths through NIX_PATH (a hit is a `Path`, a miss a
//! catchable `Throw`, plus `builtins.nixPath` / `findFile`). Per-builtin value
//! + error differential rows and a builtin-application property generator gate
//! the surface; the NIX_PATH resolver is parity-tested in `tests/path_parity.rs`.
//!
//! # Id discipline
//!
//! Ids are assigned post-order: every child id is strictly less than its
//! parent's, and `root` is always the last entry. `exprs` is therefore a
//! topologically-sorted flat vector — a forward scan visits children before
//! parents, which the later precompute passes (needed-bindings, free-var
//! sets, attrset shapes) rely on.
pub use ;
pub use ;
pub use ;