Function sequant::eval::dryrun::meter

Function Documentation

inline MeterReport sequant::eval::dryrun::meter(std::vector<EvalNodeDryRun> const &forest, BatchPolicy const &policy, SizeRegime const &regime, CacheConfig const &cfg, std::ostream *trace = nullptr)

Runs the policy-selected executor (forest descent or ordered, per policy.scheduler) over forest through the DryRun sizing backend, metering the replay with a fresh, PeakMonitor -wired, build-tallying cache, and returns the assembled MeterReport.

Mirrors MPQC’s wet dispatch: this drives the same driver entry point (

sequant::evaluate(Nodes const&, BatchPolicy const&, layout, F,

CacheManager&, mode_order, ScopeGuardFactory)

, ordered_executor.hpp) a real solve would use under policy &#8212; both executors are selected by the same policy.scheduler, not independently maintained code paths &#8212; so the metered replay is exactly the run policy describes, not a hand-rolled proxy of it. Non-throwing wrapper (if desired) is the caller’s responsibility; an exception from the replay propagates out of this call, but the RAII logger-state guard still restores Logger::instance().eval on the way out.

Parameters:
  • forest – the evaluation forest (a range of EvalNodeDryRun).

  • policy – the batch policy driving the coexistence entry &#8212; in particular scheduler (executor selection) and batch_target_size (the batch-partition source; also the source of the block_of function this call builds its own rich schedule with, for assemble_report &#8212; the coexistence entry builds an independent, internal RichSchedule of its own from the same policy.batch_target_size to drive the executor).

  • regime – the size regime supplying the DryRun CostModel.

  • cfg – cache configuration (footprint gate, min repeats, volatility) for the metered cache, built exactly as build_dryrun_cache does (same footprint arithmetic, same is_volatile default) &#8212; not via that builder directly, since its is_volatile default (substituted for an empty cfg.is_volatile) is internal to it and would otherwise be invisible to assemble_report below, which also needs a callable predicate (an empty cfg.is_volatile passed to it directly throws std::bad_function_call from compute_volatility). The same locally-defaulted predicate is used for both.

  • trace – optional sink for the eval trace; when non-null, Logger::instance().eval.stream is redirected there for the duration of the call (restored on exit, along with the elevated eval.level and the installed eval.node_meta).

Returns:

the assembled MeterReport (peak, persistent/volatile FLOPs+time, build-vs-home fidelity), stamped with policy.scheduler.