Template Function sequant::eval::evaluate_ordered¶
Defined in File ordered_executor.hpp
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 scheduleforest'sown placement implies and drivesevaluate_ordered_schedulewith it.Builds the
RichSchedule(compute_dag_boulevard), theLegalitySchedule(analyze_legality) and theOrderedSchedule(build_ordered_schedule) fromforest'sown placement — thenode_slice_mask()annotations a prior factorizer pass (e.g.optimize()with a batched objective, or a test that stamps them directly) already recorded onforest'snodes — then runs the ordered executor withpolicy.batch_target_sizeas the batch-partition source andmake_scope_guardforwarded verbatim. The throwawayeval::dryrun::CostModel/SizeRegimebuilt here are inert forcompute_dag_boulevard(itscmparameter is unused, kept only for signature symmetry — see its doc comment); they carry none ofpolicy'sor the real backend’s sizing information.The runtime operand reads of the ordered executor are table-driven (
CellReadResolver, cell_registry.hpp), built insidedetail::run_ordered_schedule_pre_resultsfrom this same schedule’scompute_sliced_mode_assignment— 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 — 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_scheduleverbatim.