summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-25 20:30:52 -0300
committerGabriel Schneider <[email protected]>2026-08-25 20:30:52 -0300
commit649fd0e983d6a207932f1ec43f7ded00e26a69c0 (patch)
tree7c072506e5a2ccbc8bf6c2afbe5414903b8fa1cc /src/gui
parent767a35d3ae3b87d1bfdd960f2187f0a51ad32333 (diff)
downloadpardes-649fd0e983d6a207932f1ec43f7ded00e26a69c0.tar.gz
pardes-649fd0e983d6a207932f1ec43f7ded00e26a69c0.zip
Compare shadow-grid cells as bytes, not through std.meta.eql
`Cell.visuallyEqual` is the semantically exact answer and too slow to ask 480 times a frame: `std.meta.eql` on a `CellStyle` recurses through a colour union and eight booleans, and the walk measured 1.45 ms on the die - about 270 cycles to compare a 28-byte struct. `sameCell` in src/p4.zig does it as bytes. That is safe in the direction that matters: byte equality IMPLIES visual equality, so it can never claim two different cells are the same. It can miss an equality - scratch bytes past `len`, or padding - and the only cost of that is one redundant `writeCell` which vaxis then diffs away. Defaults are still compared by meaning, because an unpainted cell's text and style are whatever the previous frame left in them. Measured: the grid walk 1.45 -> 0.98 ms, a keystroke 8.87 -> 8.37 ms fixed. Verified the way a rendering change has to be. The A/B harness now hashes the SGR state of every cell as well as its character, because the first version compared text only and would have passed a colour regression in silence. Reference path (`shadow_grid = false`, clear and write everything) and incremental path were each run against the same 19-step workload on the die and the reconstructed screens are identical in both text and per-row style hash. snap 95/95, hxdiff 481 cases 0 mismatches, hxparity 561 cases 0 mismatches, unit-test, and tty / p4 / gui all build.
Diffstat (limited to 'src/gui')
0 files changed, 0 insertions, 0 deletions