Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
siniPublic archive

About

gen-rebuild: pure-Nix incremental rebuilder core (Mokhov rebuilder dimension)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

68 Commits

Folders and files

Repository files navigation

gen-rebuild — pure-Nix incremental rebuilder

⚠ ARCHIVED — this library has retired. Its successor is gen-memo.

The ruling. ADR-0008 rules one incremental plane — gen-memo — over the sole evaluator, and ADR-0008 §4 moves gen-rebuild's content onto that plane and retires the library shell with it; ADR-0005 named the carried-forward list. The repository is orphaned for reference under ADR-0031's F3 pattern: no content is deleted, nothing here is maintained, and gen-rebuild is off the mkGenLibs roster and is not a gen hub input.

Take no new dependency on this repository. The rebuilder lives in gen-memo, the incremental plane. It stays archived rather than deleted so existing pins keep resolving.

The content move is complete. gen-memo's export set is a strict superset of gen-rebuild's — 26 exports in common, 5 added, 0 lost — and all nine of ADR-0005's carried-forward items are present at the destination with the suite green. Nothing still reads this repository as a source. The text below is the retiring surface as it stood; it describes what this library did, not what anyone should now build on.

CI License: MIT Sponsor

gen-rebuild answers one question — "given the last evaluation, must key K be recomputed?" — and performs the minimal recompute + reuse. It is the rebuilder dimension of Mokhov 2018's build-systems taxonomy, factored out of the scheduler (gen-scope) and the topology oracle (gen-graph) as a standalone, pure-Nix gen library. It is nixpkgs-lib-free (Class B): it depends only on gen-prelude, gen-graph and gen-scope — all pure, nixpkgs-lib-free — and takes no <nixpkgs> input. A dedicated purity CI suite pins that invariant: a stray nixpkgs.lib / evalModules in the source fails the build.

Table of Contents

Terminology

Term Definition Source
Rebuilder decides reuse: "must K be recomputed, given last time?" Mokhov 2018
Store flat relocatable id-keyed result map { <id> = value; } Mokhov 2018 §3.1 for the store (keys → values); flat and relocatable are gen-rebuild's own design properties, not the paper's
Trace per-key { deps; hash } verifying record Mokhov 2018 (verifying trace)
Cone dependent cone of x — everyone who transitively depends on x gen-graph (reverse reachability)
Dirty set changed ids ∪ their dependent cones (v1 over-approx) Reps–Teitelbaum–Demers 1983 (AFFECTED set)
Splice priorStore // fix-of-cone — recompute the cone, reuse rest gen-rebuild's own mechanism and phrase; it realizes Acar 2002 change propagation (§4.5/§7), which is not the same as being his
BuiltCtx the threaded { store, trace, accessor, recompute, hashOf } —
AFFECTED the keys whose value actually moved — post-filtered, not precomputed Reps–Teitelbaum–Demers 1983 §4.3
Early-cutoff reuse a node whose inputs are all unchanged-hash RTD 1983 (§4.1 value-cutoff, §5.3 NeedToBeEvaluated)
Change / Propagate applyDelta (rewrite data) vs propagate (drain dirty-set) Acar 2002 (§4.3 change, §4.5 propagate)
Support the transitive declared producers of a node (name-faithful) Radul 2009 §6.1
Lattice per-node { bottom; join; eq?; widen?; maxIter? } for a cyclic solve Arntzenius 2016 (Datafun Lemma 4)
SCC / condensation the cyclic strata, solved producers-first bottom-up Tarjan 1972 / Kosaraju (via gen-graph)

Overview

gen-rebuild does not schedule or evaluate; it decides reuse and drives change propagation. It functionally composes gen-graph (the topology oracle) for every structural query — including the cyclic convergence-loop: runScc ascends each strongly-connected component to its least fixed point and restabilize re-solves a change's cone stratum-by-stratum over graph.condensation, both driven by the caller-supplied recompute. gen-scope is the ecosystem's scheduler layer but is not currently consumed by gen-rebuild (the scope arg is threaded but unused — see lib/default.nix):

gen-graph   (topology oracle)   dependentsOf · cycles · condensation · canReach
   │  read-only queries over a caller-supplied edge accessor
gen-scope   (scheduler)         demand-driven evaluation — NOT consumed (threaded, unused)
   │
gen-rebuild (rebuilder)  ◄── THIS LIB
      owns: the flat relocatable result-store + verifying trace, the reuse
            decision, the change/propagate drivers, the structural deltas,
            and the cyclic re-stabilizer.

It owns a flat, relocatable result-store (plain values, not thunks closed over a prelude.fix self) — relocatability is what makes reuse-across-change possible. Flatness and relocatability are gen-rebuild's own design properties, asserted here and not taken from any paper: Mokhov 2018 §3.1 defines a store as a mapping from keys to values and says nothing about either. A reader carrying this phrase into another library should carry it as gen-rebuild's claim, not as a cited result. A change recomputes only the dependent cone via a reverse-topo splice (priorStore // fix-of-cone); everything else is reused byte-for-byte. The acyclic core runs its own thin store-backed prelude.fix eval loop; the cyclic path stratifies the solve bottom-up over graph.condensation and runs a per-SCC fixpoint (runScc). The surface is now the full v1+v2 rebuilder: dirty-bit reuse with per-node early-cutoff, exact AFFECTED, provenance, change/propagate drivers, structural deltas, and a cyclic re-stabilizer — sound and demonstrable, with each gap stated honestly.

Gen Ecosystem

Library Role
gen-prelude Pure nixpkgs-lib-free utility base (builtins re-exports + vendored lib utils)
gen-algebra Pure primitives (record, search monad, either, intensional identity)
gen-types Clean-room MIT structural type checker (leaf/poly checkers; verify: v → null|err)
gen-merge Byte-mode module merge engine (evalModuleTree, byte-identical to nixpkgs lib.evalModules over the priority subset)
gen-schema Typed registries (kinds, instances, collections, refs); re-hosted on gen-merge
gen-aspects Aspect type system (traits, classification, dispatch); re-hosted on gen-merge
gen-scope HOAG scope-graph evaluator (demand-driven, _eval memoization, circular attributes)
gen-graph Accessor-based graph query combinators (traversal, condensation, phaseOrder)
gen-select Selector algebra (pattern matching over graph positions)
gen-bind Module binding (inject external args into NixOS modules)
gen-dispatch Relational rule dispatch STEP (stratified phases, conflict resolution)
gen-resolve Demand-driven RAG evaluator over scope graphs (attribute schedule + convergence loop)
gen-rebuild Pure-Nix incremental rebuilder (change propagation, AFFECTED set)
gen-vars Pure-Nix vars/secrets (den-agnostic)
gen-flake The nixpkgs boundary — compose purely, inject resolved values, build NixOS systems (value-injection)

Quick Start

As a flake input

gen-rebuild's lib output comes pre-wired with gen-prelude + gen-graph + gen-scope:

{
  inputs.gen-rebuild.url = "github:sini/gen-rebuild";
  outputs =
    { gen-rebuild, ... }:
    let
      rebuild = gen-rebuild.lib;
    in
    {
      # use rebuild.build, rebuild.override, rebuild.affected, …
    };
}

Without flakes

gen-rebuild takes its three gen deps as values (no <nixpkgs> lib). The sibling standalone shims auto-derive prelude from their pinned lock, so each is a plain import:

let
  prelude = import ./path/to/gen-prelude;      # the pure lib value itself
  graph = import ./path/to/gen-graph { };      # auto-derives prelude
  scope = import ./path/to/gen-scope { };       # auto-derives prelude
  rebuild = import ./path/to/gen-rebuild { inherit prelude graph scope; };
in
rebuild.build {
  accessor = …;
  recompute = …;
  hashOf = …;
}

Example

A node's value is its own weight plus the sum of its dependencies' values. Override one node, and only its dependent cone recomputes — the rest is reused untouched:

let
  inherit (rebuild) build override affected;

  # a depends on b depends on c (edges a=["b"], b=["c"], c=[]).
  accessor = graph.mkGraph {
    edges = [
      { from = "a"; to = "b"; }
      { from = "b"; to = "c"; }
    ];
    nodeData = {
      a = { weight = 1; };
      b = { weight = 10; };
      c = { weight = 100; };
    };
  };
  recompute =
    acc: store: id:
    (acc.nodeData id).weight + builtins.foldl' (sum: dep: sum + store.${dep}) 0 (acc.edges id);
  hashOf = v: builtins.hashString "sha256" (builtins.toJSON v);

  ctx = build { inherit accessor recompute hashOf; };
  # ctx.store == { a = 111; b = 110; c = 100; }

  ctx' = override ctx "c" { weight = 200; };
  # affected ctx "c" == [ "a" "b" ]            (c's cone, besides c itself)
  # ctx'.store == { a = 211; b = 210; c = 200; } — recomputed {a,b,c}, nothing else
in
ctx'.store

API Reference

build

build :: { accessor, recompute, hashOf, fixpoint ? null } -> BuiltCtx

Full evaluation into a flat store + verifying trace.

  • accessor — a gen-graph accessor { edges, nodes, nodeData, parent }.
  • recompute :: accessor -> store -> id -> value — the caller's node-eval.
  • hashOf :: value -> hash — a content hash; partial on function-bearing values (treated as always-dirty, trace.<id>.hash = null).
  • fixpoint ? null — when null (default), build is exactly v1 (see below). When present ({ lattices = { <id> = { bottom; join; … }; }; }), build admits cycles whose every node carries a lattice and solves the store condensation-stratified — see Cyclic fixpoints.

In the v1 (acyclic) path it pre-checks acyclicity via graph.cycles and throws a catchable located-cycle blame on a cycle — the { why; cycle; path } record is constructed from graph.cycles and embedded in the thrown error, so builtins.tryEval catches it instead of diverging inside the prelude.fix loop.

Returns BuiltCtx = { store, trace, accessor, recompute, hashOf } (plus fixpoint when one was supplied).

override

override :: BuiltCtx -> changedId -> newDecls -> BuiltCtx

Replaces changedId's nodeData with newDecls, recomputes only the dependent cone via the reverse-topo splice, and reuses the rest byte-for-byte. Returns an updated BuiltCtx, so overrides chain soundly. v1 changes node data, not topology (edges fixed) — see Scope & Soundness.

affected (alias impactOf)

affected :: BuiltCtx -> id -> [id]

The dependent cone of id — everyone who transitively depends on it (graph.dependentsOf over the ctx's accessor). This is the set override must recompute, besides id itself.

dirtySet

dirtySet :: BuiltCtx -> [changedId] -> [id]

Deduped union of the changed ids and their dependent cones (the cheap over-approximation; the hash-cutoff that prunes unchanged-hash nodes is earlyCutoff / needsEval, and the exact subset is affectedSet).

Strategies

The three reuse predicates, all routed through the null-safe hash gate.

verify      :: BuiltCtx -> { accessor', spliced } -> id -> { reuse; value }
earlyCutoff :: { hashOf } -> { oldHash, newValue } -> bool
needsEval   :: { trace, coneSet, newHashOf, accessor' } -> changedId -> id -> bool
  • verify — Mokhov §4.2 trace-validity: reuse iff id's recorded deps still match and every dep's hash is clean.
  • earlyCutoff — RTD §4.1 unchanged-value cutoff (post-recompute): true iff the freshly recomputed value hashes equal to oldHash.
  • needsEval — RTD §5.3 NeedToBeEvaluated (pre-cutoff): the single gate override/affectedSet/propagate share; recompute iff id is the changed id, has a null hash, or has an in-cone dep whose hash moved.

Exact AFFECTED

affectedSet :: BuiltCtx -> { accessor', changedIds } -> { affected; hashes; reused }

The exact AFFECTED set for a multi-id data change (RTD §4.3): splices the over-approx cone with the needsEval gate, then post-filters affected to the nodes whose hash actually moved (affected ⊆ cone). reused are the unaffected cone nodes; hashes are the new hashes for the whole cone. Data-change envelope (acyclic, fixed edges).

Provenance

The pure read layer over the trace — zero recompute. Name-faithful to Radul §6.1 (no TMS, no merge-lattice, no worldviews).

support       :: BuiltCtx -> id -> [id]
supportDirect :: BuiltCtx -> id -> [id]
why           :: BuiltCtx -> { id, changedId, cutoffs ? {} } -> WhyResult
whyNot        :: BuiltCtx -> { id, changedId, cutoffs ? {} } -> reason | null
whyFor        :: BuiltCtx -> { changedId, cutoffs ? {} } -> id -> WhyResult
whyNotFor     :: BuiltCtx -> { changedId, cutoffs ? {} } -> id -> reason | null
  • support — the transitive declared producers of id (the dual of affected), read from the trace snapshot.
  • supportDirect — the depth-1 declared producers (immediate in-edges).
  • why — the verdict an override of changedId would produce for id: unaffected / recomputed / cutoff (Acar §7 read-rule, reframed).
  • whyNot — the negative wrapper: null when recomputed, else the reason.
  • whyFor / whyNotFor — the amortized duals, curried on changedId. Membership in the recompute cone is loop-invariant across the ids of one change, so these bind the cone once (Arntzenius reverse reachability, via dirtySet) and return a function to spend over as many ids as the caller has. why / whyNot keep the per-call point query: the amortization is the caller's decision, not a cost imposed on the caller asking once. Only the membership decision is amortized — under a non-empty cutoff overlay both routes enumerate paths per id alike.

Drivers

The Acar change/propagate split, batching, pull-semantics force, and the fused override. Dirtiness is a value (ctx.pending.dirty), not a mutated flag.

applyDelta     :: BuiltCtx -> changedId -> newDecls -> BuiltCtx
batch          :: BuiltCtx -> [{ id, newDecls }] -> BuiltCtx
propagate      :: BuiltCtx -> BuiltCtx
propagateEager :: BuiltCtx -> { <changedId> = newDecls; } -> BuiltCtx
force          :: BuiltCtx -> id -> value
forceCtx       :: BuiltCtx -> id -> { value; ctx }
override       :: BuiltCtx -> changedId -> newDecls -> BuiltCtx
  • applyDelta — Acar §4.3 change: rewrite changedId's data, stage it in pending.dirty, recompute nothing.
  • batch — fold applyDelta over many deltas (one propagate then drains them).
  • propagate — Acar §4.5 drain-to-quiescence: union-cone splice over all seeds, needsEval-gated, clearing pending.
  • propagateEager — opt-in cut-heavy fast path: a rank-ordered eager-push that constructs only O(|AFFECTED| + frontier) nodes on localized edits, byte-identical to propagate. The topological propagation order and the AFFECTED post-filter are RTD §4.3/§5; "eager push" is gen-rebuild's own name for its own variant and is not the paper's term. A constant-factor expensive-axis win on cut-heavy edits — not a total-work O(|AFFECTED|) bound (it still pays O(|cone|) cheap drive bookkeeping). Use propagate for full rebuilds; see Cut-heavy fast path.
  • force / forceCtx — Hammer/Adapton demand: drain then read the value (forceCtx also returns the quiescent ctx). Full-drain, not Adapton's selective per-edge repair (the dropped S6 seam).
  • override — the fused convenience propagate ∘ applyDelta; this is the exported override (it shadows the standalone definition via the //-fold), byte-identical on .store/.trace for a data change.

Structural

Topology-changing deltas (edges move, not just data). Both rebuild a full accessor record and re-write trace.deps for every edge-touched node.

mkAccessor    :: { edges, nodes, nodeData, parent } -> accessor
retract       :: BuiltCtx -> deadId -> retractPolicy -> BuiltCtx
applyEdgeDelta :: BuiltCtx -> changedId -> newEdges -> BuiltCtx
  • mkAccessor — rebuild a full accessor record (edges deduped via prelude.unique).
  • retract — delete deadId and splice it out of every dependent. The name is borrowed from Radul §6.2 kick-out!; the destructive delete is not. Radul's kick-out! marks a premise out of the current worldview and is undone by its dual bring-in! — it is reversible and deletes nothing, so retract is gen-rebuild's own operation under a borrowed name, not a "half" of his. The delete mechanism is Acar §4.5 obsolete-edge splice-out. retractPolicy ∈ { "error", "recompute-without" } (default "error" throws on declared in-edges). No cycle recheck — deletion only shrinks the graph.
  • applyEdgeDelta — Forgy modify = delete + add over a node's edge set: replace changedId's edges (deduped), sub-build any newly-reachable producers, then reverse-cone splice. A located reCycleCheck runs when edges were added.

Cyclic

Graphs outside the acyclic envelope. No optimality claim — fixed-point-equality to the unique lfp, with a maxIter divergence blame.

build (fixpoint param) :: { …, fixpoint = { lattices } } -> BuiltCtx
runScc      :: { accessor, store, recompute, scc, higherStrata, lattices } -> { <id> = value }
restabilize :: BuiltCtx -> changedId -> newDecls -> BuiltCtx
  • build's fixpoint param — see Cyclic fixpoints.
  • runScc — solve one SCC to its least fixed point by iterating each member's lattice from ⊥ to quiescence (Arntzenius Lemma 4 ascent, or Sloane §2.2 naive iterate-to-stabilization for an overwrite join).
  • restabilize — the cyclic-capable override: re-solve only the change's cone, acyclic strata by recompute-and-splice (== override), cyclic strata by runScc. Requires ctx.fixpoint != null.

Edge Convention

accessor.edges id = [ids that id depends on] (consumer → producer). graph.mkGraph [{ from; to; }] makes edges from = [to]. Therefore the dependent cone of a change to x is graph.dependentsOf accessor x — everyone who transitively depends on x.

Scope & Soundness

A data-change override produces a store byte-identical to a from-scratch rebuild with changedId := newDecls — property-tested over 120 seeded random DAGs plus fixed adversarial shapes. The guarantee is precisely scoped:

  • Data, not topology. newDecls replaces only the node's nodeData; edges are fixed, so the cone computed over the old accessor is exactly the affected set and acyclicity is preserved. Topology-changing override (altering a node's dep set) is the v2 seam (applyDelta / retract), out of v1 scope.
  • Hashable values. Store byte-equality is over toJSON-able node values; a function-valued node is sound-by-always-dirty (hash = null), not by ==.
  • Located cycles, not divergence. With fixpoint = null a cyclic accessor yields a catchable throw (the { why; cycle; path } blame embedded in the error), never Nix's uncatchable infinite recursion. tryEval does not catch a prelude.fix black-hole, so divergence is guarded structurally — by the located prechecks (graph.cycles, reCycleCheck) and by runScc's maxIter, never by catching infinite recursion.

Cyclic fixpoints

build's fixpoint param is the opt-in to cyclic graphs. With fixpoint = null (default) build is exactly v1 — throw-on-any-cycle, prelude.fix store, no fixpoint key in the ctx. When present, a cycle is admitted iff every cyclic node carries a declared per-node lattice:

ctx = build {
  inherit accessor recompute hashOf;
  fixpoint.lattices = {
    a = { bottom = { }; join = prev: cur: prev // cur; };  # genuine-join semilattice
    b = { bottom = { }; join = prev: cur: prev // cur; eq = (a: b: a == b); widen = null; maxIter = 100; };
  };
};

build then solves the store condensation-stratified, producers-first: each acyclic singleton recomputes reading already-converged lower strata; each cyclic SCC is solved once by runScc (iterate each member's lattice from ⊥ to quiescence). restabilize re-solves a change's cone the same way.

Three caveats:

  • Fixed-point-equality, not byte-identity. A cyclic SCC's value matches a from-scratch build by equality of two fixpoint computations to the same unique least fixed point (Arntzenius Lemma 4 on a finite-height bounded semilattice) — not the v1 byte-identical-to-the-acyclic-prelude.fix property. The acyclic strata retain the v1 byte-identical guarantee.
  • Consumer obligation: monotonicity + finite height. runScc does not check that recompute/join are monotone or that the lattice is finite-height. A non-monotone step can oscillate; an infinite-ascending chain never quiesces. Use widen to force finite ascent on tall lattices.
  • The only divergence guard is maxIter. On overrun runScc throws a located, tryEval-catchable fixpoint-diverged blame. The cyclic path is explicitly outside RTD's acyclic envelope — no O(|AFFECTED|) optimality, no never-assign-a-non-final-value invariant.

Deferred: the cut-heavy expensive-axis fast path SHIPPED as propagateEager (opt-in V-push). True total-work O(|AFFECTED|) (RTD characteristic-graph cutoff edges, containment-pruned propagation, the Adapton selective per-edge repair) is not a pure intra-eval optimization — the v3 minimality spike proved it unreachable in a single pure eval (verdict PARTIAL). It needs the impure cross-eval substrate (a stateful shell, not a deferred component), which is out of scope for this pure library.

Cut-heavy fast path

propagateEager is the opt-in eager-push variant of propagate for localized edits — e.g. overriding one host in a large fleet. Where propagate materializes the full reverse-reachable cone and post-filters AFFECTED, propagateEager recomputes nodes in producers-first rank order and cuts at the source: when a node recomputes to its prior hash it enqueues nothing, so the unmoved tail past the cut is never constructed. The result store is byte-identical to propagate (the unmoved and non-cone nodes carry through from the prior store — the §4(B) carry).

The win is precisely scoped, per the v3 minimality spike (verdict: PARTIAL):

  • It is a constant-factor expensive-axis win on cut-heavy edits, not an O(|AFFECTED|) total bound. On the expensive axis (recompute / hash / alloc — the ~94% of real cost) it constructs only O(|AFFECTED| + frontier) nodes; on cut-heavy shapes (|AFFECTED| ≪ |cone|) that is ~12–15% of the cone. But it still pays O(|cone|) cheap drive bookkeeping (the cone-local rank precompute + the rank-ordered sweep) regardless, so total work is floored at O(|cone|). It does not beat O(|cone|) total, and it does not generalize: on full-propagation shapes (every cone node moves) it constructs the whole cone and exactly matches propagate.
  • When to use: localized / cut-heavy edits where |AFFECTED| ≪ |cone|. When not: full rebuilds (every cone node moves) — there the eager push gets no win and propagate is the simpler default.
  • Envelope: data-change only (edges fixed, like override) and an acyclic cone (the rank recurrence requires it); a cyclic cone stays in restabilize / runScc.

True sub-cone total work (cross-edit amortization of the ordering bookkeeping) is unreachable in a pure single eval and needs the deferred cross-eval persistence layer — out of scope here.

Demo

examples/dag/ — the B demo: override one host of a small synthetic fleet and watch only its dependent cone recompute (proven by a poisoned recompute), byte-identical to a full rebuild, with a cyclic variant — an undeclared cycle resolves to a located blame, while a lattice-declared cycle re-stabilizes via runScc.

nix eval -f examples/dag

It also contrasts the dirty-bit rebuilder — gen-rebuild externalizes the graph and store as inspectable values — with the effects paradigm (zen, where re-evaluation is scoped and memoized by effect handlers): two dual lenses on one incremental core. A runnable zen side-by-side is a v1 follow-on TODO.

Testing

cd ci && nix flake check                       # whole suite
nix-unit --flake ./ci#tests.<suite>.<test>     # a single suite/test

Uses gen.lib.mkCi (nix-unit). 211 tests across 15 suites (affected, affectedSet, build, demo, dirtySet, drivers, eager, hash, override, provenance, purity, restabilize, smoke, strategies, structural), including the 120-seed soundness property (shared by override/propagate/propagateEager), the B demo's thesis assertions, and the cyclic/structural cases (fed by the gen/cyclicGen/structuralGen deterministic seeded generators). The purity suite is the Class-B invariant: it fails CI if any nixpkgs.lib / evalModules / nixpkgs input creeps back into the library source.

Theoretical Foundations

Paper Relationship Used for
Mokhov, Mitchell & Peyton Jones (2018) "Build Systems à la Carte" Implements The rebuilder dimension, factored from the scheduler (gen-scope) and topology oracle (gen-graph); the dirty-bit rebuilder over the store (§3.1 — the paper's store is a keys→values mapping; flat and relocatable are gen-rebuild's own properties of its store, not §3.1's) + verifying trace (§4.2.2), verify (§4.2), acyclicity precheck (§2.1/§4.1)
Reps, Teitelbaum & Demers (1983) Informed by The AFFECTED set (§4.3, affectedSet/the post-filter), the unchanged-value cutoff (§4.1, earlyCutoff), NeedToBeEvaluated (§5.3, needsEval); true O(|AFFECTED|) optimality + characteristic graphs were the v3 go/no-go gate — spike verdict: unreachable in a pure eval, needs the cross-eval substrate
Acar et al. (2002) "Adaptive Functional Programming" Informed by The change/propagate split (§4.3 applyDelta, §4.5 propagate), the change-propagation algorithm (§7 correctness), the adg read backward for support (§4.4). The reverse-topo splice is gen-rebuild's own mechanism and its own phrase (priorStore // fix-of-cone) — Acar et al. do not characterise propagation in reverse topological order, and the phrase is not theirs. Containment recovery for O(|AFFECTED|) was the v3 open problem — closed for pure eval by the spike (needs the cross-eval substrate)
Forgy (1982) "RETE" Informed by The ± change-token vocabulary: applyDelta/batch are the + token, applyEdgeDelta is modify = delete + add
Hammer et al. (2014) "Adapton" Informed by The demand/force interface (force/forceCtx). Note: our force is full-drain, not Adapton's selective per-edge repair (the dropped S6 seam, impure / O(N²) in pure Nix)
Radul & Sussman (2009) "Art of the Propagator" Informed by Provenance (§6.1 support, name-faithful only — support/why/whyNot) + the name kick-out! for retract (§6.2). ★ Radul's kick-out! is a reversible premise-marker, not a delete: it marks a premise out of the current worldview, its dual bring-in! marks it back in, and nothing is removed from the graph — so retract's destructive delete is gen-rebuild's own operation under a borrowed name, not a "half" of his (its mechanism is Acar §4.5). No TMS / merge-lattice / worldviews
Arntzenius & Krishnaswami (2016) "Datafun" Informed by The dependent cone is gen-graph's reverse reachability (a Datafun-derived query); Lemma 4 (finite-height iterate-from-⊥) grounds runScc's genuine-join lattices
Sloane (2010) §2.2 / Magnusson–Hedin "Circular Reference Attributes" Informed by The overwrite / no-op "join" case for runScc: naive iterate-to-stabilization (converges by peer-agreement, not lattice ascent)
Tarjan (1972) / Kosaraju Informed by The SCC partition + condensation (via gen-graph, closure-based O(n²)) that stratifies the cyclic build/restabilize solve producers-first

License

MIT

About

gen-rebuild: pure-Nix incremental rebuilder core (Mokhov rebuilder dimension)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages