diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 16:05:20 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 16:43:58 -0300 |
| commit | 165bb6c1344b98de7bef1d3c2b72147b4a40797a (patch) | |
| tree | 0e70e6222700063f604f78673f6ab3a5bfb9242d /anim/test | |
| parent | 66a2a7cf733f6abc1f79561c52d901ce67019fb1 (diff) | |
| download | computeranim-165bb6c1344b98de7bef1d3c2b72147b4a40797a.tar.gz computeranim-165bb6c1344b98de7bef1d3c2b72147b4a40797a.zip | |
canim: the renderer speaks the design language
The blocks, their states and the tokens carry the catalogue's names:
atoms in ui, chain/reg/slot in rows, insn with its line column, jump lane
and annotations (read, write, taken or not, a call with its arguments, a
return, a syscall) in disasm, bytes and hexdump with field paper and the
reading column, the three splits and relayout in stage, the ties (thread,
link and pin, projection, echo). A lens is a band over the whole context,
its drawing left and its bytes right. Frames' spans on the stack, each
instruction's line and a callee's parameter count come from the tracer.
A gallery scene draws every block; the test compares six of its pages
with pictures kept in test/gallery, drawn from a recording kept there
too. The scenes are ported; the motion checks report no pop and no
metronome in any of them.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/test')
| -rw-r--r-- | anim/test/gallery.script | 29 | ||||
| -rw-r--r-- | anim/test/gallery/atoms.png | bin | 0 -> 96800 bytes | |||
| -rw-r--r-- | anim/test/gallery/list.ztrace | bin | 0 -> 88491 bytes | |||
| -rw-r--r-- | anim/test/gallery/none.png | bin | 0 -> 219668 bytes | |||
| -rw-r--r-- | anim/test/gallery/rest.png | bin | 0 -> 229667 bytes | |||
| -rw-r--r-- | anim/test/gallery/rows.png | bin | 0 -> 105675 bytes | |||
| -rw-r--r-- | anim/test/gallery/step.png | bin | 0 -> 229198 bytes | |||
| -rw-r--r-- | anim/test/gallery/subject.png | bin | 0 -> 205715 bytes | |||
| -rw-r--r-- | anim/test/recordings.zig | 4 |
9 files changed, 31 insertions, 2 deletions
diff --git a/anim/test/gallery.script b/anim/test/gallery.script new file mode 100644 index 0000000..01a31d5 --- /dev/null +++ b/anim/test/gallery.script @@ -0,0 +1,29 @@ +# The gallery's pages against test/gallery/ (`zig build gallery` draws them anew): +# every channel of every pixel within 24 of the picture, above the player's own line +# (its timings change from run to run). A screenshot is saved on the frame after. +frames 2 +console set playing false +console set t 0.5 +screenshot {dir}/atoms.png +frames 1 +expect-same-screenshot {dir}/atoms.png test/gallery/atoms.png 24 0 0 1920 1040 +console set t 1.5 +screenshot {dir}/rows.png +frames 1 +expect-same-screenshot {dir}/rows.png test/gallery/rows.png 24 0 0 1920 1040 +console set t 2.4 +screenshot {dir}/rest.png +frames 1 +expect-same-screenshot {dir}/rest.png test/gallery/rest.png 24 0 0 1920 1040 +console set t 3.6 +screenshot {dir}/step.png +frames 1 +expect-same-screenshot {dir}/step.png test/gallery/step.png 24 0 0 1920 1040 +console set t 6.4 +screenshot {dir}/subject.png +frames 1 +expect-same-screenshot {dir}/subject.png test/gallery/subject.png 24 0 0 1920 1040 +console set t 8.4 +screenshot {dir}/none.png +frames 1 +expect-same-screenshot {dir}/none.png test/gallery/none.png 24 0 0 1920 1040 diff --git a/anim/test/gallery/atoms.png b/anim/test/gallery/atoms.png Binary files differnew file mode 100644 index 0000000..7458689 --- /dev/null +++ b/anim/test/gallery/atoms.png diff --git a/anim/test/gallery/list.ztrace b/anim/test/gallery/list.ztrace Binary files differnew file mode 100644 index 0000000..b941445 --- /dev/null +++ b/anim/test/gallery/list.ztrace diff --git a/anim/test/gallery/none.png b/anim/test/gallery/none.png Binary files differnew file mode 100644 index 0000000..8116b10 --- /dev/null +++ b/anim/test/gallery/none.png diff --git a/anim/test/gallery/rest.png b/anim/test/gallery/rest.png Binary files differnew file mode 100644 index 0000000..fa7ee53 --- /dev/null +++ b/anim/test/gallery/rest.png diff --git a/anim/test/gallery/rows.png b/anim/test/gallery/rows.png Binary files differnew file mode 100644 index 0000000..97a8fd9 --- /dev/null +++ b/anim/test/gallery/rows.png diff --git a/anim/test/gallery/step.png b/anim/test/gallery/step.png Binary files differnew file mode 100644 index 0000000..9678e91 --- /dev/null +++ b/anim/test/gallery/step.png diff --git a/anim/test/gallery/subject.png b/anim/test/gallery/subject.png Binary files differnew file mode 100644 index 0000000..e7f10ef --- /dev/null +++ b/anim/test/gallery/subject.png diff --git a/anim/test/recordings.zig b/anim/test/recordings.zig index ef97d31..d853285 100644 --- a/anim/test/recordings.zig +++ b/anim/test/recordings.zig @@ -44,8 +44,8 @@ test "an instrumented program under the debugger tells its calls, variables and defer arena.deinit(); const reverse = rec.call("reverse", 0); try expectEqual(@as(usize, 3), rec.allocations.len); - // The call begins where the debugger stopped on entering it: the line of its header. - try expectEqual(@as(u32, 17), rec.own[reverse.enter]); + // The call begins where the debugger stopped on entering it: the line of its header, or its first. + try expect(rec.own[reverse.enter] == 17 or rec.own[reverse.enter] == 18); // A local is not its value until its call has stored to it. const first = rec.lineMoment(18, reverse.enter); const cur = rec.variable(arena.allocator(), rec.moment(first), "cur").?; |
