summaryrefslogtreecommitdiff
path: root/docs/next-anim.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/next-anim.md')
-rw-r--r--docs/next-anim.md125
1 files changed, 124 insertions, 1 deletions
diff --git a/docs/next-anim.md b/docs/next-anim.md
index a64bfaf4..9c9610e7 100644
--- a/docs/next-anim.md
+++ b/docs/next-anim.md
@@ -25,6 +25,9 @@ Positions, not a verdict: argue with them.
| anim 6 `xykrnoql` | the tty paced too, its acks and output waited through |
| anim 7 `powlyrxv` | what the probe found: the spin, glide measure and emission, far-jump and long-line paints, the caret's sideways scroll, no join on the loop, pictures decoded off the loop |
| anim 8 | this note |
+| 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 |
Tests (one check each, `-Dtest-filter`): "frame stats: gaps into a motion
count as jank ...", "every scroll glides on one law ...", "a cursor eases
@@ -213,6 +216,64 @@ is still drawn at once: in a stream the picture is on the stream's
straight line wherever a frame samples it (tried: holding repeats to the
next tick cost a held key 7 ms of latency for no evenness one could see).
+### A PDF's strip, the same system (anim 11)
+
+The integrator is `animation.Follow` now (the Glide's state and rules,
+moved out; the text's Glide holds one, in rows). A PDF pane's strip holds
+another, in pixels: the core's position is `document_scroll_y` as every
+input leaves it, and the strip is drawn `follow.offset` from it
+(`pdf_view.stripAt`, each frame at the core's clock). Whatever moved the
+core's position since the last frame kicks it, so every way a PDF moves is
+one input to the same rules, the text's table above unchanged:
+
+| input | the strip |
+|---|---|
+| a wheel notch (a line's pixels), a spin | eases; a spin is a stream, at its rate |
+| PageDown/Up, Ctrl-d/u/f/b, held | a stream, at its rate (to the 15 bodies a second cap) |
+| ge, gg, a Look at `file.pdf:12`, Back, a section in the outline | a jump: past a body, one body's slide, as a text's far jump |
+| a click on the rail, a tick | eases |
+| a touchpad's fraction (`pdf_scroll.glide` false) | follows, drawn where the core is the same frame |
+| a resize, a fit or zoom change (a relayout) | there at once |
+| a search's reveal (it moves the strip as it draws) | there at once |
+| Motion off | there at once |
+
+Rendering stays on the loop (MuPDF; its first-frame and context work is
+the open item it was). So that no frame of a glide waits on it, the pages
+a glide crosses to its mark are rendered in its input's frame, where the
+instant move rendered its destination; a jump past a body (`far`) renders
+only where it comes to rest, and its slide comes in over what is there
+(the page above the mark is not drawn for a slide of a tenth of a second:
+that page was the input frame's whole extra cost). Drawn at the strip's
+position, rounded only by the draw (`pixel_offset_y` keeps the
+fraction). Pictures are fit to their body and neither scroll nor pan:
+nothing there to move.
+
+**Why the slow PDF scroll read as jumps**: a wheel notch moved the strip a
+whole line's pixels (25 here) in the one frame after it, and nothing in
+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.
+
+### Coming to rest (anim 9, 11)
+
+Found while measuring the PDF: a slow stream (notches 150 ms apart, just
+inside the stream window) ran its constant rate into the mark, stopping
+from 2.6 px a frame, and its last speed, never zeroed, then carried it
+0.04 row past the mark and back. A stream is now never faster than the
+spring's own pace from where it is (omega a unit of lag a second): it eases
+onto each mark. The check: "a follow comes to rest without a snap" (a
+spin, a page, and notches 144 ms apart: toward the mark only, onto it from
+under a third of a pixel, past its fastest frame each step no longer than
+the last); it fails on the old rule.
+
+Measured on every settle the runs have (frames after an input until the
+view is still, speeds normalized by the frame's own time): before anim 9
+the old spring's tails were already monotonic; the anim 9+10 stream rule
+had one rising tail in the scroll demo's notches (the stop from 2.6 px)
+and a last step of 0.88 px; now, over the scroll, stress and PDF runs
+(ReleaseSafe and Debug), no tail rises after its fastest frame and the
+last step before rest is at most 0.06 px (text) and 0.05 px (PDF).
+
### The cursor (anim 4)
The thin caret glides as the block does. A step of a cell or less eases
@@ -250,7 +311,7 @@ while the view stands still, nor for stretches over 512 KB.
| a 200-line paste | one body's slide | a long jump |
| terminal output | snaps | a stream would always lag |
| terminal under the wheel | glides | the wheel's; keys in its normal mode snap (position 4) |
-| PDF | its own scroll | untouched here |
+| PDF | glides (its strip, in pixels, anim 11); a touchpad follows | the same rules as text |
| no-wrap sideways scroll | snaps | horizontal glides were not asked; position 6 |
## Ponytail pass (on the stack, amended in place)
@@ -853,6 +914,68 @@ the 2 s ones were few, the max falls 2801 -> 319.
| all | before | 26.1/43.9/74.5/78.0 | 2.1/22.9/44.8/77.5 | 2.1/2.3/15.7/40.8 | 2189 | 1 | 108/15264 |
| | after | 24.5/37.8/63.1/70.3 | 4.9/27.5/42.9/68.7 | 15.7/18.5/24.2/39.9 | 2175 | 1 | 101/15264 |
+#### GUI: `pdf-scroll` (anim 11), before = anim 10 with the scenario, after = anim 11
+
+ReleaseSafe, run 1 of 2 (`.scratch/runs9/v1-*`; run 2 within a few ms but far-jump max):
+
+| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late |
+|---|---|---|---|---|---|---|
+| spin | before | 4.7/9.2/33.4/33.4 | 4.7/9.2/33.4/33.4 | - | 1073 | 0 |
+| | after | 2.0/6.8/22.0/22.0 | 1.7/6.9/17.2/22.0 | 12.9/16.7/21.8/28.4 | 1009 | 1 |
+| held-pagedown | before | 15.3/29.4/31.1/31.1 | 15.2/29.3/31.0/31.0 | - | 9092 | 0 |
+| | after | 1.8/19.2/26.8/26.8 | 1.7/9.6/26.7/26.7 | 16.6/20.5/33.9/33.9 | 6359 | 5 |
+| far-jump | before | 16.5/32.8/32.8/32.8 | 6.8/18.0/32.7/32.7 | 17.0/17.2/19.1/19.1 | 24126 | 0 |
+| | after | 22.6/32.1/32.1/32.1 | 5.8/7.1/32.0/32.0 | 16.6/16.8/18.8/18.8 | 23744 | 0 |
+| slow-notches | before | 7.1/7.1/7.1/7.1 | 8.8/9.8/9.8/9.8 | 16.8/17.4/17.4/17.4 | 83 | 0 |
+| | after | 6.9/7.0/7.0/7.0 | 1.7/6.7/6.9/6.9 | 16.6/16.8/17.3/17.3 | 87 | 0 |
+| slow-touch | before | 6.9/10.7/12.3/12.3 | 6.8/10.6/12.2/12.2 | - | 94 | 0 |
+| | after | 6.8/11.0/12.4/12.5 | 6.7/10.9/12.4/12.4 | - | 94 | 0 |
+
+Debug (`w1-*`):
+
+| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late |
+|---|---|---|---|---|---|---|
+| spin | before | 4.8/12.7/148.2/148.2 | 4.7/12.3/148.1/148.1 | - | 1074 | 0 |
+| | after | 3.2/7.7/140.4/140.4 | 2.7/7.6/71.8/140.3 | 16.4/16.8/72.2/141.1 | 995 | 2 |
+| held-pagedown | before | 78.5/115.5/115.5/115.5 | 78.3/115.3/115.3/115.3 | - | 8296 | 0 |
+| | after | 10.1/121.7/127.6/127.6 | 6.5/98.4/127.5/127.5 | 16.6/98.6/141.2/141.2 | 6106 | 4 |
+| far-jump | before | 45.4/84.2/84.2/84.2 | 6.2/45.1/83.9/83.9 | 16.6/17.7/18.7/18.7 | 24172 | 0 |
+| | after | 51.4/86.9/86.9/86.9 | 6.1/8.5/86.7/86.7 | 16.6/17.5/20.8/20.8 | 23525 | 0 |
+| slow-notches | before | 11.4/13.1/13.1/13.1 | 7.5/12.6/12.6/12.6 | 15.6/19.2/19.2/19.2 | 83 | 0 |
+| | after | 18.3/19.0/19.0/19.0 | 2.7/11.9/18.5/18.5 | 16.6/16.9/19.2/19.2 | 88 | 0 |
+| slow-touch | before | 7.3/11.8/14.1/17.8 | 7.0/11.5/13.8/17.3 | - | 94 | 0 |
+| | after | 7.2/11.0/12.5/15.4 | 7.0/10.5/12.3/15.1 | - | 94 | 0 |
+
+The `panes` timedemo's pdf phase (`u1-*`, RS then Debug):
+
+| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late |
+|---|---|---|---|---|---|---|
+| pdf | before | 6.9/14.8/44.1/46.3 | 6.7/14.5/30.6/44.0 | 16.7/16.8/16.9/16.9 | 4678 | 0 |
+| | after | 2.0/7.4/34.8/37.8 | 1.8/6.6/18.4/34.7 | 16.6/16.8/27.2/32.9 | 4678 | 9 |
+| pdf | before | 7.6/57.1/149.4/158.8 | 6.3/18.0/142.1/149.3 | 16.6/16.8/17.9/17.9 | 4663 | 0 |
+| | after | 3.2/16.2/144.5/155.5 | 2.8/7.2/125.0/144.4 | 16.5/16.8/134.0/149.4 | 4655 | 7 |
+
+Strip steps between presented frames (px, the probe's `scroll` column is
+the strip's drawn y for a focused PDF; cell height 25):
+
+| phase | before | after |
+|---|---|---|
+| slow notches (one each 300 ms) | 25 px in one frame a notch, 7 of 7 steps whole lines | p10/p50/p90/max 0.04/0.8/6.8/7.2 px, none a whole line |
+| slow touchpad (0.06 line a frame) | 1.5 px every frame | 1.5 px every frame (followed) |
+| a spin's steps | 25 px each (a notch a frame, 100 at a burst) | 0.5/16/28/42, a stream |
+| settle tails | none (nothing settled) | no rise after the fastest frame; last step <= 0.05 px |
+
+Latency: the spin and held PageDown answer sooner (the frame that answers
+a key no longer renders the pages it moves to before showing it; they
+render as the glide's input frames, a stream's, come). The far jumps
+(ge, gg, a Look at a page, Back) answer within the before's spread in
+ReleaseSafe (p50 16.5/17.8 -> 22.6/14.9 over two runs, max 32.8/31.7 ->
+32.1/31.2); in Debug ge's frame renders what the before split between the
+`g` prefix's frame (~20 ms, re-rendering pages left banded by a fling) and
+ge's own (~40): the same total in one frame (60-67 ms). The `late` frames
+are a held PageDown's input frames rendering a page while it moves (33 ms
+gaps; before they were not moving frames, and took 30 ms to answer).
+
## The coordinator's latency rows, answered
- **pages-up-big** (p90 8.8 -> 24): real. The paint-ahead's upward stretch