From 6215b1177e377b512aaa1296faa6311f809135f2 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 19 Oct 2026 06:18:49 +0100 Subject: 140's 8, box layout, written in aup with no new opcode (aup's examples/layout.aup: a subset of CSS Flexbox 1 written down first, one line, row or column, padding, gap, six justify-content, four align-items, grow and shrink with 9.7's loop, cross sizes stretched, nothing sized by content): 2,000 random trees (29,388 nodes; 7,659 items frozen at their padding by the loop) are Taffy 0.15's within 0.01 (layout_taffy, built by cargo; the worst 8.3e-5) and layout.py's bit for bit on the three paths, the paths the same; the single-pass subset first tried refused 66% of trees, so the loop came in; Taffy given min sizes equal to the padding (given 0 it floors at 0 while resolving lengths, where 9.7 floors the content box), the reference adding from the left (sum compensates since Python 3.12); module_specs in make check: 100 trees (tests/specs/layout); bars: 116 lines against Python's 54, 4,754 ns a node, Taffy's 644 (7.4x), pure Python 5,396 (Pure 1.14x faster), 1,494 instructions a node (9.7's loop 44%); four frictions; aup's rows read by position no longer copy (99,067 ns a node before); the suite table's row 8; CHECKPOINT's direction row --- tests/specs/layout/README.md | 7 +++++++ tests/specs/layout/trees.bin | Bin 0 -> 218992 bytes 2 files changed, 7 insertions(+) create mode 100644 tests/specs/layout/README.md create mode 100644 tests/specs/layout/trees.bin (limited to 'tests/specs/layout') diff --git a/tests/specs/layout/README.md b/tests/specs/layout/README.md new file mode 100644 index 0000000..3341c4e --- /dev/null +++ b/tests/specs/layout/README.md @@ -0,0 +1,7 @@ +# Box layout (a subset of CSS Flexbox 1): 100 trees + +`trees.bin` holds the first 100 trees `research/experiments/044-specs/layout_check.py` draws, each a u32 count of its +nodes, their rows in preorder (14 binary64s: parent, column, w, h, grow, shrink, basis, left, right, top, bottom, gap, +justify, align), then their boxes (x, y, w, h, each relative to its parent's), as `layout.py` works them out; Taffy +0.15's are the same within 0.01. `tests/check.py`'s `module_specs` gives each tree to aup's `examples/layout.aup` as a +message, on Pure's three paths: its boxes must be these, bit for bit. diff --git a/tests/specs/layout/trees.bin b/tests/specs/layout/trees.bin new file mode 100644 index 0000000..387caff Binary files /dev/null and b/tests/specs/layout/trees.bin differ -- cgit v1.2.3