From dc3b58781420be6070fca896e55776bc27db905d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 20:16:54 -0300 Subject: canim: a scene from a real program: SQLite's row on its way to disk Three inserts stopped at sqlite3BtreeInsert with their payloads read off the caller's stack, the commit's backtrace from unixWrite up to main, the pwrite64 crossing into the kernel, and page 2 as the kernel took it: its header, its cell pointers and the three rows, read by field. The scene is built only where SQLite's source is (-Dsqlite=DIR); its recording is 181 moments, 95 KB. What a real program asked of the blocks: a dump read by the fields a scene gives it, with the rows between collapsed; addresses of twelve digits and line numbers of six; the backtrace as a lens's drawing; a continue's motion (shared frames slide, a far window fades); memory drawn only where the stop read it. In the kernel lens a register is framed as carrying an argument only while it holds it at the stop shown, and an allocator row is read only where an allocation follows the word. Co-Authored-By: Claude Fable 5.2 --- anim/src/Recording.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'anim/src/Recording.zig') diff --git a/anim/src/Recording.zig b/anim/src/Recording.zig index 280d14a..41619aa 100644 --- a/anim/src/Recording.zig +++ b/anim/src/Recording.zig @@ -210,6 +210,14 @@ pub fn lineOf(r: *const Recording, addr: u64) ?u32 { return if (addr - near.addr <= 96) near.line else null; } +/// The line of the program's own source moment `i` is on; null where it is +/// elsewhere (a library's code, a stop with no line). +pub fn ownLine(r: *const Recording, i: u64) ?u32 { + const l = r.lines[@min(i, r.end())]; + if (l.line == 0 or !std.mem.eql(u8, std.fs.path.basename(r.name(l.file)), r.file)) return null; + return l.line; +} + /// The first line a source panel of `fit` lines shows when the program is /// on `line`: the whole file when it fits; else a window that has the line /// in its middle third, and is the same window for every line of that -- cgit v1.3