# Motion How things move in a canim frame, in what order, and for how long. [`README.md`](README.md) gave durations and curves. This is the direction that uses them, written after measuring the first five scenes frame by frame. Where the two disagree this one wins; its figures are tokens, see [Tokens](#tokens). Times are at 60 frames a second: "12 f" is twelve frames, 0.20 s. **Since the design language** ([`README.md`](README.md)): the blocks this page moves have names there, and its [verbs](README.md#6-verbs) are this page's charts in one table. The direction below stands. What reads differently now: - There is no head. The step counter and the progress line are the `clock`, and it moves as this page says the progress line does: still through a step at a walk or a run (the step's piece of gold fades in once its mark has landed), sweeping at a sprint. - In the context a strike arms with a 2-unit frame, pulses out 3 units, and cools to nothing, leaving the `held` corner where this page says ember and bar. A lens's cell cools to a bar along its bottom edge. The cool starts with the advance, whenever that is. - Tags of variables and registers are `pin`s. A pin is one thing and [`travel`](README.md#6-verbs)s along its lane; it never jumps. - `extend`: a chain whose first hop is struck is followed again hop by hop, 4 f apart, each fading in over 6 f. - `link`: 6 f after a register's strike its old `pin` fades (12 f) and the line draws from the register's row to the thing it now points at, head first (24 f, 36 f over 400 units, `standard`). The pin lands with the head and settles (12 f). At the advance the line draws back into the pin (18 f). "Its plaque slides" and "its tag travels", below, are this. - `project`: the idea's slot in the cascade is a tie. When bytes in the dump, or a frame's return address on the stack, are read or struck, a bracket takes their row (6 f) and a line draws from them to the part of the drawing they are (18 f; 30 f over 600 units; `standard`). The drawing reacts when the line arrives and not before: its bytes are always 18 f ahead of it. Out with the advance (18 f). - `advance`: the `thread` (the bracket on the source line, the brackets on its instructions, the line between) moves with the plaques and rip, as one mark, last. - `establish`, for a lens: its view first; then its elements come in beside their rows, 2 f apart in address order, with no lines (six lines at once would break the budget of three). - The levels of the cascade are places in one frame: the pc's annotation and the registers (CPU), the stack's slots and the dump's bytes (memory), the drawing (the idea). The order and the 18 f between them are the same. - The camera rests at x1.5 as well, and that is its usual scale: a frame of 1195 by 560. At x2 the frame is 896 by 420. It always returns. - Above the working frame there is the map, the same moment with every panel whole, and in each pane of the working frame its column of the map, small, as its minimap. A scene goes between them by `dive` and `surface` (below, "The map and the working frame"). - Down is deeper: a call the narration follows opens its callee's window under the call row and the kernel's under a `syscall` (the [descent](README.md#descent)); the answer comes back up the same lane. The backtrace lists the newest at the bottom. - `current` is a white wash across the row and the gold plaque; a strike's paper is a softened vermilion, and cools to nothing; `held` is a turned corner, which fades in over the cool's last 6 f. - The disassembly is `tied` to the stack by default ([`insn`](README.md#insn)): a row names the word it touches, and a walked step's [`touch`](README.md#4-ties) draws from the row to the word in memory's slot, before the word reacts. A read is a cause: a load's word is reached and read before the register it fills is struck. Charts: "A word touched", "The stack's own instructions". ## What was measured The five scenes as exported (30 fps, build of 13:01), with [`motion/motion.py`](motion/motion.py): a timing chart of each ([`motion/charts/`](motion/charts)), contact sheets of every transition looked at ([`motion/sheets/`](motion/sheets)), and five rule checks. | | fib | list | sort | syscalls | zoom | | --- | --- | --- | --- | --- | --- | | seconds | 30.8 | 39.3 | 36.6 | 13.8 | 25.8 | | CROWD: three or more panels begin on the same frame | 75 | 43 | 44 | 4 | 5 | | POP: a change with no frames in between | 68 | 40 | 35 | 0 | 1 | | METRONOME: longest run of evenly spaced steps | 68 at 0.25 s | 15 at 0.25 s | 36 at 0.25 s | 4 at 3.0 s | | | walked steps exactly 1.5 s apart | 8 | 7 | 14 | | | | seconds between the first caption and the first step | 0.0 | 1.5 | 0.0 | 0.0 | 0.0 | Three things account for nearly all of it: 1. **A step spends itself on its first frame.** The line's mark, the registers, the bytes and the idea drawn from them all start together and are done in 0.25 s; then 1.25 s of stillness. One change is seen, three are missed, and nothing says which caused which. 2. **Steps tick.** A walked step is 1.5 s whether it moved a line or pushed a call through four panels. 3. **Run is a strobe.** 0.25 s a step with nothing eased: whole panels replaced four times a second, for 17 of fib's 31 seconds. ## The direction ### What motion is for Four jobs, and a movement that does none of them is a cut: - **Where to look next.** An onset pulls the eye. So onsets come one at a time, and each is where the next thing to understand is. - **What caused what.** Cause moves first; its effect follows. Order on the timeline is the argument. - **This is the same thing.** What persists slides; what begins or ends fades. A plaque that teleports is two plaques. - **Now.** A change has an instant. The strike marks it; everything before is preparation and everything after is reading time. The viewer listens, reads and watches, and can do one of the three well. Nothing moves while a caption arrives. Nothing arrives while something moves. The eye takes about a quarter of a second to get anywhere, so two onsets in different panels are at least 0.30 s apart. ### A step is a sentence A step is one line (or one instruction) doing its work. It is drawn in the order it would be said: > *this line* → *changes this* → *which changes that* → *next.* 1. **Fire** (12 f). The current mark is on the line about to run. Its plaque pulses once. Nothing else moves. 2. **Effects, a level at a time**, 18 f apart, in the order they were caused: CPU (registers), then memory (bytes, words, the heap strip, the locals table), then the idea drawn from them (stack cards, call tree, list nodes, array cells). A level the scene does not show gives up its slot. Each effect is *armed* for 12 f (a frame round the cell, the old value still in it) and then struck. 3. **Hold.** 36 f after the last strike, 12 f more for each further value, 84 f at most. The gold line and the vermilion values are on screen together: the line, and what it did. 4. **Advance** (12 to 24 f). The mark moves to the next line. This is the step's follow-through and the next step's anticipation. 5. **Rest** (24 f). The next line is read. **The mark goes last.** The exported scenes move it first, and so does the working tree's `cursor.lead` (`source = 0.0`). That is a debugger's convention, and it puts gold on the line that has *not* run while the strikes show what the line before it did: in `list` at 5.27 the mark lands on `n->next = head;` as `7` is struck into `value`. Execute, then advance, and gold always names the cause of what is red. A step's length follows from its content: | A step that | Frames | Seconds | | --- | --- | --- | | only moves the line | 12 fire + 12 advance + 24 rest | 0.8 | | writes one register (or one word, or one cell) | 18 + 36 + 12 + 24 | 1.5 | | writes a register and memory | 36 + 48 + 12 + 24 | 2.0 | | makes a call, three levels shown | 150 + 36 + 12 + 24 | 3.7 | | returns from one | 144 + 36 + 12 + 24 | 3.6 | | swaps two cells | 90 + 36 + 12 + 24 | 2.7 | | crosses into the kernel | see the chart | 3.7 to 5.1 | A level with nothing on screen to change gives up its slot: a step whose writes all land outside every window is a step that only moves the line. So a walk has the program's rhythm and not a clock's. ### The principles, here **Timing and spacing.** A change takes 0.1 to 0.6 s and is then held for at least twice that and at least as long as it takes to read: | To read | Seconds | | --- | --- | | that something was struck | 0.25 | | a byte, a small decimal | 0.3 | | a group of four hex digits | 0.5 | | the end of an address against another (nobody reads twelve digits) | 0.6 | | a line of code, first time; again | 0.8; 0.3 | | a caption | 1.5 + 0.06 a character | | a frame of n panels, on first sight | 1.0 + 0.5 n | Spacing is where the frames of a move fall. Measured on the swap in `sort` the card is fastest on the first frame it moves and slows from there (35, 24, 17, 13, 10, 8, 7 pixels a frame), then creeps for eight frames more: a jump and a crawl, not an arc ([sheet](motion/sheets/sort-20.4-swap-onion.png)). The curve does that, not the duration; see the next principle. Duration follows distance: the mark takes 12 f for one row and 2 f more for each further row; a flight 30, 36 or 48 f. **Slow in and slow out.** Three curves do the work. | Curve | cubic-bezier | Peak speed | For | | --- | --- | --- | --- | | `standard` | 0.3, 0, 0.2, 1 | 2.6 x mean, a quarter of the way in | the mark, cards, tags, arrows growing, rows making room: things that answer the program | | `glide` | 0.45, 0, 0.55, 1 | 1.8 x mean, at the middle | things with weight: a value in flight, the camera, a layout, a colour cooling | | `linear` | | | time itself: the progress line, a counter, the playhead; and opacity | `standard` today is 0.2, 0, 0, 1: half the distance in the first fifth of the time, a peak of 4 x mean on the second frame. `camera` today is 0.65, 0, 0.35, 1: 4% of the way after a fifth of the time, then 2.9 x mean. Both read as a pop with a tail. `enter` (0, 0, 0.2, 1) starts at full speed and is kept only for a fade that rises 8 units; `exit` for a fade that leaves. A strike is not eased in position, because nothing moves; its fill comes in over 6 f so that a cell does not flash in one. **Anticipation.** The eye is told where before it is told what. | Before | The cue | Frames | | --- | --- | --- | | a line runs | its plaque pulses | 12 | | a value changes | a 3-unit write-coloured frame round its cell, old value still inside | 12 | | a pointer turns | its old arrow goes dashed and faint | 12, with the arm | | a value flies | it lifts: a card, 1.12 of its size, 6 units off the cell | 6 | | the camera moves | a bright frame on the target; everything else leaves | 24, 18 | | the pace changes | the steps before it shorten or lengthen | 3 or 4 steps | | a caption's subject | the caption, alone on a still frame | 60 or more | No wind-up: nothing draws back before it goes. (`cursor.anticipation`, a cell shrinking before its pulse, should go; on a 46-unit cell it is two pixels of cartoon.) No anticipation at run or sprint. **Staging.** One idea at a time. - One onset at a time, 18 f apart. Two panels that show the same bytes (the heap strip and the words) start together; only the one in focus pulses. - What cannot be read at the current pace is veiled: the registers, the stack and the disassembly from the first shortened step of a run, and at a sprint the source and the band's view as well (see Pace). What is not the subject of a camera move is gone before it starts. - The subject is never at the edge. At x2 the rows about to change are in the middle of the frame, and no row is cut by the stage's edge. A stack under the camera holds its window still, so a push fills a row in the middle of the frame instead of scrolling the whole panel at its edge. - A layout is stable. A row, a node, a card or a divider that appears makes room first; nothing else jumps because it came. - One caption at a time. The old one leaves (12 f), six frames of nothing, the new one arrives (18 f). Two captions crossfading are an unreadable third ([sheet](motion/sheets/zoom-08.7-out-and-in.png), f304). **Follow-through and overlapping action.** The cascade is the overlap: each level starts while the one before is still solid. After that: - A strike is followed by its cool, 36 f later, starting as the mark leaves. The digits change face at the middle of the cool, where the colour is moving fastest and hides it. - A pointer's word strikes first; its arrow leaves 6 f later and takes 24 f; the row or node it lands on is framed bright for 12 f. The cell is the cause, the arrow the consequence, the landing the point. - Of two things doing the same (two flights, four registers read, sixteen bytes copied) the second starts 6 f after the first; bytes of one write, 1 f apart, low address first; bytes copied by the kernel, 2 f apart. - What leaves has left before what replaces it arrives. - Nothing settles by bouncing. A flight's card is back to size on its last 6 f and the strike is its impact. **Arcs.** Ideas move on arcs; the machine moves on wires. - A value between cells of an array, or between nodes: an arc a quarter as high as it is long (34 to 120 units), on `glide`, so it is slowest at lift-off and landing and quickest over the top. A swap is one over and one under. The arc stays inside the drawing's lanes (lowered if it must), and the card passes under names and pins, never hiding them. - A value between a register and memory, or across the kernel's line: along a square-cornered path, as a flow arrow draws it. Machines do not lob. - A variable following a pointer (`cur = cur->next`): its pin travels along the drawing's bottom lane, under the arrow it followed. - The mark moves straight up and down its gutter. The camera moves in a straight line and zooms by ratio (interpolate the logarithm of the scale), or the first half of a move to x2 looks twice as fast as the second. **Secondary action.** Embers, bars, the trail, flag chips, result badges, the step counter and the progress line. They never start on a frame where something primary starts, never travel or scale, and only fade. If one of them draws the eye it is too strong: the digit pop at the middle of each cool does, in every scene, 0.8 s after each strike. **Exaggeration and appeal.** The look is sober, so the budget is small and spent in three places: the pulse of a strike, the lift of a flight, the fire of a line. Appeal here is exactness: everything lands on the grid, on whole pixels, on the beat; the same event takes the same frames every time. No bounce, no elastic, no rotation, no blur, no smear frames. **Squash and stretch.** Only the pulse, and not as a scale. At 8% a register's cell grows 27 units sideways and 3 up, and two struck rows merge ([sheet](motion/sheets/fib-02.2-register-strike-and-cool.png), f70). The pulse is an outset of 4 units on every side, whatever the cell's size, drawn over its neighbours; the digits do not move. **Pose to pose.** Every rest state is a still that was designed (the mocks). Motion is the way between two of them and is never the only place something is shown. ### The rhythm of a scene **Open.** The opening is read under its first caption, not before it: seven seconds of stillness before anything happened was the first videos' longest flaw. | Frames | | | --- | --- | | 0 to 48 | the panels fade in, 18 f each, 6 f apart: registers, stack, source, disassembly, the band's view, the drawing's panel | | 30 to 54 | the drawing's elements fade in rising 8 units, 2 f apart in address order, each with its row's quiet bracket | | 60 to 78 | the first caption arrives | | 78 to 198 | still: the caption and the picture are read | | 198 to 240 | the first step fires, by 240 (4.0 s) at the latest | **Beats.** The beat is 0.5 s. Steps are as long as their content; a *phrase* (one trip round a loop, one call and its return) ends with a rest of one beat. Three steps and a rest is a bar, and a loop is heard as bars. **Breath.** A caption is up 60 f before the first step it describes fires (120 f for a scene's first), and holds a beat longer after. It is on screen at least 1.5 s + 0.06 s a character, and at most 12 s; if there is nothing to say for longer, the scene is too long there. Captions change only in a rest. A sentence that would need three lines is two captions, split at a phrase rest. The numbers an author checks are in the catalogue's [caption](README.md#clock-and-caption). **Pace.** | | A step | What is drawn | Veiled | When | | --- | --- | --- | --- | --- | | walk | by content, 0.8 to 3.0 s | everything | nothing | the first time anything happens, and whatever the narration names | | run | 0.30 s | the mark glides (8 f); cards, nodes, arrows and pins ease (8 f); no strikes, no held corners, no arcs drawing: values change in place under 8 f crossfades, and what the run changed is shown settled when it ends (its arcs fade in, 8 f); no fire, arm, pulse, link or projection | registers, stack, disassembly | a pattern seen once in full; 24 steps at most | | sprint | 0.067 s or less | the drawing grows; embers; the mark and the pins only at phrase ends; the clock sweeps | the same, and the source and the band's view | everything longer | A run keeps its bars: 12 f of rest at each phrase end. A sprint does not. **Changing pace** is never a switch. - Into a run: four steps, each 0.6 of the one before (1.5, 0.9, 0.54, 0.32). Out of it: three steps lengthening the same way, then one beat of stillness before the walked step that the run was heading for. - On the first shortened step the panels that cannot be read at speed take the veil (50%, in over 18 f with its fire); on the last step back to a walk it lifts (18 f, with the advance). Under the veil the values go on changing, without marks: the veil says "not now", not "nothing". - The clock: at a walk and a run it is still while a step plays, and the step's piece of gold fades in once its mark has landed (12 f; 8 f at a run), the count changing as the fade starts: moving every frame of a walked step it would be a secondary action that never stops. In a sprint it grows linearly with the recording: the only thing on screen that says "fast". - The caption says it too: "and so on, down to `fib(1)`". **Close.** The last step's hold, then 2 s on the finished picture. A scene ends on its result, read. ## Timing charts Frames at 60 a second from the step's first frame. *Arm* and *strike* are always the same sub-chart: | Frames | A strike at frame s | | --- | --- | | s-12 to s | arm: a 3-unit frame in write's colour inside the cell's edge, in over 2 f; the old value unchanged | | s to s+6 | the fill (`b54f42`) comes in, linear; the digits become the new value, bold, bright, at s+3 | | s to s+12 | pulse: the fill's edges go out 4 units and back, sine | | s+6 to the advance | solid (at least to s+36) | | the advance to +24 | cool, on `glide`, the paper to nothing; digits to their ordinary face at its middle; the turned corner fades in over the last 6 f | | then | the corner for three steps; out over 36 f, linear, in the step after | ### A register written | Frames | | | --- | --- | | 0 to 12 | fire | | 6 to 18 | arm on the value cell | | 18 | strike (to 24 in, to 30 pulse, to 54 solid) | | 54 to 66 | the mark advances, `standard`; the cool starts (to 78) | | 66 to 90 | rest | Two registers by one step: the second is armed and struck 6 f after the first, in the order they were written. rip is not one of them: it is the current mark's, and moves with the advance. ### Memory written The same, one slot later if a register was struck too: arm 24 to 36, strike 36. Drawn as bytes, only the bytes whose value changed are armed and struck, 1 f apart from the low address. The heap strip's mark is the same strike at scale, without a pulse. Hold to 84, advance to 96, rest to 120. A word outside the window: the window scrolls first (the stack's or the dump's, 24 f, `glide`, whole rows, until the word is in its middle rows), and only then is the word armed; the level's slot starts after the scroll. A row that was not in the grid: the rows below glide down 18 f, the row fades in 12 f, and only then is it armed. An unknown byte that becomes known without being written fades from dots to digits in 12 f, with no mark. ### A value read | Frames | | | --- | --- | | r to r+6 | a 3-unit frame in read's colour and its ember, fading in; no arm, no pulse | | to the advance | held | | advance to +18 | out | A read is in the slot of its level. It is gone before the next line fires: in `sort` and `syscalls` read frames stand through the rest and vanish in one frame. ### A word touched Under `tied` ([mocks 44, 45](mock/44-tied-store.png)): the row names the word and the touch carries the eye from the row to it before it reacts. A store, `next = cur->next`'s last instruction, `mov [rbp - 0x18], rax` (no register changes, so memory has the first slot): | Frames | | | --- | --- | | 0 to 12 | fire on the row | | 18 to 30 | the touch draws from the row's end across the gutter to `next`'s word, head first, `standard`, in write's vermilion | | 30 to 42, 42 | arm, strike: the word (`405010`), and the row's value with it, an echo | | 60 to 90 | the idea: `next`'s pin travels under its node, 18 f after the strike | | 90 to 126 | hold | | 126 to 138 | advance; the touch draws back into the row (12 f); the cool starts | | 138 to 162 | rest: 2.7 s with the idea, 1.9 without | A load, `mov rcx, [rbp - 8]`: the read is the cause, so it goes first. | Frames | | | --- | --- | | 0 to 12 | fire | | 18 to 30 | the touch, in read's colour, to `prev`'s word | | 30 to 36 | the word framed `read`, and the row's `prev` with it | | 36 to 48, 48 | arm, strike: rcx (`405050`) | | 54 to 78 | rcx's link climbs the gutter to its pin under the node of 9 | | 78 to 114 | hold: the thread, the touch and the link, the three lines | | 114 to 126 | advance; the touch, the frames and the link draw back | | 126 to 150 | rest: 2.5 s | A store of the value its word already held (a `push rbp` over a frame's old saved rbp, `cur = head` over a word that held head's value): the touch lands, the arm's frame comes and goes (12 f) and nothing is struck. With `carry = .arrow` ([mock 56](mock/56-carry.png)) the load is one gesture, the row reaching into memory and the value coming back: fire 0 to 12; the touch to `prev` 18 to 30, framed 30 to 36; the touch draws back as the carry leaves the word, up the gutter's right lane to rcx, 36 to 54; rcx armed 54 to 66, struck at 66, the carry drawing back 66 to 84; rcx's link 72 to 96; hold, advance: 2.8 s. The store draws its carry and no touch: fire; rax framed read 18 to 24; the carry down to `next`'s word 24 to 42; armed 42 to 54, struck at 54; the carry back with the strike; `next`'s pin 72 to 102: 2.6 s. A word outside the window: the window scrolls (24 f) before the touch draws, and the touch draws to where the word now is. At a run no touch is drawn: the names change in place under the run's crossfade. With `carry = .after_touch` a store draws both, the row naming the word and then the value going there: the touch to the word first (18 to 30), then the source register framed read and the carry down from its row to the word, the word armed and struck as it lands; what follows (rsp's pin climbing onto a pushed word) only after. The introduction's `push rbp` (III4) is drawn so, and there a store of the value the word held is struck as any write, its mark gone by the step's end and no corner held: the store is the event the viewer is being shown, and the carry would otherwise land on nothing. ### A pointer written | Frames | Memory | The idea (one slot later) | | --- | --- | --- | | s-12 to s | arm on the word; the old arrow goes dashed and faint | | | s to s+6 | strike | arm on the node's pointer square, from s+6 | | s+6 to s+30 | the new arrow draws along its lane, head first, `standard` | strike at s+18 | | s+30 to s+42 | the row it lands on: a bright 3-unit frame, then 12 f out | its arrow draws, s+24 to s+48 | | | | the node it lands on framed, s+48 to s+60 | | s+6 to s+54, +18 | the old arrow, dashed, holds, then fades | the same | A pointer made null draws no new arrow; the old one still lingers, in both panels (today only the nodes keep it). ### A pointer followed `cur = cur->next`. | Frames | | | --- | --- | | r to r+6 | the `next` word, and the node's pointer half, framed as read | | s = r+18 | the variable's own word (a local on the stack) is struck: it is where the address was written | | s+18 to s+48 | `cur`'s pin travels along the drawing's bottom lane to the node it now points at, `glide`: 30 f to the next node, 36 f to one farther | Low level first: the word changes, then the pin moves. Where the variable is a register, its strike is in the CPU's slot and a `link` carries the pin instead. A pin that appears (`next` the first time) fades in rising 8 units over 12 f; two names that meet on one node keep their sides, and a name that joins or leaves cross-fades over 12 f. ### A call pushed Three levels shown: the registers, the stack, the tree ([mock 12](mock/12-calls-subject.png) is its frame 108 as it was drawn before the order below; [mock 46](mock/46-tied-call.png) is this order on `reverse`'s call, instant by instant). The instruction's order: the word the call writes comes before the pointer that moves onto it. | Frames | | | --- | --- | | 0 to 12 | fire on the line that calls; its call row says `fib(2) · rsp -8` | | 6 to 18, 18 | arm, strike: `rdi`, the argument, set by the line's instruction before the call | | 24 to 36 | the call row fires within the line's step; the touch draws to the free word over rsp | | 36 to 48, 48 | arm, strike: the return address in it, while rsp has not moved | | 54 to 78 | rsp's pin climbs onto the word (24 f, `glide`), `-8` on it, the bracket over the word; the new frame's `call` span (gold, `fib(2)`) grows with the pin, the old going to rule and dim; its `backtrace` row fades in | | 78 | rsp struck as the pin lands, the row's `-8` with it | | 84 to 90 | the new backtrace row's bracket (`project`): the frame the return address made | | 90 to 120 | the projection draws from it into the gutter beside the drawing and along the drawing's bottom lane to the place of the new node, 30 f, `standard`; the edge draws from the caller's node, arriving with it | | 120 to 126 | the callee's node fades in gold; the caller's goes from gold to a waiting ring | | 126 to 150 | the window follows: the rows glide down a slot, two free words over rsp again | | 150 to 186 | hold | | 186 to 198 | the advance: the mark on the calling line cools to the trail, out 6 f; in 6 f on the callee's first line (the panel scrolls first if it must); the projection and the touch draw back | | 198 to 222 | rest: 3.7 s | Under `whole` the same, less the touch: the return address is armed at 24. A call is a jump: the mark does not cross the lines between ([sheet](motion/sheets/fib-02.2-mark-crosses-seven-lines.png): seven lines in five frames). ### A return The `ret` reads before anything moves, and rsp falls last. | Frames | | | --- | --- | | 0 to 12 | fire on the `return` | | 6 to 18, 18 | arm, strike: `rax`, the answer, set by the line's instruction before the `ret` | | 24 to 36 | the `ret` row fires; the touch (read's colour) draws to the return address | | 36 to 42 | the return address framed as read; the frame's backtrace row takes its bracket | | 42 to 72 | the projection, in read's colour, draws from that row to the node, 30 f | | 72 to 84, 84 | arm, strike: the node's result on its shoulder, rax's digits; the node goes from gold to done, the caller from waiting to gold | | 90 to 114 | rsp's pin falls past the word, which goes quiet (`free`); the frame's span shrinks with the pin and fades as it ends, its backtrace row with it (`exit`); rsp struck as the pin lands (114) | | 120 to 144 | the window follows | | 144 to 180 | hold | | 180 to 192 | the mark jumps back to the caller's line (6 out, 6 in); the projection and the touch draw back | | 192 to 216 | rest: 3.6 s | The answer's tie is its digits: rax's and the badge's are the same number, struck one level apart. A line from rax would be a sixth thing in the frame saying what the digits say. ### The stack's own instructions The move of rsp or rbp is the event of these steps, and is seen as a move: the rows hold, the pin travels row by row with its amount on it, the rows it crosses are gained or released, the frame's span rides it, and the window follows only after it has landed ([stack](README.md#stack), mocks [46](mock/46-tied-call.png) and [47](mock/47-tied-prologue.png), each instant numbered in its order). Under `tied`; in each, nothing downstream is armed or marked before what is upstream of it has shown. | Instruction | What fires · what travels · what lands · what answers, in frames | | --- | --- | | `push rbp` | fire 0 to 12 (the row: `rsp -8 · saved rbp`) · the touch to the free word over rsp 18 to 30 · the word armed 30 to 42 and struck at 42 (rbp's own value already there: the arm's frame alone) · rsp's pin climbs onto it 48 to 72, `-8` on it, the bracket over the word, the span stretching, the role `saved rbp` fading in as the pin reaches the row; rsp struck at 72 with the row's `-8` · the window follows 78 to 102 · hold, advance, rest: 2.6 s | | `mov rbp, rsp` | fire 0 to 12 (`rbp = rsp`) · rbp's pin flies from its row (main's saved rbp, or in from the window's foot) up the lane to rsp's, 18 to 48 (rsp slides aside 36 to 48 for it) · lands at 48, rbp struck · the offsets' base becomes rbp, the tag's note crossfading 48 to 60, no digit changing · hold, advance: 1.9 s | | `sub rsp, N` | fire 0 to 12 (`rsp -0x18 3 words`) · rsp's pin climbs N/8 rows, 18 to 42 for three (24 f and 6 f a further row, 48 at most), the amount counting as it crosses each row, each row brightening from `free` and its role fading in as the pin reaches it, the bracket and the span under it; where the headroom is not room enough the rows slide down under the pin for the rest, one move · lands, rsp struck with the row's amount · the window follows (if it did not on the way) · hold 24, advance: 1.8 s | | `add rsp, N` | fire · rsp's pin falls N/8 rows (the same times), each row it leaves released to `free` and its role fading, the span shrinking · lands, rsp struck · the window follows when more than two free words stand over rsp: 1.7 s | | `pop rbp` | fire 0 to 12 (`rsp +8 · saved rbp`) · the touch (read) to the top word 18 to 30 · framed 30 to 36 · rbp's pin flies to its new row (or out at the window's foot as a stub, `3 rows`) 42 to 72, rbp struck as it lands · rsp's pin falls a row 78 to 102, the word left `free`, the base going to rsp (crossfade); rsp struck at 102 · the window follows · advance: 2.6 s | | `leave` | fire (`rsp +0x20 · saved rbp`) · the touch (read) to the saved rbp 18 to 30, framed 30 to 36 · rsp's pin falls to it and past it to the return address, 42 to 90 (the locals and the saved rbp released as it passes, the span shrinking to the return address), rsp struck at 90 · rbp's pin flies to the caller's base 96 to 126, rbp struck as it lands · the base to rsp · the window follows · advance: 3.0 s | | `enter N, 0` | `push rbp`'s order, then `mov rbp, rsp`'s, then `sub rsp`'s, one after another in one step: 4.2 s | | `call`, `ret` | "A call pushed", "A return", above | **Paces.** At a walk as above. At a run the pins still travel and are seen: 8 f and 2 f a row (16 f at most), drawn over the veil with the bracket, the span and the rows' gain or release, no amount on the pin and no touch; the window follows in the same 8 f. At a sprint, on the map: rsp is the newest frame's edge on the stack column, moving with each moment (4 f), the spans growing and shrinking with it: a deep recursion reads as the column growing down and coming back. ### The line changes | | Frames | | | --- | --- | --- | | to a line 1 to 8 rows away, in view | 12, and 2 a row beyond the first, 24 at most | slides, `standard`; the number appears in the plaque when it lands | | a call, a return, more than 8 rows | 6 out, 6 in, the in starting as the out ends | the old place takes the trail's first colour | | to a line out of view, within a window's height | 24 before the mark moves | the text scrolls by whole lines, `glide`; never a cut | | to a line farther than that (another function, line 42 290 after 80 895) | 12 out, 12 in, before the mark moves | the window fades through: scrolled, it would only blur | The trail shifts without animation. ### A system call `openat(AT_FDCWD, "note", O_RDONLY)`, followed down to libc's `syscall` row ([`descent`](README.md#descent)). The kernel is under the program: its window opens under the row, at the floor of the descent. Stepped over (a line that calls the wrapper, not followed down), the same window opens under the call row instead. | Frames | | | --- | --- | | 0 to 12 | fire on the `syscall` row | | 18, 24, 30, 36 | `rax`, `rdi`, `rsi`, `rdx` (and `r10`, `r8`, `r9` as the call has them) framed as read, 6 f each, the argument rows hanging under the `syscall` row with them (`echo`): only those that hold the argument at the stop shown | | 48 to 72 | the crossing lane draws down from the plaque, 3 units, vellum, `standard` | | 66 to 78 | the kernel's window opens where it lands, the vellum filling down from the lane's head | | 78, 84 | its head, then the call in C's form, each fading in over 6 f | | 120 to 144 | a call with work: a flow draws from the kernel's window up the gutter to `buf` in the view (`read`; for `write` the bytes are framed as read first and the flow goes down) | | 144 to 176 | the bytes strike 2 f apart; no pulse | | 180 to 186 | `returns` takes the value, struck: the kernel answers before the answer travels | | 186 to 210 | the answer climbs the lane to the `syscall` row | | 198 to 210, 210 | arm, strike: `rax`, as it lands | | 216, 222 | the registers the call clobbers, `rcx` and `r11`, 6 f apart; the band's log takes its new row (12 f, secondary) | | 222 to 258 | hold | | 258 to 270 | advance: the kernel's window draws back up into the lane (12 f) and the lane into the plaque as the plaque moves on | | 270 to 294 | rest | The result is stored only after the kernel has given it: `returns` has the value before rax, and rax before anything the caller does with it, never the other way round. A call with no bytes to move (`open`, `close`) does not wait: it goes from 84 straight to `returns` at 108, the answer climbs 108 to 132 in its full 24 f, and the step is 3.6 s; one that moves bytes, 4.9 s. The band's view changes with the arguments' framing (18 to 36): the last call's bytes out (12 f), this one's in (12 f), a path or a buffer handed in whole, a buffer the kernel fills as dots until 144 to 176; it is cleared when the log takes the row. **Stepped over.** A line that calls libc's wrapper (`n = read(f, buf, 32);`) is three parts, in the order the machine does them; the kernel's window opens under the call row, and the wrapper is not shown. | Frames | | | --- | --- | | 0 to 12 | 1, the instructions before the call, a cascade: fire on the line | | 6 to 18, 18 · 12 to 24, 24 · 18 to 30, 30 | arm, strike: the argument registers, in the order the instructions set them (`rdx` 32, `rsi` buf, `rdi` 3), the disassembly's trail following them | | 36 to 48, 48 | a store the line makes before the call, in memory's slot | | 60 to 72 | the plaque advances onto the call row; the line stays current | | 72 to 90 | 2, the crossing, on the chart above with its frame 18 at 72 (no second fire): the arguments framed with their new values, 6 f apart, the view's bytes changing with them | | 102 to 126 | the crossing lane, from the call row's plaque down to the kernel's window under it | | 120 to 132 | the window opens and its call fades in | | 198 to 230 | the bytes the kernel fills strike, 2 f apart (none for `open` or `close`, whose `returns` comes at 162) | | 234 | `returns` | | 240 to 264 | the answer climbs to the call row | | 264 | rax struck as it lands | | 270, 276 | `rcx`, `r11` | | 270 to 282, 282 | 3, the stores after the call, in their own slot 18 f after rax: `n`, `[rbp - 0x34]` | | 282 to 318 | hold | | 318 to 330 | advance; the kernel's window draws back up into the lane | | 330 to 354 | rest: 5.9 s for `read`; `close`, with no bytes and no store, 4.5 s | The order is the claim: no register is framed as an argument before the instruction that set it has struck, the kernel shows nothing before the lane lands, and nothing the caller does with the result moves before rax. A step that makes more than one call (a continue through a library) is not a crossing: the log takes the calls, oldest first, 2 f apart, and the step is a `continue`. Nothing on the kernel's side changes before frame 66: the kernel does not know the call until it has crossed. ### A call followed down `call open@plt`, followed into the stub and on to libc's `open` ([mock 16](mock/16-descent.png)). Its first 60 frames are any call's. | Frames | | | --- | --- | | 0 to 12 | fire on the call row | | 18 to 30 | the touch to the free word over rsp | | 30 to 42, 42 | arm, strike: the return address, `main+45` | | 48 to 72 | rsp's pin climbs onto it, `-8` on it, the stub's span arriving; rsp struck as it lands (72) | | 78 to 102 | the stack's window follows | | 108 to 120 | the caller's window closes round its call row, first move: the rows it gives up fade out (those after its return row, and from its top as many as the callee needs) | | 120 to 138 | second move: the rows it keeps glide up to their places, `glide`. Never both at once: a row gliding over a row fading is text on text | | 126 to 138 | the call row's gold plaque becomes the waiting ring | | 138 to 156 | the call lane draws down from the ring, head first, `standard`, to the head's place directly under the return row | | 150 to 162 | the callee's head fades in rising 8 units as the lane reaches it | | 156 to 180 | its rows fade in top down, 2 f apart, 12 f each | | 180 to 192 | the advance: the plaque lands on the callee's first row; the source's line goes `waiting` (6 f) where the callee has no source | | 192 to 216 | rest: 3.6 s | The stub's `jmp`, the next step, reads its GOT slot: fire (0 to 12); the slot framed as read in memory, on the map or in a loupe, and the row's annotation names it (18 to 24); the stub's other rows fade (24 to 36), then its `jmp` row, `pass`, glides to its place (36 to 54, `glide`); the lane runs on from it to `open`'s head (54 to 72); `open`'s head and rows come in as above (66 to 96); the stack span's name and the source's tag crossfade to `open`'s (84 to 96, 12 f, never in a frame); advance (96 to 108). A jump is not a call: nothing is pushed. **Back up.** `open`'s `ret`: | Frames | | | --- | --- | | 0 to 12 | fire on `ret` | | 18 to 36 | the touch (read) to the return address, and its frame | | 42 to 66 | rsp's pin falls past it, the word released to `free`, `open`'s span shrinking away; rsp struck as it lands | | 72 to 96 | the stack's window follows | | 96 to 120 | `open`'s window closes, its rows fading bottom up, 2 f apart, 12 f each, its head last; the stub's `pass` row with it: the return skips the stub | | 120 to 132 | the lane draws back up into the ring | | 132 to 150 | main's window opens in the reverse of its closing, first move: the rows it kept glide back down to their places, `glide` | | 150 to 162 | second move: the rows it gave up fade in | | 162 to 174 | the ring becomes a trail bar, the call's annotation takes its result (`= 3`, 6 f), and the plaque lands on the row after the call; the source's line from `waiting` to `current`, its tag crossfading | | 174 to 198 | rest: 3.3 s | A descent is a beat the narration names, and each of its steps is walked: at a run the windows open and close in 8 f with no lane drawn, and at a sprint the scene surfaces to the map, where the disassembly column is the descent whole. ### A continue A stop far from the last: a breakpoint hit, thousands of instructions on. The levels are the cascade's; what is in them is not one write each. | Frames | | | --- | --- | | 0 to 12 | fire on the line the program left from | | 18 to 18 + 2n + 6 | the n registers that changed strike in a wave, top to bottom in pwndbg's order, 2 f apart; the fill in over 6 f; no arm, no pulse | | then 18 f | memory: the stack's window scrolls to the new frame (24 f) when that is within its own height (twelve slots as the subject), else fades out (12 f) and in (12 f) with no marks; a dump the scene keeps follows its region the same way | | with it | the backtrace: frames that end fade out (12 f); frames both stops share slide to their new depth (24 f, `glide`); new ones fade in (12 f) | | then 18 f | the idea: the lens's drawing reacts, or a lens the scene brings comes in | | 36 f after the last strike | hold | | 12 | the advance: the mark jumps (6 out, 6 in), the source and disassembly fading through first when the new line is farther than a window | | 24 | rest; the clock's gold for every moment passed fades in at once | A dozen registers struck on one frame is a flash that says only "a lot"; the wave says it in about 0.6 s and lets the eye run down the panel with it. ### A call stepped over A call the narration does not follow down, told at the CPU: what it gives back first, as the call's event, then everything else it left changed. The introduction's `call malloc@plt` in push (II6, [mock 60](mock/60-regs-call.png)). | Frames | | | --- | --- | | 0 to 12 | fire on the call row; its annotation, the callee and its arguments hanging under it (`malloc`, `rdi 0x10 16`), in full ink | | 18 to 24 | the argument registers framed as read, 6 f apart, each with its hanging row (an echo) | | 24 to 36 | still: the call runs. Nothing of the callee is drawn | | 36 to 48, 48 | arm, strike: rax, the result; its chain followed again (`extend`) | | 48 to 54 | the row's annotation becomes the call in C's form and its result, `malloc(16) = 405050`, the result struck with rax (an echo); the hanging rows go | | 66 to 66 + 2n | the n other registers the call changed, a wave, 2 f apart in pwndbg's order, no arm, no pulse (rcx, rsi, rdi); a chain whose later hop changed takes its corner there (r11's), the flags that changed theirs | | 36 f after the last strike | hold | | 12 | the advance: the mark to the row after the call; the clock's gold for the callee's moments fades in with the step's own (162 for malloc) | | 24 | rest: 2.4 s with three in the wave | A call with no result (a `void` one: push, seen from main) has no rax strike, and its first mark is the wave's. Free words over rsp that the callee used (its return address, its frame) take their new values in place, faint and unmarked, as `free` words are drawn. At a run the whole call is one run step. ### A register's parts `reg`'s [`parts`](README.md#reg) opened for a step that names one, walked: the introduction's `mov edi, 0x10` (II5, [mock 59](mock/59-regs-parts.png)). The order is the regroup's read the other way: the word first, then its bytes, then the names they go by, and only then the instruction. | Frames | | | --- | --- | | 0 to 6 | the register framed as read, where the beat says its value first (push's argument, 9) | | 12 to 30 | `unpack`: the rows under it make room, three for rdi's parts (18 f, `glide`) | | 30 to 42 | its value spreads into its eight bytes, the pairs opening apart, the zeros in front coming in at `pad` (12 f, `glide`) | | 42 to 66 | its parts' rows, widest first (`edi`, `di`, `dil`): each its bracket and its name, 12 f, 6 f apart | | 66 to 90 | still: read | | 90 to 102 | the step: fire on the instruction's row | | 108 to 114 | the operand that names a part (`edi`), the part's row and its bytes in the register's row framed as read together (an echo) | | 114 to 126, 126 | arm, strike: the bytes whose value changed (`09` to `10`), 1 f apart from the low end; the row's annotation, `rdi 0x10 16`, struck with them | | 126 to 162 | hold | | 162 to 174 | the advance; the cool (24 f) | | 192 to 228 | `pack`: the parts' rows fade (12 f); then, one move, the bytes close into the value as `value` writes it, `0x10 16`, while the rows under it close up (24 f, `glide`) | | 228 to 252 | rest: 4.2 s | ### A pointer written in a panel of rows `n->next = head` where both nodes are rows of the dump: the bytes and the [`arc`](README.md#arc) between their rows are one event, the bytes first. | Frames | | | --- | --- | | s−12 to s | the arm on the word's bytes; the old arc, if its target was on screen, goes dashed | | s | the strike on the bytes that changed | | s+6 to s+18 | the old arc fades; the new one draws from the word's row along its lane to the target's row, head first, `standard`, full ink | | the advance to +24 | with the cool, the arc quiets to its standing ink | A pointer only read (`cur->next`) brings its arc to full ink with the read (6 f) and back with the advance. Where the new target is off the panel, the old arc fades and nothing replaces it, or a stub to the panel's rule if the target is in the same region but out of the window. ### A block left On a function's graph, in `rings` ([`graph`](README.md#graph); mock 24 is reverse's loop, 25 sort in the frame): in sort, `jne` decides between the swap and the inner loop's way out. The cause is in the disassembly under the source; the decision is told in the drawing over it. | Frames | | | --- | --- | | 0 to 12 | fire on the `jne` row under the source; the pc's pill's gold frame pulses with it | | 18 to 24 | the chips it reads (`zf`), on the `test` row above, framed as read: what decides | | 24 to 42 | the edge it takes draws gold, 3 units, head first, `standard`: round the inner ring to the swap's block (taken, 58 units), or out of the pill's foot down the ring's tangent and under it to `+5d` (not taken: the inner loop's way out, 318 units) | | 42 to 54 (60) | the mark travels the edge: the gold plaque, its point the way it goes, leaves the pill, `glide`, 12 f and 2 f a 100 units, 12 f at least, 42 f at most: 12 f round the ring, 18 f down the way out; the pill it left cools to the trail; the disassembly's plaque moves with the advance as ever | | 54 (60) | it lands on the target's pill: the advance | | 48 to 60, 60 | arm, strike: the target's count, `×5` to `×6` | | 54 to 72 | the oldest of the three trail edges cools to `dim` | | 72 to 96 | rest: 1.6 s (1.7 down the way out, every time after the landing 6 f later) | **A loop's turn** is the same round the ring: from the latch, round the ring's foot, up into the header at 9 o'clock; the one thing that goes back, and it goes back the way the ring turns. The mark keeps its speed (sort's inner arc, 58 units, and outer, 50: 12 f each). The count at the ring's centre is armed as the mark leaves the latch and struck as it lands, `4 turns` to `5 turns`: the mark going round the circle and the number in its middle going up are one picture, the picture of iteration. The ring does not move; only the mark and the gold behind it do. **The first time** (`reach`): an edge the run has not taken before is `rule` until the mark sets off along it, and draws in gold under the mark as any taken edge does; its target, quiet until then (on the page, its offset faint, no count), fills to `raised` as the mark lands (12 f), its offset brightening, `×1` fading in (6 f) and struck. Nothing about a block is shown before the run gets there. **A fold opening** (`unfold`): as the mark sets off into a fold of blocks not reached yet, the pills beyond it make room along the layout's own way, round the ring or down the layers (24 f, `glide`), the dashed pill splits into its blocks, quiet, in their places (12 f, 2 f apart in address order), and the mark lands on the one reached (`reach`). A fold only opens; what a viewer has seen placed stays where it was, or moves only along its ring or its column. **At a run and a sprint** the rings are at their best: a pass is a path, and a loop is the mark going round. At a run the mark goes pill to pill in 8 f, each edge it takes flashes gold and cools in 8 f, the counts change in place; nothing is struck. At a sprint, on the map, the gold moves only when the block changes (4 f at most), the three trail edges follow it, the turns tick at the rings' centres, and the linear disassembly's gold row moves with it; the picture settles at the phrase's end: the counts are where the run left them, the heat of the path in their numbers. In the frame (a sprint the scene keeps there) the same, the source and the disassembly veiled. ### A pointer opened A `loupe`, on a beat the caption names: `rdi` has just taken the next node, and the heap round it is opened beside it. | Frames | | | --- | --- | | p to p+6 | the pointer's hop framed as read | | p+6 to p+24 | the stem draws from the end of its row to the loupe's place, head first, `standard` (30 f where it is longer than 1200 units) | | p+6 to p+24 | the loupe rises with it: fading in over 12 f from 8 units lower, its shadow growing from nothing to 12 and 16 over 18 f, `standard` | | p+30 to p+36 | its target's bright frame | | p+36 to p+96 | held: the caption reads it | | q to q+36 | from a pointer inside it, the next opens the same way, over its lower rows, its shadow 20 and 26 | | the advance after | close, the deepest first: the stem draws back (12 f), the loupe sinks, fading as it falls 8 units (12 f); the other 6 f after | Two loupes at most; a third closes the first as it rises. Nothing else moves while a loupe rises: it is a beat of its own, or the idea's slot of a step, never two at once. At a run or a sprint none opens. ### A swap The compare in the step before is its anticipation: both cells framed as read. Low level first: the bytes change, the tie carries it, the cards fly. | Frames | | | --- | --- | | 0 to 12 | fire on the `swap` | | 6 to 18, 18 | arm, strike: the first element's bytes in the dump (a run of its type; only the bytes that change) | | 12 to 24, 24 | arm, strike: the second's | | 24 to 30 | the first run's bracket; the second's echoes on its own row at 30, with no line | | 30 to 48 | the projection draws from the first run to its cell, 18 f | | 48 to 54 | the first card lifts (1.12, 6 units off its cell) | | 54 to 60 | the second lifts | | 54 to 84 | the first flies over, `glide`, 30 f for neighbours | | 60 to 90 | the second flies under, under the index pins' names | | 84, 90 | each lands: back to size on its last 6 f, then its cell is struck | | 90 to 126 | hold | | 126 to 138 | advance | | 138 to 162 | rest | Each cell keeps its old digits, faint, until its own landing. Its bar (`held`) is on the cells whose value changed, and on no other. ### A node linked `n->next = head` is a pointer written (above). A node allocated: | Frames | | | --- | --- | | slot 0 | the heap strip's block fades in, 12 f; in the words, rows make room (18 f) and arrive with dots (12 f) | | slot 1 | the node fades in, 12 f, with dots in both halves, at its place in the row; nodes after it glide aside first (18 f) | `head = n`: `head`'s word is struck; its arrow redraws to the new node as for any pointer; the other nodes glide to their new places 18 f after the arrow lands. ### A word read `regroup`, walked, on the return address's eight bytes (`72 12 40 00 00 00 00 00` at `7fffffffebc8`, the dump's first word: at a function's first instruction rsp points at the way back; [mock 37](mock/37-regroup.png) draws it on the older list recording's `b0 18 00 01 00 00 00 00`), from the beat's step. The camera is at x2 on the dump the whole time, with the room over it that the bytes fly in; the dump is built where the stack panel will stand. What the viewer must leave with: which byte is the low one (the first in memory), the order they are read in (the last first), and that the sixteen digits are the same eight bytes. | Frames | | | --- | --- | | 0 to 18 | sixteen a row to eight: every row glides down as many rows as there are rows above it, making room (`glide`) | | 18 to 30 | each right half goes down a row, under its left half (`glide`) | | 30 to 48 | and left, to the bytes' column (`glide`); the new rows' addresses fade in, 36 to 48. Down, then left: a half never passes over a byte | | 48 to 66 | the veil over every row but the walked one; the dump's header fades, leaving its row to the offsets (it comes back as the veil lifts) | | 66 to 92 | its offsets fade in over its bytes, in the header's row, `+0` to `+7`, left to right, 2 f apart, 12 f each (`column`) | | 84 to 96 | `low byte` left of `+0`, `high byte` right of `+7`, in the same row: outside the run, never under another row's bytes | | 96 to 108 | still: the question is on screen | | 108 to 258 | the bytes fly, the low byte first, one at a time: byte k lifts at 108 + 18k, 24 f, so that the next lifts as it comes down and none crosses another in the air. Each goes straight up off its place to 40 over its row (clear of the offsets standing there), over, and straight down onto its pair's place in the word's field, the pairs 30 apart and ranged right (`glide` across, the rise and the fall each a quarter of the flight). In the air it is bright and bold on its own ground of page, its offset riding 22 over it; the offset lands over it, so the field reads `+7` to `+0`. `low byte` goes as its byte lifts and comes back right of `+0` as it lands (the word's last pair); `high byte` goes as `+6`'s byte lifts (it stands where `+6` lands) and comes back left of `+7` as its own lands. Its place in the dump takes a faint copy, fading in from a third of the flight (12 f): nothing is ever printed over it, and no row of memory is crossed | | 264 to 276 | the gaps close: the pairs glide right to sixteen digits, `0000000000401272` (12 f, `glide`); the offsets and labels fade with them (closed, their pairs would touch) | | 276 to 288 | a faint bracket under the zeros in front, `zeros in front` under it on a ground of page only as wide as its label, fades in | | 288 to 300 | still | | 300 to 312 | the zeros and their bracket fade: `401272`, ranged right where it was | | 312 to 342 | still | | 342 to 360 | the veil lifts | | 360 to 458 | the other fifteen at a run: rows top down, 6 f apart, each word fading in (8 f) as its bytes dim (8 f), each as the stack will write it (an address bare, a number as [`value`](README.md#value) writes it: `0x100000000`) | The bytes fly, not copies of them, so that at the lift there is nothing under them; the faint bytes left in the dump are what stays of where they were. Eight flights at once would cross; one at a time, low byte first, the order of the landing is the order of the reading, and over the row there is room for one. ### The address space enlarged The whole first, deliberately: the bar grows from the top down (72 f, `standard`), its ends' addresses and its size (18 f), then the 2-unit lines of every mapping at its ends (12 f each, over 72 f). Then `enlarge`, a box a cluster, from its start e: | Frames | | | --- | --- | | e to e+6 | the cluster's line on the whole framed bright (2 units, 3 out) | | e+6 to e+78 | the ride, `glide`: the box's left corners travel the magnification's two lines from the line to their places, the lines drawn behind them; the box is as tall as they are apart and goes from the bar's width to its own; its bands are drawn at its scale all the way, so the hairline swells, a mapping stays a 2-unit line until it is taller, and the gaps between them open (the 1.3 MiB under the loader appears as page) | | e+66 to e+78 | the bright frame on the line fades | | e+78 to e+90 | the box's page lines fade in | | e+90 on | its names, rows top down, 2 f apart: an edge's leader draws from the box (6 f), then its address fades in (12 f); a band's row fades in (12 f); a file's bracket and name with its last row | The stack's box rides first, the libraries' at e+78 (as the stack's lands), the program's in a beat of its own: three rides one after another, never two at once, in address order, so the eye goes down the stage with them. The camera is still (x1): the whole stays on screen, and the box is the magnification's own picture, not a camera's. A dump's place (the introduction), from its step l, after the last box's names: | Frames | | | --- | --- | | l to l+6 | the `tie` bracket on the dump's rows, in the stack's ink | | l+6 to l+42 | the `link` draws from the bracket's top, head first, `standard`: up into the top margin, across the gutter and the program column, down onto the stack's box | | l+42 to l+54 | the head lands; the stack's band framed bright (6 f in, 12 out); with it, never before, the dump's addresses take the stack's ink and its header goes (12 f): the place is said, so the header's words give way to its ink | | the next beat | the link and the bracket quiet to standing (24 f, `glide`, 60% toward the page) and stay while the dump and the space share the frame | A visit to it (I8) at x2 frames the stack's box and the dump's top rows together, so that the link standing between them is whole and no label is cut at the frame's edge (only the dump's rows run on out of it). At that scale the 128 bytes are still far thinner than a unit, so their place is marked: a 2-unit tick across the box in the stack's ink at the dump's address, `128 bytes` over it left of the link's head (12 f in once the camera has landed, held 60 f, 12 f out before it goes back). ### The camera In, to x2: | Frames | | | --- | --- | | before | the level's caption has been up at least 60 f; nothing is mid-step | | 0 to 24 | a bright 3-unit frame on the target (6 f in) | | 12 to 30 | everything else on the stage fades out; the head and the caption stay | | 30 to 102 | the move, `glide`, on the logarithm of the scale; the frame fades over its first 12 f; the rail's gold square slides to the level | | 102 to 138 | still | Out is the same backwards: the move, then the other panels fade in 6 f apart, then 36 f still. Sideways at x2 (registers to stack) is not out and in: the target fades out (12 f), the next fades in at x2 (12 f), the rail's square slides. 0.5 s instead of 2.6. On the stack the window holds still from the frame on the target to the way back: it is set before the move so that the slots the visit's steps will write are in its middle, with `free` slots above rsp for the pushes. A push fills one of them; rsp's pin climbs to it (24 f, `glide`), rbp's travels the same way, and no row of the panel moves. The frame at x2 is 896 by 384 units, on the 24-unit grid: the panel's tag and as many whole rows as fit, with the rows the next steps will change in the middle third. If they move out of it the frame glides a whole row (24 f) between steps. The stage clips what the camera shows at y = 112 and 888. Two seconds at x2 without a change and the camera should not be there. ### The map and the working frame The working frame's panels are windows onto the map's columns, and each pane's minimap is its column, small, with its window drawn on it. Going between the two is the most cinematic move there is, and the rule for it is the camera's: the viewer never loses where they are. So it is one continuous move, in which nothing appears and nothing jumps: the windows rise out of the map and become the panels, and the column each was a window on squeezes after it into the pane's strip, the window's outline riding on it; what no pane takes fades where it is. Each column ends where its window ends: the eye that followed the window finds its column beside it. (The corner minimap it replaces made the whole map fall into one corner, where the eye had to go looking for it.) It is not a camera move on one world (the working frame is not a crop of the map: there the source is over the disassembly, here beside it) and not a `relayout` (that keeps the text's size): every panel has its own path and its own scale. `dive`, the map to the working frame: | Frames | | | --- | --- | | before | the map is still and the caption that says where we are going has been up 60 f | | 0 to 6 | the windows' outlines go bright | | 6 to 24 | the rest of the map takes the veil, 50% | | 24 to 96 | each window travels to its panel's place, its scale from a half to whole on its logarithm, `glide`; the panels set off 6 f apart in the frame's reading order (drawing, view, source, registers, disassembly, stack), each drawn over the ones before, so that two crossing are seen to cross. With each, the same 72 f and the same stagger, the rest of its column (the map's panel it is a window on: the file, the 69 instructions, the stack from 16 words above rsp, the region's dump) squeezes into the pane's strip: from its place at half size to the strip's rect, its width and its height each on its logarithm (to 36 of 880; to 4 of 24 a row), its window's outline riding on it. The registers' and the drawing's windows are their panels whole and bring no column | | 24 to 72 | the map's parts no pane takes (the backtrace, the key, the memory round the pointers, a loupe's panel) fade where they are, veiled | | 24 to 96 | with the move, the registers [`fold`](README.md#6-verbs) (the map's panel has every register and every chain), on the move's 72 f, so the panel arrives at its height in the frame and the stack's window at its own, the longer one | | 72 to 96 | the drawing crossfades from the map's size to the frame's within its box, where the two differ | | 84 to 102 | each squeezed column crossfades into its strip's strokes (12 f); the working frame's tags, rules and lanes fade in; the clock's count fades in (mock 20) | | 102 to 138 | still | `surface` is the same backwards and a little quicker (the eye already knows the map): the tags fade (12 f) and each strip's strokes become its column's text, the panels shrink into their windows as each strip unfolds into the column round its window and the map's other parts fade in where they are (72 f, `glide`, the same stagger in the reverse order), the veil lifts (12 f), 36 f still. What is played on the map, and why: - **A sprint**: `surface`, then the sprint on the map: the current row's gold moves with the pc, the windows glide to follow it (8 f), strikes appear as their small vermilion and fade; then `dive` at the stop it reaches. On the map a sprint can be seen as a shape (the pc walking the function, the stack growing down its column), which in the working frame it could not. - **A far `continue`**: where the windows' new places are farther than their own heights, `surface`, the jump on the map (the gold goes out and in at the new place, 6 and 6, the windows glide there, 36 f), `dive`. - **A long run** may stay in the working frame; it surfaces only if it leaves the windows. In the working frame each pane's minimap is secondary action: its window glides with the pane's scroll (24 f); a mark the window does not show `flash`es on its row in the strip once (12 f) as it is struck; and every change on a strip starts 6 f after the primary onset it follows, never on that frame. Between a pane and its whole column nothing cuts: | A pane | Frames | | | --- | --- | --- | | `unroll`: the whole column for a beat ("the whole function", "the whole stack") | 0 to 18 | the panes it will cover take the veil; the strip's window framed bright (6 f) | | | 18 to 54 | the column grows out of the strip over the pane and the veiled panes under it, `glide`: from the strip's rect to as tall as the stage allows (the column's rows scaling from the strip's 4 units up, on the logarithm, to as many as fit: sort's text, 79 rows in 840, 10 a row; a 22-line file 24, readable), its strokes turning back into text as they pass 8 a row; the window's outline rides from the strip to its rows in the column, and the pane's own rows are the ones inside it, so nothing appears or vanishes | | | 54 to (at least) 114 | held: the caption reads it, the pc's row gold, the marks of the moment on their rows | | `roll` | 36 f | the reverse: the column shrinks back into the strip round the outline, which lands as the strip's window; the veil lifts (18 f) | | a far jump in the same column, at a walk | 96 f | `unroll` (36); the window travels along the column to its new place (24, `glide`), the mark lighting gold at its new row as the window reaches it; `roll` there (36). The pane comes back at its new place without a fade | | a far jump, at a run | 36 f | the new row lights on the strip, the strip's window glides to it (24), the pane fades through (12 out, 12 in): the strip has shown where it went | | a `relayout` | 48 f | each strip grows or shrinks with its pane, its window with the pane's rows, on the same `glide` | A scene that opens on the map establishes it (0 to 48), its first caption at 60, dives at 150, and has its first step by 300 (5.0 s). ### Captions, opening, closing | | Frames | | --- | --- | | a caption leaves | 12, `exit` | | nothing | 6 | | a caption arrives, rising 8 units | 18, `enter` | | on screen, from arrived to leaving | at least 90 + 3.6 a character; at most 720 | | the stage stays still after it | 60; 120 after a scene's first | | panels arrive at the opening | 18 each, 6 apart, all by 48; the drawing's elements by 54 | | a scene's first caption arrives | at 60 | | a scene's first step fires | by 240 | | still on the last picture | 120, after the last caption's reading time | **A scene in chapters** (the introduction's four): each chapter opens on the last picture of the one before, after a seam, its [`title`](README.md#6-verbs). From e, the frame its last text has been read: | Frames | | | --- | --- | | e to e+30 | still: the chapter's last picture | | e+30 to e+42 | its texts leave together (12 f, `exit`): a bubble that stood as the account goes too | | e+48 to e+66 | the next chapter's title arrives in the caption's place, rising 8 (18 f, `enter`): its numeral `faint`, its name `bright`, Go Medium 40 | | e+54 to e+66 | the clock's label crossfades to it (secondary, 6 f after the title's onset) | | e+66 to e+126 | still: the title is read over the picture | | e+126 on | the chapter's opening (what turns the last picture into its first: a fold, a fade, panels gliding to their places), under the title | | the later of the title's reading time and the opening's end | the title leaves (12 f); 6 f; the chapter's first text arrives (18 f) and leads its step by 60 f | One pause, e to e+126: 2.1 s in which nothing moves but the old text going and the title coming. A chapter's own close is that pause; the scene's last chapter closes as a scene does (above). The scene's first chapter has its seam from nothing: its title arrives at 6 (to 24), is still to 84, leaves at its reading time; its first text arrives 6 f after it has gone, and its first step fires by 240 all the same. ## Tokens Every figure on this page is a token in `anim/src/theme.zig` (`time`, `bezier`, `pulse`), and the verbs of the [catalogue](README.md#6-verbs) use the same figures. Where the file and the documents still differ is listed once, under the catalogue's [Token changes](README.md#token-changes). Every figure is an even number of frames at 60, so a 30 fps export keeps them whole. Review at 60 all the same: at 30, today's 0.25 s run alternates steps of 7 and 8 frames. ## The five scenes In each, most valuable first. Times are seconds into the exported file. ### fib 1. **The run is the scene.** 12.77 to 29.77: 68 steps at four a second, each a single frame in which the mark jumps, a card and a node appear and two registers flash solid ([sheet](motion/sheets/fib-12.8-run.png)). 55% of the running time. Ramp into a run (four steps), run only down the first branch (about 12 steps, with a rest at each call), then sprint the rest with registers veiled and the tree as the subject. 2. **No return is ever walked.** The three steps shown in full are three calls. What recursion is *for*, an answer coming back in `rax` and a card leaving, happens only inside the run. Slow to a walk for the first return (`fib(1)`, at 14.8) and for the last (`fib(5)` = 5, at 29.77, now a pop one second before the cut). 3. **Each walked step is one frame wide.** 2.27, 6.77, 11.27: mark, tree node, card and two registers all start at the same frame and finish within eight ([sheet](motion/sheets/fib-02.2-call-all-at-once.png)). Sequence them as "A call pushed". 4. **Nothing is established.** Panels are whole at 0.43, the caption at 0.73, the first step at 0.77 ([sheet](motion/sheets/fib-00.0-opening.png)). The panels must be in and the first caption read before anything moves: see [Open](#the-rhythm-of-a-scene). 5. **1.5 s for everything.** 5.27 and 9.77 move one line and then wait 1.23 s; 2.27 pushes a call through four panels in the same time. 6. **The mark sweeps seven lines in five frames** at 2.27, 6.77, 11.27. A call is a jump. 7. **The digit pop**, 0.80 s after each strike (1.57, 3.07, 4.57, ...): bold ink to ordinary digits with faint zeros in one frame, alone on a still picture. 8. One caption for 31 s. It needs three: the call, the return, the tree. 9. Ends 1.0 s after the answer arrives. ### list 1. **The reversal cannot be followed.** The scene exists to show three `next` fields turning. The first turn is walked (22.50) and the other two are in the run at 25.53 to 29.03, a frame each. Walk the first trip round the loop, run the second with its eases and a rest, walk the third. 2. **Four panels on one frame**, every step: 5.27, 6.77, 21.00, 22.50 ([sheet](motion/sheets/list-05.2-write-in-four-panels.png)). Memory first (strip and words together), the node 18 f later, the mark last. 3. **The rewrite at 22.50 has no anticipation and two endings.** In the words the old arrow vanishes on the strike's frame; in the nodes it goes dashed for 0.8 s ([sheet](motion/sheets/list-22.5-pointer-rewritten.png)). Dash it during the arm, in both. 4. **Things appear from nothing.** 2.27: the source panel is `main` on one frame and `push` on the next ([sheet](motion/sheets/list-02.2-source-cut.png)). 5.27: a row of memory exists, struck, where there was none. 11.27 to 14.50: two nodes arrive in pops. Scroll, make room, fade in. 5. **Three empty steps in a row**: 16.50, 18.00, 19.50 each move one line and wait 1.23 s, straight after the caption that promised the reversal. At 0.8 s each they are a lead-in; at 1.5 they are 4.5 s of nothing. 6. Captions crossfade at 14.80 and 29.03: at 14.87 both are on screen, one over the other. 7. Node bodies change pigment whenever `cur`, `prev` or `next` moves on: colour changes that are not writes, every step of the loop. Keep the pigment on the variable's tag and plaque. 8. The frees (30.77, then 35.27 to 38.03) are pops. Walk one, run two. ### sort 1. **The first swap is at 20.5 of 36.6 s.** Twelve walked steps (2.27 to 18.77) show three trips round the loop in which nothing swaps. Walk one, run two, and reach the swap by 10 s. 2. **The caption about the swap arrives 0.2 s before it** (20.30, the flights lift at 20.50). Bring it up at the rest before, and hold 2 s. 3. **The flights are a jump and a crawl.** Lift 0.10 s; two frames later the cards are two fifths of the way; they spend their last eight frames (0.27 s) on the final few units, hovering over the faint digits they are about to replace ([sheet](motion/sheets/sort-20.4-swap.png)). `glide`, 30 f, the second 6 f behind the first. 4. **Both cells strike on one frame** (21.23) and their pulses merge into one block. One lands, then the other; the pulse is an outset. 5. **36 steps, swaps and compares alike, in a 9 s strobe**, 26.53 to 35.27. Run two trips, sprint the rest, slow for the last swap. 6. Read frames from each compare stand through the rest and vanish in one frame at the next step ([sheet](motion/sheets/sort-06.7-step.png), f202 to f203). 7. Every third step (5.27, 9.77, 14.27, 18.77) moves one line and waits 1.25 s. 8. The sorted array is on screen for 1.0 s and nothing says it is sorted. ### syscalls 1. **Effect before cause.** At the first frame of each step (3.77, 6.77, 9.77) the kernel's side already shows the new call, decoded, with its card pushed ([sheet](motion/sheets/syscalls-03.7-kernel-pops.png)); the arrow sets off afterwards. For `read`, `buf` is struck full at 3.77 and the arrow comes back at 4.9 ([sheet](motion/sheets/syscalls-03.7-read.png)). `write` already copies its bytes in order, after the arrow: that is the model ([sheet](motion/sheets/syscalls-09.7-write.png)). 2. **Four calls in 13.8 s under one caption.** This is the richest scene and the shortest. Each call wants its own line of caption, its own 2 s lead, and the 3.5 to 4.8 s the chart gives it: about 30 s. 3. **Everything on the kernel's side pops**: name, rows, list. 4. **3.0 s a call whatever it does.** `close` has one number in and one out; `read` moves fifteen bytes. 5. The registers reload their arguments in one frame at the step's start, unmarked. Frame them one at a time: they are what the caption is about. 6. Starts 0.04 s after its caption; ends 1.0 s after `write` returns. ### zoom 1. **The CPU level has nothing to show.** 5.2 to 8.8 at x2 on the registers: `rip`'s digits change once (5.83, a pop) and `rdi` is struck once (7.33) ([sheet](motion/sheets/zoom-05.3-at-x2-registers.png)). The caption says "a handful of instructions" and no instruction is on screen. Until a line can unfold into its instructions, put the instruction in the head's `where`, and leave after the second step. 2. **Out and in again.** 8.83 to 11.43: back to x1, a caption crossfade in the middle (10.07), in to the stack: 2.6 s of the whole frame moving to go one panel to the right ([sheet](motion/sheets/zoom-08.7-out-and-in.png)). Fade through at x2. 3. **The subject is at the frame's edge.** 12.07: the return address is struck in the bottom row, half under the caption band; 13.57 the row above it ([sheet](motion/sheets/zoom-11.5-at-x2-stack.png)). The panel's tag is out of frame, so nothing says this is the stack. 4. **16.57: the grid jumps.** The `fib` divider moves four rows, every row shifts 20 units, `rsp`'s plaque teleports, and sixteen unknown bytes become digits with no mark, all between two frames ([sheet](motion/sheets/zoom-16.5-rows-jump.png)). 5. **Four seconds of nothing** at x2, 19.1 to 23.1, after one byte is struck at 18.07 ([sheet](motion/sheets/zoom-18.0-end.png)). 6. **The camera leaves unannounced** at 4.03, 0.03 s after a caption arrives, with no frame on its target; the source and stack slide away and the stack's edge stays in view ([sheet](motion/sheets/zoom-03.7-camera-in.png)). 7. Back at x1 (24.5) the memory caption is still up, one run step pops, and the scene cuts 1.0 s later. "And back up" needs its own beat: the mark on line 6 again, the three levels in view, 2 s. 8. Text under the zoom is steady ([sheet](motion/sheets/zoom-05.1-text-settles.png)): nothing to do. ## A scene: libc's heap from the inside Not a lens: a scene, drawn with the blocks the catalogue has, and two small additions (`nodes` in two rows with a `bin` at the second's head, and malloc's words `size` and `protected` in a dump). The program is [`mock/heap.c`](mock/heap.c): three pushes, two pops, a push. Every byte below is a recording's: `ztrace dbg` on it under glibc 2.44, stopped after each `malloc` and `free` returns ([mock 18](mock/18-heap.png)). **The frame.** Split `subject`. The band's drawing is `nodes` in two rows: the program's list from `head` over the tcache's free list for chunks of 0x20, headed by its `bin`. Its view is the heap by `fields`, seven rows, 405000 to 40506f, three chunks of two rows each and the next chunk's header: each size word read as `size` (`0x20 a m P`), a node's two words as the program's (`number`, `pointer`) while it has them and as malloc's (`protected`, then `bytes` noted `key`) while malloc does. Both lists are `arc`s in the view: the program's `next`s, and the free list's links to the pointers they protect. The tcache is a `loupe` hung from the view's row of the chunk it lives in (405060), two of its rows named: `num_slots[0]` and `entries[0]`. The disassembly is the program's; the calls to `malloc` and `free` are stepped over (free's own path is two hundred instructions: a descent into it is a scene of its own). **The map and the minimap.** The map's memory column holds the heap whole, from its start to the top's header (rows round what was touched, fieldless ones folded), the tcache as its own panel under it, and the arena (`main_arena`, in libc's data, far from the heap) as a dump by fields: `top`, `last_remainder`, `system_mem`, `flags`, and the bins' heads. The view's minimap is the heap's column; a strike on a row its window does not show (the top's header moving down when the tcache is cut from it) flashes there, and the tcache's and the arena's panels, which no pane shows, are the map's alone. **The beats.** Each `free` and the `malloc` that takes the head back are walked; pushes 2 and 3 are a run, which draws no strikes and no arcs and shows what it did settled at its end. | | Stop | Pace | What plays | | --- | --- | --- | --- | | 1 | the first `malloc` returns | walked | `fire`; `rax` struck and its `link` to the pin under the chunk, which fades in on the program's row, in neither list: no arrow into it (12 f); the view's rows come in unmarked, the region being new; the `bin` dashed, `dummy tcache` (before the first free the thread's tcache is a read-only dummy in libc). Then push's three stores walked: the value struck, `next` struck, `head`'s pin travelling to the node | | 2 | after `push(9)` | a run | pushes 2 and 3, twelve steps at a run: the nodes come in (8 f), values change in place unmarked; when the run ends the arcs of the `next`s fade in standing (8 f) | | 3 | the first `free` returns | walked | the chart below: the tcache made, the loupe opened on it, the node travelling to the bin's row | | 4 | the second `free` returns | walked | the chunk's first word struck on its three bytes that changed (`55 54 40`), then the key; the loupe opens again in the idea's slot (36 f) and in it `entries[0]` struck on its low byte alone (`50` to `30`), `num_slots[0]` 15 to 14 on its one byte; the free node glides one place right (18 f) and the new one travels down to the bin's head; the `arc` from 405030 to 405050 draws at full ink (12 f); the count 1 to 2, struck | | 5 | the next `malloc` returns | walked | `rax` struck and its link; the key's 8 bytes struck to zero; the loupe opens again, its head and count struck back on the bytes that changed; the arc from 405030 fades (the word is the program's again, read as `bytes`, `the old link`); the node travels up to the program's row (36 f), in neither list, its old link faint in the value's half; the count 2 to 1. Then `push` writes 25 and its `next`, walked, and that arc draws | The loupe on the tcache hangs over the stack, never over the registers (the free's register wave and malloc's `rax` are what the captions are about); it opens in each step that changes the tcache (3, 4, 5), in its idea slot, and closes at that step's advance: it is never open over a step it does not concern. Its tag reads `tcache_perthread_struct · 0x2f8 bytes` (76 two-byte counts and 76 pointers: 760), and a note that does not fit is cut with `…`, never in mid-word without it. **The captions**, on the rules (`say`; at least 90 f + 3.6 f a character, at most 720 f, arriving at least 60 f before the step they describe, in a rest). Frames from the scene's first; "lands" is when the caption has arrived, "leaves" when it starts to go. | Lands | Leaves | Least | Caption | The step it leads, at | | --- | --- | --- | --- | --- | | 78 | 396 | 317 | Three pushes and two pops: what malloc and free do to the heap. | main's `push(7)`, 198 | | 414 | 954 | 529 | malloc(16) cut a chunk of 0x20 off the top: its size word, 0x21, then the 16 bytes rax points at. The top is 0x20 smaller. | the malloc line, 474; push's stores to 954 | | 972 | 1570 | 428 | Two more pushes, at a run: three chunks in a row, each with P set, the chunk before it in use. | the run, 1032 to 1522 | | 1588 | 2068 | 263 | pop takes the head off the list: head = n->next. | the call to pop, 1648 | | 2086 | 2615 | 529 | free gave 9's chunk to the tcache, malloc's bin for 0x20. Its first word is the link now: 405, which is NULL, safe-linked. | the free, 2146 | | 2633 | 3113 | 245 | The second pop: head moves on, to 7's node. | the call to pop, 2693 | | 3131 | 3693 | 562 | The second free chains to the first: 405455 is 405050 xor 405, the chunk's own address shifted 12. The arc is the pointer it hides. | the free, 3191 | | 3711 | 4204 | 493 | malloc(16) took the bin's head, 405030: the tcache points at 405050 again, the key is wiped, the old link stays. | the call to push, 3771; its malloc, 3951 | | 4222 | the cut, 4762 | 295 | push writes 25 over the old link: the list is 25, then 7. | push's stores, 4282 to 4642 | Each caption leaves 18 f before the next lands (12 out, 6 of nothing) and only in a rest; none is up more than 598 f; the scene is 79.4 s, its last 120 f the finished picture. This replaces the rendered scene's caption up 31 s and the two that arrived after their steps. The first free, frame by frame, from its fire: | Frames | | | --- | --- | | 0 to 12 | fire on `free(n);` | | 18 to 30 | the registers `free` left changed, struck in a wave 2 f apart (`rax`, `rcx` 405, `rdx`, `rsi`, `r8`, `r10`): it was stepped over, so as a `continue` | | 54 to 66, 66 | memory: the chunk's first word armed and struck on its two bytes that changed (`05 04`), 1 f apart, the held corner to come on the first | | 72 to 80 | its second word, the key, its 8 bytes 1 f apart | | 90 to 102 | the next chunk's header struck on its three bytes that changed (`01 03 00`): the tcache's chunk, cut from the top at this first free; the top's own header has left the window and flashes on the view's minimap (6 f after) | | 102 to 138 | `open`: the loupe on the tcache, over the stack, its stem down the gutter from that row; its two fields framed | | 144, 150 | in the loupe: `num_slots[0]` struck on its one byte (16 to 15), then `entries[0]` on its three (`50 50 40`) | | 162 to 174 | the idea: the `bin`'s box crossfades from dashed to raised, `dummy tcache` to `tcache 0x20`, and the top's box crossfades to its new place and size, `0x20ca0` struck | | 168 to 210 | the node lifts (6 f) and travels down to the bin's row (36 f, `glide`); as it lands its outline goes dashed and its halves turn (12 f): the first word's half the link's well, the second hatched, `key`. `rdi`'s pin rides with it: the pointer was freed, not cleared | | 204 to 210 | the count fades in on the bin's shoulder | | 210 to 222, 222 | arm, strike: the count, 1 | | 222 to 258 | hold | | 258 to 270 | advance; the loupe closes with it | | 270 to 294 | rest: 4.9 s | **What the scene's author writes.** A sketch in the shape of `anim/scenes/sqlite.zig`'s fields: ```zig // The view: a chunk as the program has it, and as malloc does. const used = [_]Field{ .{ .at = 8, .len = 8, .reads = .size }, // size, A M P .{ .at = 16, .len = 8, .mark = 0 }, // value .{ .at = 24, .len = 8, .reads = .pointer, .mark = 1 }, // next: an arc }; const freed = [_]Field{ .{ .at = 8, .len = 8, .reads = .size }, .{ .at = 16, .len = 8, .reads = .protected, .mark = 2 }, // the tcache's next: an arc .{ .at = 24, .len = 8, .reads = .bytes, .note = "key" }, }; // Which a chunk gets is the recording's: the list each chunk is on, per stop. // The tcache, as a loupe from the row of its chunk: two fields of 760 bytes. const tcache = [_]Field{ .{ .at = 0, .len = 2, .note = "slots left" }, // num_slots[0] .{ .at = 0x98, .len = 8, .reads = .pointer, .note = "the head of 0x20" }, // entries[0] }; // The drawing: the list from `head`; the bin `tcache 0x20`, its count the // reader's (16 less the slots left), its chain the reader's, revealed. ``` **What the recording must hold, per stop.** The tracer's reader (`zt.heap.glibc`) has most of it; the scene needs: 1. The chunks in address order, each with its address, its size word (at address + 8) and the list it is on (in use, tcache and which, unsorted, small or large and which, the top). 2. For each chunk on a list, its two link words as stored and the pointers they protect, and how each chain ends (the end, memory not recorded, misaligned, a limit). 3. The tcache whole: its address, `num_slots` and `entries` (76 each on 2.44), and the capacity a bin starts with (16 here), so the count shown is what the bin holds. Before the first free, the thread's `tcache` pointer, at libc's dummy. 4. The arena: its address, `top`, `last_remainder`, `system_mem`, `flags`, and the bins' heads, each with its word's address. 5. The bodies of the in-use chunks the scene draws: the reader records them only when watched, so the heap's first kilobyte watched (`-w` on it) or `--around` round what each instruction touches. 6. Which bytes changed since the stop before (a pointer whose low byte alone moved is struck on that byte), and glibc's version: 2.44 makes the tcache at the first free, counts slots left, and has no fastbins. **Further beats on this glibc**, with the same blocks: a large chunk freed beside a live one goes to the unsorted bin (a third row, its `bin` the arena's bin, the chain ending `→ the bin`; the next chunk's `P` chip struck clear); a malloc that sorts it into a large bin (the node travels between rows); a chunk freed beside the top merges into it (the node fades into the top's box, whose size is struck). Fastbins only as a beat marked `glibc before 2.41`, under the 2.40 that runs through pwndbg's loader. **musl's mallocng** would keep the dump by fields (a group's header and its slots), the arcs (meta to group and back), a loupe on the meta (its `avail_mask` and `freed_mask` read as bits, as `size` reads A M P), and the per-class rows; but its free list is a bitmask in metadata kept apart from the chunks, not links inside them, so its drawing is a row of slots, nearer `array` than `nodes`, with no safe-linking to show. ## A scene: ASan against a plain build A [`pair`](README.md#pair): one small program built twice, plain and with clang's AddressSanitizer (`-O0 -g -fno-omit-frame-pointer -no-pie -fno-stack-protector`; Arch's clang turns the stack protector on by default, and with it the plain build dies in `__stack_chk_fail` instead of at `ret`), each recorded by instruction from `fill`. The program is [`mock/overflow.c`](mock/overflow.c): `char buf[16]; for (int i = 0; i < 32; i++) buf[i] = 'A';` in a function of its own. Every figure here is those two recordings' (mocks 26 to 28, and 38, the scene's poster). **The program and its frame.** The tracer's tested `targets/overflow.c` (a bound `n`, gcc's layout) keeps `i` and `n` above the buffer at -O0: the loop overwrites them and runs on to the end of the stack, faulting at a store. This scene's program has a constant bound and is built with clang, which puts `i` below `buf` (rbp-0x14): the overflow reaches the saved rbp and the return address and the fault is the classic one, at `ret`. The scene's program is [`mock/overflow.c`](mock/overflow.c), built in `anim/` with clang `-O0 -g -fno-omit-frame-pointer -no-pie -fno-stack-protector` (and `-fsanitize=address` for its second run); the tracer's own `targets/overflow.c` stays as it is. The ASan build is shown as a user meets it, with the fake stack (the default); with `detect_stack_use_after_return=0` the frame would be on the real stack between the same redzones, a simpler picture and a second scene. **What differs, as recorded.** - *The frame.* Plain: `buf` is at rbp-0x10, its last byte against the saved rbp, the return address the word after. ASan: `buf` is not on the stack at all but in a fake frame on ASan's fake stack (7bfff58f0000, 64 bytes): a header (magic `41b58ab3`, a descriptor `"1 32 16 5 buf:3"`, the pc, the real stack), `buf` at +0x20, a redzone at +0x30; the real stack holds only spills, the saved rbp and the return address, far away. Each column shows its frame as bytes, eight a row, read by the frame's own fields ([`hexdump`](README.md#hexdump) `eight`), not as the stack panel's words: a store here is one byte, and a word going `41`, `4141`, `414141` would hide both the letter and the field it lands in. The two are scrolled so that `buf` faces `buf`: then plain's saved rbp faces ASan's redzone, and its return address the redzone's second word. That facing is the scene. - *The code.* Line 4's store is one instruction plain (`mov [rbp + rax - 0x10]▮, 0x41`), eight a turn; ASan's turn is seventeen: the address, `shr rax, 3`, the shadow's load at `rax + 7fff8000`, `cmp al, 0`, `je` to the store; the partial check (`and rax, 7`, `cmp al, cl`, `jl`) and `call __asan_report_store1` only when the shadow is not 0. The prologue (38 instructions and `__asan_stack_malloc_0`, 250) writes the header and poisons the shadow, `f1 f1 f1 f1 f8 f8 f3 f3`; line 3, which plain has no instruction for, turns `f8 f8` to `00 00` (buf's scope begins). - *The shadow.* One byte for each word of the fake frame, on the word's own row of the frame's bytes, before its address: `f1` four times (the header), `00 00` (buf), `f3 f3` (the redzone). - *The letters.* Each turn stores one byte, `41`, and `buf`'s reading grows a letter, `"AAAA"`; the `41` beside `A` says what it is. Past `buf` the letters keep the string's ink in plain's saved rbp and then its return address, while those fields read what the CPU will: the saved rbp `→ 7fffffffed41` (i = 16) to `0x4141414141414141` (i = 23); the return address `→ 401134 main+20`, then `→ 401141 fill+1` (i = 24, still code), `→ 404141` (25, plain's data page), `0x414141` (26) and `0x41414141` (27, mock 38), no longer addresses, to `0x4141414141414141` (31): the crash foretold. - *When they part.* At i = 16: plain's store writes `41` into the saved rbp's low byte (7fffffffed00 becomes 7fffffffed41); ASan's check loads `f3`, `je` is not taken, the partial check (`0 : f3`, signed 0 against -13) is not taken, and it calls `__asan_report_store1(7bfff58f0030)`; the store never runs. After that plain goes on alone: by i = 23 the saved rbp is `4141414141414141`, at i = 24 the return address briefly points at `fill+1`, by i = 31 it is `4141414141414141`; `pop rbp`, then `ret` faults on a non-canonical address: SIGSEGV, rip still at `ret`, exit 139. ASan's report: `stack-buffer-overflow on address 0x7bfff58f0030 ... WRITE of size 1 ... [32, 48) 'buf' (line 3) <== Memory access at offset 48 overflows this variable`. - *How long.* Plain: 263 instructions from `fill` to the fault. ASan: 578 to the report's call, then about 4.75 million to write the report and exit. **The beats**, each in the form that serves it: the [`pair`](README.md#pair) while the two runs face each other, its text `below`; the [column](README.md#column) while plain goes on alone, its frame as bytes the height of the column and each bubble level with the field the turn's letter lands in, so that the narration climbs the frame with the overflow; the pair again for the poster and the end, a fault on the left and a report on the right. Frames from the scene's first; every text lands in a rest, leads its step by 60 f (120 for the first), is up its reading time (90 f + 3.6 f a character) and at most 720 f, and is covered by its lead, its steps and a hold of at most 84 f, but for the poster's rest, which is meant. *The pair's panes* (mock 26), the same in every pair beat: the shared source, 6 lines, each run's mark on its side; each run's disassembly, 10 rows, aligned by line; each run's frame as bytes (`hexdump` `eight`), eight a row, read by its fields (plain: `i`, `buf`, the saved rbp, the return address; ASan: the fake frame's header, `buf`, its redzone, each row's shadow byte beside it); each run's registers folded to the rows the loop moves. *The column's panes* (A10 to A13): plain's source, 3 lines (3 to 5); plain's disassembly as a [descent](README.md#descent), so that the place the return address names is on screen: main's window (its `call fill` waiting, ringed; the row after it, `401134 main+20`; one more) over `fill`'s window whole, 13 rows from `401140` to its `ret`; plain's frame as bytes, `rest` (`i`'s word, `buf`'s two, the saved rbp, the return address, then main's frame, which only the floor holds). On the shelf: `ASan · stopped: stack-buffer-overflow, WRITE of size 1` (its report's first line on the tag) and plain's registers (`rax` the turn's `i`). The scene turns `aim = .standing` on for these four beats (the knob is off everywhere else): the return address's field aims at the row it names, and the overflow is seen to break it. | | Form · text | Level (column) | The step, and what plays | Text (characters) | Lands | Fires | Leaves | | --- | --- | --- | --- | --- | --- | --- | --- | | A1 | pair · below | | `fill()` called in both, as any call; `establish` before it | Plain against AddressSanitizer: a loop writes 32 bytes into 16. (63) | 78 | 198 | 395 | | A2 | pair · below | | line 2, the prologues: plain's two rows walked; ASan's 38 at a run inside the step, `__asan_stack_malloc_0` stepped over; the fake frame's rows come in (12 f), the header's words struck; the shadow's cells struck 2 f apart, `f1 f1 f1 f1 f8 f8 f3 f3` | ASan's prologue moves buf to a fake frame and poisons its shadow: f1 before buf, f3 after. (90) | 413 | 473 | 827 | | A3 | pair · below | | line 3: ASan's one row, `only here`; plain holds; the two cells struck | Line 3 is ASan's alone: buf's shadow f8 f8 turns 00 00. (55) | 845 | 905 | 1133 | | A4 | pair · below | | i = 0, the check: ASan's address and check rows walked, 36 f a row, the shadow cell framed as read when its load runs; plain's plaque waits on the row facing them | Before each store ASan reads buf[i]'s shadow byte, at (addr >> 3) + 7fff8000. (77) | 1151 | 1211 | 1518 | | A5 | pair · below | | i = 0, the stores: ASan's rows after the check walked, then both stores strike (6 f apart, plain first), each side's `i++` | It is 00: the store may go. Both write 'A'; plain in one instruction, ASan in seventeen. (88) | 1536 | 1596 | 1943 | | A6 | pair · below | | i = 1 to 14, a run: no strikes, no corners; `buf`'s bytes change in place; settled at the end | Fourteen more turns, at a run: buf fills on both sides. (55) | 1961 | 2021 | 2387 | | A7 | pair · below | | i = 15, walked on both sides; the last `00` read; each `buf` reads `"AAAAAAAAAAAAAAAA"` across its two rows | i = 15, buf's last byte: still 00 on ASan's side, still buf on plain's. (71) | 2405 | 2465 | 2750 | | A8 | pair · below | | i = 16, they part: the chart below (mock 28) | i = 16, one past buf: plain writes an A into the saved rbp; ASan reads f3, a redzone. (85) | 2768 | 2828 | 3164 | | A9 | pair · below | | ASan's partial check and its call walked; its run stops: its registers give way to its stderr, the report's lines, the three the text names framed | ASan does not store: it calls its report, which names buf and the write. (72) | 3182 | 3242 | 3532 | | | | | 3550 to 3646, into the column (README, column, "Mixing them"): the text leaves; ASan's side folds to one tag on the shelf, its report's first line on it; plain's panes glide left and its frame's bytes open to the column's height | | | | | | A10 | column · beside; `aim = .standing` | the saved rbp's row | once its bubble has arrived (3664 to 3682) the aim draws from the return address's field up the gutter's left lane to main's `401134` row, standing at 60%, the row's address framed; then i = 17 to 20, each walked as a store (the chart below, 96 f): a letter a turn crossing the saved rbp's bytes, its reading changing with them; the aim holds | Plain goes on alone, an A a turn, into the saved rbp. (53) | 3646 | 3706 | 4126 | | A11 | column · beside | the saved rbp's row (A10's glides up) | i = 21 to 23, walked: the saved rbp all letters, `0x4141414141414141`, `differs` gone with ASan folded; the aim still holds: the return address is untouched | The saved rbp fills: 4141414141414141, no longer an address. (60) | 4144 | 4204 | 4528 | | A12 | column · beside; the beat's `emphasis = .aim` | the return address's row, a row lower | i = 24, walked: the touch to the field, the first byte struck, `34` to `41`; the reading `→ 401134 main+20` crossfades to `→ 401141 fill+1`, still code's ink (36 to 48); then the aim, full ink, leaves main's row and glides up the lane to `fill`'s second row, `401141` (54 to 78; this store's step 108 f), its address framed as it lands: the way back now leads into `fill` again | i = 24, the return address: it reads fill+1, still code. (56) | 4546 | 4606 | 4837 | | A13 | column · beside | the return address's row | i = 25, walked: `→ 404141` in data's ink, no name: no longer code, the aim **frays** (dashed 12 f, out 18 f, from 54); i = 26: `0x414141`, the arrow and the ink gone, a number; nothing aims | Each turn makes it stranger: 404141 is data, 414141 is nowhere. (63) | 4855 | 4915 | 5172 | | | | | 5190 to 5286, back to the pair: the bubbles leave together; plain's panes glide back to their side; ASan's side unfolds from the shelf, stopped on its report, as it was | | | | | | A14 | pair · below | | i = 27, walked: its store struck, the reading `0x41414141`; then the held rest, 5442 to 5736 (4.9 s): the half-written word, the struck byte solid, the plaque on the store, ASan standing on its report. The scene's poster, mock 38 | Half written: 41414141, no longer an address. On the right, ASan stopped at the first byte past buf. (100) | 5286 | 5346 | 5736 | | A15 | pair · below | | i = 28 to 31, walked, 96 f each: `0x4141414141` to `0x4141414141414141` | Four more turns: the last A lands, and it reads 4141414141414141. (65) | 5754 | 5814 | 6234 | | A16 | pair · below | | the loop's exit, `pop rbp` (rsp's pin falls, rbp's flies to `4141414141414141`, off every window: a stub), `ret` (the touch to the return address, read; nothing aims, there is no row to go to; the fault: the `fault` mark on its row, hazard bands round an ink plaque, `SIGSEGV`; rip stays) | The loop ends: pop rbp, then ret to 4141414141414141: the CPU faults. SIGSEGV. (78) | 6252 | 6312 | 6623 | The cut at 6743, 112.4 s, after 2 s on the two last pictures: a fault on the left, a report on the right. The scene's poster (the thumbnail, the still that stands for it) is mock 38: the return address half written, the report beside it. The two changes of form cost 192 f, 3.2 s; the walked stores past `buf` (sixteen, A8 and A10 to A15) are the scene's middle, 30 s. **A store past `buf`**, walked, each of i = 17 to 31 (into the saved rbp, then the return address), from its fire: | Frames | | | --- | --- | | 0 to 12 | fire on line 4; plain's turn walks its rows 6 f apart to the store | | 12 to 24, 24 | arm, strike the store's one byte, `41`, in a string's ink among the field's pointer-ink bytes; in the column the touch first (12 to 24, down the gutter onto the frame's right rule) and the arm and strike after it (24 to 36, 36), every row below 6 f later; in the pair the touch is its echo, the seam between the runs keeping no line | | 30 to 42 | the field's reading crossfades to what the bytes now make: an address in its region's ink and its name; or, once it is none, the number, the arrow and the name fading with the old reading | | 42 to 78 | hold, the struck byte solid (at i = 27 the hold runs on under its own text, 294 f) | | 78 to 90 | advance: the strike cools to its held corner, the plaque goes on through `i++` | | 90 to 96 | rest: 1.6 s a store | **The step in which they part** (i = 16), from its fire: | Frames | | | --- | --- | | 0 to 12 | fire on line 4, both sides' plaques on the turn's first row | | 18 to 66 | plain walks to its store, its rows spread over the time ASan takes to reach its check: ASan's address rows, 12 f each | | 72 to 78 | the two first different rows framed `attention`, one each side: plain's store, ASan's shadow load | | 84 to 96, 96 | plain: arm, strike the saved rbp's first byte, `00` to `41`, the letter in a string's ink among the pointer's; the field's reading crossfades from `→ 7fffffffed00` to `→ 7fffffffed41` (12 f) and its `differs` bar comes in (12 f) | | 102 to 108 | ASan: the shadow load's cell, `f3`, framed as read, and the load's annotation reads it; the redzone's bytes beside it stay `00` | | 114 to 126 | ASan: `cmp al, 0`, its values `f3 : 0` and `zf` | | 132 to 150 | ASan: `je` not taken, its row's annotation `not taken`; plain's plaque goes on to `i++` | | 186 to 222 | hold | | 222 to 234 | advance | | 234 to 258 | rest: 4.3 s | **What the recordings must hold, each run, per stop** (beyond what any scene asks): the shadow bytes for the stack window and for every fake frame the window shows, each with the 8 application bytes it stands for; which words are a fake frame (ASan's fake stack mapping, the frame's base and size class) and its header decoded (magic, the descriptor's variables with their offsets, sizes and lines, the pc); the red zone under rsp (the plain build's `buf` and `i` live there); the frame's fields for its dump by bytes, by name, offset and size (the debug info's locals; the saved registers and the return address from the call frame information); names for ASan's runtime (`__asan_report_store1`, `__asan_stack_malloc_0`); the run's stderr as written, by stop (the report's lines arrive by `write(2, …)`, 18 of them, 1.5 M to 4.7 M instructions after the call: a `continue` to the exit); a fault: the signal, rip and rsp at it, the exit status. And for the pair: the two recordings' stops matched by source line and by the loop's turn (i from its slot), so a step can be one line or one turn in both. ## A scene: the introduction The frame built from its bytes up, on a recording of its own (`intro`: `anim/tools/list.c`, three nodes pushed onto a global list and the list reversed, built as the compiler alone makes it, clang `-O0 -g -mno-red-zone`, with no instrumentation: nothing the viewer is walked through is a tracer's, `reverse` gets a real prologue, `push rbp; mov rbp, rsp; sub rsp, 0x18`, and its locals are named by the debug info). One scene and one video, 206 s, in four chapters, each with its title and its own opening, grown out of the last picture of the one before; the seams are the video's chapter marks, so a viewer can stop between them: | | Chapter | Its moments | From | Length | | --- | --- | --- | --- | --- | | I | Memory | reverse's first instruction, its `push rbp` (rsp holds the way back to main, `401272 main+50`), not named | 0 (0:00) | 4284 f, 71.4 s | | II | Registers | push(9) at line 11, `mov edi, 0x10`, malloc's argument, on to that same `push rbp` | 4284 (1:11) | 3121 f, 52.0 s | | III | The stack | that `push rbp`, then `mov rbp, rsp` and `sub rsp, 0x18` | 7405 (2:03) | 2118 f, 35.3 s | | IV | Code and meaning | the load on line 21, `mov rax, [rax + 8]` | 9523 (2:38) | 2851 f, 47.5 s | Each view grows out of the rawer thing under it, in the order the direction rule gives: memory first (the deepest); then the CPU's own words, which point into it; then the stack, which two of them keep; then the code that acts on all of it, and the idea last, at the top. Nothing cuts to a finished panel: the same bytes become the word, the same word the row, the same row the slot. **Why the registers second.** They need what I gives (eight bytes make a word, a word can be an address, an address has the ink of its place, a chain follows it) and nothing the stack gives: a register is read exactly as a word of I is, and the address space I leaves in the program column is where their values point, rip's into list's code, rsp's and rbp's into the stack. The stack in turn leans on them: its first beats are rsp's row landing on the top word and `push rbp`. In the three videos the stack chapter named rsp and rbp before anything had said what a register is, and the registers panel came last, built over the finished stack as "the other place values live". Now it is built first, whole, in its place, and the stack chapter opens with rsp and rbp already known. **What II teaches, and leaves out.** A register is the CPU's own word, named and not addressed, sixteen of them and rip, read as a word of I is, its chain and its ink (II1); rip is where the CPU is in the code (II2) and the address of the row about to run (II4); rsp and rbp point into the stack and others into the heap (II3); code names a register's low bytes (`edi` is rdi's four: II5); an instruction writes a register and it is struck (II5); a call takes its argument in rdi and gives its result in rax, and leaves other registers changed (II6); the panel as the working frame keeps it, the registers the scene moves as rows and the rest folded (II8). It leaves out a compare and the jump that reads its flags: the program's only compare in the recording is reverse's `while (cur)` (`cmp [rbp - 0x10], 0; je`), after III's moments and before IV's, so II could show it only by running the recording backward at its seam to III. The flags are on rip's row from II2, and II6 changes two of them (corners, unnarrated); a compare and its jump are walked where they belong, in list's loop and the graph's `leave`. **One recording, one clock.** II starts before I's moment: its call (malloc's, from push(9)) happens before reverse is reached, and the chapter walks forward to the instruction I stood at. Nothing on screen says when I is (no clock, no code, no register: memory at an instant), and I's dump waits folded on the shelf through II's moments, coming back as I left it when II reaches that instruction (II8: "back where the 128 bytes were read"); no frame ever shows two moments' state side by side. The clock comes with II's first registers (II2's `frame up`) and counts one recording, from its first stop at line 40: 6 at II's start, 7, 169 after malloc, 182 at reverse's first instruction (III to 185), 191 at the load (of 193, in this run's numbering): forward only. Its label, ranged right before the count, names the chapter (`II registers`); in I, which has no clock, the label alone (`I memory`). **Where the parts are.** Each part is built in the place it has in the finished frame, never centred and moved later: the bytes where the stack will stand (the state column), the address space in the program column, which is empty until the code comes; the registers at the state column's top, the dump folded on the shelf meanwhile; the code at the program column's foot, where the disassembly's panel will hold it. The camera frames the part being built (x2 for the bytes and the words, x1 for the address space beside them, for the registers, whole at x1 with the address space they point into, and for the stack, whose texts stand in the program column while it is empty; once more at x2 for the visit of I8, and none in II, III or IV after it), so the frame's empty parts are out of shot until the parts that fill them come. An introduction earns that emptiness; nothing else does. A panel's tag and rule come last (`frame up`): first the rows, then what they are called. **Forms.** Each part is built in the place it keeps, so the forms follow the parts: the working frame with its text `below` while the bytes stand in the state column under the camera; the [column](README.md#column) for the address space, a tall subject (the bar is the column's height, to scale), its bubbles level with each end as it is enlarged, so the chapter goes down the address space with them, while the bytes wait on the shelf; the working frame again to tie the bytes to their place. In II the working frame with its text `below` while `segments` holds the program column (II1 to II3), the bytes on the shelf over it as in I4 to I6, then `beside` on the left once the address space has gone and the code has come to the column's foot (II4 to II8), each text level with the register it speaks of. In III the text `beside` on the left, in the program column, which holds nothing else but main's rows round its call (the return address aims at one: III3, the scene's one `aim`) and reverse's first six under them (the disassembly III walks), level with the stack's rows it speaks of; in IV `above` the aligned source and code, which span both columns and read down (wrapped at 80 characters: two lines in the band of 120), then `below` as the working frame assembles, and still `below` as the map surfaces under it. Every text lands in a rest, leads its step by 60 f (120 for a form's first in IV: IV1 above, IV3 below; I1's is 60 too, so that its rows come while it is read rather than its "here" standing over an empty stage), is up its reading time and at most 720 f, and is covered by its lead, its steps and a hold of at most 84 f. A chapter's last picture holds until its last text is read; then its seam (below), and the scene's last, IV's, 2 s more ([caption](README.md#clock-and-caption)), so that the map is never cut while it is read about. **Names after the things.** Nothing is named before it is shown, in a text or a label: the first text says bytes, not the stack; the dump's header is `128 bytes at 7fffffffebc8` and its tag on the shelf `the 128 bytes`; the stack is named at I7, where its box is on screen; the registers at II1, as their rows arrive; rip at II2, its row; "the next to run" at II4, where the row is; `edi` at II5, its row of the parts. A convention is said where it first shows: the chain's arrows at I10, a register's parts at II5, the calling convention at II6 on the call that uses it, the stack panel's direction at III1 (the bar draws high addresses on top, the panel low on top, and the push goes up a row), the width squares with `columns`, the minimaps at IV4. **Notation.** From I's regroup on, a word that is no address is written as the stack will write it (the [`value`](README.md#value) atom: `0`, `1`, `0x100000000`), so a number reads the same in I, II and III. The stack's offsets and a pin's amount take `0x` from 0x10 up (`-8`, `+0x10`, `rsp -0x18`): beside a symbol's decimal offset (`main+50`), `-10` after `-8` would read as ten. **The seams.** A chapter ends when its last text has been read (call that frame e) and the next begins there, with its title ([`title`](README.md#6-verbs)): e to e+30 still, the finished picture; its texts leave together (e+30 to e+42); the title arrives in the caption's place, `II Registers` (e+48 to e+66), the clock's label with it (e+54 to e+66, secondary); still under the title (e+66 to e+126); then the next chapter's opening, its own table's second row, under the title, which leaves at its reading time or the opening's end, whichever is later; the chapter's first text arrives 6 f after. So a seam is one pause of 2.1 s (e to e+126) in which nothing moves but the old text going and the title coming, where the three videos had two: a chapter's 2 s closing hold and the next one's 30 f on the same picture, 2.5 s, then each chapter's opening and a second more before its first text. The video's start is I's seam from nothing: the title, `I Memory`, arrives at 6 (to 24), still to 84, leaves at its reading time (143 to 155); I1's text arrives at 161 and its step fires at 239, by 4.0 s as a scene's first must. Mock 62 is II's seam, four instants. The frames below are each chapter's own, from its e: a text *lands* when it has arrived, its step *fires* its lead after, and it *leaves* when it starts to go (a bubble that stays as the account *dims* instead). **I. Memory** (71.4 s; the video's frames, the title 6 to 155) | | Form · text | Panes (rows) · shelf | Level | The step, and what plays | Text (characters) | Lands | Fires | Leaves | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | I1 | working frame · below; the camera at x2 on the state column | the dump of 128 bytes, sixteen a row, eight rows, no ink, the addresses faint, its header over them, `128 bytes at 7fffffffebc8` (mock 29) | | the rows fade in a row at a time (18 f each, 18 f apart: they come while the text is read) | A running program is bytes in memory: here are 128 of them. (59) | 179 | 239 | 481 | | I2 | the same | the dump | | `regroup`: sixteen a row to eight, the return address (the dump's first word) walked, the other fifteen at a run (mock 37, [chart](#a-word-read)) | Eight bytes make a word, stored low byte first: the lowest byte is its last two digits. (87) | 517 | 577 | 1066 | | I3 | the same | the dump, sixteen words | | three words that hold addresses framed as read, one at a time, 30 f apart | Some words are addresses: they name a place in memory. (54) | 1101 | 1161 | 1386 | | | | | | 1386 to 1577, into the column: the text leaves (12 f); the camera out to x1 (72 f, then 36 still); the dump folds to its tag on the shelf, `the 128 bytes` (its rows glide up into its header, the header becomes the tag, the tag slides to the shelf, 24 f each way: README, [column](README.md#column), "Mixing them"); the program column opens to the column's height for `segments` | | | | | | I4 | column · beside | `segments` (treatment A, mock 34), the panes' column from 84 to 888: a slim bar the column's height, true scale | the bar's middle | the whole builds, deliberately ([chart](#the-address-space-enlarged)) | Its address space, 128 TiB, to scale: mapped only at each end. (62) | 1577 | 1637 | dims 1891 | | I5 | column · beside | `segments` | the stack's box, at the top | `enlarge`: the stack's box rides out (78 f) and its names come, each band with its start and end addresses and its size; the libraries' box rides as the stack's lands | Enlarged, the top end: the stack, then the libraries, each file with its addresses and size. (92) | 1909 | 1969 | dims 2330 | | I6 | column · beside | `segments` | the program's box, at the foot (the bubble's way down) | `enlarge`: the program's box, by segment (code, read-only data, data, the heap), its names | At the foot, the program: its code, its data, its heap. (55) | 2348 | 2408 | 2643, the three together | | | | | | 2643 to 2762, back to the working frame: the texts leave together (12 f); `segments` keeps the program column, its height eased to the stage's (24 f, the drawing scaling as one); the dump unfolds from the shelf in the state column, at x1, the fold backwards (2679 to 2727) | | | | | | I7 | working frame · below | `segments` in the program column; the dump in the state column | | the dump's place ([chart](#the-address-space-enlarged), mock 30): the `tie` bracket on its rows, the `link` over the top onto the stack's box, the band framed bright as it lands, and with it the dump's addresses taking the stack's ink | These 128 bytes are here, at the very top of the stack. (55) | 2762 | 2822 | 3050 | | I8 | working frame · below | the same | | a camera `visit` at x2 to the dump's place, the stack's box and the dump's top rows framed together ([chart](#the-address-space-enlarged)): the move (72 f), the place marked `128 bytes` on the box, back (72 f) | Were the bar the Eiffel Tower, they would be an atom thick, at its top. (71) | 3086 | 3146 | 3471 | | I9 | working frame · below | the same | | `ink` on the return address, walked: its digits, its bytes, its band and the band's row framed (an echo); the rest at a run, 2 f apart; the link and its bracket quiet to standing (24 f) | A word takes the ink of where it points: 401272 is list's code. (63) | 3506 | 3566 | 3830 | | I10 | working frame · below | the same | | the words glide to their field's left (24 f) to give their chains room; three chains grow (`extend`), 36 f apart | Follow an address and you reach another word: a chain. → points to a word, ← holds a value. (91) | 3866 | 3926 | II's seam | The chapter's last picture holds until its text is read, 4284: II's e. **II. Registers** (52.0 s), opening on I's last picture | | Form · text | Panes (rows) · shelf | Level | The step, and what plays | Text (characters) | Lands | Fires | Leaves | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | | | | | 0 to 126, the seam: I's last picture (30 f); I10's text leaves (30 to 42); the title, `II Registers`, arrives (48 to 66), the label with it (54 to 66); still (66 to 126); mock 62 | | | | | | | | | | 126 to 216, the opening: the dump's link and its bracket fade (18 f); its header comes back over its rows (12 f), the rows glide up into it (24 f), it becomes the tag, `the 128 bytes` (12 f, crossfading), and the tag rises to the shelf's height and slides along it to the shelf over the program column (24 f, `glide`), over the address space's labels, crossing none: the bytes wait there, folded, while the chapter's moments run, which come before I's (the bytes are I's); the title leaves (216 to 228) | | | | | | II1 | working frame · below; `segments` in the program column as I left it, the 128 bytes on the shelf | the `registers` at their place, the state column's top (48), every register a row: sixteen here, rip's and the panel's frame to come (II2) | rax's row | the rows arrive top down, a row at a time, the name and then the chain, in the inks of I9 and followed as I10 follows a word (12 f each, 14 f apart: they come while the text is read) | The CPU keeps sixteen words of its own, named, not addressed: the registers. (76) | 252 | 312 | 618 | | II2 | the same | rip's row, the flags at its end; `frame up`; the clock | rip's row | rip's row arrives (12 f), the gold plaque on its name; its value framed as read (6 f), then (18 f after) list's code band and its row of names framed in the program's box (`ink`'s echo, 6 f) and the `◂ rip` pin coming in at the row's end ([`segments`](README.md#segments), live; 12 f, rising 8); held 60 f; the frames go (18 f); `frame up` on the registers: the rule (12 f), the tag and its legend, the inks of I9 (12 f); the clock's rule and gold and its count (12 f, secondary) | And rip: where the CPU is, an address in list's code. (53) | 654 | 714 | 936 | | II3 | the same | | the stack's box | rbp and rsp framed as read, 6 f apart; the stack's band and its row framed (18 f after); their `under` pin in the band, rbp's name left of the stub and rsp's right (12 f, rising 8); held 90 f, the frames go (18 f); then rax, rcx and rsi at a run, each framed with the heap's band (12 f, 2 f apart) (mock 58) | rsp and rbp point into the stack, rax, rcx and rsi into the heap. (65) | 972 | 1032 | 1296 | | | | | | 1296 to 1384, into the code: the text leaves (12 f); `segments` fades with its pins (18 f, 1314 to 1332): what it said, the registers' inks carry from here; push's six rows round the pc arrive at the disassembly's place, the program column's foot (740 to 884), with no panel round them (III5's `frame up` gives the disassembly one), 12 f each, 2 f apart (1338 to 1360); the caption band is empty from here: the texts stand beside, on the left, over the code | | | | | | II4 | working frame · beside, on the left | push's rows, `40115c mov edi, 0x10` the pc's, its line 11 gold | rip's row | the pc's mark comes to its row, plaque and wash (12 f); rip's value and the row's address framed as read together (an echo, 6 f), held 96 f, out (18 f) | rip holds this row's address: the next to run, in push(9). (58) | 1384 | 1444 | dims 1683 | | II5 | the same | rdi's row opened into its [`parts`](README.md#reg), three rows under it (mock 59) | rdi's row | rdi framed as read (6 f: push's argument); `unpack` (54 f); still 24 f; `mov edi, 0x10` walked ([chart](#a-registers-parts)): fire; the operand `edi`, the part edi and its four bytes framed together (an echo); the byte that changes armed and struck, `09` to `10`, the row's annotation `rdi 0x10 16` with it; hold 36 f; advance, the cool; `pack` (36 f) | rdi holds push's argument, 9. Its low four bytes are edi, as eax are rax's. (75) | 1701 | 1761 | dims 2073 | | II6 | the same | the call's row; rax's | rax's row | `call malloc@plt` stepped over ([chart](#a-call-stepped-over), mock 60): rdi framed with the argument hanging under the call; the call runs, unseen; rax armed and struck, `405050`, and the row's annotation with it, `malloc(16) = 405050`; then rcx, rsi, rdi in a wave; r11's word and PF, ZF held; hold, advance, the clock's gold for malloc's 162 moments with the advance | Arguments go in rdi, rsi…; the result comes back in rax. (56) | 2091 | 2151 | dims 2383 | | II7 | the same | reverse's first six rows, after the fade through | rsp's row | a [`continue`](README.md#6-verbs) from `401166` to reverse's first instruction: fire (12 f); the wave, rcx, rbp, rsp, 2 f apart; rax's held word (`◂ 9`, written under it) and ZF take their corners; the disassembly fades through to reverse's rows (12 out, 12 in), the mark in on `push rbp`, rip's value with it; the clock's gold for the 13 moments | On, into reverse(): rsp and rbp move with the calls. (52) | 2401 | 2461 | dims 2678 | | II8 | the same | the registers folded to eleven rows; the 128 bytes under them (mock 61) | the first folded row | [`fold`](README.md#6-verbs): the ten registers the video never changes glide into their cells, three to a row, under a rule, rip's row up with them (36 f, then the rule 12 f); then the 128 bytes come back: the tag slides along the shelf's height and down to its place under the registers (24 f), becomes the header (12 f), the rows glide down out of it (24 f) and the header goes (12 f): the words as I left them, with their three chains, each at the row III's stack will give it (rsp's at 480, four free rows over it) | Registers we will not follow fold, three to a row. We are back where the 128 bytes were read. (93) | 2696 | 2756 | III's seam | The chapter's last picture holds until its text is read, 3121: III's e. Its registers panel is the scene's from here to the end, one set: rax, rcx, rsi, rdi, rbp, rsp as rows (II changes all six), the ten others folded, rip; eleven rows (48 to 344), as the `subject` split has them in IV. **III. The stack** (35.3 s), opening on II's last picture | | Form · text | Panes (rows) · shelf | Level | The step, and what plays | Text (characters) | Lands | Fires | Leaves | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | | | | | 0 to 126, the seam: II's last picture (30 f); its texts leave together (30 to 42); the title, `III The stack` (48 to 66); still (66 to 126) | | | | | | | | | | 126 to 174, the opening: the words become the stack panel where they stand (II8 put them at its rows): the bytes fade (12 f), the addresses travel to the slots' address column and the words to its chains' (24 f), and the rows are the panel's (12 f): sixteen words and four `free` over rsp. The window is held there through the chapter: the push and `sub rsp` fill the free words and only pins move, no row. The stack stands under the registers' eleven rows, 356 to 868; the title leaves (203 to 215) | | | | | | III1 | working frame, text beside on the left (the program column: reverse's six rows at its foot since II7, nothing else until III3) | the stack; its offsets, roles, spans and tag under the page until their beats | the stack's first row | the convention said where the panel first stands: the offsets come down the rows (`column`, 4 f apart), counting from rsp | Here lower addresses are drawn higher: down a word is up a row. (63) | 239 | 299 | 556 | | III2 | the same | | rsp's row | rsp's pin lands on the top word (12 f); rsp's link from its row down to the word, a link on the beat (README, [`link`](README.md#6-verbs)): rsp framed, the link (36 f), held 1 s, drawn back (18 f). Its row was built in II: nothing arrives | rsp holds the address of the top of the stack. (46) | 591 | 651 | 855 | | III3 | the same; the scene's one `aim`, `drawn` | main's three rows in the program column over reverse's (a descent's head, `main`; `40126d call 4011a0 reverse`; `401272 call 401200 clear`; `401277 xor eax, eax`), 604 to 700, level with the lower stack | the return address's row | the call first, as it happened, before the push: the word `401272 main+50` framed as read (6 f); main's rows (12 f each, 2 f apart); the `aim` from the word down the gutter's left lane to `401272`, the row after the call, head first at full ink (18 f), the address framed as the head lands (6 f) | A call pushes the address to come back to: here, main+50. (57) | 890 | 950 | 1193 | | III4 | the same | reverse's six rows (the disassembly's panel 712 to 888, its rules, tag and strip under the page until III5); rbp's pin | the free word over rsp | the aim falls to standing at 60% (18 f), the word's frame goes and main's rows go faint (18 f); rbp's pin (12 f); `push rbp` walked, its row fired by the pc's mark: the touch to the word, then rbp's value carried there from rbp's row (`carry` `after_touch`) and struck, though the word held that value; rsp's pin climbs onto it, `rsp -8`, and rsp is struck | A push moves rsp down a word and stores there: push rbp keeps the caller's rbp. (79) | 1229 | 1289 | 1625 | | III5 | the same | the stack, its roles and spans; the disassembly's and the stack's rules and tags | the frame's span | the aim leaves (18 f); `mov rbp, rsp` walked (rbp's pin flies to rsp's row; the offsets now count from rbp), `sub rsp, 0x18` walked (rsp's pin climbs three rows, `rsp -0x18`, `3 words`); the roles (`column`: `cur`, `prev`, `saved rbp`, `the way back`, and the callers' below), the spans (`column`); `frame up` on the disassembly and the stack, the rules (12 f) then the tags and strips (12 f) | rbp marks the frame's base. A function's words are its frame: the saved rbp, its locals, the way back. (102) | 1661 | 1721 | IV's seam | The chapter's last picture holds until its text is read, 2118: IV's e. (The three videos' chapter II ended on a sixth beat, the registers built over the finished stack, a row at a time; II builds them now, and III has its beats as they were, 125 f later, less the arrival of rbp's and rsp's rows in III2 and of reverse's rows in III4, both on screen since II.) **IV. Code and meaning** (47.5 s), opening on III's last picture | | Form · text | Panes (rows) · shelf | Level | The step, and what plays | Text (characters) | Lands | Fires | Leaves | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | | | | | 0 to 126, the seam: III's last picture (30 f); its texts leave together (30 to 42); the title, `IV Code and meaning` (48 to 66); still (66 to 126) | | | | | | | | | | 126 to 144, the opening: its code fades (18 f); its state column is veiled at 50% (18 f) and stays, veiled, until the decoded rows come to span it; the clock and its label stay, under the stage; the title leaves (224 to 236) | | | | | | IV1 | working frame · above | the code's bytes as a dump row in code's ink, in the program column | | the row arrives (12 f), its sixteen bytes take code's ink 2 f apart, one instruction's four bytes framed | Code is bytes too: 48 8b 40 08 is one instruction. (50) | 260 | 380 | 538 | | IV2 | `aligned` · above | `aligned`, `interleaved`, across both columns (mock 32) | | `decode`, the instruction walked (60 f) as III's state column goes under it (12 f); its neighbours at half a run's pace (rows 4 f apart), each line heading its run, while the text is read; the panel's rules and tag (24 f) | Decoded: mov rax, [rax + 8], from line 21. Each line heads the instructions it compiled to. (91) | 573 | 633 | 998 | | IV2b | `aligned` · above | `aligned`, `columns` (mock 36) | | `align` to `columns` at two thirds of its pace (120 f), while the text is read | Two columns: each line by its first instruction. A square after ]: a byte it touches. (85) | 1034 | 1094 | 1438 | | | | | | 1438 to 1599, into the working frame: the texts above leave (12 f); `stack`: the lines glide to the source panel's rows, the instructions to the disassembly's (60 f), those panels coming in under them as the aligned panel goes (12 f); `establish`: the registers, the stack and the ties, at IV's moment (the clock is on since II2) | | | | | | IV3 | working frame · below | the program column, the state column at the load; the band | | the heap's dump in the band's right half (18 f), then the nodes drawn from it, rising (`establish`); rax framed as read and its link up to the node it points at, a link on the beat | Later, at line 21, rax points at a list node on the heap: its bytes, and drawn, the node. (89) | 1599 | 1719 | 2017 | | IV4 | working frame · below | the working frame of mock 9 | | each pane's minimap draws itself, last, top down (24 f each, 72 f apart, while the text is read). No camera: at x1.5 the nodes and their bytes would not both be in frame | This is the whole frame. Every view in it is these same bytes; each strip, the whole of its pane. (97) | 2052 | 2112 | 2492 | | IV5 | the map · below: the text lands before the move and stays under the map as under the frame | the map | | `surface` | And all of it at once: the map. (31) | 2528 | 2588 | | The last picture, the map, 2 s after its text is read, to 2851. Together 12374 f, 206 s; the video's chapter marks at its titles: 0:00 Memory, 1:12 Registers, 2:04 The stack, 2:39 Code and meaning. ## A scene in the column: `open` followed down The syscalls scene's first part in the [column](README.md#column): `open` followed down from main through the PLT and libc into the kernel and back, built beside the scene as it is (`column-1080` beside `syscalls-1080`), on the same recording (`hello`, by instruction from main; the moments below are a fresh recording's and move with the build). Vertical position has a meaning here that it has nowhere else: the story goes down a call at a time to the kernel and comes back up, and each bubble, level with its row, goes down with it. Mocks 49 to 53 are five of its beats, 54 the crossing in both forms. **In the working frame** (`beside`, the descent in 17 rows, a caption of two lines under the stage): | | Moments | Step | The caption | | --- | --- | --- | --- | | P1 | 30 to 34 | walk by line to line 6 | A program cannot open a file itself. / It asks the kernel, and waits. | | P2 | 34 to 37 | walk to the call | `main` calls `open` by its stub in the PLT, with "note" / in rdi and O_RDONLY in rsi. | | P3 | 37 to 38 | `descend` | The call goes down: main's call waits, ringed; / the stub's three rows open under it. | | P4 | 38 to 39 | the stub's jmp | The stub's jmp reads open@got / and goes on to libc's `open`. | | P5 | 39 to 61 | a run | libc's `open` is a wrapper: a few lines of C, open64.c, / up to the instruction that calls the kernel. | | P6 | 61 to 64 | walk, three | Its last three set r8 to 0, rdi to AT_FDCWD (-100) / and rax to 257: openat's number. | | P7 | 64 to 65 | `cross` | `syscall` crosses down. The kernel opens the file / and answers in rax: 3, the descriptor. | | P8 | 65 to 75 | a run, then `ascend` | `open`'s ret comes straight back to main: the stub / was a jump, not a call. The windows close up. | **In the column**: the author's choices, a beat a row, as the scene file is written from them. *Panes* are in the column's order with their rows (`rest`: what the column has left above the floor); everything else is on the shelf, its note given. *Level* is the row a bubble's first line sits beside; *stem* the row its stem points at in the rest before the step (none: its level is the tie). Where a cell says *default*, the author wrote nothing there. | | Moments, step | Placement | Panes | Shelf (notes) | The bubble | Level | Stem | | --- | --- | --- | --- | --- | --- | --- | --- | | C1 | 30 to 34, walk by line | `below` | the working frame whole (`beside`) | | A program cannot open a file itself. / It asks the kernel, and waits. (the caption, as P1) | | | | C2 | 34 to 37, three walked | `beside` | source 3 (5 to 7), disassembly 11, registers (14 rows, all) | system calls · its bytes · stack | main puts open's arguments in registers: "note" in rdi, O_RDONLY in rsi. | default: the `lea` row, the beat's first | default: the same | | C3 | 37 to 38, `descend` | `beside` | source 3, disassembly 11 becoming the descent, stack `rest` (19 words) | system calls · its bytes · registers (rsp struck) | The call pushes the way back, main+45, and goes down to the stub. | the call row | the call row | | C4 | 38 to 39, the stub's jmp | `beside` | source 3 (line 6 waiting), the descent (main 8, the stub 3), stack `rest` | system calls · its bytes · registers | The stub is one jump through open@got: it pushes nothing. | the stub's `jmp` | the same | | C5 | 39 to 61, a run | `beside` | source 2, the descent (main 3, the stub 1, open's window following the pc), stack `rest` (open's frame growing: its pins travel over the veil) | system calls · its bytes · registers | libc's open is a wrapper: a few lines of C around the one instruction that calls the kernel. | open's head row | open's head row | | C6 | 61 to 64, three walked | `beside` | source 2, the descent (main 3, the stub 1, open 6), registers 14 | system calls · its bytes ("note" handed in) · stack (open's frame, 16 words) | Its last three set the kernel's arguments, and openat's number, 257, in rax. | the first of the three (`xor r8d`) | none | | C7 | 64 to 65, `cross` | `beside` | source 3 (waiting), the descent with the kernel at its floor (24 rows) | system calls (its row arriving) · its bytes · registers (rax 3 struck, rcx, r11) · stack | syscall crosses down; the kernel opens "note" and answers 3 in rax. | the kernel's head | none | | C8 | 65 to 73 a run, 73 `leave`, 74 `ascend`, 75 the store | `beside` | source 3, the descent closing to main's window (13), stack `rest` (open's frame released as rsp's pin falls) | system calls · its bytes · registers (rax 3) | open's ret comes straight back to main: the stub was a jump, not a call. main keeps the answer in f. | main's call row (the bubble climbs back) | none | | C9 to C11 | `read`, `close`, `write`, each stepped over | `beside` | its bytes (buf, 3 rows) over the source 3, main's disassembly with the kernel's window under the call row | system calls · registers · stack | the present captions for the three | each call row | each call row | | C12 | to main's return | `below` | the working frame whole | | the present closing | | | **One beat, its frames** (C2 to C3, from the end of C2's last step's rest): | Frames | | | --- | --- | | 0 to 18 | C2's bubble dims to `dim`, losing its paper | | 18 to 30 | the registers' rows fade | | 30 to 54 | the registers' panel closes to its tag as the tag travels to the shelf (24 f, `glide`); its note fades in there: `rsp` | | 54 to 78 | the stack's tag travels from the shelf to its box as the panel opens under the disassembly (24 f) | | 78 to 90 | the stack's rows fade in | | 90 to 114 | C2's bubble glides up out of the way of the next (24 f, `glide`) | | 114 to 132 | C3's bubble arrives level with the call row, rising 8 (18 f) | | 120 to 132 | its stem draws to the call row | | 132 to 192 | the lead: the bubble read, the frame still | | 192 | the step fires (`descend`, its touch to the free word over rsp, as "A call pushed"), and the stem draws back over its first 12 f | So a beat that changes its panes costs about 96 f, 1.6 s, over the caption's change (out 12, gap 6, in 18, then the same 60 f lead), and a beat that keeps them nothing. Over C2 to C8 the panes change five times: about 8 s on a part of some 45 s. **What the scene's code says for a beat.** The author's choices are the beat's arguments, each optional; what it leaves out is defaulted as the catalogue says, never against what it wrote: ```zig // C3: the call goes down. The stack under the descent, the rest on the shelf. col.beat(s, .{ .panes = &.{ .{ .source, 3 }, .{ .disasm, 11 }, .{ .stack, .rest } }, .say = "The call pushes the way back, `main+45`,\nand goes down to the stub.", .at = .beside, // .below .above .on; default .beside in a column scene .level = .{ .row = call }, // default: the row of the beat's first step .stem = .{ .row = call }, // default: what it is level with; .none }); canim.descent.step(cur, s, .moment); // the step itself, as in the scene now ``` **What it costs and gains, beat by beat** (the working frame against the column, at each beat's hold): | Beat | The working frame shows | The column shows | Leaves on the shelf | | --- | --- | --- | --- | | C2 | source 8, disassembly 17, registers 14, stack 11, the log and its bytes | source 3, disassembly 11, registers 14 | the stack (nothing changes in it), the log, its bytes | | C3 | the same; the descent closing main's window to 3 | source 3, the descent, a stack of 19 words with the return address on top | the registers (rsp struck on its tag) | | C4 | the descent 17 (main 3, stub 3) | the descent 12 (main 8, stub 3) and the stack (the return address held: the stub pushes nothing) | the registers | | C6 | the descent 17, registers 14 | the descent 12 (open 6), registers 14 (rip above 888) | the stack | | C7 | the descent 17 (open 8), registers 14, stack 11 | the descent 24 (open 13, the kernel 2) | the registers (rax 3 struck on the tag), the stack, the log (its row) | | C8 | the windows closing, stack 11 | main 13, a stack of 18 | the registers | Nothing the narration depends on is only on the shelf: rax's 3 is in the kernel's `returns 3`, on the registers' tag, and in the bubble; rsp's move is the stack's pin when the stack stands, and the registers' tag when it does not. The context is whole at C1 and C12 (`below`), on the shelf throughout, and on the map. **As built.** The render keeps the newest bubble level with its row in most beats and runs 23% longer than the working frame's (seven pane changes, about 9.5 s). Three of its beats break the rules the [column](README.md#column) now states: C4's bubble (104 characters) was still being read 4.9 s after its one step had played; the descent stood empty about 40 f while it grew at C7; and the change into the column at C2 slid the working frame's empty panels across each other. The bubbles in the table above are cut to the lengths the rule allows (C4's from 104 characters to 57). And the scene could change its panes twice less: C6's registers can stay through the crossing (rax is struck in them there), and C7's stack can stay folded until C8 needs it. ## Stills Seen while looking at motion; against `README.md`. - **Camera at x2**: the neighbouring panel shows at the frame's edge (the stack's divider and `rsp` plaque beside the registers, the source's bottom rule above them); on the stack the last row is cut by the caption band and the tag is out of frame. See "The camera". - **Kernel argument names** come from a type, not the call: `close` and `read` show their descriptor as `number`, `open` shows flags and mode both as `pointer`. They are `fd`; `path`, `flags`, `mode`; `fd`, `buf`, `count`. - **`rax`'s role** reads `result` while it holds the call's number going in. `number`, then `result` once it is struck. - A pointer in the kernel's rows is twelve digits unbroken (`7fffffffd8c0`); in fours, as everywhere. - On `write` the user's bytes are not framed as read; they still carry the ember of `read`, two calls and six seconds ago. - **Types** are in Zig's spelling for a C program: `[8]i32`, `i32`. The source says `int a[8]`. - **Two panels titled `heap`** in `list` (the strip and the words). - **Two dividers named `fib`** in the stack at x1: `fib(5)`, `fib(4)`. - The call stack clips its sixth card; elide below ("2 more"). - Unknown bytes become known with a reflow and no transition (zoom, 16.57). - A divider row inserted into the grid moves every row under it by 20 units. Give dividers a fixed place between rows. ## The ten changes 1. **Sequence the step.** Fire; effects one level at a time, 0.30 s apart, each armed then struck; the mark last. The kernel's side included: no effect before its cause. 2. **Time a step by its content** (0.8, 1.5, 2.0, 2.5 s) and rest a beat at each phrase end. 3. **Rebuild run and sprint.** 0.30 s steps with the mark and structures eased and values as embers; 24 steps at most; sprint beyond; ramp in over four steps and out over three; veil what cannot be read; counter and progress line. 4. **Let the picture and the caption be read.** The panels in by 0.9 s, the first caption at 1.0 s, the first step by 4.0 s; 2 s after a scene's first caption, 1 s after any other; each caption up for its reading time and at most 12 s; captions leave, pause, arrive; 2 s on the last picture. 5. **Walk the point of each scene once**: a return, each pointer turning, a swap by 10 s, each system call under its own caption. 6. **Anticipate every write**: the arm, the fill over six frames, the pulse as a 4-unit outset, the cool eased with the digits changing at its middle. 7. **New curves, and travel timed by distance**: `standard` 0.3, 0, 0.2, 1; `glide` 0.45, 0, 0.55, 1; the mark 12 to 24 f or a jump; flights 30 to 48 f, the second six behind. 8. **Direct the camera**: frame the target, clear the stage, move, hold; the tag and whole rows in frame with the action in the middle; sideways by fading through; never 2 s at x2 without a change. 9. **Nothing pops into a layout**: make room, then arrive; scroll, never cut; slide what persists; fade what becomes known. 10. **Show the instruction** at the CPU level, and review at 60 frames a second. ## The instruments [`motion/motion.py`](motion/motion.py): ffmpeg, numpy, Pillow. Regions and crops are in design units. ```sh cd design/motion python3 motion.py chart VIDEO --out charts # the chart, the events, the checks python3 motion.py auto VIDEO --out tmp/auto # and a contact sheet of every event python3 motion.py sheet VIDEO 20.4 21.4 --step 2 --crop 400,160,1120,368 python3 motion.py sheet VIDEO f66 f77 --diff # what changed, white on the frame dimmed python3 motion.py onion VIDEO f614 f636 --crop 400,160,1120,368 # every frame of a move in one picture python3 motion.py track VIDEO f139 f158 --color e8c46a # a colour's box and centre, frame by frame ``` `chart` compares each frame with the one before, in each region of the scene's layout (a table at the top of the script, keyed by the video's name; add a scene there). Any other name gets the working frame's: the program column, the state column, the caption's text alone (64 to 1464, 906 to 1032, clear of the clock's count), the clock and the minimap (the corner one, which the videos still have; the per-pane strips want regions of their own here, by split). A pixel *moved* if a channel changed by more than 24 of 255 and is *fading* if by more than 6. The picture is one bar a frame and one strip a region: solid for moving, outlined for fading, holds shaded with their length. The text lists every event with the first and last frame of each region in it, which is where simultaneity shows, and ends with the checks: | Check | Fires when | Wants | | --- | --- | --- | | POP | a region still for 12 frames or more changes in one frame and is still again, at any size (a label swapped, a count appearing, a box gone, a window that jumped); or over 0.2% of the frame changes within two frames, still either side. The clock's count is exempt: it is time | a crossfade, a fade, an arm and a strike | | CROWD | three or more panels begin within two frames of each other | the cascade | | METRONOME | seven or more events of over 0.5% of the frame, evenly spaced | content-timed steps, phrase rests | | CAPTION | a caption is on screen over 720 f, or under 90 f + 3.6 f a character, or the picture moves less than 60 f after it arrives. Its time on screen runs from the end of the change that brought it to the start of the next. `design/motion/motion.py` reads the video only, so it holds a caption to 90 f; `anim/tools/chart.py`, which has the scene's captions, counts their characters | a second caption, a shorter scene, a later step | | AIR | nothing changes for three seconds | a shorter hold, or something to say | A scene is ready for eyes when all five are empty or each remaining line is deliberate. They are not taste: a chart can pass and still be dull. Limits: regions are fixed on the screen, so under a camera move their names stop meaning panels; `track` follows a colour, so crop to one object (its box columns are the honest ones when two share the colour); the thresholds suit x264 at the export's quality and will need loosening for a harder encode. x264's default keyframe every 250 frames shows as a one-frame change in every region every 4.17 s: the encoder, not the scene; export with `-g 600`. What is kept: `motion/charts/` (chart, events and per-frame counts for the five scenes as reviewed) and `motion/sheets/` (the sheets this page cites, named scene, second, what). `motion/tmp/` is scratch.