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 /README.md | |
| 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 'README.md')
| -rw-r--r-- | README.md | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -32,7 +32,7 @@ The standalone example packages live in [`examples/`](examples/): - [`micscope`](examples/micscope/): records the microphone or opens sound files, plays them either way, and shows waveform, spectrogram and spectrum; a tuner. - [`spheres`](examples/spheres/): the three-body problem on the GPU, each body a voice synthesised by a compute shader. - [`talk.zig`](examples/talk.zig): a talk with a slider in it, a sketch that runs its own `anim.Deck` (`zig build test-talk` plays it). -- [`manual.zig`](examples/manual.zig): Figure 2-1 of the Intel SDM comes alive, a PDF page as vector shapes and parts of it (`zig build manual -Dmanual=PDF`; see Animation, PDF pages and parts). +- [`manual.zig`](examples/manual.zig): Figure 2-1 of the Intel SDM comes alive, then ADD's opcode table is written row by row and its `80 /0 ib` turns into SUB's `80 /5 ib`: PDF pages as vector shapes and parts of them (`zig build manual -Dmanual=PDF`; see Animation, PDF pages and parts). Run `zig build run` inside a package, with `zig build lib --watch` in a second terminal for hot reload. `zig build test` runs its headless checks; @@ -576,7 +576,8 @@ file is not part of the cache key, so one changed in place needs its entry in `.zig-cache/typst` gone. Text is outlines: every glyph is a filled shape (nothing to search or select), drawn crisp at any camera zoom, and `write` reveals the shapes in the order the PDF draws them (in the Intel -SDM: header and footer, the text from the top, then the figures). A page +SDM: header and footer, the text from the top, then the figures; a +table's text row by row, left to right, and its rules after all of it). A page costs what its shapes do: Figure 2-1's page of the SDM is 2.1 MB of SVG and 1954 shapes, parsed once, 6-12 ms, the first frame it shows; then, at 1280x720 in a release build, 0.9-1.7 ms a frame to record for the GPU @@ -601,17 +602,24 @@ place), and shows as the object does after the plays laid so far: taken from a page that has faded in, it is there. The object draws the rest from then on, at every instant. A shape goes to the first part that takes it, so a rule that crosses several fields (a box's outline) stays -with whichever holds its centre: keep areas inside the rules. Parts of +with whichever holds its centre: keep areas inside the rules. A table's +column rules run its whole height, so their centres all lie in one row: +take them first, with a band a point high through that centre. Parts of parts, and of any vector object, work the same way, and share the object's geometry (a page is parsed once however many parts it gives). `transformInto` morphs into the whole of its target, so a morph's result can be split by parts taken after it: `c0.transformInto(bits)`, then `s.part(bits, ...)` for each run of bits. -`examples/manual.zig` is a talk on Figure 2-1 of the SDM (Vol. 2, page -31): the fields of the instruction format glow in turn, `83 C0 01` is -written below, each byte flies into its field and `C0` splits into -`11 000 000` over Mod, Reg and R/M. `zig build manual` plays it in a +`examples/manual.zig` is a talk in two slides on the SDM (Vol. 2). On +Figure 2-1 (page 31), the fields of the instruction format glow in turn, +`83 C0 01` is written below, each byte flies into its field and `C0` +splits into `11 000 000` over Mod, Reg and R/M. Then ADD's opcode table +(page 132) is written row by row; its row `80 /0 ib ADD r/m8, imm8`, +cut in pieces, becomes SUB's from page 1400, laid so that the rows +coincide: first the digit after the slash alone, then the rest, a morph +per piece, so the glyphs that stay hold still; the two rows end one over +the other. `zig build manual` plays it in a window; the PDF is `-Dmanual=PATH` (`~/01-resources/intel-devref-ii.pdf` by default), never part of the repository: without it the example builds a scene that says so, and its script (`test/manual.script`, in `zig build |
