Function sequant::eval::detail::ordered_forgo_reads

Function Documentation

inline void sequant::eval::detail::ordered_forgo_reads(CellRegistry &registry, ForgoPlan const &plan, CellId c, std::size_t base_depth)

Spends the reads a skipped production of c will not perform, so its sources still reach the end of their declared lives and are released there (a source nobody ever finishes reading stays resident to the end of the evaluation and keeps looking shared, which disables in-place accumulation for it). base_depth says how much the skip collapses: the consumer’s own scope depth for a skipped visit, the skipped block’s parent scope depth for a whole-block skip (see ordered_elided_reads).

The count is clamped to the source’s remaining life. A source that is itself skipped is never produced, so its life is never restored, while its skipped consumers keep being visited: their visits legitimately outnumber the one production’s budget the table charged. Clamping there is exact (the budget is fully forgone, nothing is left to release); the registry’s own throw stays as the tripwire for a genuine over-forgo.