summaryrefslogtreecommitdiff
path: root/anim/scenes/list.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 23:36:18 -0300
committerGabriel Schneider <[email protected]>2026-11-10 23:55:42 -0300
commit81d97a9e38c740a96af13a8a981878947a508bc0 (patch)
treebbe53f2f4c195f378a5a8cb67dfac1277ac68c82 /anim/scenes/list.zig
parent2a46b60e1d115ff5149a112bc0f800467c0efaee (diff)
downloadcomputeranim-81d97a9e38c740a96af13a8a981878947a508bc0.tar.gz
computeranim-81d97a9e38c740a96af13a8a981878947a508bc0.zip
canim: quieter marks, the stack's roles, the loupe, arcs, the minimap, the map and the dive
From the user's notes on the second videos. The current row is a white wash, a strike a softened vermilion, held a turned corner. A stack row has its offset from rsp and its role from the tracer (a saved register, a local by name, argc and argv). The loupe is the telescope as a floating panel: the memory round what a pointer leads to, a pointer inside it opening the next. A pointer to a row of its own panel is an arc in a lane, in dumps, loupes and the stack. Every scene has the minimap; the map is the same moment with every panel at full length on 3840 by 2160, and the list opens on it and dives to the working frame, each panel travelling to its place. Recordings hold more round each stop. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/scenes/list.zig')
-rw-r--r--anim/scenes/list.zig31
1 files changed, 27 insertions, 4 deletions
diff --git a/anim/scenes/list.zig b/anim/scenes/list.zig
index d6f1a76..b7e6c4a 100644
--- a/anim/scenes/list.zig
+++ b/anim/scenes/list.zig
@@ -6,8 +6,10 @@
//! trip round the loop is walked (each local strikes on the stack and in
//! the table, then its tag slides to its node; the pointer's rewrite is
//! armed with its old arrow going dashed, strikes, and the new arrow grows
-//! to the node it lands on); the second trip is hurried, with a rest; the
-//! third is walked again, and `head` takes the last node.
+//! to the node it lands on); after its first load the pointer loaded is
+//! opened in a loupe, and the `next` in it one deeper; the second trip is
+//! hurried, with a rest; the third is walked again, and `head` takes the
+//! last node.
const anim = @import("anim");
const canim = @import("canim");
const recordings = @import("recordings");
@@ -32,17 +34,38 @@ fn frame(s: *anim.Frame) void {
const split = canim.layout.split.subject;
const ctx = canim.context(s, at, .{ .split = split });
const list = canim.nodes(s, .{ .cursor = at, .stage = ctx.stage, .root = "head", .track = &tracked });
+ ctx.map.add(s, canim.Nodes{ .cursor = at, .stage = ctx.map.stage, .root = "head", .track = &tracked });
var says: canim.Narrator = .{};
+ // The pointer just loaded, opened: rax holds `cur->next` after the
+ // first trip's line 21; a loupe under it, and one from that node's `next`.
+ const loaded = rec.lineMoment(22, rec.lineMoment(21, reverse.enter));
+ const near = canim.loupe(s, .{ .cursor = at, .stage = ctx.stage, .from = .{ .register = "rax" } });
+ const deeper = canim.loupe(s, .{ .cursor = at, .stage = ctx.stage, .from = .{ .field = .{ .loupe = near, .at = rec.register(loaded, "rax") + 8 } } });
const joins = ctx.ties(s);
- // The nodes come in beside their bytes, one by one: three of them.
- ctx.establish(s, .{ ctx.clock, ctx.registers, ctx.stack, ctx.source, ctx.disasm, list, joins }, 3);
+ // It opens on the map, the whole context unfolded: the first caption at
+ // 1 s, the dive into the working frame at 2.5 s, the first step at 5 s.
+ ctx.map.show(s, .{ ctx.clock, ctx.registers, ctx.stack, ctx.source, ctx.disasm, list, joins });
+ s.wait(@max(t.establish - s.cursor, 0));
says.line(s, "A list is nodes on the heap, each holding the address of the next.\nReversing it moves no node: it rewrites every `next`.");
+ s.cursor = 2.5;
+ ctx.map.dive(s);
// Three names are set up.
const first_trip = rec.lineMoment(21, reverse.enter);
at.walk(s, .line, first_trip);
// The loop's caption leads the loop.
says.line(s, "`next` remembers the way on, `cur->next` is turned round,\nand `prev` and `cur` each step along.");
+ at.walk(s, .line, loaded);
+ // A beat of its own: the pointer just loaded is opened, and the one in it.
+ says.line(s, "`rax` holds `cur->next`: under it opens the heap round that node,\nand from its `next`, one deeper, the node after it.");
+ near.open(s);
+ s.wait(t.beat);
+ deeper.open(s);
+ s.wait(2 * t.beat + t.loupe.open);
+ deeper.close(s);
+ s.wait(t.stagger * 3);
+ near.close(s);
+ s.wait(t.beat);
const second_trip = rec.lineMoment(21, rec.lineMoment(24, first_trip));
at.walk(s, .line, second_trip);
// Pacing: the second trip is the same, so hurried; it keeps its rest.