Expand description
Async parallel solver with work distribution.
Per parallel_review §2 / summary_review §2, the previous
implementation cloned the entire DagArena once per worker chunk
and spun an OS thread per chunk via std::thread::spawn. For a
million-node DAG split into 16 chunks that’s 16 × ~88 B × 1 M ≈
1.4 GB of redundant allocations and 16 native thread spawns.
The rewrite:
- Arena is shared read-only via
Arc<DagArena>— one Arc bump per fan-out instead of N clones. - Tasks dispatch through
crate::runtime::parallel_for_each, which usesdtactfibers (plan.md §4.3). evaluate_nodeis now iterative (worklist + value stack) instead of recursive — no more stack-overflow risk on deep expressions.
Structs§
- FnEval
Registry - Registry of function-pointer callbacks for parallel evaluation of
SymbolKind::Functionnodes. - OpEval
Registry - Registry of operator-evaluation overrides for the parallel evaluator.
Functions§
- evaluate_
node - Evaluates a single DAG node against the variable bindings, iteratively.
- evaluate_
node_ with_ fns - Variant of
evaluate_nodethat supportsSymbolKind::Functionnodes via a user-suppliedFnEvalRegistry. - evaluate_
node_ with_ overrides - Variant of
evaluate_node_with_fnsthat also accepts anOpEvalRegistryfor overriding built-in operator evaluation. - parallel_
evaluate - Solves and evaluates a set of expression-leaf chunks in parallel.
- parallel_
evaluate_ shared - Zero-clone parallel evaluator. The arena is shared read-only across
all worker fibers via
Arc; no per-chunk duplication.