Commit deebbe2
committed
fix: make the ticker's changing region an ELEMENT, not a run of glyphs
The round trip -- fail, parse the message's own suggestion, apply it, page must
then be stable -- failed on three separate CI runs with three unrelated regions
for the same page:
[216,52,216,65] 1 column
[62,50,219,67] 157x17
[71,51,71,68] 1 column
The diagnosis was right every time. What it was diagnosing would not hold still.
Ten random glyphs are a bad thing to measure. Their extent depends on which
characters came up, and a capture on a slower machine can land mid-repaint and
see a single column of a single character -- hence regions ranging over two
orders of magnitude. Pinning the font to monospace (previous commit) fixed the
extent but not the mid-repaint sliver, so it was necessary and not sufficient.
Now every tick paints the box a RANDOM colour. Two attempts then differ across
the whole element at high contrast, a partial repaint is still an unmistakable
diff, and the region is the element -- which `position: absolute` with a fixed
width and height pins exactly.
Random, specifically, and not a black/white toggle: a two-state flip depends on
parity, and two attempts ~100ms apart are an unpredictable number of 30ms ticks
apart, so they can land on the SAME phase. Measured -- with the toggle the region
came back as [69,50,210,66], the text again.
Measured after: eight consecutive local runs, all green, every one reporting
[40,40,239,79] -- 1.62% of the 800x600 image, changed in 4 of 4 pairs
which is the CSS box (left:40 top:40 200x40) to the pixel. Before this change no
two runs agreed.
This is also the honest shape of what the fixture stands in for: a clock or
spinner repainting inside a box that does not move, which is exactly the case
where `skip_area` is the right answer.
`rake test` and standardrb below.1 parent f6de686 commit deebbe2
1 file changed
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
45 | 66 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
51 | 71 | | |
52 | 72 | | |
53 | 73 | | |
| |||
0 commit comments