← All papers
First page of Fast Stencil Computations on a Single Arbitrarily Moving Interval

Fast Stencil Computations on a Single Arbitrarily Moving Interval

Aaron Gregory

cs.DS Sep 14, 2026 · v2 cs.DC
All correctness and work/span results for the moving-interval stencil schedule are machine-checked in Lean 4, with the classical convolution bound imported as an interface.
A stencil computation repeatedly updates every cell of a grid from its neighbours' values at the previous timestep. Simulating T steps on N cells directly costs Theta(NT), and a line of work beginning with Ahmad et al. reduces this by composing many timesteps into one linear operator and applying it with a Fast Fourier Transform. That technique needs to know which cells will still obey the same operator when the composed step ends, and in a free-boundary problem they do not: the region governed by a given rule is determined by the solution and moves as it evolves. We study one spatial dimension, a three-point stencil with time-varying coefficients, and a computed region that is a single interval whose two endpoints move by arbitrary amounts at every step, revealed online. Let B be the horizon plus the total variation of the boundary trajectory. We give a schedule whose work is O((B+N) log T log(N+B)) and whose span is O(T log T log(N+B)), and we prove that the values it computes are exact. The best existing bound for a region that moves requires its boundary to travel at most one cell per timestep. We drop that requirement and lose nothing by it: a boundary obeying it has B <= 3T, so our bound stays near-linear on every trajectory the earlier result covers. Elsewhere, B grows only by the distance the boundary actually travels – one jump of width N costs T + 2N. The reason total variation suffices is that everything the two endpoints touch over a time window of any length lies in two intervals, one per endpoint. This cannot be relaxed: with p regions the bound degrades by a factor p, and at p = sqrt(T) there is an instance on which the work is Theta(T^{3/2}) while B + N = Theta(T). All results are machine-checked in Lean 4, apart from the classical convolution bound, which is imported as an interface.

FFT-based stencil algorithms compose many timesteps into one convolution. This requires knowing which cells stay under the same operator. In free-boundary problems the governed region moves with the solution, and earlier bounds required the boundary to move at most one cell per step.

The setting is a 1D three-point stencil with time-varying coefficients on a single interval whose endpoints move arbitrarily and are revealed online. A closed-form 'cursor' gives the cells computable from a past slice, and shells at dyadic levels are filled at triggers set by the 2-adic valuation. Each shell's cost is charged to a backward window. A chaining lemma shows all endpoint activity in any window lies in two intervals bounded by the total variation.

The schedule computes exact values with work O((B+N) log T log(N+B)) and span O(T log T log(N+B)), where B is the horizon plus the boundary's total variation. With p regions the bound degrades by a factor p, and at p = sqrt(T) there is an instance with Theta(T^{3/2}) work. All results are verified in Lean 4.

MethodWorkSpanBoundary may move
Direct simulationΘ(NT)Θ(T)freely
Bentley et al.O(N log N log T)O(T log N log log N)one cell per step
This paperO((B+N) log T log(N+B))O(T log T log(N+B))freely
Comparison of bounds