summaryrefslogtreecommitdiff
path: root/anim/tools
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-11 17:42:07 -0300
committerGabriel Schneider <[email protected]>2026-11-11 19:11:00 -0300
commitb54c6776953d3243ab5b8e676e747713827ab320 (patch)
treed53be6cef4587b94531880af6479a1b5fa1aac39 /anim/tools
parent3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6 (diff)
downloadcomputeranim-b54c6776953d3243ab5b8e676e747713827ab320.tar.gz
computeranim-b54c6776953d3243ab5b8e676e747713827ab320.zip
canim: the disassembly under the source everywhere; rings
From the user. In every split the disassembly stays under the source; registers a scene never changes fold three to a row, and the stack takes the room: nine to twenty slots where it had six. The graph's first form is rings: a loop a ring its blocks sit on, an inner loop a smaller ring touching its parent, a way out leaving along the tangent; layers stay for functions without loops. Its layout comes from the code alone and it shows nothing from after the moment: a block not reached yet is quiet and is reached, a fold of what is not reached yet opens when the run arrives. A pane unrolls from its strip into its whole column and rolls back. The sqlite scene's strips move before their panes. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/tools')
-rw-r--r--anim/tools/chart.py48
1 files changed, 28 insertions, 20 deletions
diff --git a/anim/tools/chart.py b/anim/tools/chart.py
index 290c59e..0f2894f 100644
--- a/anim/tools/chart.py
+++ b/anim/tools/chart.py
@@ -24,30 +24,38 @@ W = motion.W
def ph(rows):
return 32 + 24 * rows
-def split(drawing, view, source, disasm, slots, backtrace=0):
+def split(drawing, view, source, disasm, regs, backtrace=0):
+ """Layout A: the disassembly under the source; the registers as tall as the scene's rows
+ (`regs`), the stack the state column's rest above the backtrace, whole slots, any rest above it."""
out = {}
if drawing:
out["drawing"] = (64, 48, 880, drawing)
- out["view"] = (976, 48, 880, view)
+ if view:
+ out["view"] = (976, 48, 880, view)
left = 48 + (drawing + 12 if drawing else 0)
right = 48 + (view + 12 if view else 0)
out["source"] = (64, left, 880, ph(source))
out["disasm"] = (64, left + ph(source) + 12, 880, ph(disasm))
- out["registers"] = (976, right, 880, ph(17))
- out["stack"] = (976, right + ph(17) + 12, 880, ph(slots))
+ out["registers"] = (976, right, 880, ph(regs))
+ bottom = 888 - (ph(backtrace) + 12 if backtrace else 0)
+ slots = (bottom - (right + ph(regs) + 12) - 32) // 24
+ out["stack"] = (976, bottom - ph(slots), 880, ph(slots))
if backtrace:
- out["backtrace"] = (976, right + ph(17) + 12 + ph(slots) + 12, 880, ph(backtrace))
+ out["backtrace"] = (976, 888 - ph(backtrace), 880, ph(backtrace))
return out
# The words that are not panels (motion.WORDS): the clock (its count, ranged right at 1856,
# changes in a frame by design) and the caption (its 1400 from the margin). The caption's box
# starts under the clock's count and the run's step counter (912 to 934).
words = {"clock": (0, 888, 1920, 46), "caption": (0, 940, 1464, 140)}
-none, beside, subject = split(0, 0, 14, 17, 8, 4), split(152, 152, 8, 17, 8), split(296, 200, 10, 9, 6)
-# The `blocks` lens: the graph over the program column, the source alone under it; the disassembly
-# (its view) over the state column, seven rows, the registers and six words under it.
-blocks = {**subject, "view": (976, 48, 880, ph(7)), "source": (64, 356, 880, ph(20))}
-del blocks["disasm"]
+# The splits (theme.layout.split), each scene's registers panel as tall as its rows (the
+# registers its steps change, the rest folded three to a row: `context.movedBy`).
+none = lambda regs: split(0, 0, 14, 17, regs, 4)
+beside = lambda regs: split(152, 152, 8, 17, regs)
+subject = lambda regs: split(296, 200, 8, 11, regs)
+# The `blocks` lens: the graph alone over the program column (880 by 344, no view), the source
+# six lines and the disassembly eleven under it; the registers and the stack from the top.
+blocks = lambda regs: split(344, 0, 6, 11, regs)
# Each pane's minimap a region of its own (motion.strips), secondary action: the source's, the
# disassembly's, the stack's, and the view's where it is a dump (not the calls lens's backtrace,
# not the syscalls lens's log).
@@ -58,17 +66,17 @@ def strips(panes, view):
out["view"] = panes["view"]
return out
motion.REGIONS.update({
- "fib": {**strips(subject, False), **words},
- "sort": {**strips(blocks, True), **words},
+ "fib": {**strips(subject(10), False), **words},
+ "sort": {**strips(blocks(11), True), **words},
# The band is the calls so far; the disassembly a descent.
- "syscalls": {**strips(beside, False), **words},
- "musl": {**strips(beside, False), **words},
- "heap": {**strips(subject, True), **words},
- "list": {**strips(subject, True), **words},
- # The band's drawing is the backtrace, then the kernel's side; its view a dump.
- "sqlite": {**strips(subject, True), **words},
- "zoom": {**strips(none, False), **words},
- "gallery": {**strips(beside, True), **words},
+ "syscalls": {**strips(beside(14), False), **words},
+ "musl": {**strips(beside(15), False), **words},
+ "heap": {**strips(subject(14), True), **words},
+ "list": {**strips(subject(9), True), **words},
+ # The band's drawing is the backtrace, then the kernel's side; its view a dump. It folds none.
+ "sqlite": {**strips(subject(17), True), **words},
+ "zoom": {**strips(none(9), False), **words},
+ "gallery": {**strips(beside(13), True), **words},
})
# `cut`: the gallery is the catalogue's pages, cut from one to the next (scenes/gallery.zig: 3, 6, 9.6, 13, 16,
# 19.8, 21 and 24 s), not a scene: a page's first frame changes everything at once by design.