Template Function sequant::evaluate(Nodes const&, BatchPolicy const&, auto const&, F const&, CacheManager<N, FHC>&, std::initializer_list<std::wstring>, ScopeGuardFactory)

Function Documentation

template<Trace EvalTrace = Trace::Default, meta::can_evaluate_range Nodes, typename F, typename N, bool FHC, typename ScopeGuardFactory = make_no_scope_guard>
ResultPtr sequant::evaluate(Nodes const &forest, BatchPolicy const &policy, auto const &layout, F const &leaf_evaluator, CacheManager<N, FHC> &cache, std::initializer_list<std::wstring> mode_order = {}, ScopeGuardFactory make_scope_guard = {})

The batched-evaluation driver entry. Routes a whole-forest evaluation to either the per-tree forest descent (sequant::evaluate(Nodes const&, layout, leaf_evaluator, cache), eval.hpp &#8212; called unchanged) or the ordered executor (eval::evaluate_ordered), selected by policy.scheduler.

policy.scheduler == BatchScheduler::forest_descent (the default) is an unconditional forward to the existing sequant::evaluate(Nodes const&, layout, leaf_evaluator, cache) overload &#8212; no schedule is built, nothing else runs on this path. Because this is an additive overload (distinguished by the extra policy argument), a caller reaches this driver only by supplying a BatchPolicy explicitly; every other call resolves to the policy-free overload.

policy.scheduler == BatchScheduler::ordered builds the schedule from forest's own placement and drives the ordered executor &#8212; see eval::evaluate_ordered, to which mode_order and make_scope_guard are forwarded verbatim.

Parameters:
  • mode_order – Ranks the canonical loop-chain order (outermost first); only consulted on the ordered arm. See eval::evaluate_ordered.

  • make_scope_guard – Backend scope-guard factory; only consulted (and only constructed) on the ordered arm.