diff options
| author | user <user@clank> | 2026-08-16 15:37:16 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-16 15:37:16 +0200 |
| commit | a5114a9e923814878cd9c331adfe7a4a3ae5113a (patch) | |
| tree | f06a3e780969eaadc59508503a06fb1f096eaf55 /docs | |
| parent | sl0ppty: three ways back from a painted pane (diff) | |
| download | slosh-a5114a9e923814878cd9c331adfe7a4a3ae5113a.tar.gz slosh-a5114a9e923814878cd9c331adfe7a4a3ae5113a.tar.xz slosh-a5114a9e923814878cd9c331adfe7a4a3ae5113a.zip | |
sl0ppty: zero strength is not a pass
`shader_abi.h` has said `0 is identity` from the start, and the pass did not
honour it: it materialised a cell's default colours -- resolving "whatever the
terminal draws" into our `default_fg`/`default_bg` -- and only then called a
shader that was contractually going to change nothing.
So a chain that is currently *off* still repainted. `focused * 200` on an
unfocused pane, `(since < 500) * 255` half a second later, `(x < 10) * 200`
from column ten on: every one of those wrote our idea of the default over the
terminal's own. Visible whenever the two differ, which for a real terminal
theme is always, and invisible in the test suite because the tests compared
against the materialised value.
Found by measuring, not by reading: I was checking that each example I was
about to hand over actually changed the pane, and one that should have changed
nothing changed eight style runs.
The fix is an ordering: work out the strength, and if it is zero leave the cell
before touching it. A constant-zero shader now skips its whole rect before the
loops. Cheaper too -- a pass that is off costs no materialisation and no call --
though that is a side effect and not the reason.
Three test changes, all of them the same correction. `tests/shader_test.c`'s
traversal probe was built `{.kind, .fn}` with `amount` defaulting to 0, so it
was asking to be called for every cell at zero strength; it now asks for 255,
which is what those checks are about. A new block pins the rule: a zero-strength
pass visits nothing and leaves an unset cell unset. And four checks in
`tests/test_shader_expr.py` asserted `== "#ffffff"` for cells outside an
effect's band -- the materialised default. They now assert the cell has no
colour of its own at all, which is the stronger claim and the one that would
have caught this.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions
