From 165bb6c1344b98de7bef1d3c2b72147b4a40797a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 16:05:20 -0300 Subject: canim: the renderer speaks the design language The blocks, their states and the tokens carry the catalogue's names: atoms in ui, chain/reg/slot in rows, insn with its line column, jump lane and annotations (read, write, taken or not, a call with its arguments, a return, a syscall) in disasm, bytes and hexdump with field paper and the reading column, the three splits and relayout in stage, the ties (thread, link and pin, projection, echo). A lens is a band over the whole context, its drawing left and its bytes right. Frames' spans on the stack, each instruction's line and a callee's parameter count come from the tracer. A gallery scene draws every block; the test compares six of its pages with pictures kept in test/gallery, drawn from a recording kept there too. The scenes are ported; the motion checks report no pop and no metronome in any of them. Co-Authored-By: Claude Fable 5.2 --- anim/scenes/sort.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'anim/scenes/sort.zig') diff --git a/anim/scenes/sort.zig b/anim/scenes/sort.zig index 0f14269..6ad41f9 100644 --- a/anim/scenes/sort.zig +++ b/anim/scenes/sort.zig @@ -22,16 +22,16 @@ fn frame(s: *anim.Frame) void { while (rec.next(.over, rec.next(.over, start)) < rec.call("swap", 0).enter) start = rec.next(.over, start); var at = canim.cursor(s, rec, start); // The array is the idea; `i` and `j` are memory, and strike a beat before their tags slide. - at.levels = .{ .cpu = false, .idea = .data, .follow = t.quick, .source_rows = 8 }; + at.levels = .{ .cpu = false, .idea = .data, .follow = t.quick, .source_rows = 10 }; // Its last compare: nothing larger is left of 20. const last = rec.call("swap", 9); const end = rec.next(.over, rec.next(.over, last.exit.?)); at.journey(.over, end); // The context is the instrumented program's: its registers are unmarked. - const split = canim.layout.split.beside; + const split = canim.layout.split.subject; const ctx = canim.context(s, at, .{ .split = split, .quiet = true }); // The lens: the array as cells, and the two indices that walk it. - const cells = canim.array(s, .{ .cursor = at, .box = split.lens, .variable = "a", .indices = &.{ "i", "j" }, .focus = true }); + const cells = canim.array(s, .{ .cursor = at, .stage = ctx.stage, .variable = "a", .indices = &.{ "i", "j" }, .focus = true }); var says: canim.Narrator = .{}; // A swap, start to finish, as one step of sort(): over the call. const swap = struct { @@ -40,8 +40,8 @@ fn frame(s: *anim.Frame) void { } }.step; - const joins = canim.ties(s, .{ .cursor = at }); - canim.establish(s, .{ ctx.clock, ctx.source, ctx.disasm, ctx.registers, ctx.stack, ctx.backtrace, cells, joins }); + const joins = ctx.ties(s); + canim.establish(s, .{ ctx.clock, ctx.registers, ctx.stack, ctx.source, ctx.disasm, cells, joins }); says.line(s, "`i` walks right. Everything left of it is in order,\nand 12 is not yet in its place."); // The compare: both cells framed. It is the swap's anticipation. at.walk(s, .over, rec.next(.over, start)); -- cgit v1.3