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/src/graph.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'anim/src/graph.zig') diff --git a/anim/src/graph.zig b/anim/src/graph.zig index f4e61ea..fa91adb 100644 --- a/anim/src/graph.zig +++ b/anim/src/graph.zig @@ -499,6 +499,8 @@ pub const Rules = struct { v.* = g.nodes[k].visits; }; if (visits[0] == null and visits[1] == null) return; + // For a strip: a tick at the row's top. + if (ui.strokes) return ui.collectMark(u, 0, y, .tick, 1); u.fill(.{ .x = theme.stroke.rule, .y = y, .w = w - 2 * theme.stroke.rule, .h = theme.stroke.rule }, theme.color.rule); if (!free) return; const size = theme.size.mono.context; @@ -1210,7 +1212,7 @@ pub const Map = struct { const module: []const u8 = if (std.mem.indexOfScalar(u8, full, '!')) |bang| full[0..bang] else ""; const folded = g.foldedBlocks(); const title = if (module.len > 0) u.print("disassembly \u{00b7} {s} \u{00b7} {s}", .{ name, module }) else u.print("disassembly \u{00b7} {s}", .{name}); - const note = if (folded > 0) u.print("{s}{d} blocks \u{00b7} folded: {d} never reached", .{ if (rec.sourced(now.stops[0])) "" else "no source \u{00b7} ", g.blocks, folded }) else if (g.exact) "its blocks \u{00b7} visits so far \u{00b7} the edges the run took" else "its blocks \u{00b7} visits so far"; + const note = if (folded > 0) u.print("{s}{d} blocks \u{00b7} folded: {d} not reached", .{ if (rec.sourced(now.stops[0])) "" else "no source \u{00b7} ", g.blocks, folded }) else if (g.exact) "its blocks \u{00b7} visits so far \u{00b7} the edges the run took" else "its blocks \u{00b7} visits so far"; _ = u.panel(box.w, box.h, title, .{ .note = note }); u.clip(.{ .x = theme.stroke.rule, .y = m.tag, .w = box.w - 2 * theme.stroke.rule, .h = room }); defer u.unclip(); @@ -1242,11 +1244,12 @@ pub const Map = struct { const gold = golden(v, k); o.fill(r, theme.color.page); if (n.folded > 0) { - // Blocks the whole recording never reached: one dashed box, its offsets and its count. + // Blocks the whole recording never reached: one dashed box, its offsets and its count, + // said of the run so far (a graph says what has happened by the moment shown, never what will not). o.dashedFrame(r, theme.color.rule, theme.stroke.rule); const last = n.start + n.len - 1; o.text(.mono, size, n.x + m.side, rows.baseline(n.y), o.print("+{x} to +{x}", .{ n.start - g.start, last - g.start }), t.faint); - const words = if (n.folded > 1) o.print("{d} blocks never reached", .{n.folded}) else "never reached"; + const words = if (n.folded > 1) o.print("{d} blocks not reached", .{n.folded}) else "not reached"; const micro = theme.size.sans.micro; o.text(.sans, micro, n.x + w - m.side - o.width(.sans, micro, words), n.y + m.tag - 6, words, t.faint); return; -- cgit v1.3