Template Function sequant::eval::detail::compute_cell¶
Defined in File ordered_executor.hpp
Function Documentation¶
-
template<Trace EvalTrace, typename node_t, typename F, typename N, bool FHC>
ResultPtr sequant::eval::detail::compute_cell(node_t const &node, CellId cell, CellReadResolver &resolver, F const &leaf_evaluator, CacheManager<N, FHC> &cache, eval::BatchContext const &ctx)¶ Compute one cell’s value, reading every operand through the cell table.
The ordered executor’s own compute step: what a Build cell (and an Assemble’s implicit per-batch source) is produced by.
nodeis the value’s production node — one op over its operands — andcellis the consumer the table resolves those operands against.Each operand leg is a table
Readofcell:CellReadResolver::fetchnames the source cell, spends one of its declared lives and applies the Read’s declared slices, and the value comes back in the registry’s canonical orientation, which this converts to the operand node’s own orientation (apply_canon_phase). Two cases do not resolve to a held cell:a leaf’s first touch:
fetchdefers (leaving the Read unconsumed), the leaf evaluator runs on the whole leaf, the result is recorded as that leaf’s cell in the canonical orientation, and the Read is then served — which is what applies the declared slice. Serving the whole leaf here instead would hand the consumer a whole operand where the schedule says a batch slice;a node the table holds no cell for: a transient of this production tree. It is computed here, in place, from its own operands (recursively, by the same rules) — the executor never hands a production back to the tree-walking engine.
The op itself is
apply_one_op_traced(the shaped-product hook, the recompute tally and the per-op trace event included), orsum_in_place_tracedfor an accumulatingSumwhose left operand the table says nothing will read again (CellReadResolver::operand_drained— the table-side answer to the provenance questionevaluate_implasks the scope chain). The production’s own node and every transient of its tree go through the same gate (apply_opbelow).- Parameters:
ctx – The batch context every declared slice is bound against: the enclosing realized loops plus, inside a block’s batch loop, that block’s own entry. Same context the caller put on
cache.- Returns:
node'sown oriented result (the caller converts it to the canonical orientation the registry stores).