diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 01:37:18 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 62d9f89eabf0a15c3d05d04f22d6b1810582be3f (patch) | |
| tree | 14c887c016324d2caf2e17238256eac213995d52 /test/manual.script | |
| parent | f555cf75c08ed84c90ebf366a0edea4479bf8f1c (diff) | |
| download | sketchbook-62d9f89eabf0a15c3d05d04f22d6b1810582be3f.tar.gz sketchbook-62d9f89eabf0a15c3d05d04f22d6b1810582be3f.zip | |
examples: manual's second slide, ADD's row 80 /0 ib becomes SUB's 80 /5 ib
The manual example is a talk in two slides now: Figure 2-1 as before,
then, once it clears, page 132 of the SDM's Vol. 2 (ADD) fades in with
its opcode table taken out; the table is written back row by row (the
column rules drawn down, then each row with the rule above it); the
camera goes to 80 /0 ib ADD r/m8, imm8 as the rest greys; its opcode
cell is tinted; closer in, the 0 after the slash morphs into the 5 of
SUB's row from page 1400 while 80, / and ib hold still; then the rest of
the row follows (ADD into SUB, Add into Subtract, to into from, imm8 and
r/m8. sliding to their places) and the page around it becomes page
1400; at the end ADD's row comes back over SUB's, what differs is
marked, and a line says why (one opcode byte, the ModR/M reg field picks
the operation). Seven steps; the talk is 66 s exported.
The pages and rows are checked against the PDF (pdftotext): ADD is page
132, SUB page 1400, and the rows' word boxes and the page's own rule
shapes give the rectangles, in points, turned into the page's units by
one function. Page 1400 stands 20 units higher, so its row (182-197 pt)
lies on ADD's (167-182). The page draws a table's text row by row, left
to right, and its rules after all of its text, so a row part writes in
reading order. The column rules run the whole table, so their centres
all fall in one row (83 /0 ib, at 265 pt): a band a point high through
265 takes the seven of them first, and nothing else. Each row is cut in
the same eight pieces on both pages (the digit, the rest of the opcode,
the instruction, the three short columns, the description word by word)
and each piece morphs into its own: a morph pairs shapes by index, so
the whole row (44 shapes into 51) would send every glyph after Add
across the row.
test/manual.script goes on through slide 2 with pixel checks (the table
gone and back, the cell's tint, a step back to the exact picture before
the digit's morph, the marks at the end) and checks three more exported
frames of it, the same in both exports. The bench now times pages 132
and 1400 too (2118 and 2040 shapes: parse 10.0 and 10.3 ms, CPU draw
2.8, GPU record 1.2, in budget). The README's examples list and the
manual's paragraphs say so, and how a table's column rules are taken.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/manual.script')
| -rw-r--r-- | test/manual.script | 70 |
1 files changed, 64 insertions, 6 deletions
diff --git a/test/manual.script b/test/manual.script index 3bc3c73..707e5cc 100644 --- a/test/manual.script +++ b/test/manual.script @@ -1,6 +1,7 @@ # The manual example (examples/manual.zig) on Vol. 2 of the Intel SDM: -# Figure 2-1 stepped through in the stock player, and exported twice. -# Built only when the PDF is there (-Dmanual). +# Figure 2-1, then ADD's row 80 /0 ib becoming SUB's 80 /5 ib, stepped +# through in the stock player, and exported twice. Built only when the PDF +# is there (-Dmanual). frames 150 expect deck.waiting true expect deck.log.len 0 @@ -57,17 +58,74 @@ await deck.waiting true screenshot .zig-cache/manual/split.png expect-different-screenshot .zig-cache/manual/bits.png .zig-cache/manual/split.png 280 420 310 70 expect deck.log.len 11 -# Back to the page, filled in, and the end of the talk. +# Back to the page, filled in: the end of slide 1. key space -frames 120 +await deck.waiting true expect deck.log.len 12 -expect deck.waiting false +expect deck.slide 1 screenshot .zig-cache/manual/end.png expect-different-screenshot .zig-cache/manual/page.png .zig-cache/manual/end.png 470 260 340 120 +# Slide 2: ADD's page, its opcode table out of it. +key space +await deck.waiting true +expect deck.slide 2 +expect deck.log.len 13 +screenshot .zig-cache/manual/add.png +expect-pixel .zig-cache/manual/add.png 640 300 255 255 255 255 2 +# The table, written in row by row. +key space +await deck.waiting true +screenshot .zig-cache/manual/table.png +expect-different-screenshot .zig-cache/manual/add.png .zig-cache/manual/table.png 415 90 445 310 +# Onto the row 80 /0 ib, then its opcode cell tinted. +key space +await deck.waiting true +screenshot .zig-cache/manual/row.png +expect-pixel .zig-cache/manual/row.png 230 362 255 255 255 255 2 +key space +await deck.waiting true +screenshot .zig-cache/manual/cell.png +expect-pixel .zig-cache/manual/cell.png 230 362 192 233 242 255 3 +# The digit after the slash becomes SUB's 5, closer in; back a step is the +# picture before it (the bar under it aside: it shows the time). +key space +await deck.waiting true +expect deck.log.len 17 +screenshot .zig-cache/manual/digit.png +expect-different-screenshot .zig-cache/manual/cell.png .zig-cache/manual/digit.png 0 0 1280 680 +key page_up +expect deck.log.len 16 +frames 2 +screenshot .zig-cache/manual/undone.png +expect-same-screenshot .zig-cache/manual/cell.png .zig-cache/manual/undone.png 2 0 0 1280 680 +key space +await deck.waiting true +expect deck.log.len 17 +# The rest of the row follows, on SUB's page. +key space +await deck.waiting true +screenshot .zig-cache/manual/sub.png +expect-different-screenshot .zig-cache/manual/digit.png .zig-cache/manual/sub.png 0 0 1280 680 +# ADD's row over SUB's, what differs marked: the end of the talk. +key space +frames 240 +expect deck.log.len 19 +expect deck.waiting false +screenshot .zig-cache/manual/rows.png +expect-pixel .zig-cache/manual/rows.png 75 300 251 236 183 255 3 +expect-pixel .zig-cache/manual/rows.png 962 357 251 236 183 255 3 # Exported ({a}, {b}: 10 fps, half size), each step held 1.5 s: the same -# frames twice, and the talk moves through them. +# frames twice, and the talk moves through them (Figure 2-1 at 4, 20 and +# 34 s; ADD's table being written at 45, its digit morphing at 56.5, the two +# rows at the end, 66). expect-same-screenshot {a}/000040.png {b}/000040.png expect-same-screenshot {a}/000200.png {b}/000200.png expect-same-screenshot {a}/000340.png {b}/000340.png +expect-same-screenshot {a}/000450.png {b}/000450.png +expect-same-screenshot {a}/000565.png {b}/000565.png +expect-same-screenshot {a}/000660.png {b}/000660.png expect-different-screenshot {a}/000040.png {a}/000200.png expect-different-screenshot {a}/000200.png {a}/000340.png +expect-different-screenshot {a}/000340.png {a}/000450.png +expect-different-screenshot {a}/000450.png {a}/000565.png +expect-different-screenshot {a}/000565.png {a}/000660.png |
