Expand description
Incremental patch API: dirty tracking, grid diff, and change runs.
The patch module provides an efficient change representation so renderers (native ANSI presenter, WebGPU, trace replayer) can update incrementally.
§Architecture
Grid mutations → DirtyTracker (row + span hints)
↓
GridDiff::diff_dirty(old, new, tracker) → Patch
↓
Patch::runs() → Vec<ChangeRun> (for cursor-based output)
Patch::updates → Vec<CellUpdate> (for instance-based GPU upload)§Ordering guarantee
All outputs are in stable row-major order: row ascending, then column ascending within each row. This is deterministic for identical inputs.
Structs§
- Cell
Update - A single cell update at (row, col).
- Change
Run - A contiguous horizontal span of changed cells on a single row.
- Dirty
Span - A half-open column range
[start, end)marking dirty cells in a row. - Dirty
Tracker - Tracks which cells have been modified since the last frame.
- Grid
Diff - Compute diffs between two grids.
- Patch
- A minimal set of changes between two grid states.