Function sequant::eval::detail::ordered_elided_reads

Function Documentation

inline std::size_t sequant::eval::detail::ordered_elided_reads(ForgoPlan const &plan, CellId consumer, CellId source, std::size_t base_depth)

How many reads of source one skip of consumer's production elides, when the skip is taken at scope depth base_depth (the depth of the scope the skip decision was made at): the product of the batch counts of the loop instances on consumer's scope path from base_depth inward that source is not resident on.

This is exactly detail::read_multiplicity restricted to a suffix of the consumer’s path — with base_depth 0 the two agree literally — and the suffix is what makes it the count of elided reads rather than of all reads: a skip taken at base_depth recurs once per batch of every loop outside it, and each such recurrence is a fresh production epoch of a source homed out there, whose life the table charged once per epoch. A per-visit skip passes base_depth = the consumer’s own scope depth and so elides exactly one read per leg, which is what one visit performs.