From 3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 14:43:13 -0300 Subject: canim: a minimap in each pane; source wherever it can be had, libc's included From the user. Each pane with more than it shows carries a strip of its whole column at its right edge, the pane's window outlined and what happens off it marked there; the corner minimap is gone and the dive folds each column of the map into its pane's strip. The source panel follows the pc into any file the build has: glibc's own, from the distro's debuginfod by an optional step that caches them by build id (zig build sources; nothing else touches the network), and musl's, from Zig's lib directory. The syscalls scene shows open64.c on the way down, and a new scene follows the same call through a Zig-built musl. A graph's counts and inks are as of the moment shown. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- anim/test/gallery/atoms.png | Bin 104822 -> 104943 bytes anim/test/gallery/graph-map.png | Bin 158401 -> 158281 bytes anim/test/gallery/graph.png | Bin 76868 -> 76747 bytes anim/test/gallery/loupe.png | Bin 237479 -> 237134 bytes anim/test/gallery/none.png | Bin 226735 -> 227070 bytes anim/test/gallery/rest.png | Bin 233721 -> 232355 bytes anim/test/gallery/rows.png | Bin 140530 -> 140426 bytes anim/test/gallery/step.png | Bin 232385 -> 231441 bytes anim/test/gallery/subject.png | Bin 210007 -> 210027 bytes anim/test/musl.script | 9 +++++++++ anim/test/recordings.zig | 18 ++++++++++++++++++ 11 files changed, 27 insertions(+) create mode 100644 anim/test/musl.script (limited to 'anim/test') diff --git a/anim/test/gallery/atoms.png b/anim/test/gallery/atoms.png index 8da5c01..acd54a8 100644 Binary files a/anim/test/gallery/atoms.png and b/anim/test/gallery/atoms.png differ diff --git a/anim/test/gallery/graph-map.png b/anim/test/gallery/graph-map.png index b16caf6..951d4af 100644 Binary files a/anim/test/gallery/graph-map.png and b/anim/test/gallery/graph-map.png differ diff --git a/anim/test/gallery/graph.png b/anim/test/gallery/graph.png index ea9695e..d43db42 100644 Binary files a/anim/test/gallery/graph.png and b/anim/test/gallery/graph.png differ diff --git a/anim/test/gallery/loupe.png b/anim/test/gallery/loupe.png index 7f07d94..52bc89a 100644 Binary files a/anim/test/gallery/loupe.png and b/anim/test/gallery/loupe.png differ diff --git a/anim/test/gallery/none.png b/anim/test/gallery/none.png index bac000d..4e4d5b1 100644 Binary files a/anim/test/gallery/none.png and b/anim/test/gallery/none.png differ diff --git a/anim/test/gallery/rest.png b/anim/test/gallery/rest.png index c368a30..205fc0d 100644 Binary files a/anim/test/gallery/rest.png and b/anim/test/gallery/rest.png differ diff --git a/anim/test/gallery/rows.png b/anim/test/gallery/rows.png index dd85690..4d936ab 100644 Binary files a/anim/test/gallery/rows.png and b/anim/test/gallery/rows.png differ diff --git a/anim/test/gallery/step.png b/anim/test/gallery/step.png index 19ffc00..5ccb082 100644 Binary files a/anim/test/gallery/step.png and b/anim/test/gallery/step.png differ diff --git a/anim/test/gallery/subject.png b/anim/test/gallery/subject.png index 182f8ba..9e36a1d 100644 Binary files a/anim/test/gallery/subject.png and b/anim/test/gallery/subject.png differ diff --git a/anim/test/musl.script b/anim/test/musl.script new file mode 100644 index 0000000..742770b --- /dev/null +++ b/anim/test/musl.script @@ -0,0 +1,9 @@ +# The musl scene, headless: it runs to three instants of its timeline without failing. +frames 2 +console set playing false +console set t 5 +screenshot .zig-cache/canim/musl-early.png +console set t 14 +screenshot .zig-cache/canim/musl-mid.png +console set t 999 +screenshot .zig-cache/canim/musl-end.png diff --git a/anim/test/recordings.zig b/anim/test/recordings.zig index ce5a9db..e3af983 100644 --- a/anim/test/recordings.zig +++ b/anim/test/recordings.zig @@ -210,3 +210,21 @@ test "libc's open at its syscall: the blocks never reached folded, no loop made const here = g.nodes[g.here.?]; try expect(here.y >= off and here.y + here.h <= off + room and g.w <= 1792); } + +test "the source follows the pc into musl's own files and back to main's line" { + // musl is built from Zig's sources with the program: its files are always the build's to give. + const rec = canim.open(recordings.musl); + const main = rec.call("main", 0); + try std.testing.expectEqualStrings("hello.c", rec.sources[rec.shown[main.enter].src].name()); + var files: [3]bool = @splat(false); + var back = false; + for (rec.shown[main.enter..], main.enter..) |s, i| { + const name = rec.sources[s.src].name(); + for ([_][]const u8{ "open.c", "__syscall_cp.c", "syscall_arch.h" }, &files) |want, *seen| seen.* = seen.* or (s.here and std.mem.eql(u8, name, want)); + // Where it is on a line of musl's, the panel shows it: never main's held over. + if (s.here) try expect(rec.sourced(i)); + back = back or (files[0] and s.here and std.mem.eql(u8, name, "hello.c") and s.line == 6); + } + for (files) |seen| try expect(seen); + try expect(back); +} -- cgit v1.3