Template Function sequant::eval::evaluate_ordered

Function Documentation

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

The ordered arm of the sequant::evaluate(forest, policy, ...) dispatch: builds the schedule forest's own placement implies and drives evaluate_ordered_schedule with it.

Builds the RichSchedule (compute_dag_boulevard), the LegalitySchedule (analyze_legality) and the OrderedSchedule (build_ordered_schedule) from forest's own placement &#8212; the node_slice_mask() annotations a prior factorizer pass (e.g. optimize() with a batched objective, or a test that stamps them directly) already recorded on forest's nodes &#8212; then runs the ordered executor with policy.batch_target_size as the batch-partition source and make_scope_guard forwarded verbatim. The throwaway eval::dryrun::CostModel / SizeRegime built here are inert for compute_dag_boulevard (its cm parameter is unused, kept only for signature symmetry &#8212; see its doc comment); they carry none of policy's or the real backend’s sizing information.

The runtime operand reads of the ordered executor are table-driven (CellReadResolver, cell_registry.hpp), built inside detail::run_ordered_schedule_pre_results from this same schedule’s compute_sliced_mode_assignment &#8212; so they are correctly built and wired regardless of caller; there is no separate runtime slice-inference seam.

Parameters:
  • mode_order – Ranks the canonical chain order (outermost first; see build_ordered_schedule). Empty (default) falls back to alphabetical order per index type: chain order does not affect numeric correctness (only which axis nests outer vs. inner &#8212; a performance, not correctness, concern), so the default is safe; a caller that cares about nesting order (e.g. aux outer / occ inner, for peak) passes it explicitly.

  • make_scope_guard – Backend scope-guard factory, forwarded to evaluate_ordered_schedule verbatim.