Template Function sequant::cache_manager(meta::eval_node_range auto const&, auto&&, size_t, FootprintOf, double)

Function Documentation

template<bool force_hash_collisions = false, typename FootprintOf = zero_footprint>
auto sequant::cache_manager(meta::eval_node_range auto const &nodes, auto &&is_volatile, size_t min_repeats = 2, FootprintOf footprint_of = {}, double max_footprint = 0.)

Parameters:
  • nodes – the evaluation forest.

  • is_volatilebool(TreeNode const&): true if the node is intrinsically volatile. Only its value on leaves matters in practice (volatility propagates up), but it is consulted on every node.

  • min_repeats – minimum NP repeats to cache (default 2).

  • footprint_ofdouble(TreeNode const&): the materialized storage footprint of a node’s result (e.g. its element count or byte size). Consulted only when max_footprint > 0.

  • max_footprint – footprint gate: any node whose footprint_of exceeds this is NOT cached (neither as an NP repeat nor as a P frontier node), so it is recomputed by each consumer instead of being materialized whole and held. This bounds the peak/sustained footprint of huge intermediates that carry a free large-space index (e.g. a half-transformed DF integral with a free projected-AO index), at the cost of recomputation. 0 (default) disables the gate.