Function sequant::eval::disk_eligible_cells

Function Documentation

inline container::vector<char> sequant::eval::disk_eligible_cells(CellTable const &table, std::function<bool(std::size_t value_id)> const &is_volatile_leaf = {})

The cells of table whose value the schedule can keep on disk between uses (see DiskSpill ).

A cell qualifies when its value is held whole, once, for readers:

  • it is at the root scope, whole (no sliced position) and complete (not a partial sum): a form inside a loop is rebuilt per batch, and is not idle long enough to be worth the I/O;

  • it is built, fetched as a leaf, or assembled by scattering its per-batch partials into disjoint blocks. A value assembled by summing its partials is updated in place by every batch, which a value on disk cannot be;

  • some other cell reads it: a cell nothing reads at the root scope is a result of the evaluation, which the caller takes;

  • it is not a volatile leaf (is_volatile_leaf, by value id): that is an input the caller owns and changes between evaluations. Size plays no part here; DiskSpill::min_bytes is applied to the value once it exists.

Parameters:

is_volatile_leaf – whether the value with a given id is a volatile leaf; empty means no value is

Returns:

one flag per cell of table, nonzero for a qualifying cell