summaryrefslogtreecommitdiff
path: root/docs/next-anim.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-24 23:16:11 -0300
committerGabriel Schneider <[email protected]>2026-10-25 01:30:09 -0300
commit706b9d98fdce29a58ffe5a8a5417d6b2810e6d2c (patch)
tree1367ad33c41891dc89a7507b156660e0694e5a29 /docs/next-anim.md
parent6e8a6a63d45b2caef7b649d358f836e6cc4134d6 (diff)
downloadpardes-706b9d98fdce29a58ffe5a8a5417d6b2810e6d2c.tar.gz
pardes-706b9d98fdce29a58ffe5a8a5417d6b2810e6d2c.zip
anim 12: the tty runs the GUI's motion system: the view's glide moves to src/glide.zig (Glide, its step: find the view that moved, snapshot, measure, kick), the GUI keeps only its wheel notches and its pixel draw; the tty steps it each loop and draws it at whole rows (glide.shifted: the position rounded, never the step, the rows that left in the gap, a caret whose line rode the scroll carried with it, one that kept its row left still); rows that only disagree glide the core's lines instead of snapping; the snapshot harness's virtual clock runs a frame a wake while it moves
Diffstat (limited to 'docs/next-anim.md')
-rw-r--r--docs/next-anim.md59
1 files changed, 58 insertions, 1 deletions
diff --git a/docs/next-anim.md b/docs/next-anim.md
index 9c9610e7..e1d7e14f 100644
--- a/docs/next-anim.md
+++ b/docs/next-anim.md
@@ -28,6 +28,7 @@ Positions, not a verdict: argue with them.
| anim 9 `nqznmskw` | the view's motion is one system: a stream of inputs moves it at its own rate, the spring only settles it |
| anim 10 `umnwnrvn` | the caret is its own body: drawn from its own springs, never carried by the text's glide |
| anim 11 `knzzzknu` | the integrator is `animation.Follow`; a PDF's strip moves in it, in pixels; a slow stream eases onto its mark |
+| anim 12 `nqmoxkwz` | the tty runs the same glide (`src/glide.zig`), drawn at whole rows |
Tests (one check each, `-Dtest-filter`): "frame stats: gaps into a motion
count as jank ...", "every scroll glides on one law ...", "a cursor eases
@@ -254,6 +255,62 @@ between: at a slow turn, one 25 px jump a notch. The touchpad path was
never quantized (fractions all the way to the placement). Now a notch is
a kick, and the strip eases over ~6 frames.
+### The tty, the same system (anim 12)
+
+The glide is shared now (`src/glide.zig`: the Glide, and its step that
+finds the view that moved, snapshots the body and measures the move); the
+GUI keeps only its wheel notches and its pixel draw. The tty steps the same
+glide each loop (`pollFrame`), integrates it on its 16 ms ticks, and draws
+it at whole rows (`glide.shifted`): the body's rows moved by the offset
+rounded, the position never the step, the rows that left in the gap. So a
+flick's fast part moves several rows a tick as the body dictates and its
+tail is one-row steps further and further apart: a deceleration in the
+timing, not in the step. The end is the instant version's. The caret: one
+whose line rode the scroll (a wheel's) is carried with its rows; one that
+kept its row (a page, a held j at the bottom) stays on its cell, still.
+
+Checks: "the tty draws a glide at whole rows" (a flick and a spin: once
+slowing, steps a tick never grow, one-row steps never closer together, to
+where the core is; then j held on the bottom row: the caret's row is the
+same every tick). The timedemos typed into a pty (160x50, `ttydemo.py`,
+RS): past each glide's fastest tick, steps never grew in the decelerating
+part of any of 24 (scroll) and 186 (stress) glides, and the ticks between
+one-row steps never shrank; the only growth is at a stream's constant
+speed, where the rounding alternates (5, 4, 5, 4 rows a tick at the 4.5 a
+tick cap). Bytes: a tick costs a body repaint (p50 7.4-7.9 KB, max
+13.4-15.3 KB, the before's max), so a glide costs its row steps' worth:
+the scroll demo wrote 383 -> 990 KB, the stress demo 3.8 -> 7.1 MB. Terminal
+scroll regions would make a one-row step a few bytes (position 8).
+
+| tty | | latency ms p50/p90/p99/max | frame work ms | moving gap ms | bytes/frame p50/max |
+|---|---|---|---|---|---|
+| RS scroll | before | 2.3/3.0/11.5/11.5 | 2.2/2.7/8.5/11.0 | 15.9/16.7/18.8/18.8 | 120/15264 |
+| | after | 2.5/3.1/11.5/11.5 | 2.3/2.8/4.4/11.9 | 15.7/16.7/18.4/18.7 | 0/15264 |
+| RS stress | before | 1.4/2.9/5.9/15.6 | 1.1/2.7/4.9/14.1 | 15.6/16.6/18.4/18.4 | 140/13383 |
+| | after | 1.5/2.8/5.5/14.0 | 1.9/2.9/3.8/12.5 | 14.3/16.5/18.1/19.0 | 7363/13383 |
+| Debug scroll | before | 9.4/14.5/28.7/28.7 | 6.0/13.0/21.2/36.2 | 15.5/19.0/21.7/21.7 | 128/15264 |
+| | after | 6.0/13.8/44.0/44.0 | 6.1/9.9/17.0/27.3 | 15.5/19.6/24.9/26.0 | 0/15264 |
+| Debug stress | before | 2.4/13.0/92.9/148.4 | 2.2/10.8/68.2/148.1 | 15.6/18.7/25.4/25.4 | 6858/13383 |
+| | after | 2.8/10.3/90.5/180.3 | 2.7/7.7/56.7/180.2 | 12.8/17.6/65.0/180.4 | 7270/13383 |
+
+Found on the way (sample 1): at a spin's end the measure found no shift
+under which the rows agreed (the colours painted ahead arrive as it
+stops) and gave the glide up, a 1.6-row snap on the last frame, in the
+merge head as in anim 9-11. When the core moved a few lines and the rows
+only disagree, the lines are the rows' guess now: it glides them, and the
+spin's settle is whole (33, 4, 1.8 ... 0.03 px, never growing). Re-measured
+on the head (stress, RS): the caret under a held j moves 0.0 rows frame to
+frame over the 144 frames the view moves; every settle's steps never grow
+after its fastest frame, the last at most 0.05 px. The snapshot harness's
+virtual clock moves a frame a wake while the glide moves (it only moved to
+the next due wait, so a tty glide stood still there): all 110 scripts pass,
+no golden changed.
+
+(The Debug maxima are single frames of highlight paint on the 1.6 MB
+file, as before; ponytail: a terminal's scrollback under the tty's wheel
+lands, it reaches the core as a mouse event the GUI's notch count does not
+see.)
+
### Coming to rest (anim 9, 11)
Found while measuring the PDF: a slow stream (notches 150 ms apart, just
@@ -1045,6 +1102,6 @@ gaps; before they were not moving frames, and took 30 ms to answer).
one frame later in Debug); a second open still decodes again (no cache:
a Restore is rare).
8. **The tty** has no vsync and no sub-cell motion: it is paced (a 16 ms
- tick through its acks), it does not glide, and a scroll still rewrites
+ tick through its acks), it glides at whole rows (anim 12), and a scroll still rewrites
most rows (vaxis diffs cells; terminal scroll regions would move them
for a few bytes). Position: scroll regions, if the tty's bytes matter.