diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 14:23:41 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 15:28:16 -0300 |
| commit | d967b8e955e966ccffdc94607ed1de4e61dc56ef (patch) | |
| tree | 4566db68f2c1ba2f9b7ac417e1eb0365e0ceed3f | |
| parent | 3488111273764c17a42870484fabc36abb0634a1 (diff) | |
| download | pardes-d967b8e955e966ccffdc94607ed1de4e61dc56ef.tar.gz pardes-d967b8e955e966ccffdc94607ed1de4e61dc56ef.zip | |
docs: the effects programme's documents go with it: docs/effects.md (its catalogue, its feel reviews) and docs/next-anim.md (the animation plan) are gone, and docs/render-pipeline.md says only what is left: the core's frame (the pump, its deadlines, one Surface that does not move) and what each frontend draws on its own clock from it (the glide, the window's caret, the blink, a jump's trail, InactiveDim, the Pet) and the window's four draw groups; the changelog says what left and what stayed; code comments and docs that cited the old sections or files cite the new note or nothing (building.typ, next-pdfrender.md, config.zig, gui.zig, glide.zig)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
| -rw-r--r-- | docs/effects.md | 285 | ||||
| -rw-r--r-- | docs/next-anim.md | 1107 | ||||
| -rw-r--r-- | docs/next-pdfrender.md | 2 | ||||
| -rw-r--r-- | docs/render-pipeline.md | 949 | ||||
| -rw-r--r-- | docs/typ/building.typ | 4 | ||||
| -rw-r--r-- | src/CHANGELOG.md | 12 | ||||
| -rw-r--r-- | src/config.zig | 2 | ||||
| -rw-r--r-- | src/glide.zig | 2 | ||||
| -rw-r--r-- | src/gui/gui.zig | 16 |
9 files changed, 69 insertions, 2310 deletions
diff --git a/docs/effects.md b/docs/effects.md deleted file mode 100644 index a9b27a6b..00000000 --- a/docs/effects.md +++ /dev/null @@ -1,285 +0,0 @@ -# Effects: feel reviews - -**The rule above all the others:** no effect may alter or cover a focus -indicator (the focused pane's tag colour, its grip, the cursor, the -selection) or reduce its contrast. The effects are sugar; the indicators are -how a person knows where they are. Every G stage is reviewed against this. -Lift, for one, falls only on pane bodies and rails, never on a tag, a grip or -a header, and its strength is capped so text and the selection keep min(their -contrast, 4.5) (tests in src/gui/gui.zig). The rule binds effects, not a -theme's structure: the rules between panes (2px, `rule_px`) are the theme's -borders, and the one over a tag band stays in the band's slack, never over -its text. A dim touches only the unfocused -panes, with the same floor, and the focused pane's text is never at less -contrast than theirs (tests in src/draw.zig). - -**Density.** A pixel shell draws every size given in pixels in logical -pixels, `dp()` in gui.zig (SDL's window display scale, rounded, at least -one; `PARDES_TEST_SCALE` forces one in a harness, and a test window is 1x -otherwise): the rules (`rule_px`), the tag rule, the grip's ring and its -dirty gap and mode bars, the rail's gap to the text and its minimum, the -thumb's inset, the rim, a bar cursor's minimum width, underline and -strikethrough thickness, the rule-grab margin, and the Crt's scanline and -mask periods (`pardesScale`). Left as they are: what is measured in cells -or the tagline (the rail's width, `rail_px` scaled with the tagline; Lift's -blur and offsets; every motion, in cells), Shadertoy's iResolution, -fragCoord and iMouse (the display's pixels, as ghostty's), and the pet -overlay. - -Each effect of docs/render-pipeline.md §9 lands behind its own switch, off, -and is kept only after a feel review (§8.4): a frame series on the virtual -clock, a recording, and a verdict — keep, polish or drop — with one line of -why. The verdict is the user's. - -| effect | switch | state | review material | verdict | -|---|---|---|---|---| -| Crt (bundled post pass) | `Crt 0..3` | kept, rewritten (no barrel) | fx-compare stills, live window | kept at the user's live look | -| Ripple, Glitch | — | removed | live window | dropped by the user after a live look | -| G1 lift | `Lift shadow\|rim\|auto` (off), `InactiveDim <percent>` | opt-in until the focus-lift default is decided | lift-shots-2 (off, shadow, rim, auto on acme, dusk, forge); frame series + mp4 per Motion flavour | shadow on acme: keep as is. Round 1 dropped glow and surface (surface lowered the focused text's contrast) and made rim a hairline just above the focused tag (light on a dark page, shade on a light one). auto on a dark page recedes the others (InactiveDim 30) | -| G3 cursor | follows `Motion`; `CursorBlink on\|off` (on) | glide on by default through the default flavour (smooth); blink on (decision 6) | .scratch/render/cursor/cursor-flavours-grid.mp4 (and quarter speed), raw/<flavour>/<motion>/ | pending | -| G4 bloom, vignette, grain | `Bloom`, `Vignette`, `Grain` `0..3` (off) | bundled post passes; none touches a tag, grip, notice or the cursor (pardesSpare); each capped per theme (pardesCap) | .scratch/render/{bloom,vignette,grain}/ (levels 0-3 on forge, dusk, acme; crops; mp4 stepping through the levels) | pending | -| G5 lapis | `Theme lapis` (its `decor`) | a native theme with ornament: tag plaques with hard shadows inside their bands (the focused one striped), dots, rail checker, title shadow | .scratch/render/lapis/ (whole window at 1x and 2x, crops, a slide mp4) | pending | -| G6 smooth scroll | follows `Motion` (on through the default smooth; `Motion off` lands at once) | a mouse wheel's notch glides, a touchpad follows the finger | .scratch/render/scroll/ (glide-<flavour>.mp4, quarter speed, strips) | pending | -| G7 panel transitions | `PanelSlide`, `PanelZoom`, `PanelVertical`, `PanelDissolve` (off) with `Motion` | a moving pane casts a shadow; a retargeted move keeps its speed; the GUI's dissolve is a crossfade | .scratch/render/transitions/ (slide smooth, bouncy, retargeted; dissolve) | pending | -| G8 notice chips | follows `Motion` and `Lift` | a notice floats in tier 4 on a lift (shadow) while Lift is on, drops in easing out and dissolves easing in, quicker than it came (150 ms against 180) | .scratch/render/notices/ (acme, forge) | pending | -| G9 selection glow | `SelectionGlow on\|off` (off) | a soft halo of the selection's colour round each block of it in a body, fading in over 100 ms | .scratch/render/selection/ (forge, acme, lapis; lapis-glow-zoom.png) | pending | -| G10 theme crossfade | always (a theme change) | the chrome's colours fade through OKLab, easing in and out (out when retargeted) | .scratch/render/crossfade/ (forge, lapis, acme cut short by dusk) | pending | -| G11 look-hover glow | `HoverGlow on\|off` (off) | a soft underline of the theme's accent under the word a look-hover would open, fading in over 80 ms | .scratch/render/hover/ (forge, acme, lapis; zooms) | pending | -| G12 ambient occlusion | `Occlusion on\|off` (off) | pane bodies darken toward their edges, at most 2% (§9.1: 1 to 2%) | .scratch/render/occlusion/ (on/off on forge, acme, lapis; acme-diff-x40.png) | pending | -| G13 parallax | `Parallax on\|off` (off) | a theme's page pattern under the bodies (lapis's dots) moves with the text at a quarter of its speed, glides included | .scratch/render/parallax/ (lapis, notches down and up) | pending | -| G14 afterglow | — | removed | live lapis showcase | dropped by the user: "one of the animations is like a flashing on the whole pane or something, that is really bad, just remove it" (a pane whose whole text changed, a file opened, a +Search refilled, a terminal's output, lit up at once) | - -## Motion flavours - -`Motion off|crisp|smooth|bouncy|playful` (default smooth, tuned so arrivals -land inside §8.1's 220 ms; bouncy and playful run longer, opt-in) is one parameter set -(animation.Motion) every fx animation reads, so a flavour is data, not a -branch in each effect. Input is never blocked, and a new target always -retargets from the current position and velocity. - -| flavour | timing (ω, length) | follow-through (ζ) | anticipation | squash/stretch | exaggeration (gain) | secondary lag | arcs | -|---|---|---|---|---|---|---|---| -| off | instant | — | — | — | — | — | — | -| crisp | 60, 0.6× (leaves at full speed) | 1 (none) | — | — | 1 | in step | — | -| smooth | 34, 1.1× (slow in, slow out; ≤220 ms) | 1 (none) | — | — | 1 | 0.85 | 0.04 | -| bouncy | 24, 1.4× | 0.35 (overshoots ~30%, settles twice) | — | 0.15 | 1.25 | 0.8 | 0.08 | -| playful | 18, 1.7× | 0.28 (overshoots ~40%) | 0.15 of the move | 0.35 | 1.4 | 0.55 | 0.15 | - -The flavours are distinct by design, not tuning: crisp leaves at full speed -and never passes its mark; smooth takes twice as long and eases in and out; bouncy clearly passes its mark and settles back once or twice; -playful winds up the other way first, flies well past, and stretches along -its path and squashes as it lands, its text with it (the user's choice); a -pointer inverts the same stretched box, and landed, a pane is exactly its -target. A motion only a few pixels big (Lift) is -exaggerated by the flavour's gain so its character shows. The flavours drive -the Lift spring (time-based), the notice drop and the pane moves (PanelSlide, -PanelZoom, PanelVertical opening or moving, whose length scales with the -flavour); a closing pane keeps its effect's own exit. Chart and side-by-side -video: .scratch/render/motion/compare/. - -Which principles each motion uses: - -- **Lift** (G1): timing, slow in / slow out (the spring), follow-through - (bouncy and playful lift past full and settle back), anticipation (playful - dips before it rises; below zero nothing is drawn, so it reads as a beat - before the lift), staging (only the focused pane lifts; nothing else moves - with a focus change), exaggeration (the flavour's gain). Squash, stretch, - arcs and secondary lag have nothing to act on in a lift. -- **Notice drop and pane moves**: timing and follow-through from the flavour's - spring over the move's length; anticipation (playful). A pane past its mark - never takes a neighbour's click, a rising one stays in its box, and a notice - past its row stays in its pane's body. -- **Cursor** (G3): timing (the flavour's spring, 2.4x its pace: it follows - input), follow-through (bouncy and playful pass the target), squash and - stretch and secondary action (the trailing corners lag by the flavour's - follow, so a jump smears and collapses), arcs (a jump over 8 cells bows by - the flavour's arc), anticipation (playful's wind-up). A step of a cell or - less, or any move in insert mode, lands at once, so typing never trails; - a scroll carries the cursor with the text. Only the focused cursor moves. - A pane that moves carries it too: the springs keep its place in the pane - and the quad is drawn through the pane's presented box, so through a - slide, a zoom or a drag it rides with the text, and a layout change with - no transition lands it with the text. A focus change (to another pane, or - into a column's or the workspace's tag) glides from where the cursor is - drawn to the new one, free of the old pane's edges while it crosses - (.scratch/render/cursor/move/: ride-*, cross-*). - - -Notes on G1: the lift and the dim run on one focus spring per pane, at the -Motion flavour's pace, sampled at each frame's own time; while it moves the -GUI draws at the display's rate, and a grid snaps. A notice floats on a lift -of 1 while a shadow or rim is on. InactiveDim under `Lift auto` defaults to -30. The fade is in linear light, so on a dark page it is gentle: at 30 -forge's text goes from 15.5:1 to 11.2:1 and dusk's from 6.4:1 to 4.8:1, -plainly quieter and still easy reading; at 10 forge barely moves (14.1:1). -On a light page the same percent bites far harder (acme: 7.0:1 at 10, the -4.5 floor at 30), which is why `auto` shades there instead of dimming. - -Notes on G4: the three are post passes, so each is a frame of cost only -when it is in the chain. None moves (grain is still, by choice: moving -grain would redraw every frame for a texture), so none asks for frames. -The focus rule is kept by construction: the shell hands every pass the -rectangles of the tags (with their grips), the column and workspace tags, -the notices and the cursor, and a bundled pass leaves them as they are; its -strength is capped per theme so the text on the page and the selection's -text keep min(their contrast, 4.5) (Post.capsOf, tested over the native -themes). Bloom takes only what is brighter than the page, so a light page -does not bloom at all; its glow is a dual Kawase blur in float textures at -half size and down (3 to 5 steps by level), within §8.2's 5%. The vignette -is round, starts halfway to a corner and reaches 10, 18 and 28%. Grain is -1.5, 3 and 5 of 255 on page-coloured pixels only, a logical pixel big. -Found on the way: SDL GPU binds at most 4 KiB of a uniform block, so every -Shadertoy colour after the palette (iBackgroundColor and on) read zero; the -block is now cut in three with ghostty's names and order kept. - -Notes on G5: lapis (src/themes/lapis.zig) is 0x4200.cafe's lapis.css in -pardes's chrome, drawn inside it (decision 1). The tags are the site's -trail and title bars: every tag a plaque in its own band, framed in gold -(2 px, the trail's border) with the trail's hard vermilion shadow (5 px) -down and right, the frame and the shadow both inside the band's rows and -columns, so no shadow reaches a body, a grip or the next pane; down, the -shadow gets what the band's slack under the text leaves (a pixel or three -at a tagline under the body's size, more at a larger one), to the right -its full offset. The focused pane's plaque is the code window's title bar, -gold and lapis stripes of 2 px, its words on plates of the focused ground -(the words' cells stay opaque, the blanks between let the stripes show), -so the focus indicator is plainer to see than any theme's tint, never -less; the unfocused ones are plain. Column and workspace tags take the -quieter object-label language: a 1 px frame and a 2 px shadow of vermilion -toward the page. The plaques are decor drawn under their cells (a group's -under range) with the cells blended premultiplied over them; blank tag -cells on the tag's ground are see-through there. They need an opaque -window: under WindowOpacity 100 the tags are plain. Also from the site: -the colours (lapis-deep page, vellum text, gold names and rules, -vermilion rubrics and tag rule, gold selection in lapis ink), the page's -gold dot grid (22 px, #e8c46a22) on page-coloured cells only, fixed to the -window; the dither frame's checker in the scroll track, anchored to its -rail (the thumb solid gold); the titles' vermilion offset shadow under a -file name's letters. Left out: Crimson Pro and Departure Mono, the -ornaments, a decor crossfade (it snaps while the colours fade). The tty -shows the colours alone: a tag row abuts its body and its neighbour, so -there is no cell for a shadow row or column. - -Notes on G6: a mouse wheel's notch (SDL's whole-number step) scrolls the -core by its lines at once, so keys and clicks act where the text is, and -the picture follows on the Motion flavour's spring at half again its pace, -critically damped whatever the flavour (text never passes its mark; §8.1), -from its current speed, so notches in a row carry on without a stall. How -far the rows moved is measured on the next frame against the last (a -wrapped line's rows, a terminal's output), within a couple of rows' slack -for the cursor's line and its number moving with the scroll; the rows that -left are kept and drawn in the gap the lag opens, and a lag is never more -than the body's height (a flick past that jumps). A touchpad's fractions -keep moving the picture under the finger, as before; there is no momentum -(SDL reports no finger lift on a wheel). The glide runs on the core's -continuous path (Pardes.shell_continuous), so the shell draws every loop -while it moves and a virtual clock moves with it; idle, it costs nothing. -A PDF page scrolls as before. The test feed takes wheel events -(ESC]777;mouse;wheel;<amount>;<x>;<y>BEL). - -Notes on G7: the geometry already followed the Motion flavour's spring -(sxrrwplk); a move retargeted mid-way now carries its speed on -(Track.launch, from the old move's speed along the new one's longest -side), so a second Newcol during a slide bends the motion instead of -stopping it dead. A pane that slides, zooms or rises stands off the page -while it moves: a soft shadow as Lift's, at sin(pi x progress) of its -strength (none as it sets out or lands), on the other panes' bodies and -rails alone and under the same contrast ceiling, moving with the pane. The -GUI's PanelDissolve is a crossfade: a changed cell's new form drawn whole, -its old one over it at 1 - progress; the blend is in sRGB, not linear -light (a two-colour mix in linear light needs both in one shader; open -point 3). The tty keeps its per-cell swap. GUI golden 18-mid-transition -changes (the slide's shadow at frame 6). - -Notes on G8: most of it was there: the drop eases out on the Motion -flavour's spring (sxrrwplk), the dissolve eases in, and a notice floats in -tier 4 with Lift's shadow at its fade while Lift is on, on the bodies -alone. What G8 changed: leaving was slower than arriving (a 300 ms -dissolve against a 180 ms fall); §8.1 wants leaving the quicker, in 100 to -160 ms, so MessageDissolve now defaults to 150 (a test holds both bands). - -Notes on G9: the halo is Lift's soft kind in the selection's own colour, -cast by each block of selected rows in a pane body (the rows that touch), -with the block as its caster, so the selection itself is never touched; -a cursor beside a block joins the caster, so it is never glowed over -either. It stays on bodies (never a tag or a grip), is at most 22% (§8.2: -coloured glows at most 25%) and less where the text round it would drop -below min(its contrast, 4.5); it comes up over 100 ms with an ease-out -(micro-feedback), on the core's continuous path, and is not drawn while -panes move. The blocks are read from the cells painted in the theme's -selection colour, a pixel shell's inference (§1.5, smell 4) until -selections are regions. - -Notes on G10: a theme change already faded the chrome (tags, rules, grips, -rails) over 10 frames (160 ms, in §8.1's 150 to 250 for a state change), -mixing sRGB bytes linearly in time. Now each colour goes through OKLab, so -a fade between two hues keeps its lightness instead of dipping dark and -muddy, on a smooth ease-in-out; a change made mid-fade sets off from where -it shows and eases out, so it moves at once instead of stalling. The page, -its text and the syntax colours still change at once with the theme, as -before: fading them would re-resolve every cell each frame. - -Notes on G11: the word a look-hover would open is already lit (the -affordance's tint); HoverGlow adds a strip three logical pixels tall along -its foot in the theme's accent, its edges blurred by one, at most 22% and -under the text's contrast floor, fading in over 80 ms (micro-feedback). It -stays on bodies and is split round a cursor, so it never touches one. The -word is found by the tint's colour, as G9 finds the selection. -Found while reviewing: with the machine loaded, test/gui_golden.py's -two-captures-agree settle can take a scene's frame before the scene's -change lands, and every later hash moves up a scene; a rerun on a quiet -machine matches. - -Notes on G12: four soft strips cast from just outside each body inward, -clipped to it and round a cursor, black in linear light, 2% at most and -under the lift's contrast ceiling, in the pane's own group so it moves -with it. At §9.1's strength it is all but invisible on a dark page (a -level of 255 on forge) and faint on a light one (acme's page steps one -level toward the edges); acme-diff-x40.png shows where it falls. - -Notes on G13: a body region now carries its first line (Region.line: a -file's scroll, a terminal's grid offset; on the wire, a u32 more a -region). Under Parallax the dots under each body are offset by a quarter -of its line times the row height, plus G6's glide offset while one runs, -so they drift with the text as it glides and settle with it (measured: 4 -lines at 35 px move the 22 px grid 13 px, 35 mod 22). The cell shader -reads the offset from the instance's serial slot, free since G7 took the -dissolve's per-cell noise out. Without a pattern, nothing happens. - -Notes on G14: removed with its builtin, setting and code after the user -saw it in the lapis showcase: "one of the animations is like a flashing on -the whole pane or something, that is really bad, just remove it". Every -changed cell glowing meant a pane whose whole text changed flashed whole. - -## Terminal track (§9.2) - -Audit, after decision 2 (keep every whimsical effect and polish it, never -remove it): the six core-composed character transitions (ascii, edges, -fall, wave, scramble, typewriter) and curtain stay as they are, each -bounded to its pane's final rectangle and each cell's last sample its -canonical one; slide and vertical are the tty compositor's and follow the -Motion flavour (sxrrwplk); zoom stays (nearest-cell scaling, its look is -the effect); dissolve swaps each changed cell once at its threshold; -message fades and the theme's chrome fade are the core's (the latter in -OKLab since G10), and InactiveDim (T5's unfocused dim) works in a grid as -it does in a pixel shell. - -| # | effect | switch | state | review material | verdict | -|---|---|---|---|---|---| -| T2 | cursor jump trail | `JumpTrail on\|off` (off) | a jump of three cells or more leaves 3 to 5 cells of trail behind the cursor, their ground drawn toward the text's colour in OKLab, most beside it, fading in 120 ms; truecolor terminals (vaxis's answer or COLORTERM); never the cursor's cell, a selection or outside the focused body; off under Motion off; a few cells a frame | .scratch/render/tty/trail/ (pyte replay of a real tui session at 60 fps: trail-forge.mp4, zooms) | pending | -| T1 chip shadow | `ChipShadow on\|off` (off) | a notice chip casts a shadow a cell right and down in its body: half blocks (▌ ▀ ▘) in a darker ground on blank cells, the ground 35% darker (OKLab) under text; never the cursor, a selection, a tag or another chip; truecolor only | .scratch/render/tty/shadow/ (forge, acme; zooms) | pending | -| T4 ordered swap | `PanelDissolve` (off) | the terminal's dissolve swaps each changed cell once at its place in a 4x4 Bayer matrix (shifted per pane), an even patterned screen instead of noise; hit-testing follows the same order | .scratch/render/tty/dissolve/ (ordered-swap-sim: the matrix applied to two real frames; see note) | pending | -| T7 thumb flash | `ThumbFlash on\|off` (off) | a pane whose view moves has its scroll thumb drawn toward the text's colour, 60% at once and back over 250 ms (quadratic); the thumb only, never a focus indicator; truecolor only; a few cells a frame while it fades | .scratch/render/tty/thumb-flash.mp4, thumb-flash-strip.png (pyte replay, forge) | pending | -| T3 wipe | `PanelCurtain` (off) | the curtain becomes a wipe, left to right: new grid behind the head, old ahead, and a soft edge of two columns whose ink and ground sit 2/3 and 1/3 of the way to the old ground (OKLab; a palette colour steps at the half); only the head's columns change a frame; the head's cells are not hit-testable until settled | .scratch/render/tty/wipe/ (curtain-gui.mp4, curtain-edge-zoom.png) | pending | - -Note on T4's material: a pane opening in a tui session recorded through -pyte did not animate (PanelSlide did not either there), so the review -material applies the same matrix to two real frames of that session; the -unit test holds the order (a 4x4 block reveals exactly t x 16 cells). - -Not built: T5 (unfocused dim) is InactiveDim, which already works in a -grid. T6 (a truecolor ramp on the active tag band) would change the -focused tag's colour, a focus indicator no effect may alter, so it stays -out. The §9.2 byte budget (deferring a sample after an oversized frame, -DECRQM for sync 2026) is not built either: the terminal effects here change -a few cells a frame, and only PanelSlide rewrites a whole pane per sample. diff --git a/docs/next-anim.md b/docs/next-anim.md deleted file mode 100644 index 3d95dfe6..00000000 --- a/docs/next-anim.md +++ /dev/null @@ -1,1107 +0,0 @@ -# anim: the game animation pass, as built - -The author's words were the spec: scrolling whose timing is consistent so -it never feels choppy; every scroll animated, a long one too; smooth -while keeping the responsiveness; the thin insert-mode caret animated like -the block; small motions that read as smooth; the game's habits for -implementation and testing, frame timings measured as a game measures -them. Later rounds: input latency is a hard constraint; p90/p99 against -the mean is the smoothness measure; throughput on a big file; every file -kind, pane kind and way a view moves, the tty, long lines walked along, -picture and PDF first frames; ponytail for all of it; recordings. - -Positions, not a verdict: argue with them. - -## The change stack (workspace `pardes-n-anim`, above converge `oqolqlko`) - -| change | what | -|---|---| -| anim 1 `vtmwqzpt` | `src/FrameStats.zig`, the frame probe in `Pardes.frames`, stamped by `pump`; the Debug box's timing lines; `PARDES_FRAMES` dump at exit | -| anim 1b `sxxnrzqz` | input-to-present latency, work zones, the view shown, the tty's bytes; the timedemos (`PARDES_FRAMES_DEMO=scroll\|stress\|jumps\|kinds\|panes\|longlines\|one\|clip-*`); `PARDES_FRAMES_CAPTURE` (every presented frame's pixels, for the samples) | -| anim 2 `yqwqutws` | the GUI's paced frame loop: a tick grid, each frame sampled at its tick, an input's frame at once | -| anim 3 `wkxvyoqy` | every scroll glides, whatever moved the view | -| anim 4 `qztrptlo` | the thin caret glides; a step eases; the caret rides a scroll's glide | -| anim 5 `ntnlpots` | colours painted ahead on a worker (`Stream.paintAhead`) | -| 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 | -| 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 -a cell at a time, keeps up with typing, and glides a jump ...", "the -focused cursor glides a jump, eases a step, the thin caret too ...", -"Stream: a scroll's colours are painted ahead on a worker ...", "a long -line is painted only around the caret", "a caret deep in a long line -scrolls the view sideways to it, measured from the view's edge". Builds: -Debug and ReleaseSafe, gui and tty. Failing: only the two baseline -failures NEXT.md names. Not re-baselined: the GUI golden `16-debug` (the -Debug box is three rows taller; it shows `frame virtual clock` under the -golden's clock so it stays still). - -## Method - -The probe (anim 1, 1b): a fixed ring of 16384 frames in `Pardes` (1.3 MB, -nothing allocated per frame, three clock reads a frame, always on). Per -drawn frame: update, render, present µs; the gap since the last present; -whether something was moving into it (a gap over 1.5 periods then is -jank); the input-to-present latency of the first input it answers (SDL's -event timestamp, moved onto the monotonic clock; the tty stamps a key as -its loop takes it); the view and the picture's offset (throughput is rows -actually presented); zones (the core's body rows and colours; the GUI's -instance build, shaping and rasterizing in it; a soft present's GPU wait, -upload and flip); the tty's bytes. `Debug` shows the last second. - -The timedemos are a game's: fixed scripts fed through the shell's own -input paths, named phases, the session ending itself. The tty is driven -through a pty I own (`.scratch/tools/ttydemo.py`, typing the same -scenarios as bytes, answering the frame acks). The corpus -(`.scratch/tools/corpus.sh`) links 13 big real files from the genizah -(a generated C parser, helix's commands.rs, a Python table, jquery, a -minified bundle, a grammar JSON, CHANGELOG.md, an HTML spec page, the -simdutf amalgamation, a TypeScript parser, a long shell test, a Go table, -guide.typ) and generates five (a 600 KB one-line JSON, CJK/emoji/ -combining/RTL/tab text, a 32 MB log, 400k short lines, six 360 KB lines). -The stress file is layout.zig x23 (38k lines, 1.6 MB). - -**Every before/after below is a pair run back to back** (`batch3.sh`: -base then after per demo), the before binary being main+probe (anim 1/1b -alone, `.scratch/base-bin`). The first batch, before and after an hour -apart, was useless: this i7-11700 under intel_pstate moves its clock 2-5x -with load, which moved every number more than any change did. - -## What the probe found, and what came of it - -1. **Only a wheel notch animated.** Ctrl-d/u/f/b, PageDown, G, ge, gg, n, - a Look: zero animated frames; a wheel flick past a body less three rows - snapped. Now every move glides (below). -2. **The loop ran uncapped while anything moved**, ~230 frames a second - on a 60 Hz display (the core asks for a 1 ms wait; the Wayland soft - present has no vsync), so the compositor showed whichever frame was - newest at each refresh: motion sampled at a random phase, the choppy - the author felt. Moving gaps before: p50 4.3 ms, stdev 2.2. Now one - frame a tick, sampled at the tick: p50 16.6, p99 17.2-18.0 ms. -3. **Pacing asleep made every frame 2-5x slower** (the same body-rows - work 3 -> 16 µs, an input's first frame 2.6 -> 7.5 ms p50 RS): a core - that sleeps 80% of each 16 ms is clocked down. Fixed by spinning while - something moves, as a game's frame limiter does (A/B below). -4. **Tree-sitter parsing on the frame** (perf: 36% of the Debug stress - run, most of it the DebugAllocator capturing a stack trace for every - tree-sitter allocation): a scroll past the painted stretch parsed the - next one on the frame, 6-58 ms in Debug, a hitch every two pages. Now - painted ahead on a worker; Debug held PageDown render p90 24 -> 1 ms. -5. **A key typed in the middle of a 500 KB line repainted the line**: - 172-213 ms a key in ReleaseSafe (minified JS, one-line JSON). Now 16 KB - round the caret. -6. **The caret's sideways scroll walked a long line from its start** - (no-wrap, `ensureCursorVisible`, `rawAtDisplay` measures the whole - line): now measured from the view's edge (`lineDisplayOffset`, which - already existed for selections). -7. **A picture decoded on its first frame**: 80-94 ms RS, 285-296 ms - Debug for the docs' screenshot. Now on a thread; the pane appears at - once and the picture lands a frame or so after the decode. -8. **The ReleaseSafe tail is the soft present**: a GPU fence wait (p50 0.6 - ms, p99 6.4) and a 6.7 MB upload (p50 0.9-1.7, p99 4.8) every frame. - With the GPU swapchain (X11 here) the scroll is 0.34 ms of work p50. - Not changed: see the positions. -9. Smaller, fixed: the glide's shift search on a page's first frame (6 ms - Debug: the core's line count is tried first), its emission of every - body row however far it lagged (twice the instances), a far jump - painting three views on the frame, a paint asked at every keystroke, a - paint of a 600 KB line joined on the loop (half a second), the tty's - loop running at the terminal's round trip (its acks woke it: one frame - every 0.4-2 ms while anything moved). - -## The design as built - -### Pacing (anim 2, 6, 7) - -While anything moves, the GUI draws one frame a display refresh on a grid -of ticks (`waitInput`, `Gui.pace_ns`), and the core is advanced to the -tick (`guiNow` -> `Shell.paced_ns`), not to whenever the loop woke, so each -frame moves the motion by exactly a period. A late frame skips the ticks -it missed. An input ends the wait at once and its frame is drawn then; -the grid restarts from it. Idle, the loop sleeps as before. Patterns: a -fixed presentation cadence over variable-step evaluation (the springs are -closed form, evaluated at the tick; the core's stepped animations keep -their 16 ms steps), a frame limiter, input acted on at once and never -gated (only the picture is paced). - -The tick is waited out polling, not asleep (anim 7). Same binary, same -script, interleaved, ReleaseSafe, the scroll demo (`.scratch/runs/ab*`): - -| loop | input-to-present p50/p90 ms (notches) | moving gap p50/p90/p99 ms | CPU s per 18 s run | -|---|---|---|---| -| before: uncapped | 3.2/15.2 | 4.4/9.3/10.1 | 1.9 | -| paced, asleep | 6.8-8.2/11-14 | 16.4/19.0/23.6 | 2.9-3.1 | -| paced, spinning | 1.8-1.9/7.7-15 | 16.6/16.8/17.4 | 7.0-7.3 | - -The tty is paced asleep (a terminal has no vsync and no sub-cell motion, -and power matters more there), and its wait now runs through the frame -acks and pty output to the tick (`waitOnce`): its moving frames went from -every 0.4-2 ms (each a write) to one a 16 ms tick. - -### Every scroll glides on one law (anim 3, 7) - -`stepGlide` keeps each pane's view as the last loop saw it (`Glide.seen`) -and finds the one that moved, whatever moved it. The body as the last -frame drew it is still in `core.surface` then, so it is copied there (no -per-frame copy). The next frame measures the rows moved (the core's line -count tried first; the shift search only when wrapped rows disagree), -keeps the rows that left for the gap, and kicks the spring. - -- The law: the Motion flavour's critically damped spring (the one the - author liked on a notch) at 1.5x its pace; a move during a glide adds - its rows and keeps the speed: retarget, never queue. A notch settles in - 12 frames, a half page 15, a page or a 30 000-line jump 16. -- Past what two frames share, the last frame's body is laid just past the - new one and slides one body (`.scratch/ge-montage.png`: line 55 runs - into 9448). The lag may reach two bodies, so a jump mid-glide carries on. -- Readable: at most a body in four frames (`Glide.sample`). -- Not gliding: a new pane (appears at once), a pane moved or resized in - the same step, a terminal's output, a touchpad (follows the finger), - generated text rewritten as its view moved, Motion off (all land; the - test checks). -- The caret and the glide quad ride the picture (`glideLift`). - -### The view's motion is one system (anim 9) - -The author watched sample 3 and saw a bounce a line under a held j: every -repeat restarted the spring's ease to its new target, so the picture sped -up and slowed down once an input. Now the picture's motion is one system -with its own state (`Glide`: its lag behind the text, its speed, and the -inputs that have been feeding it), integrated in one place every frame -(`Glide.advance`), and every scroll is an input into it (`Glide.kick`), -absorbed by what the system is doing: - -| the system is | an input comes | it does | -|---|---|---| -| at rest | any move (a j, a notch, a page, a jump) | the spring starts an ease from rest | -| easing | the same way, within 150 ms | the inputs are a stream now: it moves at their rate (rows an input over their spacing), a lag of an input or so behind, never easing to each | -| fed by a stream | another of the stream | the target moves on; the speed stays the stream's | -| fed by a stream | the inputs stop (none for 1.5 spacings) | the spring settles it, from the speed it has, never past its mark: the only ease-out | -| moving | an input the other way | the stream ends; the spring turns it through zero from its speed | -| moving | a jump past what two frames share | its rows are added (the stitched slide); the speed carries on | - -The caret is its own body (anim 10): its state is its own springs -(`CursorGlide`, screen cells as floats), integrated on the same tick, and -it is drawn from that state only, never from the text's glide (the ride -that lifted it with the glide's fractional lag is deleted: every motion -of the text had leaked into it). Its only coupling to the view is its -target: its cell in the view as it will be once settled (the core's view -is that one). - -| an input | the caret's target | it does | -|---|---|---| -| a page or half page, a scroll that keeps its screen row (Ctrl-f/b/d/u, PageDown/Up, a j or k at the edge row) | unchanged | not a pixel's move while the text slides under it | -| a move in a still view (h/j/k/l, w, a click, a typed character) | the new cell | the short ease | -| a stream of such moves (a held key, typing) | each new cell | lands on each, at the keys' rate | -| a scroll that carries its line (the wheel, Ctrl-o to a far place in view) | where its line will be | moves there whole, at the view's pace, and lands exactly | -| a jump that moves both (G, a Look) | the final cell | one ease, no trip with the old page | -| a terminal's output | its cell | lands with the output (which does not glide) | -| Motion off | the cell | there at once | - -While a glide moves the text the caret is drawn as its quad (from its -springs), not as a cell of the moving rows. Invariants, checked over every -frame of the scripted scroll and held-key runs (`GlideRun.checkCaret`): -while its cell stays and it is on it, its drawn row is identical frame to -frame; it only closes on its cell; it lands within half a second of its -last change. The blink keys off the last key or click, never a frame. - -So a held j, a spun wheel and a held Ctrl-d are the same case (a stream), -a single j or notch the same ease as before. Every input, a repeat too, -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. - -### 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 (`panel_compositor.glideRows`): 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 -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 -instead of landing: its own spring 1.5x stiffer, the four corners -together, never overshooting, ~60 ms; at a key's repeat it trails half a -cell and never smears a caret into a block. A jump still smears and bows. - -### Colours painted ahead (anim 5, 7) - -`Stream.paintAhead` asks the disk engine's worker (its own generation -bit) to paint the stretch two views ahead the way the view last went, -with its own parser and cursor (`syntax.highlightApart`; markdown and -typst, whose injections share parsers, stay on the loop). -`refreshHighlights` takes it on arrival (`takeAhead`). A paint still -reaching into what is asked is let finish; one that does not is told to -stop and left to end on its own, never joined on the loop. Not asked -while the view stands still, nor for stretches over 512 KB. - -## Per scenario: glides, snaps or follows - -| scenario | | why | -|---|---|---| -| wheel notch, a spin | glides, each notch retargeting | discrete steps, piled onto one glide | -| touchpad | follows | direct manipulation: smoothing is lag | -| Ctrl-d/u/f/b, PageDown/Up, held | glide, retargeting | discrete jumps | -| G, 12G, 300G, 9000G, gg, ge | glide; past a body, one body's slide | a jump shorter than a body glides its rows; longer ones on the same law | -| n/N, `*`, a query's Ctrl-n/p moving its owner | glide (the owner's view) | the eye follows where the place went | -| Look `:40`, `:7000`, `file:line` in the same pane | glide | same | -| a Look opening a new pane | appears at once | nothing to glide from | -| jumplist Ctrl-o/Ctrl-i, SPC j o/i | glide | jumps | -| rail B1/B2/B3, a tick | glide | pardes's rail is acme's: a click scrolls by the row clicked; there is no thumb to drag, so nothing to follow (a thumb drag, if added, must be skipped in `stepGlide` as the touchpad is) | -| wheel over the gutter | glides | the wheel's | -| typing, arrows, w/e/l on long lines | the caret eases | small steps | -| Enter at the bottom of the view | a one-row glide each | the text rolls up | -| 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 | 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) - -Deleted: the cursor-quad columns of the probe (unused by any analysis: -about 5 lines in anim 1 and 3 in 1b), the `PARDES_PACE_SLEEP` toggle and -the sleeping branch it kept (about 12 in anim 7; the A/B above is its -record); nothing else in the stack had a cheaper rung. -Shortcuts marked `ponytail:` with their ceilings: the ring's size, the -tick grid's phase (ours, not the display's), one glide at a time, one -paint at a time, the spin's cost, a thread a picture, the 16 KB long-line -paint. Measured behaviour unchanged by the pass (the toggle's default was -what was measured). - -## Numbers - -Every row is a pair run back to back (`batch3.sh`), the final binaries, -ms p50/p90/p99/max; *latency* is input-to-present of the frames that answer -an input; *frame work* is update + render + present of every drawn frame; -*present gap* only over frames something was moving into; *late* counts -moving gaps over 25 ms. The soft present (Wayland) in both. Small phases -(under ten inputs) move a couple of ms round to round in both directions; -the long phases are the ones to read. - -### Headline: every phase of a demo pooled, before -> after - -| build | demo | latency | frame work | present gap (moving) | -|---|---|---|---|---| -| rs | scroll | 4.2/8.2/11.4/17.4 → 2.4/7.8/14.1/14.1 | 3.6/8.4/11.2/17.0 → 3.0/6.6/11.5/14.0 | 4.5/9.4/11.9/12.6 → 16.6/16.8/16.9/17.8 | -| rs | stress | 6.4/12.4/20.7/29.5 → 2.1/6.5/12.2/14.5 | 3.6/10.4/19.3/29.5 → 2.1/6.3/10.0/14.4 | 3.3/8.7/9.6/12.4 → 16.5/16.8/17.1/22.2 | -| rs | jumps | 6.5/10.1/15.9/21.5 → 3.8/11.2/12.8/20.5 | 4.0/8.8/13.5/21.1 → 1.9/7.1/11.6/20.0 | 8.4/17.1/21.2/23.8 → 16.6/16.8/18.0/22.7 | -| rs | kinds | 6.3/10.9/21.0/220.1 → 3.3/8.1/18.4/74.4 | 4.1/8.7/13.7/218.1 → 2.4/7.1/11.7/67.5 | 4.2/9.1/11.4/18.6 → 16.6/16.8/17.6/39.0 | -| rs | panes | 6.8/9.8/20.8/84.3 → 5.4/9.4/17.9/39.2 | 5.2/8.7/13.8/84.0 → 3.6/8.1/14.6/39.1 | 4.3/9.1/14.8/25.7 → 16.6/16.8/18.0/43.2 | -| rs | longlines | 8.7/17.6/189.4/218.7 → 7.7/17.9/26.5/37.7 | 4.7/9.1/13.7/210.2 → 3.6/9.3/19.9/36.7 | 4.3/9.2/11.3/22.0 → 16.5/16.8/17.3/22.1 | -| dbg | scroll | 8.2/15.6/33.3/40.2 → 4.4/15.6/23.7/29.7 | 3.7/8.9/15.5/32.9 → 3.1/7.5/17.6/23.2 | 4.4/8.9/11.8/15.0 → 16.6/16.8/17.3/18.0 | -| dbg | stress | 4.1/25.0/51.6/65.8 → 4.0/8.6/39.0/111.1 | 3.9/17.4/43.0/63.1 → 3.6/8.3/22.6/111.1 | 4.0/9.3/16.7/33.7 → 16.4/16.8/23.1/111.2 | -| dbg | jumps | 12.7/23.2/41.8/247.9 → 11.5/21.2/35.9/280.9 | 6.9/15.0/33.3/247.4 → 3.5/11.5/22.9/280.4 | 8.1/16.9/30.0/38.9 → 16.6/16.9/29.6/73.9 | -| dbg | kinds | 8.1/18.7/53.0/1979.3 → 4.6/15.2/56.8/438.8 | 4.4/12.3/28.9/1963.1 → 3.6/9.0/24.4/188.1 | 4.3/8.8/12.3/72.5 → 16.5/16.9/24.5/115.3 | -| dbg | panes | 7.9/16.2/65.6/304.3 → 6.2/16.1/64.1/266.2 | 5.3/13.1/18.7/301.1 → 4.1/12.9/23.7/262.6 | 4.6/9.2/27.9/108.3 → 16.6/16.8/37.1/146.3 | -| dbg | longlines | 16.6/33.1/35.8/2801.3 → 16.0/33.0/130.0/319.3 | 10.1/15.7/25.3/1963.0 → 9.2/16.5/80.0/180.3 | 8.6/16.8/27.4/34.5 → 16.6/16.8/18.2/167.2 | - -CPU (user s) per run, before -> after: base-rs-scroll 1.968, after-rs-scroll 7.072, base-rs-stress 4.059, after-rs-stress 14.329, base-rs-jumps 17.935, after-rs-jumps 48.597, base-rs-kinds 34.805, after-rs-kinds 94.319, base-rs-panes 11.838, after-rs-panes 24.085, base-rs-longlines 37.191, after-rs-longlines 70.976, base-dbg-scroll 2.524, after-dbg-scroll 7.842, base-dbg-stress 6.108, after-dbg-stress 18.640, base-dbg-jumps 31.800, after-dbg-jumps 60.583, base-dbg-kinds 56.343, after-dbg-kinds 109.000, base-dbg-panes 19.374, after-dbg-panes 29.634, base-dbg-longlines 77.796, after-dbg-longlines 90.633. -The spin is most of the difference (a core while something moves). - -Read in Debug: the before's long-line spikes were 2 s (a key in a 500 KB -line repainting it); after, a key there is 80-180 ms in Debug (16 KB of -tree-sitter through the DebugAllocator: position 2) and 18-22 ms in -ReleaseSafe; the pooled Debug p99 rises because those keys are many and -the 2 s ones were few, the max falls 2801 -> 319. - -### Per scenario - -#### GUI ReleaseSafe: `scroll` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| notches | before | 3.8/6.9/6.9/6.9 | 3.4/8.4/10.8/11.5 | 4.5/9.5/11.9/12.6 | 7 | 0 | -| | after | 1.9/8.4/8.4/8.4 | 1.8/3.2/8.3/8.3 | 16.7/16.9/17.8/17.8 | 7 | 0 | -| spin | before | 2.9/8.0/9.2/9.2 | 3.2/8.2/9.2/10.0 | 4.0/9.0/10.2/11.1 | 35 | 0 | -| | after | 2.4/7.1/11.8/11.8 | 2.3/6.4/11.7/11.7 | 8.8/16.7/17.0/17.0 | 34 | 0 | -| pages | before | 6.8/7.2/17.4/17.4 | 6.7/7.1/17.0/17.0 | - | 3788 | 0 | -| | after | 7.6/14.1/14.1/14.1 | 4.1/7.6/13.6/14.0 | 16.6/16.8/16.9/17.0 | 3598 | 0 | -| retarget | before | 8.4/11.2/11.2/11.2 | 8.4/11.1/11.1/11.1 | - | 150 | 0 | -| | after | 5.0/11.4/11.4/11.4 | 5.0/5.2/11.3/11.3 | 16.6/16.8/16.9/16.9 | 92 | 0 | -| cursor | before | 6.9/8.8/11.4/11.4 | 6.1/8.8/11.3/11.5 | 5.5/9.8/12.4/12.5 | 0 | 0 | -| | after | 2.4/8.2/10.6/10.6 | 4.0/6.7/10.4/11.5 | 16.6/16.7/16.9/17.7 | 0 | 0 | - -#### GUI ReleaseSafe: `stress` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| spin | before | 2.8/8.0/9.9/11.3 | 2.8/7.9/9.7/11.3 | 3.3/8.7/9.6/12.4 | 189 | 0 | -| | after | 2.1/6.0/7.6/10.6 | 2.2/6.5/7.5/10.6 | 8.2/13.2/16.8/16.9 | 175 | 0 | -| held-ctrl-d | before | 7.6/15.1/20.0/20.0 | 7.5/15.0/20.0/20.0 | - | 539 | 0 | -| | after | 2.2/6.5/14.5/14.5 | 2.1/6.1/9.3/14.4 | 16.6/16.9/17.3/18.2 | 508 | 0 | -| held-j | before | 6.8/11.1/15.3/15.3 | 6.7/11.0/15.3/15.3 | - | 35 | 0 | -| | after | 2.0/6.3/11.5/11.5 | 2.2/6.0/7.6/11.4 | 16.6/16.9/17.1/17.8 | 33 | 0 | -| held-pagedown | before | 11.2/19.4/29.5/29.5 | 11.1/19.3/29.5/29.5 | - | 758 | 0 | -| | after | 2.1/5.7/7.8/7.8 | 2.2/6.3/7.7/10.3 | 16.6/16.8/17.3/22.2 | 703 | 0 | -| far | before | 8.1/17.2/17.6/17.6 | 8.1/15.8/16.2/16.2 | - | 64670 | 0 | -| | after | 12.2/12.4/12.5/12.5 | 1.8/8.6/12.3/12.4 | 16.6/16.8/17.0/17.0 | 60219 | 0 | - -#### GUI ReleaseSafe: `jumps` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| counted-G-big | before | 6.9/12.0/16.5/16.5 | 6.5/9.6/16.1/16.1 | 4.7/9.4/10.7/10.7 | 9605 | 0 | -| | after | 8.6/12.5/12.8/12.8 | 5.2/8.5/12.1/12.3 | 16.6/16.8/22.5/22.5 | 8998 | 0 | -| pages-up-big | before | 8.2/14.2/21.2/21.2 | 8.1/14.1/21.1/21.1 | - | 1784 | 0 | -| | after | 8.4/8.8/15.4/15.4 | 4.1/6.0/12.7/15.3 | 16.6/16.8/18.0/18.1 | 1706 | 0 | -| search-n-big | before | 7.3/9.1/10.1/10.1 | 4.3/8.9/10.7/12.4 | 5.0/10.0/21.6/23.8 | 1255 | 0 | -| | after | 11.4/11.8/11.8/11.8 | 1.8/7.0/11.7/11.7 | 16.6/16.8/16.9/18.0 | 1255 | 0 | -| rail-big | before | 6.2/15.6/15.6/15.6 | 4.5/8.9/15.5/15.5 | 5.3/9.9/12.5/14.9 | 3028 | 0 | -| | after | 8.5/12.6/17.4/17.4 | 1.9/6.2/12.5/17.2 | 16.6/16.8/17.0/18.0 | 3030 | 0 | -| query-ctrl-n-big | before | 7.8/15.9/16.1/16.1 | 4.2/10.3/15.8/16.0 | 4.7/10.2/16.1/16.1 | 624 | 0 | -| | after | 6.3/8.8/9.2/9.2 | 1.8/6.0/9.1/11.7 | 16.6/16.8/17.9/18.2 | 724 | 0 | -| star-big | before | 6.9/10.1/10.1/10.1 | 3.5/8.6/11.2/11.2 | 4.5/10.6/16.0/16.0 | 853 | 0 | -| | after | 11.5/11.7/11.7/11.7 | 1.9/11.4/11.6/11.6 | 16.6/16.8/16.9/16.9 | 853 | 0 | -| jumplist-big | before | 12.5/15.6/19.1/19.1 | 6.8/12.6/19.0/19.0 | 16.9/18.9/22.7/22.7 | 4506 | 0 | -| | after | 11.6/11.8/11.9/11.9 | 1.8/7.1/11.7/11.8 | 16.6/16.9/18.7/21.9 | 7227 | 0 | -| insert-big | before | 3.3/7.4/12.6/21.5 | 2.4/7.0/12.3/21.0 | 15.9/16.8/22.0/22.4 | 42 | 0 | -| | after | 2.5/6.2/8.6/20.5 | 1.9/6.0/7.5/20.0 | 16.6/16.8/16.9/17.9 | 58 | 0 | -| counted-G-small | before | 9.1/12.4/12.4/12.4 | 9.0/12.3/12.3/12.3 | - | 384 | 0 | -| | after | 8.2/11.4/11.4/11.4 | 2.5/8.6/11.3/12.0 | 16.6/16.8/18.2/18.2 | 363 | 0 | -| pages-up-small | before | 7.6/15.6/15.7/15.7 | 7.5/15.4/15.6/15.6 | - | 78 | 0 | -| | after | 11.6/11.8/12.6/12.6 | 1.8/6.8/11.6/12.5 | 16.6/16.8/17.0/17.5 | 74 | 0 | -| search-n-small | before | 8.9/10.1/12.0/12.0 | 3.3/8.8/10.3/11.7 | 4.0/9.3/12.2/14.1 | 44 | 0 | -| | after | 7.2/10.7/11.4/11.4 | 5.6/7.1/11.3/11.3 | 16.6/16.8/18.1/18.1 | 45 | 0 | -| rail-small | before | 8.8/9.8/12.3/12.3 | 8.8/9.7/12.3/12.3 | - | 71 | 0 | -| | after | 7.3/7.8/8.7/8.7 | 7.1/7.5/8.5/8.5 | 16.6/16.8/16.9/16.9 | 72 | 0 | -| query-ctrl-n-small | before | 8.7/9.0/12.5/12.5 | 4.6/8.7/10.3/12.3 | 5.1/10.0/16.2/16.2 | 91 | 0 | -| | after | 7.1/7.6/10.8/10.8 | 1.8/7.0/10.5/10.5 | 16.6/16.8/17.5/17.5 | 94 | 0 | -| star-small | before | 9.3/10.4/10.4/10.4 | 6.8/9.5/11.0/11.0 | 6.9/9.7/12.4/12.4 | 166 | 0 | -| | after | 7.8/8.4/8.4/8.4 | 1.8/7.7/9.2/9.2 | 16.6/16.9/22.7/22.7 | 155 | 0 | -| look-small | before | 7.5/7.5/7.5/7.5 | 7.4/7.4/7.4/7.4 | - | 0 | 0 | -| | after | 8.3/9.6/9.6/9.6 | 5.9/9.4/12.2/12.2 | 16.6/16.8/18.0/18.0 | 80 | 0 | -| jumplist-small | before | 9.4/10.2/12.2/12.2 | 8.7/10.1/12.1/12.1 | 16.6/17.2/22.0/22.0 | 88 | 0 | -| | after | 8.2/9.5/11.2/11.2 | 6.6/8.1/12.3/12.3 | 16.6/17.2/22.4/22.4 | 87 | 0 | -| insert-small | before | 4.6/8.7/12.1/12.3 | 4.1/8.2/12.2/13.1 | 18.1/20.4/23.2/23.5 | 27 | 0 | -| | after | 2.0/6.2/8.0/12.9 | 1.8/5.7/7.6/12.8 | 16.6/16.8/17.4/17.9 | 38 | 0 | -| look-new-pane | before | 7.8/7.8/7.8/7.8 | 4.5/7.0/9.7/9.7 | 16.6/17.4/18.8/18.8 | 0 | 0 | -| | after | 14.8/14.8/14.8/14.8 | 14.0/14.0/14.0/14.0 | - | 0 | 0 | - -#### GUI ReleaseSafe: `kinds` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| generated-parser.c | before | 4.4/10.4/15.9/25.6 | 3.3/8.3/13.4/23.7 | 4.0/8.9/10.7/12.3 | 3794 | 0 | -| | after | 2.1/6.7/11.6/22.9 | 2.1/6.9/12.2/21.4 | 16.6/16.8/17.2/18.0 | 3788 | 0 | -| commands.rs | before | 6.8/11.8/22.4/62.2 | 4.1/9.0/18.2/60.6 | 4.3/9.0/10.8/11.8 | 1696 | 0 | -| | after | 2.0/7.0/11.7/16.2 | 1.9/6.5/11.5/14.7 | 16.5/16.8/18.1/22.6 | 1694 | 0 | -| tables.py | before | 6.9/12.7/16.3/25.2 | 3.7/8.7/13.8/23.4 | 4.2/9.1/11.4/12.3 | 2447 | 0 | -| | after | 2.0/6.4/9.5/11.4 | 1.9/5.7/11.3/12.6 | 16.6/16.8/17.9/22.6 | 2447 | 0 | -| jquery.js | before | 6.8/10.2/14.5/199.5 | 4.2/9.1/13.2/197.7 | 4.1/9.1/10.9/11.5 | 2154 | 0 | -| | after | 1.9/7.0/11.8/31.1 | 1.9/6.7/11.3/29.3 | 16.5/16.8/17.4/22.7 | 2147 | 0 | -| minified.js | before | 7.0/16.8/21.4/21.9 | 5.7/9.0/11.5/12.5 | 7.5/10.0/11.8/11.8 | 0 | 0 | -| | after | 7.0/16.5/22.5/22.6 | 4.8/8.3/12.0/12.5 | 16.6/16.8/16.9/16.9 | 0 | 0 | -| grammar.json | before | 6.2/9.9/13.1/205.0 | 3.2/8.1/12.1/204.2 | 4.0/8.6/9.7/10.5 | 2286 | 0 | -| | after | 1.8/7.0/11.5/22.4 | 1.8/6.9/11.1/20.4 | 16.6/16.8/16.9/18.0 | 2282 | 0 | -| oneline.json | before | 6.7/8.9/13.1/25.3 | 6.2/8.9/12.5/24.0 | 5.0/10.0/11.5/11.5 | 4 | 0 | -| | after | 6.8/10.1/35.0/47.4 | 6.4/9.1/32.0/45.8 | 16.6/16.8/16.8/16.8 | 4 | 0 | -| CHANGELOG.md | before | 4.1/16.5/26.4/28.2 | 3.3/8.7/21.8/28.1 | 4.0/9.0/11.6/13.6 | 715 | 0 | -| | after | 2.9/7.6/13.7/25.4 | 2.4/7.1/11.4/25.2 | 16.6/16.8/22.7/25.5 | 712 | 2 | -| cascade.html | before | 5.2/9.4/16.3/87.4 | 3.3/8.3/12.1/79.9 | 3.9/8.9/10.4/11.1 | 645 | 0 | -| | after | 2.2/6.7/10.8/74.4 | 1.9/6.5/11.1/67.5 | 16.6/16.8/17.0/17.6 | 645 | 0 | -| simdutf.cpp | before | 5.1/12.5/23.0/24.5 | 4.0/9.1/22.5/24.4 | 4.4/8.9/10.8/12.8 | 9874 | 0 | -| | after | 2.0/6.9/11.0/11.0 | 1.9/6.2/10.8/11.0 | 16.6/16.8/17.2/17.6 | 9872 | 0 | -| parser.ts | before | 5.4/9.5/13.0/33.0 | 4.5/8.9/12.3/32.0 | 4.5/9.6/11.4/12.0 | 1779 | 0 | -| | after | 2.0/7.0/10.6/25.8 | 2.0/6.8/11.9/24.8 | 16.5/16.8/17.5/18.3 | 1778 | 0 | -| fcnal-test.sh | before | 4.1/10.4/14.0/57.5 | 3.3/8.6/12.2/55.3 | 4.0/8.9/10.6/11.6 | 1037 | 0 | -| | after | 1.9/7.0/10.8/58.8 | 1.9/6.6/10.7/56.6 | 16.6/16.8/17.5/18.2 | 1036 | 0 | -| data.go | before | 6.9/9.2/14.3/28.0 | 3.9/8.6/12.3/27.8 | 4.3/9.1/11.2/12.1 | 3898 | 0 | -| | after | 2.1/6.8/10.6/38.6 | 2.0/6.2/11.7/38.1 | 16.6/16.8/17.1/18.2 | 3892 | 0 | -| guide.typ | before | 6.8/13.2/17.7/17.9 | 4.3/9.0/15.6/17.7 | 4.4/9.2/11.3/13.3 | 119 | 0 | -| | after | 2.6/7.9/13.3/19.3 | 2.0/7.1/12.5/15.6 | 16.5/16.8/18.3/23.7 | 119 | 0 | -| unicode.txt | before | 6.9/9.8/15.6/53.9 | 4.1/8.7/11.7/21.0 | 4.4/9.3/11.6/13.1 | 4642 | 0 | -| | after | 2.1/6.9/17.3/55.2 | 1.9/6.3/11.2/22.0 | 16.6/16.8/17.0/18.4 | 4635 | 0 | -| big.log | before | 3.8/11.0/15.8/29.8 | 3.3/8.8/12.8/13.9 | 4.1/8.9/10.7/12.4 | 69343 | 0 | -| | after | 2.4/8.7/23.4/24.8 | 2.4/7.2/12.3/13.9 | 16.5/16.7/17.0/17.8 | 69269 | 0 | -| words.txt | before | 6.4/8.6/12.4/15.7 | 3.6/8.5/11.4/12.3 | 4.1/9.3/11.2/12.5 | 92633 | 0 | -| | after | 1.9/6.6/13.8/14.3 | 2.2/7.0/11.9/12.0 | 16.6/16.8/17.3/22.2 | 92628 | 0 | -| hugelines.txt | before | 6.7/10.0/16.5/177.6 | 6.0/9.3/12.3/177.1 | 7.0/15.7/18.6/18.6 | 12 | 0 | -| | after | 6.8/10.6/15.2/29.9 | 6.3/10.2/12.1/28.1 | 16.6/17.0/39.0/39.0 | 12 | 1 | -| minified.js! | before | 7.2/16.1/21.3/220.1 | 5.3/9.0/12.4/218.1 | 6.4/12.2/17.0/17.0 | 0 | 0 | -| | after | 7.2/17.3/22.3/27.3 | 5.0/8.7/12.4/25.4 | 16.6/16.8/16.9/16.9 | 0 | 0 | -| oneline.json! | before | 6.7/10.5/13.0/17.4 | 5.8/9.4/12.3/12.8 | 4.9/9.5/11.0/11.1 | 0 | 0 | -| | after | 6.4/10.2/20.0/38.1 | 5.3/8.9/12.7/37.6 | 16.6/16.8/16.9/16.9 | 0 | 0 | -| hugelines.txt! | before | 6.4/9.6/16.0/18.2 | 5.4/8.7/11.7/13.7 | 5.0/9.7/12.0/12.3 | 2 | 0 | -| | after | 5.6/9.4/13.6/16.5 | 3.6/8.1/11.5/13.4 | 16.6/16.8/17.0/17.2 | 2 | 0 | - -#### GUI ReleaseSafe: `panes` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| command-cat | before | 7.1/9.1/14.5/31.5 | 5.9/8.2/12.9/25.9 | 4.5/9.0/14.8/14.8 | 4668 | 0 | -| | after | 6.7/11.1/13.7/24.6 | 6.2/10.2/12.3/12.7 | 16.6/16.9/22.8/22.8 | 4616 | 0 | -| command-yes | before | 6.7/9.6/13.0/22.6 | 6.0/8.9/12.6/20.6 | 5.7/9.8/11.9/11.9 | 4855 | 0 | -| | after | 6.1/9.1/12.7/23.5 | 4.6/8.5/12.5/21.4 | 16.6/16.8/17.4/17.4 | 4924 | 0 | -| pager | before | 7.0/9.2/12.7/12.9 | 6.1/8.7/12.3/12.6 | 4.4/9.0/13.0/13.0 | 0 | 0 | -| | after | 6.9/9.7/14.3/14.6 | 5.5/9.2/12.4/14.6 | 16.6/16.8/17.3/17.3 | 0 | 0 | -| directory | before | 6.4/9.3/12.2/12.3 | 4.4/8.6/12.0/12.2 | 4.4/9.1/11.4/12.2 | 2 | 0 | -| | after | 5.6/8.7/12.4/12.5 | 3.5/7.6/11.9/12.4 | 16.6/16.8/17.7/18.0 | 2 | 0 | -| pdf | before | 6.9/16.1/44.7/44.9 | 6.4/13.3/31.5/44.8 | 3.9/9.1/9.5/9.5 | 0 | 0 | -| | after | 7.0/16.6/38.5/39.2 | 6.4/14.6/34.5/39.1 | 16.6/16.8/17.8/17.8 | 0 | 0 | -| image | before | 6.9/10.1/24.1/84.3 | 5.9/9.1/12.4/84.0 | 4.6/9.1/10.7/10.7 | 0 | 0 | -| | after | 6.9/9.0/12.7/14.1 | 6.4/8.9/12.4/28.5 | 16.6/16.8/43.2/43.2 | 0 | 1 | -| help | before | 6.8/8.8/12.1/12.6 | 3.5/8.2/11.5/12.5 | 4.2/8.8/11.5/12.4 | 69 | 0 | -| | after | 2.6/7.1/8.0/14.4 | 1.9/6.8/8.0/14.0 | 16.6/16.8/17.1/18.0 | 69 | 0 | -| changelog | before | 6.3/9.6/12.9/13.0 | 4.0/8.6/12.0/12.9 | 4.2/9.2/11.7/12.7 | 220 | 0 | -| | after | 1.8/6.8/13.7/14.3 | 1.8/6.4/11.2/14.3 | 16.6/16.8/17.3/18.3 | 220 | 0 | -| query-typing | before | 7.5/10.6/13.8/13.8 | 1.7/11.7/13.8/14.1 | 2.8/15.4/23.2/25.7 | 0 | 1 | -| | after | 7.3/9.3/12.4/12.4 | 1.9/7.9/12.3/12.6 | 16.6/17.0/22.9/22.9 | 17 | 0 | - -#### GUI ReleaseSafe: `longlines` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| w-held-minified.js-wrap | before | 3.0/7.9/9.4/9.4 | 3.2/8.1/9.4/9.9 | 4.1/9.1/10.5/11.0 | 0 | 0 | -| | after | 1.8/5.9/7.7/7.7 | 1.7/5.7/7.3/7.6 | 16.6/16.7/16.9/17.3 | 0 | 0 | -| e-held-minified.js-wrap | before | 3.1/8.3/9.3/9.3 | 3.1/8.0/9.2/11.3 | 4.1/9.0/10.0/12.4 | 0 | 0 | -| | after | 1.7/5.9/7.2/7.2 | 1.7/5.7/7.2/7.2 | 16.6/16.8/17.7/18.2 | 0 | 0 | -| l-held-minified.js-wrap | before | 6.6/10.1/11.7/11.7 | 3.3/8.5/11.3/11.6 | 4.2/9.2/10.3/12.0 | 0 | 0 | -| | after | 1.9/5.9/7.3/7.3 | 1.9/5.9/7.3/7.3 | 16.6/16.8/17.1/17.4 | 0 | 0 | -| dollar-zero-minified.js-wrap | before | 7.5/8.7/8.7/8.7 | 7.3/8.6/8.6/8.6 | - | 0 | 0 | -| | after | 7.5/7.7/7.7/7.7 | 3.2/7.7/11.4/11.4 | 16.6/16.9/16.9/16.9 | 0 | 0 | -| f-t-minified.js-wrap | before | 7.3/7.6/7.8/7.8 | 7.2/7.5/7.7/7.7 | - | 0 | 0 | -| | after | 7.2/7.5/9.0/9.0 | 4.6/11.2/11.6/12.0 | 14.5/16.7/17.9/18.0 | 0 | 0 | -| gl-gh-minified.js-wrap | before | 7.4/7.6/7.7/7.7 | 7.3/7.5/7.6/7.6 | - | 0 | 0 | -| | after | 7.4/8.1/8.4/8.4 | 5.0/11.0/11.4/11.4 | 13.9/16.7/18.7/18.7 | 0 | 0 | -| insert-end-minified.js-wrap | before | 7.2/11.0/12.7/12.7 | 7.0/10.7/12.6/12.6 | 5.7/9.8/10.6/10.6 | 0 | 0 | -| | after | 1.8/6.2/8.0/8.0 | 1.8/6.1/10.6/10.9 | 16.6/16.8/17.3/18.1 | 0 | 0 | -| insert-middle-minified.js-wrap | before | 171.7/177.5/185.4/185.4 | 7.3/174.3/184.4/184.4 | 5.2/9.8/10.3/10.3 | 0 | 0 | -| | after | 16.8/26.5/28.1/28.1 | 12.7/24.9/27.3/27.3 | 15.9/16.7/16.9/16.9 | 0 | 0 | -| sweep-L-W-minified.js-wrap | before | 7.1/11.5/212.2/212.2 | 6.9/10.2/14.1/210.2 | 5.5/9.4/12.9/12.9 | 0 | 0 | -| | after | 7.3/12.1/13.5/13.5 | 6.8/11.2/12.6/12.9 | 16.6/16.9/20.9/20.9 | 0 | 0 | -| w-held-oneline.json-wrap | before | 3.9/10.1/11.3/11.3 | 4.1/8.6/10.9/11.5 | 4.8/9.6/11.4/12.0 | 0 | 0 | -| | after | 1.8/6.0/13.3/13.3 | 1.8/5.7/7.3/13.2 | 16.6/16.8/17.0/17.6 | 0 | 0 | -| e-held-oneline.json-wrap | before | 3.2/7.8/9.0/9.0 | 3.2/8.2/9.4/11.1 | 4.1/9.2/10.6/12.2 | 0 | 0 | -| | after | 1.8/5.6/7.7/7.7 | 1.8/5.6/7.6/7.6 | 16.6/16.8/16.9/17.0 | 0 | 0 | -| l-held-oneline.json-wrap | before | 4.4/10.4/13.3/13.3 | 3.2/8.4/11.9/13.2 | 4.0/9.1/11.0/13.4 | 0 | 0 | -| | after | 1.9/6.1/7.5/7.5 | 1.8/6.0/7.4/7.5 | 16.6/16.8/17.2/17.4 | 0 | 0 | -| dollar-zero-oneline.json-wrap | before | 7.6/8.0/8.0/8.0 | 7.4/7.7/7.7/7.7 | - | 0 | 0 | -| | after | 9.0/9.4/9.4/9.4 | 2.3/8.9/10.8/10.8 | 16.5/16.9/17.0/17.0 | 0 | 0 | -| f-t-oneline.json-wrap | before | 7.4/7.6/9.2/9.2 | 7.3/7.5/9.1/9.1 | - | 0 | 0 | -| | after | 7.3/8.8/9.3/9.3 | 4.6/10.4/11.7/12.3 | 14.7/16.7/17.0/17.4 | 0 | 0 | -| gl-gh-oneline.json-wrap | before | 7.5/7.6/7.6/7.6 | 7.3/7.4/7.5/7.5 | - | 0 | 0 | -| | after | 7.5/7.7/8.6/8.6 | 4.0/10.6/11.5/11.5 | 14.5/16.6/16.9/16.9 | 0 | 0 | -| insert-end-oneline.json-wrap | before | 7.4/10.8/12.8/12.8 | 7.2/10.6/12.9/12.9 | 7.8/10.3/14.0/14.0 | 0 | 0 | -| | after | 1.8/6.0/7.4/7.4 | 1.8/5.9/11.1/11.3 | 16.6/16.8/17.0/17.0 | 0 | 0 | -| insert-middle-oneline.json-wrap | before | 193.1/199.8/207.9/207.9 | 5.2/195.5/206.4/206.4 | 4.0/9.3/13.6/13.6 | 0 | 0 | -| | after | 21.3/29.0/37.7/37.7 | 18.1/25.4/36.7/36.7 | 16.6/16.9/17.9/17.9 | 0 | 0 | -| sweep-L-W-oneline.json-wrap | before | 7.2/11.3/31.8/31.8 | 6.8/9.3/12.2/12.5 | 4.4/9.3/10.1/10.5 | 6 | 0 | -| | after | 7.7/12.1/21.5/21.5 | 6.9/11.0/12.6/21.5 | 16.6/16.8/16.9/16.9 | 6 | 0 | -| w-held-hugelines.txt-wrap | before | 3.2/8.5/11.8/11.8 | 3.2/8.2/10.2/12.2 | 4.2/9.1/10.5/13.3 | 0 | 0 | -| | after | 1.8/5.8/10.7/10.7 | 1.8/5.5/7.4/10.6 | 16.6/16.8/17.3/17.9 | 0 | 0 | -| e-held-hugelines.txt-wrap | before | 5.1/7.3/11.7/11.7 | 4.1/8.5/11.3/11.9 | 4.5/9.5/12.1/12.9 | 0 | 0 | -| | after | 3.7/7.3/12.6/12.6 | 2.4/7.1/12.5/12.5 | 16.6/16.8/18.1/18.1 | 0 | 0 | -| l-held-hugelines.txt-wrap | before | 7.3/11.6/13.0/13.0 | 7.1/11.4/12.9/12.9 | - | 0 | 0 | -| | after | 7.2/11.4/13.4/13.4 | 7.1/11.2/13.2/13.2 | - | 0 | 0 | -| dollar-zero-hugelines.txt-wrap | before | 7.3/7.4/7.4/7.4 | 7.1/7.2/7.2/7.2 | - | 0 | 0 | -| | after | 7.3/7.3/7.3/7.3 | 6.0/10.4/11.0/11.0 | 15.6/16.6/16.7/16.7 | 0 | 0 | -| f-t-hugelines.txt-wrap | before | 7.2/7.5/7.6/7.6 | 7.1/7.3/7.5/7.5 | - | 0 | 0 | -| | after | 7.2/7.4/9.2/9.2 | 4.4/10.9/11.7/11.9 | 14.6/16.7/16.9/16.9 | 0 | 0 | -| gl-gh-hugelines.txt-wrap | before | 7.4/7.6/7.6/7.6 | 7.2/7.4/7.5/7.5 | - | 0 | 0 | -| | after | 7.4/7.9/10.8/10.8 | 4.6/10.6/11.2/11.2 | 14.8/16.8/17.7/17.7 | 0 | 0 | -| insert-end-hugelines.txt-wrap | before | 7.4/10.6/12.1/12.1 | 7.2/10.5/12.0/12.0 | - | 0 | 0 | -| | after | 2.1/7.4/8.0/8.0 | 2.2/7.3/10.7/10.8 | 16.6/16.8/16.9/17.0 | 0 | 0 | -| insert-middle-hugelines.txt-wrap | before | 7.9/10.7/13.0/13.0 | 7.2/10.2/12.1/12.1 | - | 0 | 0 | -| | after | 7.9/12.9/13.5/13.5 | 7.2/12.2/12.4/12.4 | - | 0 | 0 | -| sweep-L-W-hugelines.txt-wrap | before | 7.8/12.3/14.9/14.9 | 7.0/11.5/13.8/14.8 | 5.8/10.8/19.9/22.0 | 0 | 0 | -| | after | 7.7/11.9/13.1/13.1 | 7.1/12.1/13.6/14.6 | 16.7/16.9/20.1/20.1 | 0 | 0 | -| w-held-minified.js-nowrap | before | 7.1/16.3/28.5/28.5 | 3.5/8.2/10.2/13.7 | 4.5/9.2/10.9/11.3 | 0 | 0 | -| | after | 2.7/15.9/22.6/22.6 | 2.1/3.9/12.7/12.7 | 16.6/16.8/17.9/17.9 | 0 | 0 | -| e-held-minified.js-nowrap | before | 15.5/19.6/24.7/24.7 | 4.4/8.4/10.1/10.1 | - | 0 | 0 | -| | after | 15.2/18.8/23.0/23.0 | 4.1/8.2/9.4/9.4 | - | 0 | 0 | -| l-held-minified.js-nowrap | before | 15.7/20.7/27.7/27.7 | 4.3/8.4/11.3/11.3 | - | 0 | 0 | -| | after | 15.3/19.6/24.2/24.2 | 3.9/8.9/9.9/9.9 | - | 0 | 0 | -| dollar-zero-minified.js-nowrap | before | 9.2/10.1/10.1/10.1 | 9.0/9.9/9.9/9.9 | - | 0 | 0 | -| | after | 9.3/10.4/10.4/10.4 | 3.7/9.1/10.2/10.2 | 16.6/16.8/16.9/16.9 | 0 | 0 | -| f-t-minified.js-nowrap | before | 8.9/9.1/9.9/9.9 | 8.7/9.0/9.8/9.8 | - | 0 | 0 | -| | after | 8.7/9.0/9.7/9.7 | 3.3/8.8/10.7/11.0 | 16.0/16.7/17.9/18.3 | 0 | 0 | -| gl-gh-minified.js-nowrap | before | 9.1/9.2/10.4/10.4 | 8.9/9.1/10.3/10.3 | - | 0 | 0 | -| | after | 8.9/9.2/9.3/9.3 | 2.8/8.9/9.7/9.7 | 16.1/16.8/18.2/18.2 | 0 | 0 | -| insert-end-minified.js-nowrap | before | 8.8/12.1/13.8/13.8 | 8.5/11.0/13.7/13.7 | 4.5/8.9/11.9/11.9 | 0 | 0 | -| | after | 2.1/7.3/9.0/9.0 | 2.2/7.1/9.1/9.4 | 16.6/16.8/16.9/17.1 | 0 | 0 | -| insert-middle-minified.js-nowrap | before | 185.1/192.3/201.4/201.4 | 3.4/172.0/182.2/182.2 | 4.0/8.8/9.4/9.4 | 0 | 0 | -| | after | 16.1/26.7/29.1/29.1 | 8.5/15.2/18.4/18.4 | 16.6/16.9/17.2/17.2 | 0 | 0 | -| sweep-L-W-minified.js-nowrap | before | 11.2/19.6/26.4/26.4 | 7.0/10.2/13.9/14.2 | 5.6/9.6/11.6/12.2 | 0 | 0 | -| | after | 11.9/20.0/26.9/26.9 | 3.9/10.9/13.9/26.2 | 16.6/16.8/17.1/17.1 | 1 | 0 | -| w-held-oneline.json-nowrap | before | 8.8/16.9/21.6/21.6 | 3.3/7.9/8.9/13.2 | 4.2/8.9/9.9/10.6 | 0 | 0 | -| | after | 8.1/20.2/23.4/23.4 | 2.3/5.8/9.3/9.3 | 16.5/16.7/19.7/19.7 | 0 | 0 | -| e-held-oneline.json-nowrap | before | 15.8/20.7/24.4/24.4 | 4.5/8.0/9.4/9.4 | - | 0 | 0 | -| | after | 15.7/20.7/24.5/24.5 | 3.8/6.3/8.5/8.5 | - | 0 | 0 | -| l-held-oneline.json-nowrap | before | 15.7/19.1/29.3/29.3 | 3.6/7.4/9.1/9.1 | - | 0 | 0 | -| | after | 15.8/20.5/25.1/25.1 | 3.8/7.4/10.1/10.1 | - | 0 | 0 | -| dollar-zero-oneline.json-nowrap | before | 9.9/9.9/9.9/9.9 | 9.6/9.7/9.7/9.7 | - | 0 | 0 | -| | after | 9.8/10.2/10.2/10.2 | 4.5/9.6/12.6/12.6 | 16.4/16.8/17.8/17.8 | 0 | 0 | -| f-t-oneline.json-nowrap | before | 9.7/9.8/10.0/10.0 | 9.6/9.7/9.9/9.9 | - | 0 | 0 | -| | after | 9.4/9.6/10.1/10.1 | 3.2/9.4/13.1/13.2 | 16.1/16.8/18.2/18.6 | 0 | 0 | -| gl-gh-oneline.json-nowrap | before | 9.6/9.9/10.0/10.0 | 9.5/9.7/9.8/9.8 | - | 0 | 0 | -| | after | 9.6/10.3/10.4/10.4 | 2.7/9.4/10.2/10.2 | 16.5/16.8/22.1/22.1 | 0 | 0 | -| insert-end-oneline.json-nowrap | before | 9.5/13.3/15.2/15.2 | 9.2/11.7/15.1/15.1 | 5.2/9.5/12.7/12.7 | 0 | 0 | -| | after | 2.3/7.3/10.9/10.9 | 2.3/7.0/9.9/10.8 | 16.6/16.8/17.0/17.8 | 0 | 0 | -| insert-middle-oneline.json-nowrap | before | 209.8/216.8/218.7/218.7 | 3.0/195.5/196.9/196.9 | 4.0/9.0/9.4/9.4 | 0 | 0 | -| | after | 23.1/29.0/35.4/35.4 | 10.3/21.1/28.7/28.7 | 16.6/16.8/17.9/17.9 | 0 | 0 | -| sweep-L-W-oneline.json-nowrap | before | 10.3/14.9/24.9/24.9 | 6.6/11.0/14.2/14.8 | 4.4/9.3/14.3/14.4 | 0 | 0 | -| | after | 10.0/15.6/21.7/21.7 | 4.9/11.6/15.0/15.5 | 16.6/16.8/18.2/18.2 | 0 | 0 | -| w-held-hugelines.txt-nowrap | before | 12.8/18.8/22.8/22.8 | 4.5/8.1/11.5/12.7 | 4.2/8.9/9.9/11.2 | 0 | 0 | -| | after | 9.8/18.4/20.3/20.3 | 2.4/7.9/11.2/11.2 | 16.5/16.8/18.2/18.2 | 0 | 0 | -| e-held-hugelines.txt-nowrap | before | 15.7/20.0/20.9/20.9 | 6.0/9.7/11.9/11.9 | - | 0 | 0 | -| | after | 14.9/19.2/20.8/20.8 | 5.6/9.7/10.7/10.7 | - | 0 | 0 | -| l-held-hugelines.txt-nowrap | before | 15.4/20.1/25.1/25.1 | 5.3/10.0/13.7/13.7 | - | 0 | 0 | -| | after | 15.6/19.4/21.8/21.8 | 5.2/9.2/11.3/11.3 | - | 0 | 0 | -| dollar-zero-hugelines.txt-nowrap | before | 9.7/9.8/9.8/9.8 | 9.5/9.7/9.7/9.7 | - | 0 | 0 | -| | after | 9.4/9.4/9.4/9.4 | 3.1/8.5/9.3/9.3 | 16.6/16.8/16.9/16.9 | 0 | 0 | -| f-t-hugelines.txt-nowrap | before | 9.4/10.4/11.4/11.4 | 9.3/10.3/11.2/11.2 | - | 0 | 0 | -| | after | 9.2/9.4/9.9/9.9 | 2.8/9.0/9.4/9.8 | 16.3/16.7/16.8/17.7 | 0 | 0 | -| gl-gh-hugelines.txt-nowrap | before | 9.4/9.9/10.1/10.1 | 9.3/9.7/9.9/9.9 | - | 0 | 0 | -| | after | 9.3/9.9/10.9/10.9 | 3.0/9.2/10.7/10.7 | 16.3/16.7/17.0/17.0 | 0 | 0 | -| insert-end-hugelines.txt-nowrap | before | 9.6/13.7/15.1/15.1 | 9.0/12.6/14.9/14.9 | 6.0/9.3/10.3/10.3 | 0 | 0 | -| | after | 2.3/7.1/9.4/9.4 | 2.3/6.8/9.2/9.2 | 16.6/16.7/16.8/16.8 | 0 | 0 | -| insert-middle-hugelines.txt-nowrap | before | 18.4/22.5/26.1/26.1 | 4.7/8.8/10.6/10.6 | 5.0/9.2/10.0/10.0 | 0 | 0 | -| | after | 17.0/19.9/23.0/23.0 | 5.9/8.6/12.4/12.4 | 16.6/16.9/17.1/17.1 | 0 | 0 | -| sweep-L-W-hugelines.txt-nowrap | before | 11.9/18.7/24.0/24.0 | 6.2/9.1/14.4/14.5 | 4.2/9.0/9.8/9.8 | 0 | 0 | -| | after | 10.2/18.1/22.5/22.5 | 7.0/11.1/14.1/14.5 | 16.6/16.9/17.1/17.1 | 0 | 0 | - -#### GUI Debug: `scroll` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| notches | before | 8.2/14.4/14.4/14.4 | 3.4/7.8/9.3/14.3 | 4.4/8.6/10.1/10.4 | 7 | 0 | -| | after | 3.5/19.8/19.8/19.8 | 3.0/3.5/19.8/19.8 | 16.7/17.0/17.6/17.6 | 7 | 0 | -| spin | before | 3.6/8.8/15.8/15.8 | 3.5/8.6/14.0/15.7 | 4.2/8.9/12.7/14.1 | 35 | 0 | -| | after | 4.3/8.4/20.4/20.4 | 4.3/7.7/20.4/20.4 | 10.1/16.7/17.1/17.1 | 34 | 0 | -| pages | before | 15.4/25.7/40.2/40.2 | 15.0/25.2/32.8/32.8 | - | 3787 | 0 | -| | after | 15.0/22.0/29.7/29.7 | 3.0/7.1/17.6/21.3 | 16.6/16.8/17.3/18.0 | 3607 | 0 | -| retarget | before | 16.7/33.3/33.3/33.3 | 16.3/32.9/32.9/32.9 | - | 150 | 0 | -| | after | 9.6/23.7/23.7/23.7 | 3.0/6.2/23.2/23.2 | 16.6/16.8/16.8/16.8 | 92 | 0 | -| cursor | before | 12.2/15.6/16.2/16.2 | 6.5/11.9/15.4/15.5 | 5.6/9.7/12.5/15.0 | 0 | 0 | -| | after | 3.8/14.9/18.4/18.4 | 3.6/6.3/17.1/17.7 | 16.6/16.8/17.2/18.0 | 0 | 0 | - -#### GUI Debug: `stress` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| spin | before | 3.6/8.9/25.4/33.7 | 3.6/8.8/17.2/33.7 | 4.0/9.3/16.7/33.7 | 188 | 3 | -| | after | 3.7/7.9/13.1/23.3 | 3.6/7.3/11.9/23.2 | 8.2/13.1/16.7/16.8 | 175 | 0 | -| held-ctrl-d | before | 8.3/33.2/45.9/45.9 | 8.1/32.8/45.5/45.5 | - | 539 | 0 | -| | after | 4.3/8.5/24.4/24.4 | 3.7/7.5/12.6/24.0 | 16.6/17.2/18.4/23.1 | 508 | 0 | -| held-j | before | 11.9/15.6/30.7/30.7 | 11.5/15.2/30.3/30.3 | - | 35 | 0 | -| | after | 3.6/8.3/25.0/25.0 | 3.3/7.3/12.2/24.7 | 16.6/16.8/17.9/22.4 | 33 | 0 | -| held-pagedown | before | 9.7/38.3/63.4/63.4 | 9.7/38.0/63.1/63.1 | - | 758 | 0 | -| | after | 4.8/13.1/111.1/111.1 | 4.6/8.7/82.3/111.1 | 16.6/17.5/83.3/111.2 | 703 | 8 | -| far | before | 15.2/56.1/65.8/65.8 | 14.8/32.4/35.9/35.9 | - | 64673 | 0 | -| | after | 15.3/30.0/39.0/39.0 | 3.2/8.7/22.6/23.3 | 16.6/16.8/17.1/17.1 | 60139 | 0 | - -#### GUI Debug: `jumps` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| counted-G-big | before | 13.0/41.0/46.9/46.9 | 6.9/20.5/40.0/40.0 | 4.6/9.2/12.0/12.0 | 9607 | 0 | -| | after | 12.4/26.7/32.5/32.5 | 3.0/11.1/19.3/24.9 | 16.6/16.8/17.0/17.0 | 9013 | 0 | -| pages-up-big | before | 18.7/43.6/56.7/56.7 | 18.3/43.2/56.3/56.3 | - | 1784 | 0 | -| | after | 20.1/28.3/46.7/46.7 | 5.0/8.7/27.9/46.2 | 16.6/16.8/22.3/22.4 | 1709 | 0 | -| search-n-big | before | 12.7/14.8/33.3/33.3 | 4.3/9.3/14.2/27.8 | 4.6/9.3/18.2/19.2 | 1254 | 0 | -| | after | 11.9/14.5/24.7/24.7 | 4.3/9.5/14.0/14.0 | 16.6/16.8/22.7/24.4 | 1255 | 0 | -| rail-big | before | 8.2/37.9/50.1/50.1 | 3.5/7.9/37.0/49.3 | 4.4/8.7/10.4/10.9 | 3032 | 0 | -| | after | 9.0/35.6/38.7/38.7 | 3.2/7.1/34.9/38.0 | 16.6/16.8/22.3/22.6 | 3030 | 0 | -| query-ctrl-n-big | before | 22.2/39.4/40.3/40.3 | 7.2/21.8/38.3/38.9 | 7.1/15.5/31.1/31.1 | 628 | 2 | -| | after | 7.0/22.4/28.3/28.3 | 3.6/8.8/18.9/19.4 | 16.6/16.8/26.4/27.4 | 727 | 3 | -| star-big | before | 12.8/36.9/36.9/36.9 | 7.2/12.3/19.6/19.6 | 8.2/10.1/17.2/17.2 | 853 | 0 | -| | after | 11.6/44.7/44.7/44.7 | 3.1/11.0/21.8/21.8 | 16.6/16.9/17.0/17.0 | 853 | 0 | -| jumplist-big | before | 33.4/41.0/41.4/41.4 | 8.1/32.9/41.0/41.0 | 15.9/20.3/21.2/21.2 | 4759 | 0 | -| | after | 17.9/23.4/23.5/23.5 | 3.0/12.4/23.0/23.0 | 16.6/16.8/18.4/20.1 | 7394 | 0 | -| insert-big | before | 9.3/14.9/29.9/247.9 | 6.5/13.5/23.3/247.4 | 11.8/23.0/31.6/35.5 | 42 | 12 | -| | after | 10.3/17.0/30.5/280.9 | 3.4/11.4/22.9/280.4 | 16.6/19.1/26.5/33.4 | 58 | 13 | -| counted-G-small | before | 13.4/26.4/26.7/26.7 | 12.6/25.0/26.1/26.1 | - | 384 | 0 | -| | after | 11.4/22.9/29.3/29.3 | 3.9/9.7/27.8/27.8 | 16.6/16.8/18.3/18.3 | 363 | 0 | -| pages-up-small | before | 21.8/34.4/36.4/36.4 | 21.1/33.6/35.6/35.6 | - | 78 | 0 | -| | after | 23.0/35.3/35.9/35.9 | 3.1/7.7/34.6/35.2 | 16.6/16.8/17.4/17.9 | 75 | 0 | -| search-n-small | before | 15.2/20.5/25.3/25.3 | 3.2/14.4/20.2/24.5 | 4.0/9.0/31.3/31.3 | 44 | 1 | -| | after | 16.2/17.5/21.1/21.1 | 3.0/16.0/21.2/21.2 | 16.6/16.9/31.3/31.3 | 45 | 1 | -| rail-small | before | 14.3/16.1/18.2/18.2 | 14.1/15.1/18.2/18.2 | - | 71 | 0 | -| | after | 14.5/17.5/21.8/21.8 | 6.8/16.0/20.3/20.3 | 16.6/16.8/17.0/17.0 | 72 | 0 | -| query-ctrl-n-small | before | 15.0/17.0/19.5/19.5 | 4.2/14.3/17.4/17.9 | 4.8/9.1/19.0/19.0 | 91 | 0 | -| | after | 12.8/17.4/17.4/17.4 | 3.4/13.6/16.7/16.7 | 16.6/16.8/25.3/25.3 | 94 | 1 | -| star-small | before | 15.9/28.3/28.3/28.3 | 6.5/14.1/27.5/27.5 | 4.7/8.8/13.5/13.5 | 166 | 0 | -| | after | 17.3/19.5/19.5/19.5 | 3.0/12.1/18.5/18.5 | 16.6/16.8/17.1/17.1 | 155 | 0 | -| look-small | before | 26.1/26.1/26.1/26.1 | 24.7/24.7/24.7/24.7 | - | 0 | 0 | -| | after | 15.4/20.6/20.6/20.6 | 7.7/14.3/20.4/20.4 | 16.7/16.8/16.9/16.9 | 81 | 0 | -| jumplist-small | before | 16.3/28.9/29.2/29.2 | 9.8/25.2/28.3/28.3 | 16.7/18.8/21.2/21.2 | 81 | 0 | -| | after | 17.1/21.5/27.1/27.1 | 4.7/12.1/20.8/26.3 | 16.6/17.0/18.8/19.7 | 87 | 0 | -| insert-small | before | 13.1/19.4/32.8/41.8 | 7.7/17.0/29.2/41.5 | 13.0/24.1/34.0/38.9 | 27 | 13 | -| | after | 9.6/20.6/28.4/61.6 | 4.9/14.0/23.4/60.6 | 16.4/18.5/32.4/73.9 | 37 | 35 | -| look-new-pane | before | 14.9/14.9/14.9/14.9 | 8.2/8.7/8.8/8.8 | 16.8/17.3/17.9/17.9 | 0 | 0 | -| | after | 24.9/24.9/24.9/24.9 | 18.4/18.4/18.4/18.4 | - | 0 | 0 | - -#### GUI Debug: `kinds` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| generated-parser.c | before | 7.3/22.4/29.5/103.2 | 3.6/11.7/24.9/86.5 | 4.2/8.7/10.1/13.0 | 3787 | 0 | -| | after | 3.9/7.9/26.6/39.3 | 3.2/6.8/17.6/31.5 | 16.5/16.9/18.4/18.8 | 3789 | 0 | -| commands.rs | before | 7.4/21.6/32.5/33.8 | 3.8/11.8/30.0/33.4 | 4.4/8.9/10.8/15.1 | 1694 | 0 | -| | after | 4.3/8.7/23.0/35.4 | 3.8/8.0/12.8/18.8 | 16.5/17.2/18.5/23.3 | 1690 | 0 | -| tables.py | before | 6.8/25.3/32.2/77.5 | 3.6/12.0/29.5/69.8 | 4.2/8.7/14.5/16.6 | 2444 | 0 | -| | after | 3.9/8.9/25.5/26.7 | 3.2/7.8/17.2/24.8 | 16.5/16.9/17.9/23.1 | 2442 | 0 | -| jquery.js | before | 7.6/18.8/28.0/1979.3 | 4.3/12.1/23.3/1958.4 | 4.2/8.7/10.6/12.6 | 2217 | 0 | -| | after | 3.8/8.4/27.9/119.7 | 3.2/7.1/14.6/98.3 | 16.5/16.9/17.6/17.8 | 2149 | 0 | -| minified.js | before | 8.4/18.7/29.4/34.0 | 4.1/12.4/17.2/17.5 | 4.4/8.4/9.1/9.1 | 0 | 0 | -| | after | 7.7/19.3/28.9/32.5 | 4.3/13.1/16.6/18.4 | 16.6/16.8/17.2/17.2 | 0 | 0 | -| grammar.json | before | 7.8/17.3/23.9/1870.4 | 3.9/12.2/21.5/1850.4 | 4.4/8.7/10.1/17.2 | 2351 | 0 | -| | after | 3.5/8.4/26.5/84.4 | 3.2/7.3/14.2/61.4 | 16.5/16.8/17.4/18.4 | 2279 | 0 | -| oneline.json | before | 7.2/16.2/45.4/92.1 | 6.0/13.0/27.4/76.5 | 4.5/9.1/45.4/45.4 | 4 | 1 | -| | after | 7.8/14.1/180.6/189.0 | 6.5/13.1/78.9/188.1 | 16.6/16.8/16.9/16.9 | 4 | 0 | -| CHANGELOG.md | before | 10.7/58.2/72.2/72.5 | 4.7/12.8/66.5/72.5 | 4.4/8.9/58.8/72.5 | 715 | 7 | -| | after | 7.2/60.5/74.0/75.3 | 4.7/17.0/70.5/75.1 | 16.6/18.1/73.5/75.4 | 713 | 31 | -| cascade.html | before | 8.5/17.8/25.9/119.6 | 4.0/13.8/19.6/83.9 | 4.2/8.8/10.6/11.3 | 643 | 0 | -| | after | 3.9/8.6/19.7/72.3 | 3.3/7.0/18.1/36.4 | 16.5/16.8/18.8/22.8 | 642 | 0 | -| simdutf.cpp | before | 6.4/29.0/58.8/65.4 | 3.3/11.2/52.7/64.7 | 4.2/8.6/9.6/12.8 | 9852 | 0 | -| | after | 4.0/12.9/113.9/115.2 | 3.8/7.9/55.9/114.8 | 16.5/16.8/56.5/115.3 | 9862 | 9 | -| parser.ts | before | 8.6/17.7/25.6/27.0 | 3.7/13.4/19.8/26.0 | 4.2/8.8/10.4/13.8 | 1776 | 0 | -| | after | 3.7/8.8/21.8/22.2 | 3.1/7.0/16.2/21.1 | 16.5/16.9/18.9/22.6 | 1775 | 0 | -| fcnal-test.sh | before | 8.1/17.7/27.8/30.8 | 4.0/11.9/21.7/27.1 | 4.2/8.8/11.1/14.0 | 1034 | 0 | -| | after | 4.0/8.7/18.6/82.3 | 3.5/7.3/14.4/62.3 | 16.6/16.8/18.1/23.2 | 1034 | 0 | -| data.go | before | 8.6/18.7/24.3/42.6 | 3.8/13.6/21.5/40.0 | 4.2/8.8/12.8/19.1 | 3897 | 0 | -| | after | 4.2/9.7/19.1/42.0 | 3.4/7.4/17.0/39.4 | 16.5/16.9/22.8/24.1 | 3898 | 0 | -| guide.typ | before | 7.8/31.1/43.8/52.2 | 4.0/11.4/37.3/50.9 | 4.4/9.1/33.2/37.4 | 117 | 6 | -| | after | 4.9/24.8/46.6/54.8 | 3.9/11.3/37.1/53.5 | 16.5/16.8/40.5/46.7 | 117 | 21 | -| unicode.txt | before | 8.7/19.2/92.4/435.3 | 4.2/10.3/17.4/146.9 | 4.4/8.9/10.2/11.5 | 4510 | 0 | -| | after | 4.0/9.2/92.9/438.8 | 3.2/6.8/16.3/146.3 | 16.5/16.8/17.7/18.2 | 4505 | 0 | -| big.log | before | 8.3/17.6/61.1/188.2 | 4.2/12.7/21.5/25.7 | 4.3/8.7/9.9/14.9 | 69103 | 0 | -| | after | 6.6/14.8/73.4/201.2 | 4.8/11.2/15.8/24.4 | 16.5/17.0/24.5/28.9 | 69008 | 3 | -| words.txt | before | 7.9/15.7/22.7/27.6 | 3.3/11.4/16.4/17.7 | 4.1/8.7/10.2/16.5 | 92552 | 0 | -| | after | 3.3/8.5/25.1/47.8 | 3.0/7.1/15.1/17.6 | 16.5/16.8/17.7/19.0 | 92274 | 0 | -| hugelines.txt | before | 8.9/15.3/34.3/1973.2 | 7.0/13.3/16.5/1963.1 | 5.3/16.7/25.9/25.9 | 12 | 1 | -| | after | 7.9/15.8/33.0/96.5 | 6.2/13.8/17.4/90.4 | 16.7/18.9/22.1/22.1 | 12 | 0 | -| minified.js! | before | 9.1/21.0/43.3/1875.3 | 5.8/15.0/24.5/1852.3 | 5.0/11.7/17.4/17.4 | 0 | 0 | -| | after | 8.4/21.5/46.2/87.9 | 5.0/14.6/21.4/64.6 | 16.6/16.8/17.0/17.0 | 0 | 0 | -| oneline.json! | before | 7.8/18.2/47.5/48.0 | 6.6/12.7/16.8/48.0 | 7.5/9.3/48.1/48.1 | 0 | 1 | -| | after | 7.6/17.1/72.2/193.8 | 7.0/12.9/21.4/182.3 | 16.6/16.8/22.5/22.5 | 0 | 0 | -| hugelines.txt! | before | 8.1/17.8/33.0/41.8 | 6.1/11.4/16.6/18.4 | 6.3/10.2/11.8/12.7 | 2 | 0 | -| | after | 6.6/18.7/32.3/46.7 | 5.6/11.3/14.9/22.2 | 16.6/16.9/23.9/26.1 | 2 | 1 | - -#### GUI Debug: `panes` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| command-cat | before | 8.9/19.7/34.8/35.0 | 4.6/9.1/15.7/27.5 | 7.0/37.5/58.1/58.1 | 4509 | 5 | -| | after | 7.8/19.3/36.5/45.4 | 4.1/9.2/17.9/30.8 | 16.6/37.9/53.8/53.8 | 4501 | 6 | -| command-yes | before | 8.0/17.0/27.5/34.5 | 6.6/14.5/17.5/24.1 | 4.4/34.9/44.9/44.9 | 4616 | 7 | -| | after | 7.6/15.7/34.5/35.0 | 6.4/13.6/17.8/22.8 | 16.6/34.5/58.8/58.8 | 4545 | 7 | -| pager | before | 7.5/14.6/18.6/20.2 | 6.5/13.7/17.1/18.0 | 4.3/8.7/46.2/46.2 | 0 | 1 | -| | after | 8.6/16.2/19.7/19.8 | 7.6/14.8/19.0/19.2 | 16.6/16.9/47.3/47.3 | 0 | 1 | -| directory | before | 7.6/15.3/18.7/19.2 | 5.0/12.6/17.7/18.6 | 4.7/9.2/14.5/16.6 | 2 | 0 | -| | after | 5.4/14.4/18.6/24.6 | 3.9/12.9/17.3/21.6 | 16.6/16.8/17.1/17.1 | 2 | 0 | -| pdf | before | 7.7/57.3/138.0/190.3 | 6.7/13.8/113.8/174.4 | 4.3/8.9/13.5/13.5 | 0 | 0 | -| | after | 8.0/59.7/155.2/161.8 | 8.1/41.0/134.9/161.5 | 16.6/16.8/16.9/16.9 | 0 | 0 | -| image | before | 7.5/16.5/128.7/304.3 | 6.8/15.2/18.7/301.1 | 5.4/9.1/10.4/10.4 | 0 | 0 | -| | after | 7.9/14.2/17.2/18.3 | 6.8/13.9/17.0/133.0 | 16.7/17.0/146.3/146.3 | 0 | 1 | -| help | before | 7.8/14.4/18.8/19.8 | 5.2/12.4/17.3/18.2 | 4.7/8.8/12.2/16.3 | 69 | 0 | -| | after | 3.3/12.7/17.2/17.4 | 3.0/7.9/16.1/17.2 | 16.5/16.8/17.5/18.7 | 69 | 0 | -| changelog | before | 8.1/16.7/19.3/20.2 | 3.8/12.9/18.2/19.5 | 4.3/8.9/10.6/14.2 | 220 | 0 | -| | after | 3.9/8.7/16.2/25.1 | 3.7/7.7/14.6/23.7 | 16.6/16.8/17.4/22.5 | 220 | 0 | -| query-typing | before | 13.1/16.8/41.6/41.6 | 6.5/12.4/38.2/102.2 | 7.6/17.3/27.9/108.3 | 0 | 2 | -| | after | 13.4/50.3/266.2/266.2 | 3.1/13.0/262.6/262.6 | 16.6/17.0/62.1/62.1 | 17 | 2 | - -#### GUI Debug: `longlines` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | -|---|---|---|---|---|---|---| -| w-held-minified.js-wrap | before | 3.6/8.6/19.8/19.8 | 3.3/8.2/9.1/19.0 | 4.2/9.0/9.7/10.4 | 0 | 0 | -| | after | 3.5/7.4/12.3/12.3 | 3.2/7.2/10.8/11.6 | 16.6/16.9/17.4/17.4 | 0 | 0 | -| e-held-minified.js-wrap | before | 3.7/11.5/15.0/15.0 | 3.3/8.1/13.9/14.4 | 4.2/9.0/10.3/11.4 | 0 | 0 | -| | after | 3.3/7.3/8.9/8.9 | 3.1/6.9/8.5/8.8 | 16.6/16.8/17.0/17.1 | 0 | 0 | -| l-held-minified.js-wrap | before | 8.1/17.0/19.1/19.1 | 4.6/10.3/17.6/18.4 | 4.7/9.2/11.6/13.4 | 0 | 0 | -| | after | 3.2/7.4/8.6/8.6 | 3.1/7.2/8.5/8.5 | 16.6/16.7/17.5/17.7 | 0 | 0 | -| dollar-zero-minified.js-wrap | before | 7.3/7.4/7.4/7.4 | 6.5/6.6/6.6/6.6 | - | 0 | 0 | -| | after | 14.6/14.7/14.7/14.7 | 2.8/9.0/13.7/13.7 | 16.6/16.8/17.4/17.4 | 0 | 0 | -| f-t-minified.js-wrap | before | 14.3/16.7/16.9/16.9 | 13.6/16.1/16.2/16.2 | - | 0 | 0 | -| | after | 14.4/20.7/20.7/20.7 | 3.0/13.8/20.1/20.1 | 16.4/16.8/17.6/17.7 | 0 | 0 | -| gl-gh-minified.js-wrap | before | 14.0/16.4/16.5/16.5 | 13.3/15.6/15.9/15.9 | - | 0 | 0 | -| | after | 13.8/20.2/20.4/20.4 | 3.2/13.1/19.7/19.7 | 16.5/16.7/17.3/17.3 | 0 | 0 | -| insert-end-minified.js-wrap | before | 14.9/18.5/20.1/20.1 | 12.1/17.1/19.5/19.5 | 7.1/9.8/10.9/10.9 | 0 | 0 | -| | after | 3.3/8.6/14.6/14.6 | 3.1/8.3/13.6/13.8 | 16.5/16.8/17.3/18.2 | 0 | 0 | -| insert-middle-minified.js-wrap | before | 14.1/1994.4/1994.4/1994.4 | 6.9/13.5/1963.0/1963.0 | 6.7/11.1/11.5/11.5 | 0 | 0 | -| | after | 82.9/83.5/95.1/95.1 | 79.0/81.3/84.2/84.2 | 16.4/16.8/17.0/17.0 | 0 | 0 | -| sweep-L-W-minified.js-wrap | before | 13.0/19.3/1858.0/1858.0 | 3.6/12.4/18.7/1848.9 | 4.4/8.7/10.0/10.0 | 0 | 0 | -| | after | 13.4/17.0/71.2/71.2 | 12.4/15.5/60.7/84.4 | 16.6/16.8/84.5/84.5 | 0 | 1 | -| w-held-oneline.json-wrap | before | 3.8/8.3/9.3/9.3 | 3.3/7.8/8.6/9.1 | 4.1/8.8/9.3/9.8 | 0 | 0 | -| | after | 3.7/8.1/19.4/19.4 | 3.4/7.4/12.6/18.4 | 16.6/16.9/17.5/22.5 | 0 | 0 | -| e-held-oneline.json-wrap | before | 3.7/8.1/11.7/11.7 | 3.3/7.8/8.4/11.3 | 4.2/8.8/9.3/9.8 | 0 | 0 | -| | after | 3.6/7.2/9.1/9.1 | 3.4/7.0/8.5/8.9 | 16.6/16.9/17.1/17.9 | 0 | 0 | -| l-held-oneline.json-wrap | before | 8.1/18.0/21.3/21.3 | 3.7/8.6/18.9/20.5 | 4.3/8.9/10.8/13.0 | 0 | 0 | -| | after | 3.7/7.9/9.2/9.2 | 3.4/7.4/9.0/9.0 | 16.7/16.9/17.6/22.5 | 0 | 0 | -| dollar-zero-oneline.json-wrap | before | 7.6/12.9/12.9/12.9 | 6.8/12.0/12.0/12.0 | - | 0 | 0 | -| | after | 18.1/18.7/18.7/18.7 | 2.9/16.3/17.7/17.7 | 16.7/16.8/16.9/16.9 | 0 | 0 | -| f-t-oneline.json-wrap | before | 14.2/17.3/17.6/17.6 | 13.4/16.4/16.7/16.7 | - | 0 | 0 | -| | after | 18.8/20.1/20.3/20.3 | 5.1/18.0/19.4/19.5 | 15.5/16.8/16.9/17.0 | 0 | 0 | -| gl-gh-oneline.json-wrap | before | 13.8/16.8/17.0/17.0 | 12.9/15.9/16.1/16.1 | - | 0 | 0 | -| | after | 19.8/20.4/20.6/20.6 | 6.7/18.1/19.7/19.7 | 15.4/16.8/17.2/17.2 | 0 | 0 | -| insert-end-oneline.json-wrap | before | 15.4/18.1/21.5/21.5 | 13.4/17.2/20.7/20.7 | 8.6/14.1/20.7/20.7 | 0 | 0 | -| | after | 3.3/8.2/20.3/20.3 | 3.1/8.1/17.5/19.4 | 16.6/16.8/18.0/18.2 | 0 | 0 | -| insert-middle-oneline.json-wrap | before | 15.1/1887.6/1887.6/1887.6 | 7.1/18.2/1844.0/1844.0 | 7.8/14.6/17.4/17.4 | 0 | 0 | -| | after | 82.1/177.2/182.1/182.1 | 14.4/171.6/176.3/176.3 | 16.6/16.8/16.8/16.8 | 0 | 0 | -| sweep-L-W-oneline.json-wrap | before | 15.4/23.1/49.8/49.8 | 3.5/11.2/18.3/19.6 | 4.4/8.6/10.5/10.6 | 6 | 0 | -| | after | 13.9/18.3/167.2/167.2 | 10.2/15.2/19.4/167.0 | 16.6/16.8/167.2/167.2 | 5 | 1 | -| w-held-hugelines.txt-wrap | before | 3.4/8.6/21.4/21.4 | 3.3/8.2/9.1/20.3 | 4.3/9.0/10.2/13.5 | 0 | 0 | -| | after | 3.3/7.7/11.9/11.9 | 3.2/7.4/10.8/11.3 | 16.6/16.8/17.2/17.8 | 0 | 0 | -| e-held-hugelines.txt-wrap | before | 8.0/14.5/20.0/20.0 | 3.8/9.3/18.5/18.9 | 4.4/9.2/10.8/11.6 | 0 | 0 | -| | after | 6.0/17.2/21.2/21.2 | 4.2/14.8/19.9/19.9 | 16.6/16.8/17.0/17.0 | 0 | 0 | -| l-held-hugelines.txt-wrap | before | 14.4/18.8/20.4/20.4 | 13.4/17.8/19.4/19.4 | - | 0 | 0 | -| | after | 14.0/16.8/20.8/20.8 | 13.0/15.7/19.7/19.7 | - | 0 | 0 | -| dollar-zero-hugelines.txt-wrap | before | 15.7/16.6/16.6/16.6 | 14.5/15.5/15.5/15.5 | - | 0 | 0 | -| | after | 18.7/19.3/19.3/19.3 | 7.1/17.6/18.2/18.2 | 16.5/16.8/16.8/16.8 | 0 | 0 | -| f-t-hugelines.txt-wrap | before | 16.1/16.4/16.8/16.8 | 15.1/15.3/15.7/15.7 | - | 0 | 0 | -| | after | 20.1/20.3/22.6/22.6 | 4.8/19.1/20.5/21.6 | 14.7/16.8/16.9/17.3 | 0 | 0 | -| gl-gh-hugelines.txt-wrap | before | 13.9/16.9/16.9/16.9 | 12.9/15.7/15.8/15.8 | - | 0 | 0 | -| | after | 18.8/19.6/20.0/20.0 | 6.8/15.4/19.0/19.0 | 15.1/16.8/17.3/17.3 | 0 | 0 | -| insert-end-hugelines.txt-wrap | before | 15.4/19.2/21.1/21.1 | 14.4/18.2/20.1/20.1 | - | 0 | 0 | -| | after | 3.3/8.1/18.4/18.4 | 3.2/7.6/10.2/17.3 | 16.6/16.8/16.9/17.3 | 0 | 0 | -| insert-middle-hugelines.txt-wrap | before | 17.6/21.3/26.2/26.2 | 13.0/16.9/20.2/20.2 | - | 0 | 0 | -| | after | 16.7/21.7/24.6/24.6 | 12.2/16.5/19.2/19.2 | - | 0 | 0 | -| sweep-L-W-hugelines.txt-wrap | before | 14.3/17.8/32.3/32.3 | 8.5/16.1/20.0/26.1 | 7.4/16.7/18.3/18.3 | 0 | 0 | -| | after | 14.0/18.6/30.0/30.0 | 11.4/15.1/19.1/30.0 | 16.7/16.8/17.0/17.0 | 0 | 0 | -| w-held-minified.js-nowrap | before | 16.8/32.8/34.0/34.0 | 15.6/15.8/27.7/27.7 | 16.7/16.9/33.3/33.3 | 0 | 5 | -| | after | 14.3/29.1/30.6/30.6 | 9.5/13.5/20.8/20.8 | 16.6/17.1/32.3/32.3 | 0 | 4 | -| e-held-minified.js-nowrap | before | 28.0/31.1/33.5/33.5 | 11.6/14.4/17.1/17.1 | - | 0 | 0 | -| | after | 25.9/30.0/32.7/32.7 | 9.5/13.7/16.4/16.4 | - | 0 | 0 | -| l-held-minified.js-nowrap | before | 27.5/31.5/33.0/33.0 | 11.0/15.2/16.4/16.4 | - | 0 | 0 | -| | after | 25.3/29.3/30.6/30.6 | 8.9/13.0/14.3/14.3 | - | 0 | 0 | -| dollar-zero-minified.js-nowrap | before | 24.5/25.0/25.0/25.0 | 23.4/23.8/23.8/23.8 | - | 0 | 0 | -| | after | 23.3/24.4/24.4/24.4 | 8.5/13.3/23.2/23.2 | 16.6/17.0/18.0/18.0 | 0 | 0 | -| f-t-minified.js-nowrap | before | 29.4/35.6/36.6/36.6 | 28.4/34.6/36.2/36.2 | - | 0 | 0 | -| | after | 31.3/31.5/31.6/31.6 | 8.6/30.2/30.5/30.6 | 16.5/16.8/17.9/18.1 | 0 | 0 | -| gl-gh-minified.js-nowrap | before | 24.5/35.6/35.7/35.7 | 23.5/34.5/34.6/34.6 | - | 0 | 0 | -| | after | 21.9/31.0/31.8/31.8 | 9.2/20.8/30.8/30.8 | 16.6/16.7/17.4/17.4 | 0 | 0 | -| insert-end-minified.js-nowrap | before | 19.4/25.7/35.6/35.6 | 18.4/24.3/34.5/34.5 | 16.7/17.9/17.9/17.9 | 0 | 0 | -| | after | 8.8/14.5/23.9/23.9 | 8.6/12.7/22.5/22.8 | 16.6/16.8/22.4/22.6 | 0 | 0 | -| insert-middle-minified.js-nowrap | before | 16.6/1994.8/1994.8/1994.8 | 13.9/18.2/1955.8/1955.8 | 15.3/18.5/30.3/30.3 | 0 | 1 | -| | after | 166.7/251.2/253.8/253.8 | 8.6/153.7/166.3/166.3 | 16.5/16.8/18.0/18.0 | 0 | 0 | -| sweep-L-W-minified.js-nowrap | before | 24.7/2780.7/2780.7/2780.7 | 15.6/16.3/1963.0/1963.0 | 16.7/16.8/16.8/16.8 | 0 | 0 | -| | after | 16.4/26.3/84.3/84.3 | 11.0/14.2/18.3/77.0 | 16.6/16.9/17.1/17.1 | 1 | 0 | -| w-held-oneline.json-nowrap | before | 32.7/33.7/34.4/34.4 | 15.3/15.7/24.8/24.8 | 16.7/17.8/33.9/33.9 | 0 | 5 | -| | after | 32.8/33.5/34.7/34.7 | 15.1/15.4/22.0/22.0 | 16.7/18.0/33.4/33.4 | 0 | 5 | -| e-held-oneline.json-nowrap | before | 33.3/33.7/51.7/51.7 | 13.7/14.0/14.9/14.9 | - | 0 | 0 | -| | after | 33.3/33.5/52.7/52.7 | 13.7/13.9/14.0/14.0 | - | 0 | 0 | -| l-held-oneline.json-nowrap | before | 33.3/33.5/52.6/52.6 | 13.4/13.7/14.9/14.9 | - | 0 | 0 | -| | after | 33.3/33.5/51.0/51.0 | 13.7/13.9/14.9/14.9 | - | 0 | 0 | -| dollar-zero-oneline.json-nowrap | before | 26.1/33.4/33.4/33.4 | 17.3/25.3/25.3/25.3 | - | 0 | 0 | -| | after | 30.5/33.3/33.3/33.3 | 16.6/22.0/30.7/30.7 | 16.7/16.8/17.2/17.2 | 0 | 0 | -| f-t-oneline.json-nowrap | before | 27.2/35.5/39.1/39.1 | 26.2/34.5/38.1/38.1 | - | 0 | 0 | -| | after | 30.8/31.0/31.2/31.2 | 16.5/29.6/30.3/30.3 | 16.7/16.8/17.1/17.4 | 0 | 0 | -| gl-gh-oneline.json-nowrap | before | 25.8/27.6/35.3/35.3 | 24.8/27.0/34.2/34.2 | - | 0 | 0 | -| | after | 31.7/32.6/32.7/32.7 | 15.8/30.5/31.6/31.6 | 16.6/16.8/16.8/16.8 | 0 | 0 | -| insert-end-oneline.json-nowrap | before | 21.8/26.4/35.2/35.2 | 20.5/25.0/34.2/34.2 | 16.6/16.8/16.8/16.8 | 0 | 0 | -| | after | 16.6/18.2/32.8/32.8 | 16.4/16.6/31.3/31.7 | 16.7/16.9/18.2/19.0 | 0 | 0 | -| insert-middle-oneline.json-nowrap | before | 16.7/1891.8/1891.8/1891.8 | 15.6/16.7/1853.1/1853.1 | 16.7/16.9/34.5/34.5 | 0 | 1 | -| | after | 124.1/318.2/319.3/319.3 | 16.4/179.1/180.3/180.3 | 16.7/16.7/16.9/16.9 | 0 | 0 | -| sweep-L-W-oneline.json-nowrap | before | 16.8/2801.3/2801.3/2801.3 | 15.6/15.8/16.7/1844.0 | 16.7/16.8/17.0/17.0 | 0 | 0 | -| | after | 16.4/33.2/70.5/70.5 | 13.4/16.8/26.4/31.8 | 16.6/16.9/17.5/17.5 | 0 | 0 | -| w-held-hugelines.txt-nowrap | before | 22.3/27.4/27.8/27.8 | 15.3/16.0/16.8/16.8 | 16.8/25.6/27.8/27.9 | 0 | 11 | -| | after | 22.4/26.9/31.7/31.7 | 15.1/16.0/27.1/27.1 | 16.7/22.7/27.6/27.6 | 0 | 3 | -| e-held-hugelines.txt-nowrap | before | 22.5/27.5/28.8/28.8 | 11.4/16.3/17.0/17.0 | 22.3/27.4/28.8/28.8 | 0 | 17 | -| | after | 22.4/26.7/28.1/28.1 | 11.4/15.2/17.0/17.0 | - | 0 | 0 | -| l-held-hugelines.txt-nowrap | before | 22.0/27.4/28.1/28.1 | 10.8/15.8/16.7/17.0 | 21.8/24.2/28.1/28.1 | 0 | 16 | -| | after | 22.1/26.4/27.6/27.6 | 10.9/15.3/16.4/16.4 | - | 0 | 0 | -| dollar-zero-hugelines.txt-nowrap | before | 16.6/16.7/16.7/16.7 | 15.6/15.8/16.5/20.6 | 16.7/16.8/17.3/21.7 | 0 | 0 | -| | after | 15.6/30.4/30.4/30.4 | 13.9/16.1/29.2/29.2 | 16.6/16.8/16.9/16.9 | 0 | 0 | -| f-t-hugelines.txt-nowrap | before | 16.6/16.8/16.9/16.9 | 15.6/16.0/16.6/16.7 | 16.7/16.8/17.0/17.5 | 0 | 0 | -| | after | 30.7/30.9/31.4/31.4 | 14.8/29.6/29.9/30.4 | 16.6/16.8/22.3/22.6 | 0 | 0 | -| gl-gh-hugelines.txt-nowrap | before | 10.9/16.7/16.8/16.8 | 15.6/15.8/16.9/20.7 | 16.6/16.8/18.0/21.7 | 0 | 0 | -| | after | 16.8/31.4/31.6/31.6 | 15.0/16.7/30.6/30.6 | 16.6/16.8/22.7/22.7 | 0 | 0 | -| insert-end-hugelines.txt-nowrap | before | 16.5/16.8/17.1/17.1 | 15.6/16.4/16.8/16.9 | 16.6/16.8/17.1/17.9 | 0 | 0 | -| | after | 16.5/18.3/31.8/31.8 | 16.3/16.6/29.8/30.8 | 16.6/16.9/22.7/22.7 | 0 | 0 | -| insert-middle-hugelines.txt-nowrap | before | 26.2/29.0/29.4/29.4 | 11.6/15.7/16.2/16.4 | 16.6/26.9/29.2/29.4 | 0 | 40 | -| | after | 24.4/29.0/37.4/37.4 | 10.7/16.3/16.9/16.9 | 16.6/17.1/22.3/22.3 | 0 | 0 | -| sweep-L-W-hugelines.txt-nowrap | before | 16.2/25.8/30.4/30.4 | 12.6/15.7/16.5/18.3 | 16.2/25.6/30.0/30.5 | 0 | 30 | -| | after | 21.0/25.8/30.4/30.4 | 14.1/18.1/29.3/29.7 | 16.6/16.8/16.9/16.9 | 0 | 0 | - -#### tty ReleaseSafe: `scroll` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | bytes/frame p50/max | -|---|---|---|---|---|---|---|---| -| all | before | 2.6/3.0/8.8/8.8 | 0.4/1.4/2.8/8.7 | 0.5/1.9/3.1/16.5 | 1449 | 0 | 105/15264 | -| | after | 2.4/3.0/8.1/8.1 | 2.2/2.7/7.9/8.0 | 15.8/16.9/18.6/18.6 | 1455 | 0 | 120/15264 | - -#### tty ReleaseSafe: `stress` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | bytes/frame p50/max | -|---|---|---|---|---|---|---|---| -| all | before | 2.6/11.4/23.2/26.1 | 1.0/2.7/20.1/26.0 | 2.0/2.6/5.2/16.7 | 9811 | 0 | 174/13383 | -| | after | 1.3/2.8/5.9/14.6 | 1.1/2.7/4.9/13.1 | 15.5/16.6/17.6/17.6 | 9807 | 0 | 132/13383 | - -#### tty ReleaseSafe: `jumps` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | bytes/frame p50/max | -|---|---|---|---|---|---|---|---| -| all | before | 1.6/6.0/22.0/22.7 | 0.4/0.8/2.8/22.7 | 0.4/1.5/2.8/16.7 | 2190 | 0 | 108/15264 | -| | after | 1.6/3.6/15.8/17.4 | 1.1/2.6/7.3/17.3 | 15.8/16.8/18.4/19.1 | 2189 | 0 | 100/15264 | - -#### tty Debug: `scroll` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | bytes/frame p50/max | -|---|---|---|---|---|---|---|---| -| all | before | 9.8/14.8/60.9/60.9 | 1.9/5.4/14.7/45.2 | 2.0/2.0/13.3/24.9 | 1452 | 0 | 86/15264 | -| | after | 7.3/14.1/36.2/36.2 | 5.6/11.8/25.2/27.9 | 15.5/19.8/20.8/20.8 | 1454 | 0 | 128/15264 | - -#### tty Debug: `stress` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | bytes/frame p50/max | -|---|---|---|---|---|---|---|---| -| all | before | 3.5/29.0/73.5/103.4 | 2.6/13.2/58.9/103.0 | 3.0/3.2/18.7/24.0 | 9825 | 0 | 180/13383 | -| | after | 2.4/12.8/69.9/195.7 | 2.3/11.0/66.3/195.5 | 15.6/19.2/24.9/24.9 | 9825 | 0 | 6859/13383 | - -#### tty Debug: `jumps` - -| scenario | | latency ms p50/p90/p99/max | frame work ms | present gap ms (moving) | rows/s | late | bytes/frame p50/max | -|---|---|---|---|---|---|---|---| -| 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 - stopped two lines short of the view's own bottom (it was "two views out", - the AFTER rows counted from the far end), so a half page up missed it and - painted on the frame (11-17 ms). The stretch is now the view itself and - three more the way it goes, both ways; re-measured (two interleaved - rounds and the final batch): p90 8.8-11.0 against 9.7-19.1 before, frame - work p90 6.0 against 14.1; the p99 left (15-20 ms) is the first page up - after `ge`, which paints on the frame in both (the paint-ahead was - looking down). -- **notches p90/p99**: the wheel takes the drawn-at-once branch (its SDL - event sets `input_seen` as a key's does: the nine notches into a running - glide answer in 1.7-2.0 ms against 2.7-4.7 before). The p90 of ten - samples is the first notch after 1.2 s idle: 13.3 against 9.8, n=1, the - CPU and GPU waking in both (its upload 4.7 ms, its fence 2.4). -- **small-file jumps +2 ms**: not reproducible: two more interleaved rounds - put after both above and below before (search-n-small 8.6/7.2 against - 9.1/10.4, rail-small 8.6/7.0 against 8.9/12.1). Per frame, an input after - idle pays the soft present's upload at a low clock (4.7 ms against 0.8 - warm) in both builds; that is the spread. -- **insert-big max**: the 200-line paste's frame (a far, stitched slide and - its paint), 31-37 ms in both builds. -- **rows/s that changed meaning**: the `scroll` demo's before ran `G` (a - no-op without a count; the script was fixed to `ge` in anim 3, not in - 1b, so before and after ran different scripts). Moved into 1b, both - rebuilt and re-run: the tables below are the same script. `jumplist`'s - rows/s counts how far the jumps went, which depends on what earlier - phases left in the jumplist; before's `look-big` phase drew no frames - (its Looks resolved in the query pane), so its jumplist held fewer far - places. Compare its latency and work, not its rows/s. - -## Open questions and positions - -1. **The soft present on Wayland is the ReleaseSafe frame's tail.** Every - native-Wayland GUI presents through SDL_Renderer so WindowOpacity can be - background-only, whatever the setting: a GPU fence wait and a 6.7 MB - upload a frame, and the first frame after idle pays both at a low clock. - With the GPU swapchain (X11) the scroll is 0.34 ms of work p50. Position: - claim the GPU swapchain when a session starts at WindowOpacity 100 (the - author's config) and say "needs a restart" below 100. -2. **Debug is slow where tree-sitter allocates**: a third of the Debug - stress run was the DebugAllocator's stack capture per tree-sitter - allocation. Position: a size-class pool for tree-sitter in safe builds, - leak-checked by counting. -3. **The spin** costs a core while something moves (CPU 2.0 -> 7.3 s over - the 18 s scroll demo, ReleaseSafe). Position: keep; asleep, the clock - that cannot be trusted costs the latency the author ranked first. -4. **Terminals and keys**: a terminal glides only under the wheel. Ctrl-d - in its normal mode could glide too when no output arrived that frame. - Position: next, with the stream test. -5. **The far jump's slide** shows the last frame's body sliding off and the - new one in, not what lies between. Position: keep; it reads as motion - and never shows anything that was not on screen. -6. **Long lines**: 16 KB round the caret is painted; the rest of a minified - line keeps its last colours. Typing in the middle of a 500 KB line is - now 18-22 ms a key in ReleaseSafe (was 173-213); what is left is the - text's splice and the wrap of the line. The no-wrap sideways scroll - snaps (a horizontal glide was not asked). Position: an incremental - whole-text parse is the real fix; not ponytail-sized. -7. **PDF first frames are not improved.** The bridge renders on the loop - through one MuPDF context and a one-page cache (30-38 ms RS, 110-184 - Debug, the page's content stream interpreted). Off the loop needs a - cloned fz_context per worker and locks round the document: a day's - work with the band-render design in the latency notes. Pictures are - done (decoded on a thread: first frame 90 -> 13 ms max RS, 296 ms -> - 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 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. diff --git a/docs/next-pdfrender.md b/docs/next-pdfrender.md index 4c8565d8..9e2e34b8 100644 --- a/docs/next-pdfrender.md +++ b/docs/next-pdfrender.md @@ -1,7 +1,7 @@ # pdfrender: PDF pages rendered off the loop The author's ask: "add concurrency to the mupdf build so its smoother". The -open item of `next-anim.md` (7): the bridge rendered on the loop through one +open item of the animation plan (7): the bridge rendered on the loop through one MuPDF context and a one-page cache, so a PDF's first frame, a far jump's page and every page a held PageDown reached cost the frame they landed in. Later asks from the coordinator, answered here too: the Intel SDM (combined diff --git a/docs/render-pipeline.md b/docs/render-pipeline.md index c04ccd33..49180ad3 100644 --- a/docs/render-pipeline.md +++ b/docs/render-pipeline.md @@ -1,915 +1,54 @@ -# pardes render pipeline: one frame, one clock, one order +# pardes render pipeline: the core's frame, then the frontend's own -Status: DESIGN, FINAL (draft 2 plus the adversary's two convergence fixes; converged with the adversary; the adversary's 17 objections to draft 1 are folded in, each marked "draft-2 fix" where it changed the design). Nothing here is implemented. Line numbers are -the working copy of 2026-09-28 (`losuylsy`, mid tag→Text refactor; they drift). +What a frame is and who draws it, as it stands. The effects programme this +document planned (eleven panel transitions in two tracks, a Shadertoy post +chain with Crt, Bloom, Vignette and Grain, Lift and its soft shadows, the +glows, the terminal's chip shadow and thumb flash, the lapis ornament and +its parallax, the message fall and dissolve, the theme crossfade, five +Motion flavours with anticipation and squash, tiers and track groups) is +gone: the core keeps no motion and no clock but its deadlines, and each +frontend keeps the little it draws on its own. -Goal, in the user's words: an algorithm for the ordering of rendering, how each -part is selected and joined, the shader passes after that, and one animation -model. Consumers: the lapis theme (shader effects on specific parts), multi-line -tags, the full-screen post pass (now Shadertoy-compatible), images/PDF, and -animations. Added requirements: a game-quality GUI effects catalogue, a separate -terminal effects track (audit + new cell-native effects), and a motion / colour / -performance / "feel" discipline. +## The core's frame ---------------------------------------------------------------------------------- +- `Pardes.pump` drives the host: `wait_input`, with the core's next + deadline (`nextWake`: a message's linger, the look-hover preview, a + question's hint, a paused Grep, work that resumes a frame at a time); + `now`; `poll_frame`; `render` and `present` only when a frame is owed + (`needs_frame`); and `post_present`, whose `Pardes.presented` lets a + drag's moving end and a look-hover follow what is under the pointer now. +- `advance(now)` steps `.tick`s a `frame_ns` (16 ms) at a time, for the + work that resumes a frame at a time; a wait is jumped in one step. +- `render` (draw.zig) paints one `Surface`: the canonical grid (`/screen`, + the snapshot goldens, the tty), the regions (each part's rectangle, + owner and focus; a body's first line and the text it shows, + `Region.line` and `Region.doc`), the layers a pixel shell draws at the + tagline's pitch and with compact context rows, the images, the cursor + and the palette (`Chrome`). Nothing on it moves. -## 1. Today's frame, end to end +## The frontends' own -### 1.1 Who drives a frame +Each draws these on its own clock, from the Surface alone, and draws their +frames itself while they move (the last frame again: the tty's +`poll_frame`, the window's loop), pacing its own waits: -`Pardes.pump` (pardes.zig:4607) is the only loop body every shell runs: -`wait_input(timeout = animationActive ? 16 : 0)` → queued events → `update` → -effects → `poll_frame` → **skip unless `needs_frame or animationActive()`** → -`frame_arena.reset` → `render` → `present` → `needs_frame = present_skipped` → -`post_present`. - -Ticks (`Event.tick`) are produced by six different clocks: - -| shell | who ticks | cadence | -|---|---|---| -| tty | `tickWatch` thread: nanosleep 16 ms **after** the wait asked, then `postEvent(.tick)` (tui.zig:1513) | 16 ms + frame time: drifts slow, worse over ssh | -| gui | `AnimationClock.due` in `postPresent` re-arms `now+16ms` (gui.zig:203, 221, 4095) | a tick only once ≥16 ms have passed since the re-arm: at 144 Hz every 3rd frame (20.8 ms) → animations ~25% slow; at 120 Hz every 2nd; a slow frame slows them further | -| gui grid mode | every `poll_frame` while active (gui.zig ~4114) | as fast as the loop | -| web | JS rAF fixed-step bank, capped (app.mjs:566) | correct average rate, always ticking | -| macOS | `spendTickTime` bank (macos.zig:868, 1549) | correct average rate | -| detached server | after a timed `poll` (server.zig:816, 828) | ≥16 ms | - -So the same animation runs at different speeds per shell. Everything counts -16 ms frames (`layout.Animation.frame_ms`, layout.zig:2041). - -Acknowledgement is also per shell: tty `postPresent` acks the tracks it drew -(tui.zig:1187), GUI acks then ticks (`finishPresentedAnimationFrame`), grid mode -acks `&.{}`, macOS acks via `pardes_frame_presented`, **web never acks**. - -### 1.2 Core render (`Pardes.render`, pardes.zig:5950), in code order - -1. `File.refreshHighlights`; size the grid; reset cursor/pointer shape, **clear - every cell's hover bit** (5979 — stale state that exists only because paint - passes do not own their output), zero layers/images/tracks. -2. Fill the whole screen with `chrome.border` (5991). -3. Per pane: `collectNotices` → `renderPane` (6580): `clearRect` + page fill - ("two full passes over every cell in the pane", 6596) → grip → `paintPaneTag` - → PDF / image / `renderBody` (+scrollbar) → `renderBodyLayer` (body_layer.zig:243) - which **renders the whole body again** into a temporary Surface by - `std.mem.swap(Surface, &p.surface, &temporary)` (body_layer.zig:266-272). -4. Notice chips painted on the grid (6000-6065). -5. Workspace tag, column tags, their hover word and header selection/caret on - the grid (6068-6155). -6. `renderTagLayers` (6396): **paints every pane tag a second time** into a - temp Surface via the same swap (6414-6419); builds notice layers (re-deriving - chip geometry, text, caret the grid pass already computed) and column / - workspace layers (`renderHeaderLayer` 6520, which re-does hover and header - selection). -7. Drag overlays (`overlayDash`, glyph-only rewrites, 6158); the column-move - rail shrinks layer viewports by one cell so the rail stays visible. -8. Debug box (6244). -9. `presentation.submit` (6301): tracks, previous grid, per-cell diffs. -10. `composeAsciiTransitions` (6305): character effects composed in the core - into an arena copy of the cells. - -Implicit orderings that matter and are written nowhere: body layers before tag -layers (notice chip over a context band); images after cells, which is why an -image pane "gives up the rows" under its notices (6629) instead of having z; -tag layer array index order (panes, columns, workspace, notices) is paint order. - -### 1.3 Surface: what the shells get (surface.zig) - -`cells` (the canonical grid), `cursor`, `pointer_shape`, `images` -(`ImagePlace`, with `patch` rows), `body_layers[16]` (compact context rows + -body rows), `tag_layers[MAX_TAG_LAYERS]` (one row each; the tag refactor just -added `line` — one layer per tag line), `panel_tracks`, `previous_*` + `cell_diffs` -while a transition needs them, `mark_hover` (a flag that makes `Surface.at` -set `cell.hover`, 378-385 — a side channel for macOS glass). - -### 1.4 Shells - -- **tty** (tui.zig:1100): `panel_compositor.compose` rewrites cells for - slide/zoom/dissolve/vertical → `paintCells` (win.clear + every cell) → kitty - images (hidden while geometry moves) → cursor → `vx.render` (vaxis diffs - against its last screen, wraps in sync 2026). Layers are ignored. -- **gui** (`renderFrame`, gui.zig:5035): one render pass. `makePaintPlan` - (2048) = one batch per active track + static batch. Per batch: grid cells not - covered by a layer (`coverLayers` 5656) → body layers → tag layers → previous - layers/cells for transitions → that batch's images. Then the overlay - (`buildOverlay` 7258: pet, topbar rule, column rule, bottom fill, pane chrome - 7468, grips 7543, bar cursors, touch). Then optional crt pass scene_tex → - swapchain (5439). Cell = one instance drawing bg + glyph (ui.frag.glsl). -- **web**: DOM spans for the grid + absolutely positioned divs for tag and body - layers. No images, tracks, scene; never acks. -- **detached** (wire.zig, `version = 7`): cells + body/tag layers, delta coded. - A GUI attached client has `core == null` → no pane chrome (appendPaneChrome - reads `core.rects`): a per-shell divergence caused by the shell reading core. -- **macOS** (out of scope): its own copies of tag/body layer ABIs, its own - tick bank, Metal crt. - -### 1.5 Duplicated logic, smells, bugs - -1. Paint twice: pane tags (grid + layer), bodies with context rows (grid + layer), - notices (grid + layer, text/geometry/caret recomputed), workspace/column tags - and their hover/selection/caret (grid + layer). The two copies already - disagree: a notice layer highlights the hovered word, the grid chip does not; - the column-tag grid hover is suppressed during `column_move`, the layer's is not. -2. `std.mem.swap(Surface, &p.surface, …)` as the way to "paint into something - else": every paint function writes `p.surface` directly. -3. Geometry recomputed everywhere: `tag_y = if tag_bottom …` appears in - renderPane, paintPaneTag, renderBody, renderTagLayers, appendPaneChrome, - taglineBaseRgb; `bodyTop`; BOX_H == 1 assumed throughout (multi-line tags - break all of these). -4. The GUI infers semantics from painted cells: scrollbar thumb from - `cellBackgroundIs(scroll_thumb)` (7468ff), topbar rule from "row 1 has a - tagline cell" (5509), bottom band (5519), grips from tagline cells - (`paneGripCell` 5872), focus tint recomputed from `core.active` - (`taglineBaseRgb` 5609). Any theme where two roles share a colour breaks it. -5. Six clocks (1.1), four ack sites, and a web that never acks. -6. `animationActive` (5884) is true while crt/ripple/glitch are on → the whole - core render (double paints included) and `capturePrevious` run every 16 ms - for a time-only uniform. -7. `acknowledge(&.{})` → `capturePrevious` memcpys all cells and all layer - cells on **every idle presented frame, even with `panel_transition = .off`** - (layout.zig:283-290). -8. A lingering message (`message_linger_ms`) keeps `needs_frame` true every - tick for its whole linger (Messages.zig:238-250): seconds of full 60 Hz - renders that change nothing. Look-hover delay likewise ticks every frame. -9. `Animation.Transition.retarget` (layout.zig:2064) restarts from the displayed - value with step 0: position continuous, velocity snaps to zero. -10. Colour fades mix sRGB bytes (`interpolateRgb` layout.zig:2111, - `Messages.blendRgb`, `colors.mix`): muddy mid-fades. -11. Shell-side animations each have their own time: crt uniform - (`SDL_GetTicksNS`), pet (`SDL_GetTicks`), smooth scroll lag (per poll), - touch flash (per rendered frame), macOS coasting. -12. `mark_hover` hack and the hover-bit reset (1.2 step 1). - ---------------------------------------------------------------------------------- - -## 2. Principles - -1. **Core decides WHAT and WHERE; shells decide HOW.** The core emits an ordered - region list with geometry, z, and resolved styles. No shell reads - `core.rects`, `core.active`, settings or theme to decide what something is. -2. **Paint once.** Every part is painted exactly once, into its own target; the - grid is produced by joining those targets. -3. **One clock.** Time is the shell's monotonic `now_ns`, passed in; the core - never reads a clock. Animations are functions of `now - start` (tweens) or - closed-form springs, never frame counters. -4. **A fixed, named order**, written as straight-line code in one function per - side. No pass objects, graphs or vtables. -5. **Zero cost when off; zero work when idle.** A disabled effect emits nothing. - Idle means the earliest deadline is "never". -6. **Decorations never change cell geometry.** Grid, hit testing, 9P cells and - snapshot goldens are unaffected by any GUI effect. - ---------------------------------------------------------------------------------- - -## 3. The frame - -### 3.1 Loop (pump, all shells) - -``` -pump(h, now_ns): - wait_input(timeout = min(core.nextWake(now), shell's own next wake)) - drain events → update ; drain effects → perform - core.advance(now) // settles animations whose time passed; sets - // needs_frame if something core-visible moved - poll_frame - if needs_frame or core.running(now): - render(now) → present → if present said "shown": core.acknowledge(tracks) - else if shell has a presentation-only animation: - shell redraws at level A (post chain only) or B (decor only), §5.5; - no core render, no cell-instance rebuild -``` - -`animationActive: bool` becomes `nextWake(now) ?u64` (null = idle, 0 = run -every frame, >0 = sleep until). `acknowledge` moves into `pump` (present returns -whether it showed the frame); the four shell ack sites and GUI's -`finishPresentedAnimationFrame` go. `capturePrevious` runs only when -`panel_transition != .off`. - -### 3.2 Core `render` (moves to `src/draw.zig`, `pub const render = draw.render`) - -Straight-line, in this order: - -``` -render(p, arena, now): - 0. BEGIN size grid; reset regions, layers, images, cursor, tracks - 1. PLACE compute every part's rect ONCE and append a Region, in z order: - page; per pane: body, tag (h = tag lines), grip, rail(+thumb), - notices; per column: tag + grip; workspace tag; drag overlays; - debug box; cursor - 2. PAINT for each region: paint its cells once into its target — its - layer (tags, notices, bodies with compact rows) or the grid - 3. JOIN copy each layer's grid-visible cells into the grid at its - viewport, in region order → the canonical grid (tty/9P/wire) - 4. GRID-ONLY glyph-only overlays (drag dashes) and the debug box on the grid - 5. PRESENT presentation.submit (tracks, diffs); region tier from role - and track phase (§3.4) - 6. STYLE resolve region styles: lift, dim (focus animation), the - theme's decor per region kind, style_alpha, per-pane view origin -``` - -Paint functions take the target `s: *Surface` instead of writing `p.surface` -(mechanical signature change through body_layer, File, Terminal, Image, Pdf); -the swap hack and the second tag/body/notice paint are deleted. Where the -old grid and layer copies disagree, **the grid's behaviour wins** so goldens -stay byte-identical. Every disagreement is listed in the change and decided -on its merits later (e.g. the column_move hover suppression is right for both; -notice-word hover could go either way). JOIN traps: (a) a wide grapheme at the -viewport's right edge. `print` drops a width-2 glyph that does not fit -(`col + 1 >= end`), but the layer has columns beyond it, so the copy must -re-clip at the edge and never leave a head without its spacer. (b) The body -layer's first `r.h − tag_rows` rows must equal today's grid rows with -`tag_bottom` both on and off (`first_row`, body_layer.zig ~275). - -### 3.3 Which parts render, and from what - -- A region is emitted iff its rect intersects the screen and its owner is - visible (collapsed pane → tag region only). -- Pixel shells draw a region **from its layer if it has one, else from the grid - cells in its rect**. The page region draws only grid cells no other region - covers (today's `coverLayers`, generalised to regions). -- Cell shells (tty, detached tty) draw the grid; layers exist only for pixel - shells. - -### 3.4 Composition order (GUI): fixed tiers by ROLE - -A region's tier comes from its **role** and is fixed for the frame. Animated -elevation (`Region.lift`, 0..1) only drives shadow offset, σ and strength, so -nothing changes draw order partway through a lift (draft-2 fix: an animated -`z` whose floor is the tier makes the draw order pop mid-animation). - -| tier | role | overlap inside the tier? | -|---|---|---| -| 0 | page, static panes, their chrome (rails, grip marks, rings, rules) | no | -| 1 | the active pane (only when focus lift is on) | no | -| 2 | panes moving/opening in a transition | **yes**: split per track, in `paintOrder` | -| 3 | closing tombstones (frozen previous cells) | **yes**: split per track | -| 4 | floating: notice chips, debug box, drag preview | no | -| 5 | true overlays: cursor, touch/pet (debug) | no | - -A pane's own chrome (rail, grip marks, rings, rules) is decor of the pane's -tier and carries its track transform, so it moves with the pane. Today it is -hidden during transitions (`transient_on`, gui.zig ~7299) because it doesn't -move. Only real overlays live in tier 5. - -Straight-line GUI draw, one render pass: - -``` -for tier 0..5: - for each group in tier // one group per tier, except tiers 2 and 3: - // one group per track, in paintOrder - decor-under fills, patterns, rings under content [decor] - cells bg + glyph; text-shadow regions in 3 phases [ui] - images the group's images [image] - cast shadows this group's shadows, darken-only, each with - its caster's rect as an exclude rect [decor] - decor-over rings over edges, rails, rules, grip marks [decor] -post chain (§6) → present -``` - -Why cast shadows come AFTER cells (draft-2 fix): static panes share tier 0. If -the shadow were drawn before the tier's cells, the neighbour's opaque cells -would paint over a shadow cast onto its gutter or tag row, which is exactly the -lapis case. Each shadow instance discards inside its caster's rect, so it only -darkens what lies beside or under it. An elevated tier's shadow onto lower -tiers works the same way. - -Draw calls: ≤ 5 per group. Tiers 0, 1, 4 and 5 are one group each, so ~20 draws. -Tiers 2 and 3 add ≤ 16 groups, and only while a transition runs. Empty draws are -skipped. The per-track batching that exists today (PaintPlan) survives only in -tiers 2 and 3, as groups. The vertical effect's scissor becomes a per-instance -clip rect. A notice chip (tier 4) ends up above an image, so the image pane can -stop "giving up the rows" (its own visual-change step). - ---------------------------------------------------------------------------------- - -## 4. Data the core hands the shells - -Additions to `Surface` (all POD, fixed-size): - -```zig -pub const Region = struct { - kind: enum(u8) { page, body, tag, grip, rail, column_tag, workspace_tag, - notice, overlay, debug }, - pane: u8 = none, column: u8 = none, serial: u32 = 0, - rect: Rect, // grid cells: the hit-test geometry - tier: u8 = 0, // fixed by role (§3.4) - lift: f32 = 0, // animated elevation 0..1: shadow only - dim: f32 = 0, // 0..1 pull toward the page (unfocused) - layer: u16 = none, // layer index, or draw the grid cells in rect - style: u8 = 0, // index into Surface.styles (0 = plain) - style_alpha: f32 = 1, // decor weight; theme crossfade (below) - active: bool = false, - thumb: struct { y: u16, h: u16 } = .{}, // rail only -}; -regions: [MAX_REGIONS]Region, nregions: u16, -styles: [8]Style, // resolved per frame from theme + settings -view: [MAX_PANES]struct { serial: u32, top_line: i32, wrap_at: i32 }, // ABSOLUTE per-pane view origin (§5.4) -``` - -`Style` holds a theme's decor for one region kind. Hard-edged geometry is in -**logical pixels** and snapped to whole device pixels by the shell (logical px × -display scale, rounded): ring widths, pattern periods, hard-shadow offsets. -Lapis is pixel art (2/3/1 px rings, 6 px checker, 5-6 px hard shadow). In -fractional cell units those would blur and change with font size (draft-2 fix). -Fields: `fill`, `ring[3] {px, rgba}`, `pattern {none|checker|stripes|dots, px, -duty, a, b, see_through}`, `hard_shadow {dx_px, dy_px, rgba}`, `text_shadow -{dx_px, dy_px, rgba}`. Soft elevation shadows are not per style. They come from -`lift` and one global `shadow {rgba, σ_px, offset_px}` per theme. - -`see_through`: a region style with an under-pattern (the lapis dot grid under -pane bodies) marks page-coloured cell backgrounds as clear, using the existing -ui.frag clear-bg flag (0x40000000), so the pattern shows between glyphs. In a -tiled layout the page region is almost never visible, so the pattern has to sit -under the bodies. - -Theme crossfade: switching into or out of a decorated theme fades -`style_alpha` from 0→1 or 1→0 over the same Tween as the colours. Decor never -snaps while colours fade. Schema: `decor` is an optional field on `Theme`. The -comptime `fold` and the ZON ThemeFile parser (colors.zig:266) both walk the -same struct, so theme files get decor with no separate schema. Lapis ships -compiled in first. - -Layers: once the tag refactor lands, `TagLayer` and `BodyLayer` merge into one -`Layer { kind, id, serial, viewport, cols, rows, compact_rows, cells, cursor -{x,y,bar}, bg, slide, fade, separators }`. A tag is all compact rows. A body is -`context_rows` compact rows followed by body rows. A notice is one compact row. -There is one `rowTop/rowHeight/hitAt`. Multi-line tags are `rows > 1`, which -replaces the refactor's one-layer-per-line `line` field. This is the only part -that touches the other agent's files, and it waits for them. - -Time: `Surface.now_ns`, the core's time for this frame. - -Wire: regions and styles go over the detached wire (`version` 7 → 8). The -attached GUI then draws chrome from them, which fixes the core==null -divergence. Web ignores the new data at first. Its lapis could later map styles -onto CSS box-shadow, borders and gradients, a natural fit since the reference -IS CSS. - -Deleted from the shell once regions exist: `taglineBaseRgb`, -`topbarPaneBorderHeight`, `bottomTaglinePresent`, the scrollbar inference in -`appendPaneChrome`, `cellBackgroundIs`, `paneGripCell`'s scan, and `mark_hover`. -The hover affordance becomes an `overlay` region. - ---------------------------------------------------------------------------------- - -## 5. Region effects on the GPU - -### 5.1 One decor pipeline, instanced - -New `shaders/decor.{vert,frag}.glsl`. Each decoration is one instance: -`{ rect_px, clip_px, exclude_px, kind, params vec4, color0..2 (premultiplied), -transition header (the same fields as CellInstance) }`. - -- **Hard-edged kinds, no AA, snapped edges**: `solid`, `ring` (up to 3 inset - rings), `checker`, `stripes`, `dots`, `hard_shadow`. Rules, rails and grip - marks become `solid` decor emitted from regions. Because they are snapped and - un-anti-aliased, stage 8's "PPM goldens byte-identical" is achievable. -- **Soft kinds, fwidth AA, dithered**: `soft_shadow` (a rectangle convolved - with a Gaussian in erf closed form, as Wallace and GPUI do: one quad grown by - 3σ, no blur pass), `inner_shadow`, `glow`, and `cursor` (rounded corners). - Wide gradients get ±0.5/255 interleaved-gradient-noise dither. - -The triangle overlay pipeline stays only for the pet and the cursor's glide. - -### 5.2 Shadows and gamma - -A pane's right and down shadow lands on its neighbour's gutter or tag row -(chrome), because pane rects tile. With `tag_bottom` it lands on the first body -row instead, which is simply what a shadow does. §3.4 guarantees it is drawn -over the neighbour and never over the caster. - -Gamma decision (draft-2 fix, one rule instead of two). Decor blends on the -UNORM target, so blending happens in sRGB space, as CSS does. -- Dark shadows: alpha is pre-warped so the result matches linear light, - `a' = 1 − (1 − a)^(1/2.2)`. This is exact for black. -- Coloured decor (glows, selection halo, tinted shadows) is capped at ≤ 25% - alpha, where sRGB-space falloff is only slightly dark. That is documented, and - it is accepted by the feel review, not by maths. -- Opaque decor (lapis hard shadows, rings) has no gamma issue. -- Measured experiment in the fx set: render the scene into RGBA16F linear - (ui.frag writes a linearised `mix(bg,fg,a)`, so glyphs look identical) and add - one encode pass that also produces the sRGB iChannel0. It is adopted only if - its cost at 4K on the iGPU fits §8.3. - -### 5.3 Text shadow - -Only for regions whose style has `text_shadow` (lapis titles). The region's -cells are emitted in three phases in its group: all bg instances (glyph = the -space slot), then shadow glyph instances (offset, shadow colour, clear bg), then -glyph instances (clear bg). Every other region keeps its single bg+glyph -instance. Within a group, bodies come before tags, so a tag's shadow can hang -over the body's top edge. - -### 5.4 Cursor (shell-owned presentation) - -The cursor is decor in tier 5, not a reversed cell. It is a quad whose 4 corners -follow the target on critically damped springs. The leading corners are stiffer -than the trailing ones, which gives a smear along the motion that collapses at -rest. -- **Distance rule** (draft-2 fix): a move of ≤ 1 cell, or any move in insert - mode, snaps or settles in ≤ 40 ms. Only jumps glide (90-150 ms), as neovide - does. At key-repeat rate (~33 ms per cell) a 120 ms spring would trail 3-4 - cells behind and feel sluggish. -- **Scroll-aware**: the core exposes each pane's ABSOLUTE view origin - (`view[pane]`: serial, first line, wrap offset). The shell diffs it against - the origin it last drew and shifts its spring state by the difference in - pixels, so the cursor does not glide against text that jumped. It is absolute, - not a per-frame delta, because frames get dropped: the detached server skips - clients with pending output (server.zig ~712), and a GUI can skip a present. - G6 smooth scroll uses the same origin. -- **Legible during the glide**: glyphs under the quad are re-emitted in the - cursor-text colour, clipped to the quad (per-instance clip), as neovide does. -- **Geometry**: the pixel rect comes from the layer the cursor sits in (body - layer compact rows, or tag layer pitch plus band offset), not from `cols × cell_w`. -- **Blink**: default OFF, as pardes never blinked. When on, it is a square wave - with an ~80 ms ease at each edge, so it redraws only at the edges, held solid - while typing and for 500 ms after, and it stops after 10 s idle. - -### 5.5 Presentation-only redraw levels (draft-2 fix: zero idle cost must be real) - -| level | trigger | work | -|---|---|---| -| A: chain only | iTime or ShaderAnimation, scene unchanged | re-run only the post chain from the retained `scene_tex` | -| B: decor only | cursor glide, blink edge, hover fade | reuse the uploaded cell vbuf and image draws; rebuild and upload the decor instances AND the cursor-legibility glyph instances (the glyphs under the cursor quad in cursor-text colour, ui pipeline, clipped to the quad); redraw the scene, then the chain | -| C: core frame | `needs_frame` or a core animation | full render and instance build | - -Cell instances are rebuilt only at level C. With a chain active, the cursor -lives in the scene, so cursor motion is level B, not A (a documented choice: -iCurrentCursor shaders still get exact uniforms). - -### 5.6 tty / web / wire - -GUI decor is GUI-only. The tty realises nothing from `styles` beyond the colours -that are already in cells; its own effects are in §9.2. Web ignores the new -data. The wire carries regions and styles so an attached GUI draws the same -frame. - ---------------------------------------------------------------------------------- - -## 6. Post passes: a Shadertoy-compatible chain (GUI) - -Mirror ghostty 1.4.0 (`zig-pkg/ghostty-*/src/renderer/shadertoy.zig`, -`shaders/shadertoy_prefix.glsl`, `generic.zig:2106-2230, ~1692`): - -- **Source format**: user file with `void mainImage(out vec4 fragColor, in vec2 - fragCoord)`, untouched. pardes prepends its OWN prefix with ghostty's exact - uniform names, types and std140 order (iResolution, iTime, iTimeDelta, - iFrameRate, iFrame, iChannelTime[4], iChannelResolution[4], iMouse, iDate, - iSampleRate, iCurrentCursor, iPreviousCursor, iCurrentCursorColor, - iPreviousCursorColor, iCurrentCursorStyle, iPreviousCursorStyle, - iCursorVisible, iTimeCursorChange, iTimeFocus, iFocus, iPalette[256], - iBackgroundColor, iForegroundColor, iCursorColor, iCursorText, - iSelectionForegroundColor, iSelectionBackgroundColor; CURSORSTYLE_* defines; - `#define texture2D texture`), but SDL GPU bindings: `iChannel0` at set 2 - binding 0, the block at set 3 bindings 0 to 2 (cut before and after - iPalette: SDL GPU binds at most 4 KiB of a block, so one block left - the colours after the palette at zero until G4), pardes's own at 3. `main()` calls - `mainImage(_fragColor, gl_FragCoord.xy)`. Trap found: ghostty's Zig - `Uniforms` (shadertoy.zig:13) orders selection_background before - selection_foreground while its GLSL block orders Foreground before Background, - so in ghostty the two arrive swapped. pardes fills by the GLSL names (the - documented meaning); a unit test checks our Zig mirror's std140 offsets - against the prefix (≈4.6 KB block, pushed with SDL_PushGPUFragmentUniformData). -- **Y is down**, exactly like ghostty on Metal (`custom_shader_y_is_down`): - fragCoord, iChannel0 UV and cursor uniforms share one top-left space, no flip. - `iCurrentCursor = (left x, BOTTOM-edge y, w, h)` in framebuffer pixels (the - "+Y edge" rule community cursor shaders rely on). Directional shaders appear - flipped versus Linux ghostty (OpenGL, y-up); documented, not emulated. -- **Chain**: a list of paths, run in order; ping-pong two UNORM textures - (cleared to 0), the last pass writes the swapchain. iChannel0 holds - sRGB-encoded values (scene_tex and swapchain are UNORM today — keep it so; if - the scene ever moves to an _SRGB/float target, encode before the chain). Empty - chain → render straight to the swapchain, no scene texture (today's cost). -- **Uniform sources** (shell): iTime since the first post frame, iTimeDelta - between draws, iFrame per draw (ghostty semantics, shell wall clock); iMouse = - real Shadertoy mouse (superset; ghostty leaves it 0); cursor rect/colour/style - from the region cursor (5.4 geometry), iTimeCursorChange stamped when rect or - colour changes; iFocus/iTimeFocus from window focus events; palette, - background, foreground, selection from the theme. -- **Alpha**: forced to 1 unless WindowOpacity < 100 (then passed through - premultiplied). Transparent grounds keep working. -- **Input mapping**: identity. The bundled CRT has NO geometric distortion - (beam-profile scanlines, aperture mask, bloom, vignette), so input stays exact. - Barrel exists only in user shaders, with the drift documented: 1.6% is ~30 px, - ≈3 cells, at the corners of a 4K screen, where the grips and rails are. - `crt.zig` is deleted. If the user insists on barrel in the bundled CRT, keep - `crt.zig`'s inverse keyed to "bundled crt active". -- **Compile** (decision 3): a user's file is compiled by spawning `glslc` with - the build's own flags, prefix and file on its stdin, SPIR-V on its stdout - (no file of ours anywhere; std's spawn allocates before fork), on a thread of its own when the file joins the chain, never on the - frame path; the result is taken in at the next loop step. The prefix ends in - `#line 1`, so glslc's errors count the file's own lines, and they name the - file, not `<stdin>`. Level A redraws once a refresh of the window's display. A failed compile keeps the file's last good - pipeline and says glslc's first line as a message; glslc missing is said - once, and only files stay off (the bundled passes are compiled with the - build, through the same prefix). The files' directories are watched - (file_watch shader slots): a change there has each file read and hashed, - and one whose bytes moved compiles again; the same bytes (good or bad) - compile nothing and say nothing twice. The process that holds the core - compiles (ShaderBuild.zig): a local GUI, or a detached session, which - sends its attached GUIs the chain with each file's SPIR-V (wire `post`, - on attach and on every change), so an attached GUI runs the same passes, - levels and ShaderAnimation as a local one and still reads no disk and runs - no program. -- **Animation mode**: `ShaderAnimation off|on|always` (ghostty's - `custom-shader-animation`): off = redraw only when content changes; on = - continuous while the window is focused; always = continuous. Continuous means - the shell redraws its retained Surface (3.1), never a core tick or render. -- **Existing crt** becomes a bundled Shadertoy file in `shaders/post/` under - the same builtin; `scene_effects` and `crt.frag.glsl`/`crt.zig` are deleted. - It takes a level, `Crt 0..3` (0 off, `on` the default 2, `off` and bare - still work), passed as `pardesLevel`: 2 is the polished rewrite, 3 at least - as strong as the old CRT (pixels changed by more than 8 in a channel against - a plain frame: 18.3% vs 17.4%). Ripple and Glitch were rewritten too, then - removed at the user's word after a live look (decision 8). The chain is - `Crt` and `Shader <path>` in the order they were put in - (`Shader off` empties it of files), `ShaderAnimation off|on|always` - (default on). The core keeps no clock for it: level A redraws are the - shell's. -- macOS (out of scope) would need spirv-cross → MSL, as ghostty does. - -Region filters (e.g. "tint/blur one pane") are NOT built. If one is ever needed: -one post pass reading a uniform array of ≤16 region rects+kinds, not a pass per -region. - ---------------------------------------------------------------------------------- - -## 7. Animation model - -### 7.1 Time - -- The shell's monotonic `now_ns` is the only clock. It enters the core with each - `pump` (and a `.tick = now_ns` event for shells without pump, e.g. esp32). - Tests inject a fixed clock: a helper steps `now` by 16.67 ms. -- Two domains, one clock: - - **core animations** (change what hit-testing or the grid show, or state): - panel geometry, message life, notice slide/fade, look-hover delay, chrome - theme crossfade, focus lift/dim. Stored in the core, deterministic in tests. - - **presentation-only animations** (never touch core state): cursor glide/ - trail/blink, shader iTime, smooth-scroll pixel offset, pet, touch flash. - Owned by the shell, redraw the retained Surface, never tick the core. - -### 7.2 Two primitives, closed form - -```zig -Tween { start_ns, duration_ns, from, to, curve } // value = lerp(from,to, curve(t)) -Spring { start_ns, x0, v0, target, omega } // critically damped: - x(t) = target + (c1 + c2 t) e^{-ωt}, c1 = x0-target, c2 = v0 + ω c1 -``` - -Both are pure functions of `now`: frame-rate independent, free catch-up after a -sleep, no per-tick `advance` loops. Retarget: a Spring evaluates `(x, v)` at now -and restarts from them (velocity kept); a Tween retargets from the displayed -value with an ease-out curve (starts moving at once, no ease-in stall). -Colours interpolate in OKLab (small CPU function), not sRGB bytes. - -Settling (draft-2 fix: a critically damped spring never reaches its target). -Each quantity has an end rule: position springs end when |x − target| < 0.5 -device px and |v| < 1 px/s, lift/elevation when < 0.002, and then they snap to -the target and stop. A test checks that `nextWake` returns null after settle. -A Tween ends at `start + duration`. - -### 7.3 Idle and wakes - -`nextWake(now)` is ONE straight-line function listing every core animation -(the same list `advance` settles): - -- running tween/spring → 0 (frame now) -- holding phase (message linger, look-hover delay) → its end time -- nothing → null - -Shells wait `min(core wake, own wake, input)`. A lingering message now costs -zero frames until it starts to dissolve. `advance(now)` performs the state -changes at phase ends (message entering→shown→lingering→leaving→removed, -track done → drop, hover wait → preview) and sets `needs_frame` only when -something visible changed. - -### 7.4 What each animation becomes - -| today | becomes | -|---|---| -| `ChromeAnimation` 10 steps sRGB (colors.zig:192) | Tween, 200 ms, OKLab, ease-in-out; retarget ease-out | -| panel `Track.frame` counters (layout.zig:1583) | geometry Spring per track (retarget-safe); content crossfade Tween | -| `MessageLife.frame` (Messages.zig) | phase + start_ns; motion from Tween curves | -| look-hover wait frames (look.zig:902) | deadline | -| GUI `AnimationClock`, tty `tickWatch` cadence, web `animationTicks`, macOS `spendTickTime`, detached tick | deleted; each shell passes `now_ns` and sleeps to `nextWake` | -| crt time uniform, pet, touch flash, scroll lag | shell-owned, same now_ns source | - ---------------------------------------------------------------------------------- - -## 8. Motion, colour, performance, feel (both tracks) - -### 8.1 Motion spec - -| class | examples | curve | duration | -|---|---|---|---| -| micro-feedback | hover affordance, button/word highlight, selection appear | ease-out (cubic) | 80–120 ms | -| follows input | cursor, smooth scroll, drag preview, pane geometry under interaction | critically damped spring | settles 90–150 ms (cursor), 180–260 ms (layout) | -| arriving | notice drop-in, pane open | ease-out (cubic / quint), no overshoot | 150–220 ms | -| leaving | notice dissolve, pane close | ease-in (cubic), shorter than arriving | 100–160 ms | -| state change | focus lift/dim, theme crossfade | ease-in-out (smooth) | 150–250 ms | -| anything > 300 ms | — | must be justified in the feel review | — | - -Rules: leaving is faster than arriving; nothing overshoots at text scale -(a 2 px bounce reads as jitter); interruptions retarget (7.2), never snap or -restart from zero; **input is never gated**: hit testing uses logical geometry -(`presentation.pointer` already does), keys act on the logical state -immediately, animations only lag the picture. - -### 8.2 Colour and contrast spec - -- Targets (WCAG ratio via `colors.themeContrast`, colors.zig:113): body text vs - page ≥ 4.5 (aim 7); secondary ink (comments, line numbers) ≥ 3; tag/chrome text - vs its band ≥ 4.5; non-text chrome (rules, grips, scroll thumb) ≥ 3 vs - neighbours; selection text vs selection bg ≥ 4.5. -- Absolute targets apply to the 15 native themes only, matching the existing - test (colors.zig ~465), including its deliberate 2.5-4 band for line numbers - (lineno is the exception to "secondary ≥ 3"). Imported themes get a RELATIVE - rule: with every effect at its maximum (shadow darkening, unfocused dim, glow), - no text/ground pair may drop below min(its original contrast, the target). - Measured against the composited ground. If an effect would break the rule, its - strength is clamped for that theme. -- Subtlety budget: elevation shadow max 30% darkening at the edge, σ 0.4–0.8 - cell; unfocused dim ≤ 10% toward the page; glows ≤ 25% alpha; bloom threshold - high (only true highlights), strength ≤ 5%. -- Gamma: effect maths in linear light (shaders convert), shadows via pre-warped - alpha (5.2), crossfades in OKLab; glyph coverage untouched (ui.frag stays). - Wide gradients dithered. -- Focus hierarchy by light, not only hue: the active pane is lifted (shadow), - unfocused panes recede (dim), the cursor is the brightest thing on screen, - chrome is quieter than text. - -### 8.3 Performance budget - -- Targets: 60 Hz → 16.6 ms, 144 Hz → 6.9 ms end to end. Shares (144 Hz, - 200×60 grid, 4K, iGPU): core render ≤ 1.5 ms (only on state change), GUI - instance build ≤ 1 ms, scene GPU ≤ 2 ms, decor+text-shadow ≤ 0.5 ms, post - chain ≤ 2 ms for two passes (bloom at half res). Measured with the existing - tracy zones plus GPU timestamps; numbers are budgets to verify, not facts. -- Idle: zero ticks, zero renders, zero presents (7.3); blink stops after 10 s. -- Presentation-only animation: shell redraw only, no core render. -- Degrade order: post chain to half res → bloom off → soft shadows become hard - (σ = 0) → cursor trail off → transitions snap. Hysteresis: step down after 30 - of the last 60 frames miss the budget; step up only after 10 s with none - missed; at most one step per 2 s, reset on theme or window-size change. A step - is never taken mid-transition, only at the next idle, and each one is logged - (and shown in Debug). Input handling is never deferred for effects. - -### 8.4 Feel review (gate before an effect is kept) - -Each effect lands behind its own toggle, default off. Before "keep": render a -frame sequence with the injected clock (GUI capture mode, PPM per frame, at 60 -and 144 Hz; tty via the snapshot harness `snapstyle` per frame) and a live -screen recording; judge in motion against a reference (the lapis page, ghostty -cursor trail, neovide smear); record keep / polish / drop with one line of why -in `docs/effects.md`. Code review never substitutes for this. - ---------------------------------------------------------------------------------- - -## 9. Effects catalogues - -Every effect: a toggle (one `Fx` bitset in settings + builtin words, like -`scene_effects` today), zero instances/passes/uniforms when off. - -### 9.1 GUI track - -Existing, verdicts: crt → REWRITE as bundled Shadertoy (Lottes-style mask, -proper scanline beam profile, subtle); ripple → DROP; glitch → DROP (or a -tasteful rewrite only if the feel review asks); pet → keep as-is, out of scope; -transitions slide → POLISH (spring + elevation shadow while moving); zoom → DROP; -dissolve → REPLACE with a linear-light crossfade; vertical → POLISH timing; the -character effects (ascii…typewriter) → not a GUI effect (terminal track). - -| # | effect | needs from pipeline | pri | +| what | tty | window | from | |---|---|---|---| -| G1 | soft elevation shadows onto lower panes (active lifted, floating chips, dragged pane) | regions + z tiers, decor `soft_shadow` | P1 | -| G2 | focus transition: lift (spring) + unfocused dim | core focus Tween, `Region.dim`, cell-instance dim | P1 | -| G3 | cursor: jumps glide on springs, adjacent moves snap (≤40 ms), 4-corner smear with glyphs re-drawn legibly inside it, optional edge-eased blink | layer geometry, per-pane view origin, shell time, decor `cursor`, redraw level B | P1 | -| G4 | Shadertoy chain + bundled CRT, bloom (half-res dual-Kawase), vignette+grain | post chain, offscreen ping-pong, shell time | P1 | -| G5 | lapis decor: rings, checker, stripes, hard offset shadows, title text shadow | styles, decor kinds, 3-phase text shadow | P1 (lapis set) | -| G6 | smooth scroll: pixel offset on a spring, momentum for touchpads | shell-side; replaces scroll_lag stepping | P2 | -| G7 | panel transitions redone: spring geometry, shadow while moving, linear crossfade | Track as Spring, tiers | P2 | -| G8 | notice chips: elevation, shadow, ease-out drop, ease-in fade | tier 4, existing slide/fade | P2 | -| G9 | selection glow: soft halo behind selection runs, 100 ms fade-in | selection runs as regions (overlay kind) | P2 | -| G10 | theme crossfade in OKLab, 200 ms | Tween | P2 | -| G11 | look-hover affordance: soft underline glow, 80 ms | hover region | P3 | -| G12 | pane edge ambient occlusion (inner shadow, 1–2%) | decor `inner_shadow` | P3 | -| G13 | parallax body pattern (lapis dots under see-through bodies at 0.25× scroll) | `see_through` style, per-pane view origin | P3 | -| G14 | damage afterglow (changed cells glow briefly) | removed: a pane whose whole text changed flashed whole (the user: "really bad, just remove it") | — | - -### 9.2 Terminal track (tty, cell-native; separate, smaller) - -Where: presentation-only cell rewrites in the tui shell after the canonical -grid (`tui/panel_compositor.zig` grows into the tty compositor), never in the -canonical grid, so 9P/goldens stay clean with effects off. Gated on truecolor -(vaxis caps / COLORTERM) — static effects may quantise to 256, animated ones -turn off below truecolor. Safe glyph set by default (░▒▓ ▀▄▌▐ ▖▗▘▝); -sextants/octants behind a setting. Budget: an animated frame ≤ 8 KB of output -(≤ 4 KB and 30 Hz when `SSH_CONNECTION` is set); prefer effects whose per-frame -delta is a moving edge, not a full-pane rewrite; without sync 2026, animated -effects are off (static ones stay). vaxis has `caps.rgb` but no 2026 cap: the -tty sends its own `CSI ? 2026 $ p` (DECRQM) at startup, next to the kitty shm -probe; no answer = assume unsupported. Under tmux, tmux answers for itself (its -own 2026 handling; old tmux does not answer → animated effects off), which is -correct, because tmux is the thing that repaints the outer terminal. - -Enforcing the budget (draft-2 fix): tty animations are time-based, so dropping -samples is free and correct. After each `vx.render` the shell counts the bytes -written. If a frame exceeded the budget, the next sample is deferred by -`bytes / budget × frame` ms. Slide and vertical therefore get fewer samples over -ssh; they are not exempt. Effects are designed so each cell changes as few -times as possible over the whole animation. - -Audit of what exists: - -| effect | where | verdict | why | -|---|---|---|---| -| ascii (byte walk) | core compose | REMOVE | slot-machine noise, rewrites every changed cell every tick | -| edges | core compose | REMOVE | gimmick, full-pane churn | -| fall | core compose | REMOVE | gimmick | -| wave | core compose | REMOVE | gimmick, illegible mid-motion | -| scramble | core compose | REMOVE | noise every tick, worst byte cost | -| typewriter | core compose | REMOVE | slow on big panes, row-major reveal reads as lag | -| curtain | core compose | POLISH → wipe | a directional reveal is good; give it a 2-cell soft truecolor edge | -| slide | tty compositor | POLISH | ≤150 ms ease-out, pane open/close only; a full-pane rewrite per sample, so the byte budget thins it to few samples over ssh | -| zoom | tty compositor | REMOVE | nearest-neighbour cell scaling is garbage | -| dissolve | tty compositor | POLISH → ordered swap | Bayer 4×4 threshold per cell; each cell swaps old→new ONCE at its threshold (no continuous colour lerp), so the total output is one pane's worth spread over the animation | -| vertical | tty compositor | KEEP (timing polish) | reads as a drawer, cheap | -| message fade | core (grid colours) | KEEP (OKLab) | | -| theme crossfade | core | KEEP (OKLab, fewer steps over ssh) | | - -Removing the six core-composed effects deletes `composeAsciiTransitions`, -`charSource`, `AsciiDiff`, `PanelCellDiff.ascii` and their shader/GUI paths -(user decides). - -New, cell-native: - -| # | effect | technique | pri | -|---|---|---|---| -| T1 | floating shadow for chips/debug box/drag preview | 1 cell right/down darkened in OKLab; blank edge cells get ▗▄/▐ half-cell edges | P1 | -| T2 | cursor jump trail | on jumps ≥ 3 cells: 3–5 cells along the path, bg ramp cursor→page, 120 ms; tiny delta | P1 | -| T3 | wipe transition | 2-cell soft leading edge; only the edge changes per frame | P2 | -| T4 | ordered swap transition | = polished dissolve: Bayer threshold, one swap per cell | P2 | -| T5 | unfocused dim | fg 15% toward bg, instant (no animation over ssh) | P2 | -| T6 | active tag gradient | subtle horizontal truecolor ramp on the active tag band | P3 | -| T7 | scroll thumb flash | rail thumb brightens 300 ms on scroll | P3 | - ---------------------------------------------------------------------------------- - -## 10. Lapis on this pipeline - -Colours: a normal theme file (lapis #0f1a4a, deep #0a1030, ink #050a24, gold -#e8c46a, vermilion #d4412f/#ff6a4a, vellum #eee6d2/#9aa6d9). No fonts. Styles: - -- workspace/column/pane tag (the "trail"): lapis fill, 2 px gold ring, hard - shadow 5×5 px vermilion (px snapped to device pixels, no AA), 3 px title - text shadow for the file name. -- pane (the "panel"): gutter (2 cells ≈ the CSS 18 px band) carries the - ornament pattern (checker gold/lapis), inset rings gold/lapis/vermilion - (2/3/1 px) on the pane edge, soft black shadow from its tier. -- column tag bar / notice chips: striped gold/lapis (`stripes`, period 4 px) - behind the text band, ring gold, hard vermilion shadow. -- page: lapis-deep. The dot grid sits under the pane BODIES (`dots` pattern - with `see_through`, so page-coloured cell backgrounds let it show between - glyphs). It is fixed to the pane, not to the text, so it does not track - scroll. G13 parallax is retargeted to this body pattern at 0.25× scroll and - stays P3. - -Where the pixels come from: left band = the pane's own gutter; top = its tag -row (the band has vertical slack above/below the tagline glyphs); right/bottom -= 1–2 px rings over the last column/row's side bearings; shadows fall on the -neighbour's gutter/tag row (§5.2, drawn after the neighbour's cells, §3.4). No -layout change. If the user wants the CSS -look with real gaps between panes, that is a separate layout knob (question 1). - ---------------------------------------------------------------------------------- - -## 11. Damage / dirty tracking - -No new dirty bits without a measurement. Existing: `needs_frame` (frame-level), -vaxis cell diff (tty output), wire deltas, web node caches. The pipeline makes -two savings free: (a) presentation-only animations skip the core render -entirely; (b) deadlines replace per-tick renders for holding phases. Region -lists make per-region instance caching possible later, if tracy shows the -instance build matters. - ---------------------------------------------------------------------------------- - -## 12. What gets deleted or merged - -Core: second pane-tag paint, second body paint, grid-notice pass (joined from -layers), duplicated header hover/selection/caret, `std.mem.swap` of the Surface, -hover-bit reset + `mark_hover`, per-animation `advance` counters and frame -constants, `animationActive` (→ `nextWake`), `SceneEffect` (→ shader list), -`capturePrevious` on idle frames with transitions off; if the user agrees, the -six core-composed character effects. -Types: TagLayer + BodyLayer → Layer; layout.zig's Presentation/Track/Easing/ -Animation move to `src/Presentation.zig` and `src/animation.zig` (pure moves). -GUI: AnimationClock, finishPresentedAnimationFrame, PaintPlan/PaintBatch, -coverLayers-as-cell-loop (→ page cover), the five inference functions (4), -crt.zig mapping, crt.frag.glsl, `scene_failures` plumbing folds into the chain. -Shells: four ack sites, six tick drivers. - ---------------------------------------------------------------------------------- - -## 13. Staged plan (jj changes on a bookmark `render-pipeline`; effects on top of it on `fx`, droppable) - -Gate for every stage: `zig build snap` byte-identical, `zig build unit-test` -and `unit-test -Dplatform=gui` pass, `-Dplatform=web` builds, tracy frame time -not worse at 200×60. Builds redirected to files; `-Dplatform` always; PARDES_* -stripped. No visual change until stage 9 unless stated. - -| # | change | notes / risk | -|---|---|---| -| 0 | GUI capture goldens: a handful of scenes rendered hidden in capture mode, PPM hashes checked in (same machine/driver) | the safety net the GUI stages need; machine- and driver-specific, so a LOCAL gate only, never CI | -| 1 | pure moves: render → `src/draw.zig`; Presentation/animation out of layout.zig | no behaviour | -| 2a | clock plumbing: `Host.now` (the shell's monotonic ns) and `Pardes.advance(now)`, which runs one `.tick` per whole 16 ms frame since core time last stood still; `nextWake()` lists every core animation and answers the next frame while anything moves, the wait's end while something only waits (message linger, look-hover delay), null when idle; the pump sleeps to it and draws only stepped frames. No shell posts `.tick` any more (tty's timer thread only wakes the wait; GUI's AnimationClock, web's JS tick bank and the detached server's and the board's ticks are gone; grid mode moves its virtual clock straight to the next wake). `acknowledgePanelPresentation` stays in the shells (revisit at stage 8: grid mode acks `&.{}` on purpose). capturePrevious only when transitions are on. `.tick` stays as the one-frame step `advance` and the unit tests use, so every curve and every asserted number is unchanged | pacing is corrected (144 Hz no longer ~25% slow, ssh no longer drifts): a bug fix allowed in this phase. PARDES_TEST_CLOCK (set by the snapshot harness): tty and the detached server answer a virtual clock that a timed-out wait moves exactly to the core's next wake, so goldens replay the same frame sequence on any machine load. Review fixes: tty's wake timer is interruptible (a newer, shorter request cuts short an older sleep); a wait (linger, hover delay) is jumped to its end in one step, never counted against the 240-frame catch-up cap; an overshoot under 1.5 ms after a step is let go, so 60 and 120 Hz take exactly one step per display frame. Known exceptions: the GUI still polls every 16 ms when idle (SDL events, gamepad, fs tick, smooth scroll depend on it; revisit at stage 8); a minimized GUI renders every stepped frame of a running animation (stage 8) | -| 2b | (on `fx`, feel-reviewed) Tween/Spring curves, settle rules, OKLab crossfades, new durations from §8.1 | a look change, kept apart from 2a so either can be bisected | -| 3 | paint functions take `s: *Surface`; delete the swap hack | mechanical, wide | -| 4 | PLACE: Region list built once; renderPane/tags/notices read their rects from it | wait for tag→Text; the refactor is already replacing BOX_H with `pane.tag_rows` and `p.tagTop/bodyTop(pane, r)` — PLACE absorbs those into the region rects | -| 5 | JOIN: paint tags/notices/headers once into layers, copy into grid; the grid wins where the copies disagree, and each disagreement is listed for a later decision | goldens are the oracle; wide-grapheme re-clip at the edge (§3.2) | -| 6 | body layer joined the same way (paint once, copy visible rows) | riskiest join; A/B the old double paint in a temporary test with tag_bottom on and off, then delete it | -| 7 | Layer merge (TagLayer + BodyLayer), wire v8, web accessors | after the other agent lands; touches mouse hit paths; breaks the macOS shell's layer ABI (accepted: macOS build ignored for now); done: one `Layer` (src/Layer.zig) with `rows` (0 = no layer) and a `cursor{x, y}`; a tag of N rows is ONE layer of N grid rows (`tagHit` answers the row as `line`, `bodyHit` keeps its meaning), so the per-line layer bases are gone. Wire v8 ships rows, cursor y and the region list in the one bump; v7 and v9 peers are refused in both directions (tests). web: `tag_layer_value` 11 = rows, 12 = cursor y, and app.mjs lays every row. macOS: its Zig side compiles against `Layer`, but pardes.h still sees one row per tag layer (a taller tag shows its first row there) | -| 8 | GUI draws from regions: role tiers with track groups in tiers 2-3, page cover, hard-edged snapped decor for rules/rails/grips (pane chrome in the pane's tier), per-instance clip; delete inference functions, `transient_on` and `mark_hover` (breaks macOS glass hover; accepted, macOS ignored for now) | stage-0 PPM goldens byte-identical (possible only because hard decor is snapped and not anti-aliased); pane chrome now also shows during transitions, which is the one allowed visible delta, listed Done: the frame is drawn in groups (makeGroups): tier 0, one group per track in paint order (tiers 2 and 3), tier 4 as two groups (the notices; then the guides and the debug box, which the core paints over them), tier 5 (bar cursors), each drawing cells, images, decor. Decor is every rule, rail, thumb, grip mark, spine, the workspace and column rules, the bottom band, notice rules and bar cursors: whole-pixel rects drawn by `decor.frag` over `ui.vert` as cell instances (colour in the ground, coverage in fg.r, blended like the overlay), so each carries its track's transition and clip; a closing pane's comes from the last frame's regions (`Surface.previous_regions`). Only `solid` exists yet: `decor.vert` and the other kinds (§5.1) come with the first effect that needs them. Deleted: taglineBaseRgb, topbarPaneBorderHeight, bottomTaglinePresent, frameChromeBg, cellBackgroundIs and the rail inference, paneGripCell's scan, transient_on, PaintPlan; one cover map (coverFrame: layer, grip and offset, focus, anchor, floating) is marked from layers and regions once a frame. New regions: `column` (spines, anchors, the focused column's tint), `guide`, `debug`; `Surface.chrome` is the palette, on the wire in v8 (not yet shipped, so no bump), and an attached GUI draws the same chrome (test). Per-instance clip (`CellInstance.clip_*`, 104 → 120 bytes an instance, ~15% more upload a frame) replaces the vertical transition's scissor. While any pane moves, opens or closes, notices stay in their own panes' groups, under whatever slides over them; tier 4 holds them only when nothing moves. Goldens: 01-12 byte-identical; 13-17 differ only in pixels past the grid (with a picture on screen the image pass left the scissor at the grid's size, cutting every rule end, rail foot and band that runs into the leftover pixels; they now run to the edge as in every scene without one); 16-debug shows the debug box (it was drawn from the grid under the source's context-row layer, so the GUI never showed it there); 18-mid-transition is new (virtual clock, PanelSlide Newcol with the picture, frame 6 of 12: chrome moves with its pane). Other deltas, outside the goldens: a guide over a tag or a context-row body now shows; with WindowOpacity < 100 a layer's bar cursor is ink like the grid's; an attached GUI gains the focus tint, notice rules, spines and the theme's page and caret colours. Deferrals fixed: the GUI sleeps when idle (SDL and queue events wake it; a smooth scroll, a gamepad, the test feed, a shell's kill deadline, a present to retry still poll), and a minimized or occluded window sleeps through animation. Tracy, `gui frame build`, 200x60, terminal output plus scrolling, ReleaseFast, two interleaved runs of ~180 frames: before 992/1015 µs median, after 989/987 µs | -| 9 | post chain: glslang, Shadertoy prefix, ping-pong, ShaderAnimation, redraw levels A/B (§5.5); bundled CRT without barrel; delete scene_effects/crt.zig/crt.frag | first visual change (the CRT look) Done: src/gui/Post.zig, shaders/post/ (prefix, crt, ripple, glitch), post.vert. glslc (decision 3) with compileGlsl's flags, off the frame path; ghostty's Uniforms matched offset for offset by a test against a copy, and the prefix's block checked name by name; ghostty's test_shadertoy_crt and _focus compile, _invalid fails with glslc's words. Level A measured (Tracy, 200x60, Crt, idle 10 s): 215 chain-only redraws at 34 µs median CPU each, 6 core frames (957 µs) in the same time; the core's clock stays idle. Input is identity (test: the corner click with Crt on). The three bundled passes were rewritten: Crt without barrel or tube edge, scanlines and mask that average to one, dithered vignette; Ripple as rings in pixels, eased in, lit on their slopes in linear light, dithered; Glitch as short eased bursts of torn bands with an RGB split, keyed to iTime. Before/after stills for the user's judgement. | -| 10+ | `fx` bookmark: G1–G3 → feel review → G4 bundled → G5 lapis theme → P2s; tty T1–T2 → feel review → removals of audited effects (after user decision) → T3–T5 | each effect its own change, default off | - -Tests to add: fixed-clock animation tests (Tween/Spring closed form, retarget -velocity continuity, `nextWake` for each holding phase); region placement vs -old ad-hoc geometry (all layouts, tag_bottom, collapsed, multi-line tags); -contrast test (absolute targets on the native themes, relative rule on all themes × effect maxima); -settle tests (`nextWake` is null after every spring settles); Shadertoy prefix compile test with -ghostty's test shaders (`test_shadertoy_crt.glsl`, `_focus`, `_invalid`) and -uniform-offset checks against ghostty's `Uniforms` struct; tty byte budget test -(bytes per animated frame via the snapshot harness). - -Risks: the tag refactor moving under stages 4–7; body-layer join parity; glslang -build time and size (C++, ~minutes on the ~10 min build); machine-specific GPU -goldens; ssh/tty byte budgets; wire version bump breaks mixed-version attach. - ---------------------------------------------------------------------------------- - -## 14. Recorded open points (agreed with the adversary: not blockers) - -1. Selection colours: because ghostty swaps them (§6), Shadertoy shaders tuned - on ghostty will see iSelectionForeground and iSelectionBackground swapped in - pardes, which fills them by their GLSL names. Documented. -2. A same-tier cast shadow over a neighbour sits under that neighbour's - decor-over rings, because rings are drawn last. Accepted as the look; check it - in the feel review. -3. Gamma is a compromise (sRGB-space blending with pre-warped alpha). Coloured - glows keep a slightly dark falloff until the RGBA16F experiment is measured. -4. The macOS shell breaks at stages 7 and 8 (Layer ABI, mark_hover). Accepted, - since the macOS build is ignored for now. -5. Stage-0 GPU goldens gate locally only. -6. Revisit at the first visual stage (from stage 5): the notice layer lost - its hover word to keep the grid's behaviour. Notice words are Look/Exec - targets, so bring the hover affordance back in BOTH the grid and the - layer then. Done right after stage 8: a notice's word under the pointer - is lit as a header's is, in the layer and so in the grid's copy joined - from it. The same change deleted `mark_hover`, the `Cell.hover` bit and - the per-frame reset of it (never set since stage 5; macOS loses its - glass hover rect, accepted with open point 4). -7. Revisit at stage 8 (from stage 6): a body without context rows has no - layer (paint once, straight onto the grid). If the GUI is to read every - body from a layer, give every body one then and measure the copy. The - context-row path also still builds the body's text twice (a pre-pass - with body_rows 0 decides the context rows, renderBody builds it again at - the layer's rows); the paint is single. Measure both there. Decided at - stage 8, measured (Tracy, 200x60, TreeContext on a scrolled source, - ReleaseFast): the pre-pass text build is 5 µs median and the layer's - copies 10 µs per context-row body per frame. Kept as they are: nothing in - the GUI reads a layerless body from anything but the grid, which is - exact, so a layer for every body would be ~10 µs a body a frame for no - pixel. - -## 15. Questions for the user +| a scroll's glide (glide.zig) | whole rows | the pixel | a body's line and doc between two frames, and the last frame's cells | +| the caret's ease | (the terminal's cursor) | its quad on critically damped springs (gui.zig's `Caret`) | the cursor and the focused body | +| the blink (`CursorBlink`) | (the terminal's) | the cursor's alpha | the window's last key or click | +| a jump's trail (`JumpTrail`, jump_trail.zig) | the ground behind the cursor, truecolor terminals | drawn over it, in the overlay | the cursor between two frames | +| `InactiveDim` | (kept, not drawn) | the unfocused panes' ink faded, never below its contrast floor | the regions' focus | +| `Pet` | (unsupported) | a sprite in the workspace tag's blank end (gui/pet.zig) | the grid's first row; SDL's ticks | -1. Lapis geometry: decorations inside existing chrome (gutter band, tag row, - thin edge rings; no layout change — recommended), or real pixel/cell gaps - between panes like the CSS page (layout + hit-testing change)? -2. Remove the six core-composed character transitions (ascii, edges, fall, - wave, scramble, typewriter) and GUI zoom/ripple/glitch? -3. Runtime shader compile: link glslang (C++, from ghostty's vendored pkg, - allocator-policy exception), or spawn `glslc` at load time (no new dep, needs - glslc installed)? -4. Focus lift/dim on by default once it passes the feel review, or opt-in? -5. Stage 2a corrects animation pacing (144 Hz is ~25% slow today, and ssh - drifts) while keeping every curve. OK as a bug fix inside the "no visual - change" phase? -6. Cursor blink: pardes never blinked. Keep it off by default (recommended), - with an opt-in eased square-wave blink? -7. Bundled CRT without barrel distortion (exact clicks, recommended), or barrel - plus keeping crt.zig's inverse mapping for the bundled shader? +The settings these read are plain bytes in the core's settings, dumped +and replicated as any other; nothing a frontend keeps goes back to the +core. -## Decisions (user, 2026-09-28) +## The window's composition -1. Lapis is drawn inside the existing pane chrome; no gaps between panes. -2. Keep every whimsical effect (the six terminal transitions, GUI zoom, ripple, - glitch): the problem is their quality, so polish each until it feels good - instead of removing it. -3. Shadertoy shaders are compiled by spawning `glslc`, not by linking glslang. -4. Focus lift/dim default: undecided, ask when that stage lands. -5. The animation pacing fix goes into the no-visual-change phase. -6. Cursor blink is on by default. -7. The bundled CRT has no barrel distortion, so clicks stay exact. -8. (After trying them live) Ripple and Glitch are removed entirely; Crt stays. +Four fixed draw groups, bottom to top: the page and the panes, the +notices, the guides and the debug box the core paints over them, and the +ink (bar cursors); then the overlay (the pet, a jump's trail, the caret's +quad). Decor is flat: rules, rails, grips, spines, notice rules and bar +cursors as hard-edged rectangles read from the regions. diff --git a/docs/typ/building.typ b/docs/typ/building.typ index 972b8a97..456cbb3e 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -305,8 +305,8 @@ the hint. = Other notes `docs/` keeps the platform and design notes beside this book: -`macos.md` (the macOS shell; `web.md` says what the browser shell was), `effects.md` and -`render-pipeline.md` (visual effects), `helix-keys.md` and `selections.md` (helix parity), +`macos.md` (the macOS shell; `web.md` says what the browser shell was), +`render-pipeline.md` (a frame, and what the frontends draw on their own), `helix-keys.md` and `selections.md` (helix parity), `lsp-evaluation.md`, `ui-review.md`, `divergences.md` (bookmarks off `main`) and `open-questions.md`. `next-steps.txt` is a wishlist and `transactions.txt` records one open structural gap against helix. diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 2719717b..346b5214 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -11,6 +11,18 @@ `-Desp32p4-cols` and `-rows`, the `Peek`, `Poke`, `Hexdump` and `Gpio` words, and every limit and guard only the board needed; the desktop builds keep their capacities. +- The effects are out of the core: the panel transitions (the eleven + Panel words), the post chain (Crt, Bloom, Vignette, Grain, Shader, + ShaderAnimation and the glslc it spawned), Lift, the glows + (SelectionGlow, HoverGlow, Occlusion), ChipShadow, ThumbFlash, the + lapis ornament and Parallax (with `lapis_plain`, which lapis now is), + the message fall and dissolve (MessageAnimation, MessageFall, + MessageDissolve), the theme crossfade and Motion with its five + flavours; a PDF's scroll lands at once. What stays is the frontends': + a scroll glides (the window at the pixel, a terminal by rows) and the + window's caret eases, each on its own clock, and CursorBlink, JumpTrail + (both frontends), InactiveDim and Pet (the window's) are plain settings + the frontends read. docs/render-pipeline.md says what is left. - 9P over QUIC is gone: the `-Dquic` build with its OpenSSL, `quic!` dials for `--9p-quic` and Mount, the poll loop that served them on the editor's thread, and their tests. Unix and TCP serve and mount sessions diff --git a/src/config.zig b/src/config.zig index 50748b60..9eb95cfd 100644 --- a/src/config.zig +++ b/src/config.zig @@ -714,7 +714,7 @@ pub const Runtime = struct { /// Builtins announce themselves on the message row. verbose: bool = true, - /// The cursor blinks, a pixel shell's (docs/render-pipeline.md §5.4): + /// The cursor blinks, a pixel shell's (docs/render-pipeline.md): /// solid while typing and for half a second after, eased at each edge, /// solid again after ten idle seconds. cursor_blink: bool = true, diff --git a/src/glide.zig b/src/glide.zig index 723beba9..6f8fe9a3 100644 --- a/src/glide.zig +++ b/src/glide.zig @@ -305,7 +305,7 @@ pub const Follow = struct { pub const bodies_per_s: f32 = 15; /// Inputs this close, each the way the last went, are one stream. pub const stream_ns = 150 * std.time.ns_per_ms; - /// The spring's natural frequency, rad/s: arrivals land inside §8.1's + /// The spring's natural frequency, rad/s: an arrival lands inside /// 220 ms. pub const omega: f32 = 51; diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 8d69ed80..60b00f7a 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -1059,7 +1059,7 @@ const Gui = struct { capture_pad: u32 = 0, capture_dir: []const u8 = "", /// PARDES_TEST_SERIES: every captured frame is kept too, numbered, for a - /// feel review's frame series (docs/render-pipeline.md §8.4). + /// frame series to look at. capture_series: bool = false, captured: u32 = 0, capture_tex: ?*c.SDL_GPUTexture = null, @@ -3713,7 +3713,7 @@ fn waitInput(ctx: ?*anyopaque, timeout_ms: u32) void { // would; otherwise a wait that ran out moves it exactly to the // core's wake. // Through an edge, or woken for the next: the shell redraws the last - // frame with the new alpha, no core render (§5.5 level B). + // frame with the new alpha, no core render. if (blink_ms != null and (blink.?.edge or !got)) g.blink_due = true; if (s.test_clock) |*virtual| { if (frontendMoving(g)) { @@ -3769,7 +3769,7 @@ fn waitInput(ctx: ?*anyopaque, timeout_ms: u32) void { // limiter spins: asleep between 60 Hz frames, the CPU's clock fell // (intel_pstate, 4.9 GHz down toward 0.8) and every frame, an // input's first among them, took 2-5x as long: input-to-present p50 - // 1.9 ms spinning against 7-8 ms asleep (docs/next-anim.md). + // 1.9 ms spinning against 7-8 ms asleep. // ponytail: a core while something moves (~250 ms a scroll); a // sleep to a millisecond short of the tick if the power matters more. while (paced and !g.input_seen and s.held == null) { @@ -3989,7 +3989,7 @@ fn runDemo(g: *Gui, in: *Input, core: *pardes.Pardes) void { /// The blink now, from the frame's time since input and how long ago it /// arrived; null where nothing blinks (off, idle, an unfocused window). -/// The cursor's opacity under blink (§5.4): solid while typing and for +/// The cursor's opacity under blink: solid while typing and for /// `hold_ns` after, then on and off with an eased edge, solid again after /// `idle_ns` of no input. `edge` says whether it is mid-edge (a frame is /// owed), `next_ns` when the next edge starts (a wake). @@ -7332,8 +7332,8 @@ fn softPresentFrame(g: *Gui, cmd: *c.SDL_GPUCommandBuffer, target: *c.SDL_GPUTex defer if (frame_probe) |probe| probe.zone(.gui_upload, probe_upload); if (!c.SDL_UpdateTexture(texture, null, mapped, @intCast(sw * bpp))) return error.GpuMap; // PARDES_FRAMES_CAPTURE: every presented frame's pixels as they went - // out, and when, for a recording at the frames' own times (the - // samples of docs/next-anim.md). One write a frame; nothing else. + // out, and when, for a recording at the frames' own times. One write a + // frame; nothing else. if (frame_capture_dir) |dir| captureSeries(dir, @as([*]const u8, @ptrCast(mapped))[0..size], sw, sh); // The cell shader already produced premultiplied backgrounds with opaque // foreground ink. Copy that alpha unchanged; never modulate the full frame. @@ -7512,7 +7512,7 @@ fn bodyPixels(region: pardes.Region, layout: CellLayout) [4]f32 { }; } -/// The frame's decor, group by group (docs/render-pipeline.md §3.4), all of it +/// The frame's decor, group by group (docs/render-pipeline.md), all of it /// read from the regions and the palette: the page's rules and the panes' /// rails, rules and grip marks with the page, notice rules with the /// notices, bar cursors with the ink. @@ -8222,7 +8222,7 @@ const Caret = struct { seen: struct { owner: u8 = pardes.Region.none, line: i32 = 0, x: u16 = 0, y: u16 = 0 } = .{}, /// The default flavour's spring, as fast again as the caret follows - /// input (§8.1: it settles in 90-150 ms). + /// input (it settles in 90-150 ms). const omega: f32 = 34 * 2.4; /// The trailing corners of a jump, a little behind the leading ones. const follow: f32 = 0.85; |
