grid: skip the per-cell ISO-protection resolve when no protected style exists #409

Closed
opened 2026-09-25 02:26:52 +09:00 by natsukium · 0 comments
Owner

Split from #401.

On kitten's csi payload (EL 2 per chunk), Grid::range_blank_inner (crates/felis-grid/src/editing.rs) resolves every blanked cell's style through the style table to test AttrFlags::ISO_PROTECTED, because EL/ED go through range_blank_iso. The #401 diagnosis measured it at 11.3% self time of the csi parse-into-grid floor, and a probe that skipped the check cut the floor's instructions:u by a further 6%.

Almost no stream ever sets SPA/EPA protection, so the per-cell resolve is paid for nothing. Proposed shape: a sticky grid flag, "a style carrying ISO_PROTECTED has been interned", set where SPA puts it on the pen. range_blank_inner then skips the per-cell resolve while the flag is clear. The flag can stay set for the grid's lifetime (clearing it would need a sweep that proves no cell still carries such a style), which keeps it exact on the side that matters: a protected cell is never blanked.

Gates: esctest's test_ED_respectsISOProtection / test_EL_respectsISOProtection family, the existing ISO-protection unit tests, and the csi floor (measure_parse_into_grid_floor with a kitten-shaped csi payload, plus csi_dispatch criterion).

Split from #401. On kitten's csi payload (`EL 2` per chunk), `Grid::range_blank_inner` (`crates/felis-grid/src/editing.rs`) resolves every blanked cell's style through the style table to test `AttrFlags::ISO_PROTECTED`, because `EL`/`ED` go through `range_blank_iso`. The #401 diagnosis measured it at 11.3% self time of the csi parse-into-grid floor, and a probe that skipped the check cut the floor's `instructions:u` by a further 6%. Almost no stream ever sets SPA/EPA protection, so the per-cell resolve is paid for nothing. Proposed shape: a sticky grid flag, "a style carrying `ISO_PROTECTED` has been interned", set where SPA puts it on the pen. `range_blank_inner` then skips the per-cell `resolve` while the flag is clear. The flag can stay set for the grid's lifetime (clearing it would need a sweep that proves no cell still carries such a style), which keeps it exact on the side that matters: a protected cell is never blanked. Gates: esctest's `test_ED_respectsISOProtection` / `test_EL_respectsISOProtection` family, the existing ISO-protection unit tests, and the csi floor (`measure_parse_into_grid_floor` with a kitten-shaped csi payload, plus `csi_dispatch` criterion).
Commenting is not possible because the repository is archived.
No description provided.