From 2f27fbe0aa2da0f85d599c1e5f3ac14d025f590c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 13:22:07 -0300 Subject: canim: the graph of a function's blocks From the user. A blocks lens draws a function's basic blocks as boxes with their offsets and visit counts, loops in their lanes with the turn count, the path's last edges gold, the pc's block gold, and the disassembly as its view; leave and turn carry the mark along an edge, with the compare's flags framed for the edge chosen. On the map the graph takes the disassembly's place with its rows. The layout is a pure function, tested on sort, reverse and libc's open (twelve blocks the run never reached fold into six boxes). The sort scene walks one trip of its inner loop block by block and sprints the middle on the map. Every scene's linear rows carry a rule and a count at each block's head. The stack's panel no longer reads registers from the file on every draw: a frame is 20 ms where it was 57. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- anim/README.md | 162 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 91 insertions(+), 71 deletions(-) (limited to 'anim/README.md') diff --git a/anim/README.md b/anim/README.md index cffb7aa..1401ad7 100644 --- a/anim/README.md +++ b/anim/README.md @@ -98,12 +98,12 @@ on a primary onset's frame and nothing on it changes in one. | `title` | the series (six programs, named) and the legend of the marks the scenes use | a card | | | `fib` | recursion: each call a frame and a node | `subject`, `calls` | `steps` | | `list` | a list reversed: each `next` turned; it opens on the map and dives into the frame; after the first load the pointer loaded opens in a loupe, and the `next` in it one deeper | `subject`, `nodes` | `list` | -| `sort` | insertion sort: compares and swaps | `subject`, `array` | `sort` | +| `sort` | insertion sort as its blocks: one trip of the inner loop walked a block at a time (each block's rows a cascade onto its last, then `leave` along the edge it takes: the compare's chips framed, the edge drawn gold, the mark along it, the target's count struck; `turn` up the inner loop's lane), the next trip at a run, the long middle a sprint on the map (`surface`, the gold going block to block, the counts growing, `dive`), the last value's trip walked again, the way out run | `blocks` (`graph.Blocks`; the disassembly its view over the state column, the source alone in the program column); on the map the graph with its rows (`Context.Options.graph`) | `sort` | | `syscalls` | glibc's `hello`, by instruction from main: `open` followed down (main's call ringed, the PLT's stub passed, libc's wrapper run to its last three instructions and those walked, the kernel's window at the floor with the call in C's form and `returns`, and back up), then `read`, `close`, `write` stepped over, each in three parts: the instructions before the call a cascade onto the call row, the crossing from that row with the kernel's window opening under it (the rows after it making room), the stores after it 18 f after rax | `beside`, `syscalls` (the calls so far, as strace writes them); the disassembly a `descent` (`Context.Options.descent`) | `hello` | | `heap` | glibc's malloc under a list of three: three pushes, two pops, a push, told by motion.md's storyboard (nine captions; pushes 2 and 3 at a run; each `free` and the `malloc` that takes the head back walked; what the storyboard does not narrate runs: the calls into push and pop with their prologues, the returns to main but the one under the second free's long caption); the chunks by fields (`size`, `protected`, `key`), the program's list over the tcache's free list with its `bin` (a chunk in neither list drawn in the program's row, unarrowed), the tcache in a loupe over the stack, its stem down the gutter from its chunk's row, opened in each step that changes the tcache and closed at its advance | `subject`, the scene's own drawing (`nodes` in two rows) and view, both on its map too | `heap` | | `zoom` | one line of C as its instructions, the call's bytes | `none`, the camera at x1.16 on the instructions and the stack in one view, cause and effect (the stack's window set before the move and held); the map's drawing the calls of `fib` (`Map.drawing`) | `steps` | | `sqlite` | a row's way to disk in SQLite: from `sqlite3_step` to `sqlite3BtreeInsert` (three continues, the row's struct on the stack), the commit's `unixWrite` nine calls under `main`, `pwrite64` of page 2 into the kernel, and the page read as a B-tree leaf | `subject`, `backtrace` (`Context.Options.backtrace`), then `syscalls`; its view a `hexdump.Dump`; as the caption names them, rdi's `BtCursor` opened in a loupe, then rsi linked to its row in the view (`Context.tiesWith`); the page's fields named a group at a time, 2 s apart; the backtrace lens drawn on its map | `sqlite` | -| `gallery` | every block in its states, a page or a state each 3 s | all three | `gallery` | +| `gallery` | every block in its states, a page or a state each 3 s; at 21 s the `blocks` lens (at rest, `leave` mid-way, `turn` landing, libc's `open` folded), at 24 s the graph with its rows as the map draws it, at half size (sort's panned to its loop; `open` at its `syscall`, the blocks never reached folded) | all three, `blocks` | `gallery`, and for the graph pages `test/gallery/sort.ztrace` and `hello.ztrace` | ## The blocks @@ -121,15 +121,17 @@ every state the code has in the `gallery` scene. | | `descent` | `src/descent.zig` (`Descent`, `step`) | the disassembly a call deep: the root's window on top (main), each callee's under the row that called it (that row `waiting`, ringed, its annotation the call in C's form), a PLT stub gone through kept as its `jmp`, `pass`; a head row over each window (the name at 40, Go Medium 18; what it is ranged right: `libc.so.6 · no source`, `the PLT · its jmp reads open@got, 403fd8`, `the PLT, jumped through`); the call lane at x 14; the nearest caller takes the rows the deepest does not use, all above its call row (one row after it, the return row, the callee's head directly under that), and where its function starts first the rest go back to the deepest window; three code windows at most, the rest one `more` row; each window's addresses its own width; the tag the deepest function and its module (`open · libc.so.6`); at a `syscall` (and the stop after it) the floor's three rows are the kernel's: in a crossing the lane down from the plaque (3, vellum), the window filling down, `the kernel` and `openat, system call 257`, the call in C's form, `returns` struck, `rcx, r11: clobbered`, the answer climbing the lane (24 f, `glide`), the window drawing back at the advance. A crossing stepped over opens the same window under the call row, past the arguments hanging under it, the rows after them making room (18 f) and closing up with the window. Every row keyed (an address, a head), so a step is the rows both stops have gliding and the rest leaving or arriving on its verb's timetable, in two moves, never at once: `descend` (2.9 s: the given-up rows fade 66–78, the kept ones glide 78–96, ring 84–96, lane 96–114, head 108–120, rows 114–138), on through a stub's `jmp` (2.2 s), `ascend` (2.5 s: the window closes 48–72, lane back 72–84, the kept rows glide 84–102, the given-up ones fade in 102–114), `cross` (`syscalls.step`); a row whose state the verb changes (the call row to `waiting` with its hanging arguments, a jmp to `pass`, a waiting call taking its result) crossfades; with it the source's line `waiting` (ringed, the tag `main waits at line 6 · the pc is in libc's open`, crossfading over the 12 f before the advance, as a stack span's name does) and the thread waiting (primary, 2) | | 3 panel | `registers`, `stack`, `backtrace` | `src/context.zig` | rip's value crossfading over the advance, a flag set or cleared over the 6 f it lands in (`rows.RipWas`); the backtrace newest at the bottom, `#0` last, the oldest dropped from the top (`newest at the bottom · 2 more above`), as a panel, the calls lens's view, the backtrace lens and on the map, all one block (`backtraceRows`: frames leave, slide and arrive; what a kept row says that changes, its depth, its pc's offset, its line, and the tag's count, crossfades, 12 f before the advance); the stack's window on `[rsp, rbp+16)` keeping the touched word in view, its tag the first and last word shown (`rsp+20 to rsp+48`), a word's role and offset, and the tag, crossfading (12 f from memory's strike) where the step changes them, rsp and rbp's pins travelling 18 f after rsp's strike (`time.pin`, keeping their place among the names they leave and join), at rest only where the register points; a window that moves farther than its own height (six or eight slots) fades out and in round memory's strike (12 f each; at a run half its step each), and what it brings, and what changed before it, is plain; while rows slide they keep their roles (those of both windows are read), and a word becoming a saved rbp, or no longer one, has its arc go or come with its role; a frame's name longer than the spans' room shortens the chains beside it; `call` spans and the backtrace (`#n`, name, arguments at 384, file and line) from `zt.telescope.frames`, the frames two stops share sliding to their new depth; the backtrace as a lens's drawing with `Context.Options.backtrace` | | | `source` | `src/source.zig` | the whole file in a window, its middle third; the trail's bars crossfading with the advance; numbers as wide as the program's largest line (SQLite's six digits), the text moved right by as much; a window going farther than its own height fades out and in | -| | `disasm` | `src/disasm.zig` | 17 rows (9 as subject), fewer above near a function's start; the line column as wide as the source's; two windows that overlap scroll, others fade out and in; its tag's function (a descent's tag too) crossfading with the advance | +| | `disasm` | `src/disasm.zig` | 17 rows (9 as subject), fewer above near a function's start; the line column as wide as the source's; two windows that overlap scroll, others fade out and in; its tag's function (a descent's tag too) crossfading with the advance; a 2-unit `rule` across over each block's first row (not its function's), and the block's visits by the moment shown ranged right, faint (`×3`), where the row's annotation leaves room, crossfading with the advance (`graph.Rules`, a descent's windows too); the rows clipped above the panel's padding (a row scrolling out takes its rule with it) | +| | `graph` | `src/graph.zig` (`read`, `fold`, `place`, `layout`, `Blocks`, `Map`, `Rules`) | the function's blocks from the recording (`zt.telescope.blocks`; a block of `nop` padding nothing goes to left out), their edges by how each ends, and the run over them by the moment shown: each block's visits, each edge's count, the last three edges taken, the pc's block; counted where one stop in the function follows another across an edge, and only for a recording that stops at every instruction (`exact`; by line, visits only, every edge `rule`). Laid out (`place`, pure, by the whole recording's counts, so it never moves as they grow): back edges by a walk from the entry in address order, layers by the longest forward path, the blocks that return last; in a layer a block under the predecessor that reached it most often, then under the one it falls from, a taken target never taken right of it, the more travelled first where two want one column; columns a pitch apart (the map's as wide as the pc's block with its annotation, 928; the lens's 300); a forward edge out of the bottom on its target's side (40 in, 16 in the lens; the middle when straight below), along the gap's middle, into the target's top (arrivals 48 apart), through the right channel (32 out) where it would cross a block; a back edge down 14, out to its loop's lane (16 apart from 24, the outermost farthest), up, into its header's head. Too tall for its place (`layout`), in the catalogue's order: each run of blocks the whole recording never reached (neighbours in address order joined by an edge; split where folding would make a loop the code does not have) one dashed box, `+5b to +b9 · 5 blocks never reached`; then blocks over 16 rows to four, `more`, four (not the pc's); then it pans, whole layers, to the largest loop the pc's block is in that fits, else the pc's block in the middle. The static part kept per function and form (`memo`), the moment's counts counted again each frame. `Blocks`: the lens's drawing, boxes 24 high, 60 and 10 a row wide (132 at least), the offset, the visits (`dim`), reached `raised`, not yet on the page, a fold dashed, the pc's framed gold 3; the edges never taken `rule`, taken `dim`, the trail's golds (the newest 3), a loop's turns on its lane (Go 18). `Map`: on the map two columns wide beside the source, each block a head (its address, `lines a to b`, `×n` primary) over `insn`'s rows moved 52 left, the offset where the address was (ranged right at 72); the annotation only in the pc's block (and its rows that ran in the last three steps, with their trail bars), which widens to its column, its rows' annotations kept inside it; a conditional's counts by its ports; a direct call's hook out of the block's side and back a row down, the callee named (`swap`); under a return the way out (stub 14, bar 28), a tail call's stub and name, an indirect jump's `targets not known` | +| | `blocks` lens | `src/graph.zig` (`Blocks`), `theme.layout.split.blocks` | its drawing the graph as shapes over the program column (296 high), which then holds the source alone (twenty lines); its view the disassembly itself, seven rows over the state column; the registers over six words; no thread (the disassembly is not under the source: it fades with the distance between them) | | | `hexdump` | `src/hexdump.zig` | malloc's words: a field read as `size` (`0x20 a m P`, the bits as rip's flags) or `protected` (`→ 405050 ^ 405`, `NULL ^ 405`, its arc to the pointer it protects), and a field's `note` (Go 18 faint: `key`, `top`, `slots left`); a lens's view (`hexdump.panel`): `bytes` rows and their reading, veiled at a sprint; a row whose bytes the step changed where the recording saw no write (memory nothing watches, read anew at a stop), or that became known, crossfading over 12 f (`rowPasses`); one reading for every dump (`hexdump.reading`), a list a character apart, a typed number as its type reads (`char` quoted, `bool` by name); the address room once a dump, by its widest; `Dump`, a view of a region by the fields a scene gives it (`Field`: where, how long, read as a number, big-endian or not, a pointer, text, or left to the eye), the rows that hold a field and a `more` row for each stretch left out, and where those rows outnumber the window, a window kept round the first row a mark or the step is on, the rest folded into `more` rows; marks the scene plays, and the step's only from the stop it came in at (`since`); the bytes a syscall was given as the kernel took them (`given`), and only what the debugger read at the stop (`seen`) | | | `loupe` | `src/loupe.zig` (`canim.loupe`, `Loupe.open`, `.close`) | from a register, a loupe's field, or a dump's row read by the scene's fields (`.row`: malloc's tcache, `num_slots[0]` and `entries[0]`, the rest `more`); five rows round a pointer's target, lifted (`color.lift`, `lift_tag`, `shade` 12 and 16; 20 and 26 deeper), hanging from its pointer (its tag on the row's foot, 92 left of the digits, clamped to the stage), a 4-high bracket under the digits its stem, the target's fields framed bright; one opened from the band's view lies over the stack, never the registers, its stem down the gutter's right lane (x 962), its fields struck once it has opened (6 f after, 6 f apart: `Fields.struck`); a deeper one with no room to the right hangs under the one it opens from, its stem down to its tag; a note that does not fit is cut at a word with `…`; `open` 36 f (read 6, stem and rise 18 with the shadow, the frame 6 f after), `close` 12 f; it opens again after a close | | | lenses: `nodes`, `array`, `calls`, `syscalls`, `backtrace` | `src/nodes.zig`, `src/array.zig`, `src/calls.zig` (`Tree`), `src/syscalls.zig` (`Crossing`), `src/context.zig` (`Backtrace`, `lens`) | the drawing in `band` (over the program column), its view in `view` (over the state column): `nodes` and `array` a dump (`hexdump.panel`), `calls` the backtrace with arguments, `syscalls` the calls so far as strace writes them (oldest on top, the newest coming in once it is back, held; the rows make room for it, a full log scrolling a row, 24 f, `glide`, the count above crossfading; out of room a row gives up its faint names first, then its arguments from the right, and keeps what it returned; a path by its string, the kernel's capture where the stop did not read it) over the bytes the call crossing in the step is given or fills (in with the argument framing, 12 f out and 12 f in; what a read fills landing a byte every 2 f, struck, the stack's words with them; a write's buffer framed as read while the kernel takes it; cleared with the log's new row: between crossings `no call crossing now`), `backtrace` (eleven rows as subject, five beside) a `Dump` the scene gives; an `under` pin's names in the order they came, the first left, faded out through the middle of a register's joining or leaving (`Pins.text`); a call node's look (gold, ringed, done) crossfading as the tree's moment changes (6 f), and at a sprint a new node coming in over its step; a left child's result on its left shoulder, off its parent; a view's row a register points into carries the register's `pin` at the row's end (`hexdump` `rowPin`), the reading ending before it; at a sprint the array's pins hold and move where a phrase ends | | 4 tie | `thread`, `link` (and its `pin`), `projection`, `echo` | `src/ties.zig` | panels publish places (`anchor`); `Ties`, added last, draws in the channels: a link climbs to a node by the gutter's left lane and goes down to a slot by the right, its name riding its head, a target past the stack's window a stub and a row count; to a view's row (`dump_pin`) by the left lane, into the row's edge; on a beat the narration names (`Context.tiesWith`, `ties.Beat`): the register framed as read, then its link, held, drawn back with the frame; a projection from the view's bytes, or from a frame's return address to its call's node | -| 5 frame | `map`, `minimap`, `dive`, `surface` | `src/map.zig` (`Map`, `split`, `minimap`), `Context.map` | the working frame's panels bound to a stage of 3840 by 2160 (`map.split`, packed by content: each box as long as the most rows its panel has wanted, `measure`, the backtrace's as long as the deepest call chain of the scene's way, so that it is packed once; the drawing, the source and under it the backtrace; the disassembly; the view (none where nothing draws one), the registers, and in the column's rest the stack going on, `stack, continued`; the stack from 16 words above rsp; and the first two columns' rest (`Split.spare`) given, in the catalogue's order, to `map.Spare`: a five-row dump round each place the registers (pwndbg's order, not rsp or rbp) and the 64 words up from rsp point at outside the stack and the code, none within another's rows, then the loupes open (`Map.loupes`, lifted, nine rows), then the key (the recording and the moment, the marks as drawn, the inks); only then page); its rows published while `ui.mapping` (the dumps' too); the working windows outlined (2 `dim`, 4 out), each window published with where its step took it from and how far its scroll has gone, so its outline glides; the thread across the gutter (x 1008), gold; a scene without a band can put a drawing on its map (`Map.drawing`); the minimap the same at a twentieth under the clock (text as 1-unit strokes at 45% toward the page, marks as blocks; `ui.strokes`), drawn six times into the host's images, each from the cursor's mirror a frame later (6 to 11 f behind: `Cursor.lagInto`, `time.minimap_fade`) and averaged, so that every change on it fades in over 6 f and nothing on it changes in a frame; its outlines on whole pixels at rest and between them only as they glide; a mark no working window shows (a word struck or read on the stack or in a dump the map draws) flashing on it (a ring 8 to 14 in the mark's colour, 12 f), the count ranged right at 1648; `Map.show`, `.dive` (outlines bright 6 f, veil to 24, each panel from its window to its place 60 f, 6 f apart, a panel drawn over another setting off first (drawing, view, disassembly, stack, source, registers) so that none in its place is crossed by one on its way, opaque on the way, its rows on the window's rows, its tag and rules in at the end; the map falls into the minimap's corner over 72 f, its scale on the logarithm, its corner going toward the minimap's as the scale does, small it is drawn over the panels with its edge, and crossfades into the minimap's drawing at 90–96; 120 f and 30 f still), `.surface` (the dive back, 84 f, then 30 f still); per-panel transforms through `context.at` (`context.zoomed`) | +| 5 frame | `map`, `minimap`, `dive`, `surface` | `src/map.zig` (`Map`, `split`, `minimap`), `Context.map` | the working frame's panels bound to a stage of 3840 by 2160 (`map.split`, packed by content: each box as long as the most rows its panel has wanted, `measure`, the backtrace's as long as the deepest call chain of the scene's way, so that it is packed once; the drawing, the source and under it the backtrace; the disassembly; the view (none where nothing draws one), the registers, and in the column's rest the stack going on, `stack, continued`; the stack from 16 words above rsp; and the first two columns' rest (`Split.spare`) given, in the catalogue's order, to `map.Spare`: a five-row dump round each place the registers (pwndbg's order, not rsp or rbp) and the 64 words up from rsp point at outside the stack and the code, none within another's rows, then the loupes open (`Map.loupes`, lifted, nine rows), then the key (the recording and the moment, the marks as drawn, the inks); only then page); its rows published while `ui.mapping` (the dumps' too); the working windows outlined (2 `dim`, 4 out), each window published with where its step took it from and how far its scroll has gone, so its outline glides; the thread across the gutter (x 1008), gold; a scene without a band can put a drawing on its map (`Map.drawing`); with `Context.Options.graph` the disassembly is the function's graph (`graph.Map`), two columns wide beside the source, the registers over the stack in the last column, no band (the lens's window on it is the graph whole, the disassembly's the box round the rows it shows), no thread line (the gold line number is the thread); the minimap the same at a twentieth under the clock (a graph's blocks outlined, its edges a pixel, the pc's block framed gold) (text as 1-unit strokes at 45% toward the page, marks as blocks; `ui.strokes`), drawn six times into the host's images, each from the cursor's mirror a frame later (6 to 11 f behind: `Cursor.lagInto`, `time.minimap_fade`) and averaged, so that every change on it fades in over 6 f and nothing on it changes in a frame; its outlines on whole pixels at rest and between them only as they glide; a mark no working window shows (a word struck or read on the stack or in a dump the map draws) flashing on it (a ring 8 to 14 in the mark's colour, 12 f), the count ranged right at 1648; `Map.show`, `.dive` (outlines bright 6 f, veil to 24, each panel from its window to its place 60 f, 6 f apart, a panel drawn over another setting off first (drawing, view, disassembly, stack, source, registers) so that none in its place is crossed by one on its way, opaque on the way, its rows on the window's rows, its tag and rules in at the end; the map falls into the minimap's corner over 72 f, its scale on the logarithm, its corner going toward the minimap's as the scale does, small it is drawn over the panels with its edge, and crossfades into the minimap's drawing at 90–96; 120 f and 30 f still), `.surface` (the dive back, 84 f, then 30 f still); per-panel transforms through `context.at` (`context.zoomed`) | | | `stage` and `relayout` | `src/stage.zig` | splits `none`, `beside`, `subject` (`theme.layout.split`): the band is `band` (the drawing) and `view`; `relayout` fades the drawing round its move; `holdStack` holds the stack's window for the camera, with `free` slots | | | `clock`, `caption`, `veil`, `card` | `src/words.zig`, `src/root.zig` (`Narrator`, `Camera`) | the clock still while a step plays, its piece fading in once the mark lands; a caption stays its reading time; the title card is `scenes/title.zig` | -| 6 verb | `fire`, `arm`, `strike`, `cool`, `read`, `extend`, `link`, `project`, `travel` (pins), `advance`, `cascade`, `continue` (`Cursor.continue`, `Plan.wave`), `run`, `sprint`, `establish` (`Context.establish`: a drawing's elements fade in rising, no lines), `scroll`, `relayout`, `visit`, `say` | `src/cursor.zig` (the timetable), the blocks (each draws its state at the instant) | tokens in `theme.time`; a level gives up its slot when nothing it touched is drawn (`Recording.drawn`); a label that changes in place with a step crossfades over the 12 f before the advance, or from the step's start where that is sooner (`Now.renaming`); at a run what marked a value goes with the run's ease (8 f) and a pin changes over it; at a sprint an ember and what grows come in over the step (4 f), never in a frame | +| 6 verb | `fire`, `arm`, `strike`, `cool`, `read`, `extend`, `link`, `project`, `travel` (pins), `advance`, `cascade`, `continue` (`Cursor.continue`, `Plan.wave`), `run`, `sprint`, `establish` (`Context.establish`: a drawing's elements fade in rising, no lines), `scroll`, `relayout`, `visit`, `say`; `leave` and `turn` (`graph.leave`, from a block's last row, `graph.toEnd` to get there: fire 0–12; the compare's chips framed as read from 18 (the CPU's slot, the jump's echo), held while the edge draws gold, head first, 24–42; the mark (a gold plaque, half size in the lens) along the edge 42 to 42 + 12 f and 2 f a 100 units of the lens's edge (30 f at most), up the lane for a turn; landing, the advance; the target's count armed and struck 6 f after (a turn's lane count as it lands), cooled to nothing by the step's end; the trail recoloured over 18 f from the landing; a rest of 42 f from the landing); over a graph at a walk of several blocks, a run or a sprint the trail, the counts and the gold crossfade with the advance (8 f at a run, the step at a sprint), the pan gliding with it | `src/cursor.zig` (the timetable), `src/graph.zig` (`leave`, `instant`), the blocks (each draws its state at the instant) | tokens in `theme.time`; a level gives up its slot when nothing it touched is drawn (`Recording.drawn`); a label that changes in place with a step crossfades over the 12 f before the advance, or from the step's start where that is sooner (`Now.renaming`); at a run what marked a value goes with the run's ease (8 f) and a pin changes over it; at a sprint an ember and what grows come in over the step (4 f), never in a frame | `Recording` (`src/Recording.zig`) is the index every block reads: lines, calls, syscalls, allocations, which registers and bytes each moment changed @@ -157,9 +159,14 @@ and no canary stepped through that the source does not say. | `heap` | `heap.c` (design/mock/heap.c), the system's clang and glibc, dynamic, as `hello` | every line, `--from main`, and pop's `call free@plt` (`break_call`: a breakpoint objdump finds, which a line-stepping recorder now stops at) | 77, 59 KB | `--heap` (`ztrace.heap.glibc`: chunks, the tcache, bins, the arena); `-w 0x405000,1024` (the chunks' bodies) and `-w head` (the global the list hangs from: unwatched, a recording keeps a global as last seen) | | `sort` | `sort.c`, `ztrace cc --instr vars --only sort,a` | every instruction, `--from main` | 4396, 751 KB (5154, 799 KB at `--stack 256`) | `--ring`: the variables' names and types; each `__zt_var` call is stepped (4 of them) | | `list` | `list.c`, `ztrace cc --instr vars --only push,reverse,head` | every instruction, `--from reverse` | 2920, 743 KB (2913 the pass before: the count differs by a few moments from one recording to the next, not looked into; 3369, 782 KB at `--stack 256`) | `--alloc --preload` the agent: allocator headers are read; the pushes (the agent's and the runtime's first calls) run through | -| `gallery` | the old `list` by line, kept in `test/gallery/list.ztrace` | | 134, 88 KB | the gallery's pictures depend on the drawing only | +| `gallery` | the old `list` by line, kept in `test/gallery/list.ztrace`; for the graph pages `sort` and `hello` as recorded on 11 November (with blocks), kept in `test/gallery/sort.ztrace` and `hello.ztrace` (`gallery_sort`, `gallery_hello`) | | 134, 88 KB; 776 KB; 87 KB | the gallery's pictures depend on the drawing only | | `sqlite` | `sqlite.c` (three rows into a table, committed) with SQLite 3.50.4's amalgamation, system clang `-O2 -g -fno-omit-frame-pointer -no-pie -fno-stack-protector -Wl,-z,now`, glibc | `--by break`: `sqlite3_step`, `sqlite3BtreeInsert`, `unixWrite`, and the instruction after its `pwrite64` (found by objdump); every syscall recorded, `-s 4096` | 181 (42 stops, 138 syscalls), 233 KB (139 KB) | made only with `-Dsqlite=DIR` (default `~/05-genizah/sqlite/sqlite-amalgamation-3500400`), in a new temporary directory each time; `sqlite3.c` is embedded as the source | +Every recording the build makes carries each function's blocks +(`zt.telescope.blocks`, at the first stop in it) and a `branch` event at +each stop on a jump: the graph and the linear rows' block rules read them. +The old `list` of the gallery has none, and draws none. + A recording that begins inside a call (`--from`) has that call open from its first stop (`Recording.index`, from the frame chain). Writes are the bytes whose value changed, to the element the instruction stored (its @@ -173,7 +180,9 @@ holds is named from its module's first mapping (`list+2c89`). `tools/chart.py chart` on the 1080p exports (the designer's `design/motion/motion.py`, its checks and its regions told where canim's -panels are; the clock, ranged right at 1648, its own region, whose count +panels are (sort's the `blocks` split's: the drawing, the view that is +the disassembly, the source alone, the registers and the stack); the +clock, ranged right at 1648, its own region, whose count changing in a frame is no POP; the caption's box from 940, under the clock's count and a run's step counter; the minimap its own region, secondary action, and its one-frame changes POPs). POP: any region still @@ -198,67 +207,43 @@ under the caption, which does not change. | | fib | list | sort | syscalls | zoom | sqlite | heap | gallery | | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| POP, before / after | 14 / 11 | 14 / 13 | 8 / 6 | 26 / 25 | 7 / 11 | 7 / 8 | 21 / 17 | 5 / 8 | -| of them the minimap's, before / after | 5 / 5 | 7 / 6 | 2 / 1 | 16 / 17 | 4 / 6 | 3 / 3 | 9 / 8 | 3 / 4 | -| POP exempt, before / after | | keyframe 3 / | | keyframe 2 / | | keyframe 2 / | | cut 3 / cut 3 | -| CROWD, before / after | 4 / 4 | 8 / 9 | 6 / 7 | 3 / 3 | 3 / 1 | 0 / 1 | 15 / 16 | 4 / 4 | +| POP, before / after | 11 / 12 | 13 / 13 | 6 / 3 | 25 / 25 | 11 / 12 | 8 / 8 | 17 / 19 | 8 / 9 | +| of them the minimap's, before / after | 5 / 5 | 6 / 6 | 1 / 2 | 17 / 17 | 6 / 6 | 3 / 3 | 8 / 10 | 4 / 4 | +| POP exempt, before / after | | | | | | | | cut 3 / cut 5, keyframe 1 | +| CROWD, before / after | 4 / 3 | 9 / 8 | 7 / 10 | 3 / 3 | 1 / 1 | 1 / 1 | 16 / 16 | 4 / 5 | | METRONOME, before / after | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | | CAPTION up over 720 f, before / after | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | -| CAPTION under its reading time, before / after | not paired / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | | -| CAPTION picture moving within 60 f, before / after | 1 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | -| AIR, before / after | 0 / 0 | 2 / 0 | 0 / 1 | 2 / 0 | 1 / 1 | 5 / 2 | 0 / 0 | 0 / 1 | -| seconds, before / after | 42.0 / 42.0 | 84.5 / 81.7 | 42.2 / 42.2 | 89.2 / 83.8 | 33.6 / 33.5 | 64.6 / 62.9 | 78.1 / 78.6 | 11.0 / 21.0 | - -"Before" is the last pass's "after", measured with x264's adaptive -quantization, whose keyframes re-quantized still regions (the `keyframe` -exemptions, and a still picture broken in two: sort's last 4.6 s, an AIR -now). zoom's POPs grew because its camera now shows the disassembly and -the stack's chains with the stack (annotations taking their value in -place, 18.10 and 19.60 s; offsets crossfading, 12.80 and 16.40 s); -the gallery's because each state is held 3 s and its view re-windows at a -state's first frame (9.00, 12.62, 15.40 s), as before. - -What this pass fixed at the block (every scene that draws the block gets -it), an effect shown before its cause first, found on the last pass's -exports: - -- A write's bytes took their new value at memory's landing, before their - own arm (any write 6 f or more after the first of its step: sort's first - swap, the heap's first free, its chunk's words and the tcache's header). - Each run now keeps its old bytes, and their reading (by its old field - where the step retypes it), through its arm until its own strike lands - (`hexdump.keepOld`, `Now.shownAt`, a stack word too); a write on a frame - the step has already left (a callee's words under rsp) takes no place - among the strikes, so sort's two elements strike 6 f apart, not on one frame. -- A register's chain read memory as of the stop after the step from the - CPU's strike: rsi's `Hello, k` 2 s before `read` wrote it. It reads it as - the panels show it; its later hops fade out from the bytes' strike and - are followed again 4 f after the word's last byte lands (`Now.following`), - never gone in a frame. -- What a crossing's first part struck had its cool cut as the crossing - began (read, write): the crossing's plan carries the cool on - (`Plan.cooling`); an fd's `"note"` fades in with its framing. -- The list's dive played twice: the minimap's drawings overwrote where the - falling map's windows are, which the panels set off from (`map.minimap` - keeps `window_px`); the thread, which came in a frame at the landing, - fades in after it (`context.thread_shows`). -- A stack window going far at a run faded out in a frame (the 12 f before - memory's strike lie before a run step's start): it fades out and in round - a turn that fits the step (syscalls 56 s). -- Rows sliding out of the stack's window lost their roles (fib 6.50, - `saved rbp`, `saved rbx`), and an arc was drawn from the row above the - window that is there only for a slide: the roles of both windows are - read; arcs join rows on show; a word becoming a saved rbp has its arc go - with its role. -- The system calls' log scrolled a row in a frame as a crossing began - (sqlite 38.67): it scrolls with the row's arrival, its count crossfading. -- sort's source jumped 3 lines at a sprint's phrase end: the mark travels - over the sprint's step. -- Under the camera a free word rsp reached became a slot in a frame (zoom - 19.6 s): it crossfades as memory strikes. -- `changedBytes` read its own result as it wrote it (a Zig result-location - hazard): a strike could cover bytes that kept their value (a Debug build - panicked on it). +| CAPTION under its reading time, before / after | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | | +| CAPTION picture moving within 60 f, before / after | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 | +| AIR, before / after | 0 / 0 | 0 / 0 | 1 / 1 | 0 / 0 | 1 / 1 | 2 / 2 | 0 / 0 | 1 / 1 | +| seconds, before / after | 42.0 / 42.0 | 81.7 / 81.7 | 42.2 / 63.8 | 83.8 / 83.8 | 33.5 / 33.5 | 62.9 / 62.9 | 78.6 / 78.6 | 21.0 / 27.0 | + +"Before" is the last pass's "after". The sort scene is new (the `blocks` +lens and the map's graph, against the array scene's 42.2 s), and the +gallery has two pages more; the other scenes changed only by the linear +rows' block rules, and their counts are within one of the last pass's: +fib's 27.53 (the ran rows' annotations as the sprint begins), zoom's 19.25 +and 21.85 and syscalls' 28.23 are in the last pass's exports at the same +frames, counted now; the heap's minimap has two more. + +What this pass built (`graph`, design/README.md's "graph" and motion.md's +"A block left"), and what it fixed at the block on the way: + +- The graph: its layout (`graph.place`, unit-tested on sort's, reverse's + and libc's `open` recordings in `test/recordings.zig`), the `blocks` + lens, the graph with its rows on the map and its blocks on the minimap, + the block rules on every scene's linear rows, `leave` and `turn`, the + run and the sprint over it (the gold, the trail and the counts + crossfading with each step's advance), and the gallery's two pages. +- `Stack.watched` read each stop's registers from the trace file, ten + reads a stack drawn and seven stacks a frame with the minimap's: most of + a frame's time once the scene had run a while (sort's draft 57 ms a frame, + about 20 after). It reads the recording's index. +- The disassembly's rows were clipped at the panel's rule, not above its + padding: a row scrolling out showed in the padding (a block's rule there + came and went in a frame). They are clipped above it. +- `surface` did nothing in a scene that had not opened on the map: the + map's object was never shown. It shows it. Right in one frame, and exempted by name: the encoder's keyframes and the gallery's cuts (above). @@ -273,25 +258,60 @@ What fires still, by kind (located on this pass's exports): - The stack: a few pixels in the arcs' lanes and the pins (fib 8.20, 19.50, 24.90, 39.13; syscalls 29.13, 57.72, 70.17; sqlite 20.43, 31.75). - Registers: a held corner, a few pixels at a value's top left (fib 21.10, - sort 14.88, syscalls 44.32, sqlite 38.67). + syscalls 44.32, sqlite 38.67). - The source and the disassembly: syscalls 17.92 and 55.62, the line going `waiting` and back with the descent's rows; zoom 18.10 and 19.60, an annotation taking its value in place under the camera. - The view: syscalls 64.77, the read's first byte landing over the buffer's dots; the gallery's view re-windowing at a state's first frame. -- The drawing: fib 33.63 the calls tree's badge corner; sort's index pins - sliding where a sprint's phrase ends; the heap's runs (its 16 CROWDs - too: the calls and returns it does not narrate). +- The drawing: fib 33.63 the calls tree's badge corner; the heap's runs + (its 16 CROWDs too: the calls and returns it does not narrate); the + gallery's 22.38, a struck count's digits going to their ordinary face at + the middle of its cool (the catalogue's `cool`). +- The map filling the frame: sort 32.25, at the sprint on it, a few pixels + of the map's panels changing in place at the sprint's pace. - AIR: sort's and zoom's last picture (the last caption read, then held); sqlite 32.95, after the continue to `unixWrite`, and 46.02, where the chart misses the read frame on one byte (`0d`) at 47.5 s: the picture is still 1.5 s and then 2 s; the gallery's atoms page, 3 s by design. - CROWD: the advance (thread, plaques and rip as one mark, the source and the disassembly scrolling with it), the veil over three panels at a - run's first step. + run's first step; sort's `surface` and `dive`, every panel at once by + design. ## What is not done +- The graph (`graph`): the map draws the disassembly as its graph only + where the scene asks (`Context.Options.graph`: sort); the catalogue has + it whenever the recording has the function's blocks. Not built for the + rest: the descent on the map (graphs stacked, the caller folded to its + call), a list scene that opens on the map and dives out of a graph, a + 2 510-block `sqlite3VdbeExec`. `spread` and `gather` are not built: in a + `surface` and a `dive` the working rows and the lens fade on their way + (`context.Zoom.shows`) instead of gliding into their blocks. A finished + loop is not folded; a fold is not named (`multi-threaded: a cancellable + call`) since no scene names one; an indirect jump's taken targets do not + become edges. The pan is by whole layers to the largest loop the pc's + block is in that fits: sort's ten layers do not fit the lens (its outer + loop is 284 of 270), so the lens pans three times a trip round the outer + loop (24 f, `glide`). A function change (the pc going into another + function with blocks) is not crossfaded: the graph changes in a frame, + and sort ends at its `ret` for that. A count struck as the mark lands + cools to nothing by the step's end (no held corner: the steps after do + not keep it); at a walked step across several blocks the counts, the + gold and the trail crossfade with the advance, nothing struck. On the + map a `leave`'s plaque fades out of its row (6 f) as the mark sets off + from the block's port, and in at the landing; it does not slide along + the rows to the port. The pc's block widens no further than the right + channel: a block in the last column has no annotation room. A + `syscall`'s or call's arguments hang only as far as the block's last row. +- Sort's recording is the instrumented build: eleven blocks (`setg`, a + `test`/`jne`, two blocks of a lone `jmp`), not mock 22's eight; its + prologue (25 rows, the instrumentation's calls) folds on the map to four, + `more`, four, and the map pans to the outer loop. Mock 22's exit sits in + the second column; here it is under its fall-through's block, as the + catalogue's rule has it, and its edge runs in the right channel. + - The descent: the kernel's three rows are kept at the floor from the `syscall` to the stop after it, so the rows under the call move up again a step later. The fold past three windows (`2 calls: fib fib`), a lazy -- cgit v1.3