1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
# canim
Animations of how a program ran, from a `ztrace` recording, on sketchbook's
`anim` (live scenes). The frame is a debugger's whole context, as pwndbg
shows it, with one lens over it; the names, sizes and colours of everything
in it are the design language's catalogue (`../design/README.md`), and how
it moves is `../design/motion.md`. Code and design share one set of names:
a block of the catalogue is a function or a component of the same name here.
```sh
zig build record # the recordings, into zig-out/recordings
zig build run -Dscene=fib # a scene in a window, hot reload (zig build lib --watch)
zig build export -Dscene=fib -- DIR --fps 60 --size 1920x1080 # frames as PNGs (or - for raw RGBA)
zig build videos -Doptimize=ReleaseFast # every scene: out/NAME-1080.mp4 and out/NAME-2160.mp4 (x264, 60 fps)
zig build test # unit tests, each scene run headless, and the gallery against its pictures
zig build gallery # the gallery's pictures drawn anew into test/gallery
zig build bench # what a recording costs a frame
zig build bench -- NAME BY [FUNCTION] # a recording's steps (BY: moment, line, over), with what each changed
python3 tools/chart.py chart out/fib-1080.mp4 --out out/motion/fib # the designer's timing chart and checks (POP, CROWD, METRONOME, CAPTION, AIR)
```
Needs what sketchbook and ztrace need, and `setarch`, `clang` (the pass
plugin), `ffmpeg` (videos), python with numpy and Pillow (charts). The
`sqlite` scene also needs SQLite's amalgamation (`-Dsqlite=DIR`, the
directory of `sqlite3.c` and `sqlite3.h`; by default
`~/05-genizah/sqlite/sqlite-amalgamation-3500400`) and `objdump`; where
the directory is not there the scene is not made, and the rest builds
and tests as before.
Dependencies are by path (`..` is ztrace, `../../sketchbook`,
`../../02-pardes-code`); `zig-pkg` is a symlink to pardes's.
## A scene
```zig
const anim = @import("anim");
const canim = @import("canim");
const recordings = @import("recordings");
pub const background = canim.background;
pub const scene = anim.Live(frame, struct {});
fn frame(s: *anim.Frame) void {
const rec = canim.open(recordings.steps); // a recording the build made and embedded
var at = canim.cursor(s, rec, rec.lineMoment(10, rec.call("main", 0).enter));
at.levels = .{ .idea = .calls, .source_rows = 10 }; // what a step is timed by
at.journey(.line, rec.call("fib", 0).exit.?); // the clock's whole way
// The stage: the band (the lens) over the program column and the state column.
const ctx = canim.context(s, at, .{ .split = canim.layout.split.subject });
const tree = canim.callTree(s, .{ .cursor = at, .stage = ctx.stage, .function = "fib" });
const joins = ctx.ties(s); // thread, link, projection; add it last
var says: canim.Narrator = .{};
canim.establish(s, .{ ctx.clock, ctx.registers, ctx.stack, ctx.source, ctx.disasm, tree, joins });
says.line(s, "`fib` calls itself."); // old caption out, a gap, new one in, then stillness
at.walk(s, .line, rec.lineMoment(6, rec.call("fib", 0).enter)); // each step in full, timed by its content
at.hurry(s, .line, rec.call("fib", 4).enter, .{}); // a run: ramps in and out, counted on the clock
ctx.stage.relayout(s, canim.layout.split.none); // a change of split, 48 f
s.wait(canim.theme.time.before_cut);
}
```
`frame` runs every frame and builds the whole timeline each time; a
component is an `anim` object (`fadeIn`, `fadeOut`) that draws the program's
state at the cursor, at the box its `Stage` gives it now.
**The cursor** (`src/cursor.zig`) moves in steps from one moment straight to
a later one (`Recording.Stop`: `.moment`, `.line`, `.over`, `.call`,
`.syscall`). For each step it writes a timetable, a `Plan`: the cascade.
The line fires (12 f); each level the step touched strikes 18 f after the one
before (after the last of its registers, which strike 6 f apart), in the order CPU, memory, idea (a level the scene does not show, or
the step did not touch, or touched nothing drawn, gives up its slot; a
drawing made of bytes strikes when the projection from them arrives, 24 f
after them, and its write 12 f later still; a call's node when the
projection from its return address does, 36 f after); the writes of one step strike 6 f apart; a hold to read; the
mark advances last; a rest. `walk` plays steps in full, `hurry` ramps the
pace down and up again (each step 0.6 of the one before) to a run (0.30 s a
step: nothing struck, no held corner, no arc, a dump's values crossfading
over 8 f; the arcs fade back in as it ends) or a sprint, `step` takes an explicit `Plan` (`Array.swap`,
`syscalls.step`), and `continue` goes to a stop far from this one (a
breakpoint): the line it leaves fires, the registers it changed strike in
a wave 2 f apart in pwndbg's order (fill 6 f, no arm, no pulse), then
memory and the idea, a 36 f hold, the mark out and in (6 f each, the
source fading through first if far), a 24 f rest. Components read it
through `Cursor.now(at)`; the minimap reads the same values 6 f behind
(`Cursor.lag`, `time.minimap_lag`), so nothing on it starts on a primary
onset's frame.
## The scenes
| Scene | Shows | Split, lens | Recording |
| --- | --- | --- | --- |
| `title` | the series and the legend of marks | 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` |
| `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); 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 | `heap` |
| `zoom` | one line of C as its instructions, the call's bytes | `none`, the camera at x2 | `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` | `sqlite` |
| `gallery` | every block in its states | all three | `gallery` |
## The blocks
The catalogue's layers, and where each block is. Every block is drawn in
every state the code has in the `gallery` scene.
| Layer | Block | Where | Notes |
| --- | --- | --- | --- |
| 0 tokens | grid, colour, type, the splits | `src/theme.zig` | per "Token changes" (`metric.calls`, `time.pin`, `time.continue_wave`, `time.relayout_fade` there; the insn's character counts gone); JetBrains Mono NL (`.code*` faces) for all mono, Medium under 30 |
| 1 atom | `address` (`lead`, `name`, `rwx`), `value` (and `Ui.typed`: `fd`, `bool`, `char`), `arrow` (`points`, `holds`, `more`), `mark`s, `plaque` (`chip`), `pin` (`row`, `under`), `bracket` (`quiet`, `tie`, `thread`), `tag` | `src/ui.zig` (`Ui.address`, `.value`, `.arrow`, `.written`, `.corner`, `.read`, `.cellWritten`, `.cellRead`, `.current`, `.trail`, `.unknown`, `.chip`, `.pinRow`, `.pinUnder`, `.bracket`, `.panel`) | marks as mock 15's column B: `current` the white wash (`color.wash`) and the gold plaque; `struck` the softened paper (`color.struck`) with bold bright digits; `held` a turned corner (9; 12 on a lens's cell), in over the cool's last 6 f (`Heat.corner`, `time.strike.corner`); `armed`, `read` |
| | `byte` | `src/rows.zig` `bytes` | `number`, `pointer`, `text` (a string's ink), `loose` (a byte of no field: the allocator's, padding, past what a dump is of), `unread`; `pad`; `bytesAt` moves the bytes right of a long (stack) address, by the dump's widest; a write's arm, strike and held corner cover the bytes whose value changed, first to last (`Run.changed`, `Now.changedBytes`), struck a byte a frame from the low address (what a read fills, 2 f apart) |
| 2 row | `chain`, `reg` (and `rip` with the flags), `slot`, `line`, `bytes`, `call` (`span`, `callRow`) | `src/rows.zig` | `chain` follows `zt.telescope.chase`; cut at its far end, `more`. `slot`: pins from 16, the offset from rsp ranged right to 172, the address at 184, the chain, its role ranged right where the room ends, from `zt.telescope.slots` (`saved rbx`, a local's name in primary, `n, high half` for a narrower local in the word's top four bytes, `argc`, `argv[0]`, `argv end`, `envp end`, `auxv`; nothing for a return address or `.none`). `bytes`: the bracket at 24, the address at 34, the bytes 12 after it and at 132 at least |
| | `arc` | `src/rows.zig` (`Arcs`), `src/hexdump.zig` (`pointerArcs`) | a pointer to a row of its own panel: lanes at 4, 10, 16 in a dump or a loupe, 4 and 10 on the stack; longest outermost, a chain in one lane; standing at 60% toward the page, full in the step that writes or reads it and always in a loupe; rewritten: the old dashed with the arm, fading from 6 f after the strike as the new draws (12 f), quieting with the cool; a stub to the rule for a target in the region past the window, only in its step; a saved rbp's only in its step; a dump withholds the arcs an open loupe carries |
| | `insn` | `src/disasm.zig` | columns at 2, 31, 40, 134, 180, 264, 564; size words dropped from every operand, a `width` of byte cells (`metric.width`) after the `]` where no register outside the brackets has the access's size and the mnemonic does not fix it; `nop` and `endbr64` faint; a PLT target named (`401070 open@plt`); the annotation from 564 or a character after the operands, then the operands give way, never inside `[]`; `current`, `ran` (every instruction of the last three steps), `ahead`, `outside`, `waiting`, `pass`; the jump lane from the jump just before the pc's moment. The row's detail, every value the recording's at that moment: a compare's two values and the flags it leaves as chips (those the conditional after it reads; CF ZF SF OF when none); a conditional's `taken`/`not taken · reads` and its flags, `→ target` when it leaves the window, and while it runs the setting row's chips and rip's framed as read (an echo); `lea`'s `= value`; a call through memory or a register `→ target name · read from open@got, 403fd8` (out of room the slot goes, then the digits); a call through a PLT stub by the function it reaches (`the resolver` while its slot is lazy); `fs:[0x28]` as the stack's canary (`canary` where the row has no room); a `rep`'s count and step; `syscall` with its name and number, its arguments under it by register, typed (`-100 AT_FDCWD`, `O_RDONLY`), the rows they hang over giving up their own annotation; a call that has run in C's form with its result (`read(3, …) = 15`: out of room the arguments go from the right, the result stays); a memory access narrower than a word read at its width (`rows.narrow`: `7fffffffecc4 ◂ 15`) |
| | `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` | 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; 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`), 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, and what it brings, and what changed before it, is plain; 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; 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 |
| | `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; 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) 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 |
| 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; 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 drawing, the source and under it the backtrace; the disassembly; the view, the registers, and in the column's rest the stack going on, `stack, continued`; the stack from 16 words above rsp); its rows published while `ui.mapping`; the working windows outlined (2 `dim`, 4 out); the thread across the gutter (x 1008), gold; 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`), 6 f behind the frame, a stack word struck outside the stack's window flashing on it (a ring 8 to 14, 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`) |
`Recording` (`src/Recording.zig`) is the index every block reads: lines,
calls, syscalls, allocations, which registers and bytes each moment changed
and read (a debugger's `touch` reads count), each moment's `touch` and
`branch`, and each instruction's line.
## The recordings
`build.zig` records five programs of `tools/` under `ztrace record` (the
debugger: registers, the stack, what they point at, the instructions round
the pc with their lines and callees' parameter counts, what each stack
word is (`zt.telescope.slots`), at every stop: `--stack 1024 --around 256
--disasm 69`, what the map needs, except where noted), each
by a bare name in a directory of its own with an empty environment, without
address randomisation, with the tools built `ReleaseFast` (a step through
the agent's or the runtime's code is a moment, and a slow tracer stretches
the clock's retry loops it steps through). The instrumented ones are built
`-no-pie -fno-stack-protector -Wl,-z,now`: short addresses, no resolver
and no canary stepped through that the source does not say.
| Name | Program | Stops | Moments, bytes | Also |
| --- | --- | --- | --- | --- |
| `steps` | `fib.c`, static musl, `-O0` | every instruction | 1999, 431 KB (336 KB before) | |
| `hello` | `hello.c`, the system's clang and glibc, dynamic: `-O0 -g -no-pie -fstack-protector-strong -Wl,-z,now` (a PLT bound at load, no resolver; the canary) | every instruction, `--from main`, `--steps 132` (to main's return) | 166 (30 of them the loader's syscalls before main), 83 KB (233, 126 KB: static musl by line) | reads `tools/note`; PLT stubs and GOT slots named (`open@plt`, `open@got`) |
| `heap` | `heap.c` (design/mock/heap.c), the system's clang and glibc, dynamic, as `hello` | every line, `--from main` | 75, 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` | 2913, 742 KB (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 |
| `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 |
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
`touch`); a store of the same value is kept apart (`storedSame`) and
counts as assigning a local (and as a name coming to a node's pin). A register's change over a step is net: a
call's rsp put back is not struck. A call into the vDSO (the runtime's clock) is one moment, as the tracer
now records it: `list` and `sort` have `--stack 1024` like the rest. An address no symbol
holds is named from its module's first mapping (`list+2c89`).
## Motion, as measured
`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
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
for 12 f that changes in one frame and is still again. CAPTION: up over
720 f, up under 90 f + 3.6 f a character (chart.py counts the characters
of the scene's `says.line` strings as shown; where the video's arrivals
and the scene's captions do not pair up it says so and checks no reading
time), or the picture moving within 60 f of its arrival. Encoded with
`-g 600`: x264's keyframe at 10, 20, 30 s is a one-frame fade the
instrument sees. "Before" is the last pass's exports charted by this
instrument (the old scenes' captions are not the sources' now:
syscalls' and heap's reading times not checked); "after" this pass's.
| | fib | list | sort | syscalls | zoom | sqlite | heap | gallery |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| POP, before / after | 43 / 44 | 52 / 43 | 41 / 32 | 72 / 66 | 19 / 22 | 11 / 14 | 83 / 72 | 13 / 10 |
| of them the minimap's, before / after | 13 / 16 | 31 / 26 | 17 / 15 | 45 / 47 | 12 / 14 | 5 / 8 | 49 / 48 | 6 / 5 |
| CROWD, before / after | 2 / 2 | 6 / 8 | 4 / 5 | 5 / 2 | 3 / 3 | 0 / 0 | 10 / 7 | 3 / 4 |
| METRONOME, before / after | 0 / 0 | 0 / 0 | 0 / 0 | 9 / 9 | 0 / 0 | 0 / 0 | 0 / 0 | 0 / 0 |
| CAPTION up over 720 f, before / after | 0 / 0 | 3 / 2 | 0 / 0 | 0 / 0 | 1 / 1 | 0 / 0 | 4 / 1 | 0 / 0 |
| CAPTION under its reading time, after | 0 | not paired | 0 | 0 | 0 | 0 | 0 | |
| CAPTION picture moving within 60 f, before / after | 0 / 0 | 1 / 1 | 0 / 0 | 1 / 1 | 0 / 0 | 2 / 2 | 1 / 1 | 0 / 0 |
| AIR, before / after | 0 / 0 | 0 / 0 | 0 / 0 | 2 / 2 | 1 / 1 | 5 / 5 | 2 / 0 | 0 / 0 |
| seconds, before / after | 41.5 / 42.0 | 70.9 / 71.1 | 42.0 / 42.2 | 76.0 / 89.2 | 32.0 / 32.0 | 64.6 / 64.6 | 100.4 / 96.8 | 11.0 / 11.0 |
What fires, and why it is left, by kind (examined this pass):
- POP, the minimap (about half of every scene's): it follows the frame
6 f behind, but a row's stroke or a mark's block changes in one frame;
a fade of each change is not built.
- POP, registers, stack, view: a read frame that goes in one frame, a
value changing at a run (registers and stack are veiled then), a
stack window going farther than its height; the heap's drawing: a
node's value turning at the middle of its travel. The heap's pins
crossfade now; its dump comes in faded at the first malloc.
- CROWD: the advance (thread, plaques and rip as one mark, the source and
the disassembly scrolling with it), the veil coming over three panels
at a run's first step, x264's keyframes; list 0.02 and 2.52, the map
coming in and the dive's first frame.
- METRONOME: syscalls 36.77 to 39.17 is the run through libc's `open`
to its last three instructions, 0.30 s a step by design (a run).
- CAPTION over 720 f: heap 9.83, malloc's caption over its five walked
steps (12.9 s); list 21.75 and 46.58 and zoom 8.38, the captions of
their walked trips. Picture moving within 60 f: the step firing 60 f
after the caption by the narrator's lead, which the check counts from
the frame after (heap 9.83), x264's keyframe (syscalls 9.95), and
list 3.63, the falling map crossing the caption band in the dive (it
also makes list's arrivals 7 to the scene's 6).
- AIR: syscalls 13.72 and 20.10, the stage still under the two captions
that recount the descend and lead the stub's `jmp` (the review's
split); sqlite's four dense captions and its last; zoom's last.
## What is not done
- 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
PLT's resolver row and the vDSO's window are written but no recording
shows them; the descent on the map is the same component at 69 rows, not
checked. At a run the windows do not open and close in 8 f with no lane
(the syscalls scene walks every step of the descent).
- `open("note", O_RDONLY) = 3` does not fit 880 from 564 (27
characters): the arguments go from the right, `open("note", …) = 3`.
A call's arguments come from as many as the source's call writes, typed
by the system call of the function's name (`open`, `read`): a libc
function with no system call of its name has its arguments in hex.
- The heap scene's drawing and view are the scene's own components
(`Lists`, `Chunks` in `scenes/heap.zig`), not blocks of `src/`: no
second scene needs them. It is 96 s, not the storyboard's 79.4: its
steps are the engine's cascades (a call 3.1 s, a prologue 2.9 s), longer
than the storyboard's budget; its captions keep their order and leads.
`free` is stepped over as one step from its line (a continue's wave),
not as a cascade onto its call row and then the call (mock 18's
`free in libc, stepped over`). A `size` bit that changes is not struck
on its chip. The heap's map shows no arena panel and no drawing (the
scene adds its lens to the working frame only).
- The map is packed by content, but a column's rest after the
disassembly is page: the 5-row dumps round what the registers' and the
stack's pointers point at, loupes as panels on the map (and lifted
blocks on the minimap) and the map's key are not built; `continued` is
built for the stack alone. The boxes are as long as the most rows each
panel has wanted so far (`map.measure`, process-wide, a frame behind):
a scene's first frame packs by the defaults. The sqlite scene's lenses
(the backtrace, the calls so far), the heap's and the zoom scene's have
no drawing on their map.
- The minimap follows the frame 6 f behind, but its changes are not
faded: a row's stroke or a mark's block changes in one frame (most of
the instrument's POPs). A struck word outside every window flashes on
it only for the stack. Its windows are outlined a frame behind the
panels that publish them after the clock (the lens's view). The scene's
focus is not set on it.
- `dive`: every panel travels 60 f (the catalogue's 72 f is the map's
fall), so that seven of them 6 f apart land by 120 f; the drawing does
not crossfade between sizes (the list's are the same, subject on both).
Only the list opens on the map; no scene surfaces, and no sprint or far
continue plays on the map.
- A loupe hung from a register keeps to the stage but does not yet move
past the current marks or a changed row; on the 1920 stage a deeper one
hangs under the first, not 120 to its right. The catalogue's stem is 3
in its strokes and 4 in the loupe's anatomy: it is 4 here.
- An `arc`'s lane change does not glide (12 f): a lane is given each
frame from the arcs then present.
- At a run only a dump's values crossfade (8 f); a register's, a slot's
and a node's change in a frame (the registers and the stack are veiled
at a run).
- The gallery keeps the old recording of the list
(`test/gallery/list.ztrace`): on the build's list (by instruction) its
loupe page has no second loupe, the nodes being 32 bytes apart and a
loupe's five rows holding the next one's target already.
- Back pointers between nodes still run under the nodes: a page keyline
round each pin's stub and head shows them passing behind it (there is
no lane for them in `beside`).
- An `under` pin's names are in the order they came to the node (the
recording read back from the stop shown), so a name that lands where
another is stays on the right it travelled on; but one left alone
where it was on the right keeps that side only for the step in which
the other left, and takes the left at the next. A third name coming to
a pin whose two sides are taken is counted (`+1`), unless it is a
variable the scene names and a register holds the right, which it then
takes; on its way it is drawn over the right-hand name (list, 7.5 s).
A pin's count (`+1`) can run into the left-hand name of the next
node's pin (list, 26 to 57 s).
(In the stack's lane,
rsp or rbp travelling alone keeps its place among the names it leaves
and joins; both travelling to rows with other names is not handled.)
- Pins travel with `time.pin`'s times, but on `standard`, not the
catalogue's `glide`, in the stack's lane and the array; a pin in a
drawing sets off when the idea strikes (the projection's arrival),
not 18 f after its word's strike.
- The disassembly scrolls or fades over the mark's advance: 24 f where
the source's window moves too, 12 f where the mark only jumps.
- Whether the stack's window faded at a step is judged by the slots it
shows now: after a relayout to fewer, a step that scrolled may lose
its ticks.
- A frame's name on a `call` span is never cut (`metric.span.name_max`,
300 units, is not built); the calls tree's small and folded sizes are
not built.
- A link to a slot past the stack's window ends in its stub and row count:
drawn in the sqlite scene only (rsi to the struct on the caller's
stack, `23 rows`, 5.0 s; in a continue a link sets off with memory's
strike, when the window is at its new place). One to a slot above the
window would put its count over the panel's tag.
- The calls tree's leaf spacing holds for fib(5); past about ten leaves
nodes and badges collide (the catalogue's known case).
- The `pages` lens is not in the band (`Timeline` is the old far view).
- The map's and minimap's drawing flags (`ui.mapping`, `ui.strokes`,
`ui.chrome`), a dive's per-panel transforms (`context.zoomed`), the
map's measured rows (`map.held`), the ties' table and the thread's
waiting are process-wide globals, set and read in one frame's drawing
(the measured rows a frame behind); two players at once would want them
on the frame. Not moved this pass: each is read by components that the
frame reaches only through `anim.Placed`, which carries no frame state.
- A recording holds the bytes it has seen, each as last seen: it cannot
tell a byte read again and unchanged from one not read since. Memory
nothing watches (SQLite's page cache) is read at a stop only where a
pointer leads (32 bytes), so a view of it says what the stop read
(`hexdump.Fields.seen`); a syscall's buffer is shown as the kernel took
it, from its capture. The recorder should say what it read at each stop.
- A frame's file and line are known only where the recording stopped in
it: return addresses are recorded with names, not lines, so a deep
backtrace's older rows have none.
- A program's frame arguments are in the backtrace only for calls the
recording tells (an instrumented program's); at a breakpoint the
callee's are in its registers, which the scene's captions name.
- The sqlite scene changes what is over the band (the backtrace lens,
then the calls so far) and its view (the SQL at rbx, the row, the
page) by fades scripted in the scene (12 f out, then 12 f in); the
kernel's side does not bring its elements in as at `establish`.
- `zig build test` prints "failed command" for each scripted scene: that
is the run echoing its stderr (the Vulkan headless warning), not a
failure; the summary line is the verdict (none printed when it passes).
|