Skip to main content

recompute

Function recompute 

Source
pub fn recompute(
    state: &mut VirtualRowsWorkerState,
    render_state: &ArcSwap<RenderState>,
    providers: &VirtualRowProviderRegistry,
) -> WorkerDecision
Expand description

Pure sync recompute. Iterates rs.cells.panes, dispatches each to recompute_pane, and aggregates the per-pane decisions into a single one for the async loop. Returns the aggregate so tests can assert behaviour without driving run.

D.4.d.2.1.c (2026-05-30): switched from a single global matrix_cell write target to per-pane iteration over rs.cells.panes. Each pane carries its own pane.virtual_rows_matrix registry cell (D.4.d.2.1.b publish-time scaffold), which the worker writes via pane.virtual_rows_matrix.store(...). Active-pane entries share Arc identity with Editor::virtual_rows_matrix_cell (D.4.d.2.0 boot seed) so the existing renderer read path through RenderState.virtual_rows.matrix is bit-identical for single-pane flows until D.4.d.2.1.d swaps the renderer to per-pane lookup.

Aggregate decision precedence: Recomputed > Clear > CacheHit. Mirrors the cells worker’s precedence (minus the incremental path virtual rows don’t have). Recomputed or Clear content changes; the async loop fires paint_request on either.