pub struct TileDiffConfig {
pub enabled: bool,
pub tile_w: u16,
pub tile_h: u16,
pub skip_clean_rows: bool,
pub min_cells_for_tiles: usize,
pub dense_cell_ratio: f64,
pub dense_tile_ratio: f64,
pub max_tiles: usize,
}Expand description
Configuration for tile-based diff skipping.
Uses a summed-area table (SAT) to perform constant-time tile row and
rectangle dirty-density queries, skipping clean tile rows wholesale.
Performance measurements and ablation results are recorded in
docs/perf/sat_tile_skip_2026-09.md.
Fields§
§enabled: boolWhether tile-based skipping is enabled.
tile_w: u16Tile width in cells (clamped to [8, 64]).
tile_h: u16Tile height in cells (clamped to [8, 64]).
skip_clean_rows: boolSkip scanning clean rows when building tile counts.
When true, the tile build only scans rows marked dirty, reducing build cost for sparse updates. Disable to force full-row scans.
min_cells_for_tiles: usizeMinimum total cells required before enabling tiles (default: 12,000, i.e. 200x60).
Smaller viewports (e.g. 80x24 = 1,920 cells) fall back to direct row diffs
because SAT construction overhead exceeds tile skip savings below this threshold
(see docs/perf/sat_tile_skip_2026-09.md).
dense_cell_ratio: f64Dense cell ratio threshold for falling back to non-tile diff.
dense_tile_ratio: f64Dense tile ratio threshold for falling back to non-tile diff.
max_tiles: usizeMaximum number of tiles allowed (SAT build budget; fallback if exceeded).
Implementations§
Source§impl TileDiffConfig
impl TileDiffConfig
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Toggle tile-based skipping.
Sourcepub fn with_tile_size(self, tile_w: u16, tile_h: u16) -> Self
pub fn with_tile_size(self, tile_w: u16, tile_h: u16) -> Self
Set tile size in cells (clamped during build).
Sourcepub fn with_min_cells_for_tiles(self, min_cells: usize) -> Self
pub fn with_min_cells_for_tiles(self, min_cells: usize) -> Self
Set minimum cell count required before tiles are considered.
Sourcepub fn with_skip_clean_rows(self, skip: bool) -> Self
pub fn with_skip_clean_rows(self, skip: bool) -> Self
Toggle skipping clean rows during tile build.
Sourcepub fn with_dense_cell_ratio(self, ratio: f64) -> Self
pub fn with_dense_cell_ratio(self, ratio: f64) -> Self
Set dense cell ratio threshold for falling back to non-tile diff.
Sourcepub fn with_dense_tile_ratio(self, ratio: f64) -> Self
pub fn with_dense_tile_ratio(self, ratio: f64) -> Self
Set dense tile ratio threshold for falling back to non-tile diff.
Sourcepub fn with_max_tiles(self, max_tiles: usize) -> Self
pub fn with_max_tiles(self, max_tiles: usize) -> Self
Set SAT build budget via maximum tiles allowed.