Template Function sequant::eval::detail::cell_footprint

Function Documentation

template<typename BlockOfFn>
inline std::size_t sequant::eval::detail::cell_footprint(container::svector<Index> const &carried, container::svector<Index> const &home_modes, dryrun::CostModel const &cm, BlockOfFn const &block_of, container::svector<Index> const &divergent_modes = {})

Home-relative footprint of a cell via the existing dryrun::CostModel::memsize.

A cell homed at home_modes (depth

d = home_depth_of(

home_modes, ectx)

) sizes each carried mode m at block extent (via block_of) if m’s loop encloses the home &#8212; i.e. m appears in ectx at a level <= d &#8212; else at full (nominal regime) extent. Builds the dryrun::ExtentOverrides mapping exactly those block-sized modes to their block extent, then delegates the actual extent-product / composite-moment math to cm.memsize() verbatim: no sizing logic is reimplemented here.

block_of is any Index -> std::size_t callable giving the block (sliced) element count for a mode.

divergent_modes is informational only, and is retained for signature compatibility with existing callers. A divergent value homed at a sub-scope is un-folded into two non-divergent ValueCell s, each priced once here at its own home; peak co-residency is priced structurally by peak_profile_sweep over the two cells’ liveness intervals (which keys on value_id, so two cells of one hash need no sweep change), and the replication recompute is a separate, report-only term.