Template Function sequant::eval::dryrun::compute_volatility¶
Defined in File meter.hpp
Function Documentation¶
-
template<class Forest, class IsVolatile>
std::unordered_map<std::size_t, bool> sequant::eval::dryrun::compute_volatility(Forest const &forest, IsVolatile const &is_volatile)¶ Bottom-up memoized volatility over an evaluation
forest:a node is volatile iffis_volatileflags it directly, or (for an internal node) either child is volatile — the same rule the gatedsequant::cache_managerfactory applies while building its NV/V frontier (see cache_manager.hpp’s DAG walk). Keyed byTreeNode::hash_value()(rather than the node identity itself) so a caller can classify aCacheManager::recompute_tally()entry — keyed by the same node identity but not necessarily the same node object — by its hash.- Parameters:
forest – the evaluation forest (a range of eval nodes).
is_volatile –
bool(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, matchingcache_manager'sgated factory.
- Returns:
a map from
hash_value()to whether that value is volatile.