Template Function sequant::eval::dryrun::build_dryrun_cache

Function Documentation

template<typename NodeRange>
auto sequant::eval::dryrun::build_dryrun_cache(NodeRange const &nodes, CacheConfig const &cfg, SizeRegime const &regime)

Builds a gated dry-run cache from an eval-node range, a cfg, and a regime that supplies the moment-aware node-size model used for the footprint gate.

The footprint functor sizes a node’s result (its canon_indices()) with the same moment-aware counter the DryRun Result uses (memsize_counter over regime.idx_to_extent()/inner_pow_fn()), scaled to bytes, so the gate compares like-for-like against cfg.max_footprint.

Unlike the simple cache_manager(nodes) factory the ad-hoc dry-run test sites use, this routes through the gated overload so free-batchable-axis giants are vetoed (matching the real run). The returned cache is used across the whole forest without a per-summand reset (matching a real solve’s whole-iteration cache scope; the replay relies on the lifetime mask to release each value after its last cross-term use, so cross-summand-shared values are reused, not rebuilt).

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

  • cfg – footprint/repeat/volatility/batchability configuration.

  • regime – the size regime supplying extents and CSV moment tables.

Returns:

a CacheManager over EvalNodeDryRun.