Skip to main content

predict_linear_instants

Function predict_linear_instants 

Source
pub(crate) fn predict_linear_instants(
    grid: GridSpec,
    fold_offset: i64,
) -> Result<()>
Expand description

Checks that predict_linear can read the instant of every point of grid once shifted by fold_offset.

Unlike every other range function, which reads the window a grid point opens alone, predict_linear reads the instant it reports as well, and reports it shifted by the fold offset. The first and the last point are the ones checked: the shift is the same at every point and the grid’s points are ordered, so what fits at both ends fits between them.

The refusal is arithmetic rather than shape, but it is decided by the grid and the window alone, which is why the native route’s admission predicate reaches it too (native_tree_supported): a query refused only here has to keep the plan it had instead of failing while its runtime is built.