summaryrefslogtreecommitdiff
path: root/anim/scenes/sqlite.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 22:02:01 -0300
committerGabriel Schneider <[email protected]>2026-11-10 22:06:03 -0300
commit8b5d0340c9f9b3168c67f04e57cfa03712ac992c (patch)
tree66891f03e905731b8afa2689e86fe612675f4f35 /anim/scenes/sqlite.zig
parent36bb1c332a124cb4d437dd8386b267ee58310a5d (diff)
downloadcomputeranim-8b5d0340c9f9b3168c67f04e57cfa03712ac992c.tar.gz
computeranim-8b5d0340c9f9b3168c67f04e57cfa03712ac992c.zip
canim: a continue is a wave; what arrives after a fade is plain; a pin only where its register points
From the designer's review of the SQLite scene. Between far stops the changed registers strike two frames apart in pwndbg's order, and links and pins set off with memory. A stack window or a dump that fades in carries no marks of changes the viewer did not see. At rest a moved register kept a pin at its old place as well, in every scene: gone. The kernel's answer is filled before the return arrow leaves, and rax strikes as it lands. Every dump has one reading, by type (a char quoted, a bool by name); line numbers are as wide as the program's largest; pins' names keep the side they came to. Names and measures follow the catalogue (.loose, theme.metric.calls, time.pin, time.continue_wave). Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/scenes/sqlite.zig')
-rw-r--r--anim/scenes/sqlite.zig25
1 files changed, 9 insertions, 16 deletions
diff --git a/anim/scenes/sqlite.zig b/anim/scenes/sqlite.zig
index f145da6..e7d103e 100644
--- a/anim/scenes/sqlite.zig
+++ b/anim/scenes/sqlite.zig
@@ -103,18 +103,17 @@ fn frame(s: *anim.Frame) void {
var at = canim.cursor(s, rec, start);
at.levels = .{ .source_rows = 10 };
at.journey(.moment, back);
- // The lens is the subject: the call chain, eleven rows, over the
+ // The lens is the subject: the backtrace, eleven rows, over the
// program column (where the kernel's side comes later), and over the
// state column the bytes the newest call is handed.
- var split = canim.layout.split.subject;
- split.backtrace = split.band;
- const ctx = canim.context(s, at, .{ .split = split, .syscalls = true });
+ const ctx = canim.context(s, at, .{ .split = canim.layout.split.subject, .syscalls = true, .backtrace = true });
const kernel = canim.crossing(s, .{ .cursor = at, .stage = ctx.stage, .view = false });
// What the opening stop's rbx points at: the SQL sqlite3_exec is running.
const sql = canim.add(s, canim.hexdump.Dump{
.cursor = at,
.stage = ctx.stage,
.about = "the SQL being run, at rbx",
+ .since = start,
.of = .{ .base = rec.register(start, "rbx"), .len = 32, .fields = &.{.{ .at = 0, .len = 32, .reads = .text }}, .region = region.rodata },
});
// The row, as sqlite3BtreeInsert is handed it: rsi.
@@ -126,6 +125,7 @@ fn frame(s: *anim.Frame) void {
.about = "pX, the row: a BtreePayload, at rsi",
.of = .{ .base = rec.register(first, "rsi"), .len = 48, .fields = &payload, .region = region.stack },
.marks = row_marks,
+ .since = first,
});
// The page, as unixWrite is handed it: rsi. At that stop the debugger
// has read 32 bytes of it (where rsi leads); the kernel takes it whole.
@@ -140,6 +140,7 @@ fn frame(s: *anim.Frame) void {
.about = "pBuf: page 2 of t.db, at rsi",
.of = .{ .base = write.args[1], .len = 4096, .fields = leaf(s.arena, bytes), .region = region.heap, .seen = .{ .addr = write.args[1], .len = 32 } },
.marks = page_marks,
+ .since = handed,
});
const joins = ctx.ties(s);
var says: canim.Narrator = .{};
@@ -165,19 +166,11 @@ fn frame(s: *anim.Frame) void {
}
}
};
- // A continue: straight to the next stop, timed by what it changed.
- const walk = struct {
- fn to(c: canim.Cursor, f: *anim.Frame, moment: u64) void {
- const plan = c.reading(c.moment(f), moment);
- c.step(f, moment, plan, plan.total);
- }
- }.to;
-
canim.establish(s, .{ ctx.clock, ctx.registers, ctx.stack, ctx.source, ctx.disasm, sql, ctx.backtrace, joins });
says.line(s, "SQLite at a breakpoint in `sqlite3_step`, which runs\n`INSERT INTO t VALUES ('alpha')`. Continue:");
// What rbx showed was this stop's: it goes before the program moves on.
fade.out(s, sql);
- walk(at, s, first);
+ at.@"continue"(s, first);
s.wait(t.beat);
// The row it was handed: a struct on its caller's stack.
fade.in(s, row);
@@ -190,13 +183,13 @@ fn frame(s: *anim.Frame) void {
says.line(s, "Two more continues, the same call: rowid 2, then 3, records\nof 6 and 7 bytes. The rows are in memory, not yet on disk.");
mark.out(s, row_marks);
- walk(at, s, second);
+ at.@"continue"(s, second);
s.wait(t.beat);
- walk(at, s, third);
+ at.@"continue"(s, third);
says.line(s, "`COMMIT`: `unixWrite`, nine calls under `main`, is handed\npage 2 of the file: 4096 bytes, for offset 4096.");
fade.out(s, row);
- walk(at, s, handed);
+ at.@"continue"(s, handed);
s.wait(t.beat);
fade.in(s, page);