summaryrefslogtreecommitdiff
path: root/anim/src/words.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-11 09:41:45 -0300
committerGabriel Schneider <[email protected]>2026-11-11 10:14:30 -0300
commit390872b7bb9cdcf3e8095442af88af0dfcb40602 (patch)
treeab767cf46dfca036e61e0e19bb5e1c4772cb1d4d /anim/src/words.zig
parent378379807fb4cd751e90808c8363caddb365bcd8 (diff)
downloadcomputeranim-390872b7bb9cdcf3e8095442af88af0dfcb40602.tar.gz
computeranim-390872b7bb9cdcf3e8095442af88af0dfcb40602.zip
canim: what the verification review found, fixed
A register's chain reads memory as its panel shows it, and follows again only after the bytes land: rsi no longer shows what read returns before the kernel writes it. Bytes keep their old value through the arm and change at their own strike, in every dump, stack word and loupe. The dive lands once. Captions lead what they name: the longest still in the syscalls scene is 2.8 s where it was 13. Pins hold through a sprint; a row of a view carries the pin of the register that points at it; a left child's badge sits on its left shoulder; a log scrolls with the row that arrives. The zoom scene's camera holds the disassembly's rows and the stack in one view. Six programs, the title says now. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/words.zig')
-rw-r--r--anim/src/words.zig29
1 files changed, 23 insertions, 6 deletions
diff --git a/anim/src/words.zig b/anim/src/words.zig
index 4d221f4..f66f6d2 100644
--- a/anim/src/words.zig
+++ b/anim/src/words.zig
@@ -162,9 +162,10 @@ pub const Veil = struct {
/// it means: the same in every picture.
pub const Legend = struct {
box: Rect,
- entries: []const Entry = &.{ .current, .written, .changed, .read, .link, .allocated, .freed, .unknown, .kernel },
+ /// The marks the scenes use.
+ entries: []const Entry = &.{ .current, .written, .changed, .read, .waiting, .unknown, .link, .pin, .arc, .loupe, .freed, .kernel },
- pub const Entry = enum { current, written, changed, read, link, allocated, freed, unknown, kernel };
+ pub const Entry = enum { current, written, changed, read, link, pin, arc, loupe, waiting, freed, unknown, kernel };
pub fn draw(l: *const Legend, f: *sk.Frame, at: anim.Placed) void {
const u: ui.Ui = .{ .f = f, .at = at };
@@ -182,7 +183,10 @@ pub const Legend = struct {
.changed => .{ "changed", "a moment ago" },
.read => .{ "read", "by this step" },
.link => .{ "link", "now points at that" },
- .allocated => .{ "allocated", "handed out" },
+ .pin => .{ "pin", "who points here" },
+ .arc => .{ "arc", "a pointer in its panel" },
+ .loupe => .{ "loupe", "where it points" },
+ .waiting => .{ "waiting", "for the call it made" },
.freed => .{ "freed", "handed back" },
.unknown => .{ "not seen", "never observed" },
.kernel => .{ "kernel", "the other side" },
@@ -211,9 +215,22 @@ pub const Legend = struct {
u.label(.mono, size, cell, .center, digits, t.primary);
},
.link => u.route(&.{ .{ r.x, r.y + 23 }, .{ r.x + r.w, r.y + 23 } }, theme.color.region.heap, .{ .width = theme.stroke.tie.link, .head = .{ 10, 10 } }),
- .allocated => {
- u.fill(r, theme.mark(.allocated).ember);
- u.frame(r, theme.mark(.allocated).solid, theme.stroke.line);
+ .pin => u.pinRow(r.x, r.y + 11, &.{"rsp"}, theme.color.region.stack),
+ .arc => {
+ const k = theme.metric.arc;
+ u.route(&.{ .{ r.x + r.w, r.y + 8 }, .{ r.x + 20, r.y + 8 }, .{ r.x + 20, r.y + 38 }, .{ r.x + r.w, r.y + 38 } }, theme.color.region.heap, .{ .width = k.width, .head = k.head, .radius = k.radius });
+ },
+ .loupe => {
+ const k = theme.metric.loupe.shadow[0];
+ u.fill(.{ .x = r.x + k[0] / 2, .y = r.y + k[1] / 2, .w = r.w - k[0] / 2, .h = r.h - k[1] / 2 }, theme.color.shade);
+ const lifted: Rect = .{ .x = r.x, .y = r.y, .w = r.w - k[0] / 2, .h = r.h - k[1] / 2 };
+ u.fill(lifted, theme.color.lift);
+ u.fill(.{ .x = r.x, .y = r.y, .w = lifted.w, .h = 10 }, theme.color.lift_tag);
+ u.frame(lifted, t.dim, theme.stroke.rule);
+ },
+ .waiting => {
+ u.frame(.{ .x = r.x + 1, .y = r.y + 1, .w = r.w - 2, .h = r.h - 2 }, t.primary, theme.stroke.rule);
+ u.label(.mono, size, r, .center, "call", t.primary);
},
.freed => u.dashedFrame(r, theme.mark(.freed).solid, theme.stroke.line),
.unknown => {