25067 Commits

Author SHA1 Message Date
alonso.torres
abc64f0243 📎 Log targets and final shapes in both engines of the replay
With `debug`, the browser replay logs each target and the shapes every
program ends with whether the WASM engine is on or off, so a WASM failure
can be compared with the same program on the plain engine.

Harness only; the benchmark is not run.

Also in this commit:

- Apply the generated typography only where the file holds it. A text style edit
  picks the generated typography for one of its values, but only worlds with
  text styles add that typography to the file. In the others the model applied
  the edit's styles while the frontend applied a missing typography, which sets
  no style, so the two diverged. The edit names the typography only when the
  file holds it.
- Replay programs in the browser as the frontend tests do. The browser replay
  mocks the backend and the timers as the frontend generated tests do, turns the
  WASM engine off for the plain engine even when the page's configuration turns
  it on, and in debug logs the content a text edit commits and each text's
  characters and font weights.
- Name the boards a deleted component's main was held by. The canonical design
  data names shapes and components by their place in the tree, so the model and
  the frontend compare although each allocates its own ids. A deleted component
  keeps the ids of the board that held its main, as a variant's component keeps
  its container's once the variant is undone; with that board gone the ids
  stayed raw and differed between the two runs. They are named after the
  component when no live shape is.
- Report where the model and the frontend first differ. A backend mismatch in
  the frontend replay printed the whole diff of the two canonical designs, which
  lists float noise the comparison accepts next to the difference it rejects.
  `oracle/inequivalence` walks the two designs as `equivalent?` compares them
  and returns the path of the first rejected value with both sides; the mismatch
  message leads with it.
- Keep text sizes and take inline programs in the browser replay. With the WASM
  engine on, the replay keeps each text's stored size in place of the engine's
  text resizes: the model keeps stored sizes, and the generated texts are too
  narrow to measure, so a new copy's measured text differed from its main's
  unmeasured one. The page also takes the programs inline in an `edn` query
  parameter, which a shrink loop drives.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
ac31d67366 🐛 Sync copies when a copy nested in a main is moved
The component watcher drops a translation commit that moves only shapes
outside mains or whole mains. It found the main of each moved shape with
`get-component-shape`, which stops at the nearest copy head, so a copy
placed in a main, or a shape inside one, looked like a shape outside any
main: moving it with the WASM engine on, whose drags commit as
translations, left the main's copies where they were.

The watcher now walks up through nested copies to the main instance the
shape lies in.

The benchmark covers JVM code; this change is ClojureScript only, so it
is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
700245059b 📎 Resume, debug and compare the browser replay of programs
The replay page takes a `start` index to resume a long run, an `engine`
of `plain` to replay the same programs with the WASM engine off, and a
`debug` flag that logs each target, each WASM layout with its result and
the shapes of a failing program.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
1c339ddcca 🐛 Send the WASM engine the paddings and margins the layout uses
A `:simple` padding or margin type repeats the top and right values on
the bottom and left, as `ctl/paddings` and `ctl/child-margins` read them,
but the WASM engine received the four stored values. A board whose type
was switched to simple after editing its sides laid out its children with
the stale bottom and left values in the WASM engine only, so moving one
child shifted all of them and marked copies as touched.

Both the shape payload and the per-attribute calls now send the values
the layout functions return.

The benchmark covers JVM code; this change is ClojureScript only, so it
is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
447125339e 🐛 Let the WASM engine lay out a moved shape a layout places
With WASM on, a pure move took a shortcut: the translation was applied
to the moved shapes and their subtrees without asking the engine to lay
them out. A shape in a layout's flow then stayed where it was moved,
where the CLJS engine's layout put it back, and a copy shape kept the
move as a geometry override. A move of a shape that a layout places now
goes through the engine like any other transform.

Found by replaying generated programs in the browser with WASM on. The
JVM benchmark does not run the WASM path; it is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
5d84e9a449 ✨ Replay generated programs in the browser with the WASM engine
The frontend replay of generated component programs runs in node, where
the WASM render engine is not available. A `test-wasm` build runs the same
replay in a browser page: it loads the engine on a canvas, turns on
render-wasm/v1 and loads the shapes of the replayed page into the engine
whenever they change, so every layout goes through it. Text edits commit
through the SVG editor, as the WASM editor needs its own editing session.
The page reads the programs the common tests pin, which a script writes
out, and reports each one to the console.

Build with `pnpm run build:test-wasm`, then open
`/test-wasm.html?programs=programs.js`.

Test tooling only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
77e17922a2 📎 Compare bools by their flags and segments in design snapshots
A bool shows its segments. Its transform and the order of its corners
say nothing its flags and segments do not: sync orients its children
from its turn and flips, and fitting it resets its transform. A turned
bool in a flipped board could store a transform that does not mirror,
or its corners in another order, depending on which step last fitted
it. Design snapshots now leave its transform out and take its corners
in any order.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
c86e7b2f3a 🐛 Orient children of a fitted bool by its turn before its flips
A bool keeps its turn and flips when fitting it resets its transform, so
sync orients its children from them, choosing between the turn before
the flips and the flips before the turn by which is nearer the bool's
axes. A fitted bool's axes are the identity, which tells neither apart,
and the choice fell to the flips first: a flipped, turned copy bool gave
its child a half-turned orientation, which a sync of the settled state
did not. The turn now goes first on a tie, as a flip of a turned shape
stores it.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  22.783 |  25.354 |  0.65 |
| edit-through-a-chain-of-dependents |   68.931 |  51.070 |  52.568 |  0.74 |
| library-update-into-copies         |   83.083 |  54.684 |  63.220 |  0.66 |
| main-edit-among-many-shapes        |    4.837 |   2.978 |   3.782 |  0.62 |
| main-edit-into-10-copies           |    1.79  |   1.212 |   1.281 |  0.68 |
| main-edit-into-100-copies          |   15.415 |  12.907 |  13.628 |  0.84 |
| main-edit-into-1000-copies         |  153.086 | 107.916 | 123.169 |  0.70 |
| variant-switch-into-copies         |   32.052 |  25.136 |  29.877 |  0.78 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
5b725b68a6 🐛 Ignore float noise and same-looking texts in the override scan
Run on the dashboard templates, the scan reported thousands of copies
that a sync would rewrite with the same geometry within a hundredth of a
pixel, the same path segments, or a text whose letters and styles show
the same in another spelling. It now compares geometry and path content
within a hundredth and text content by its override groups, so what it
reports is a difference a user can see.

The scan is a debugging tool outside sync; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
3a1b0e3d75 🐛 Author the size a resize gives an untouched swapped head
Resizing a copy board scales a swapped head in it through its
constraints. The next sync of the head, as the root of its own component,
gave it its component's size back. As a sync that resizes a board already
does, a transform that resizes one now marks the geometry of each
untouched swapped head it gives another size, unless a layout sizes it,
so later syncs keep that size. The harness model authors the same size.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  23.800 |  28.893 |  0.68 |
| edit-through-a-chain-of-dependents |   68.931 |  48.458 |  60.725 |  0.70 |
| library-update-into-copies         |   83.083 |  61.325 |  63.038 |  0.74 |
| main-edit-among-many-shapes        |    4.837 |   2.523 |   2.669 |  0.52 |
| main-edit-into-10-copies           |    1.79  |   1.180 |   1.214 |  0.66 |
| main-edit-into-100-copies          |   15.415 |  11.228 |  11.628 |  0.73 |
| main-edit-into-1000-copies         |  153.086 | 110.756 | 120.456 |  0.72 |
| variant-switch-into-copies         |   32.052 |  24.565 |  28.627 |  0.77 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
0c1ea0bfc7 📎 Compare missing and empty fill and stroke lists alike in harness
A pasted shape gets empty fill and stroke lists, as the clipboard gives
them, while its main and a later sync of it have none. Both show nothing,
but the oracle and the model told them apart. Values and design
snapshots now take a missing list as an empty one.

Harness only; the benchmark is not run.

Also in this commit:

- The harness changes that check the next commit, "Author the size a resize
  gives an untouched swapped head".

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
30acd12f98 🐛 Index an empty paragraph's run before adding it to the runs
The letters of a text keep, for a paragraph with no letters, the index of
its run among the runs. It was counted after the run was added to the
transient list, so it pointed one past the run: at the next paragraph's
run, or past the end when the empty paragraph came last. Comparing the
styles of such a copy with its main failed, and importing the Penpot
Design System template stopped in the migration that recomputes old
text overrides.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.783 |  24.854 |  0.62 |
| edit-through-a-chain-of-dependents |   68.931 |  47.467 |  53.332 |  0.69 |
| library-update-into-copies         |   83.083 |  70.859 | 102.070 |  0.85 |
| main-edit-among-many-shapes        |    4.837 |   3.322 |   3.654 |  0.69 |
| main-edit-into-10-copies           |    1.79  |   1.200 |   1.572 |  0.67 |
| main-edit-into-100-copies          |   15.415 |  11.457 |  18.418 |  0.74 |
| main-edit-into-1000-copies         |  153.086 | 109.634 | 125.910 |  0.72 |
| variant-switch-into-copies         |   32.052 |  30.110 |  35.890 |  0.94 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
29a1b18f08 📎 Give pasted shapes fill and stroke lists in the harness paste
The clipboard's paste maps over the fills and strokes of every shape it
adds, so a shape without them, such as a group, gets empty lists. The
harness paste left them out, and the frontend replay of a generated
paste differed from the JVM run by them.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
0cce919e48 🐛 Rename a component and its main in one undo step
Renaming a component from the assets panel renames the component, then
its main root, in two commits. Undo took them back one at a time, so a
single undo left the component and its main with different names. They
are now one undo transaction.

Found by the frontend replay of generated programs with the new rename
kind. The JVM benchmark does not run frontend events; it is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
1ed798df25 ✨ Size percent tracks by content in a grid that hugs
A grid that hugs its content along an axis took its percent tracks
there as percentages of its current size, which the hug then changed,
so the grid settled only over several reflows, in both engines. Along an
axis the grid hugs, percent tracks are now sized by their content, as
CSS does for a container without a definite size, and the grid settles
in one reflow.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  22.420 |  23.267 |  0.64 |
| edit-through-a-chain-of-dependents |   68.931 |  42.715 |  52.079 |  0.62 |
| library-update-into-copies         |   83.083 |  59.152 |  66.682 |  0.71 |
| main-edit-among-many-shapes        |    4.837 |   3.469 |   3.887 |  0.72 |
| main-edit-into-10-copies           |    1.79  |   1.119 |   1.416 |  0.63 |
| main-edit-into-100-copies          |   15.415 |  10.790 |  12.449 |  0.70 |
| main-edit-into-1000-copies         |  153.086 | 108.911 | 129.565 |  0.71 |
| variant-switch-into-copies         |   32.052 |  23.968 |  26.842 |  0.75 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
10f573b327 🐛 Fill a grid copy's own cells in main layer order on ungroup
Ungrouping in a grid main brings the group's shapes into each copy as
well. A copy with its own cells gave them its free cells in the order
the main's grid flows them, while sync gives such a copy's new children
its free cells in the main's layer order, so the result depended on the
path. The ungroup now uses the main's layer order too.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  22.979 |  26.978 |  0.65 |
| edit-through-a-chain-of-dependents |   68.931 |  43.948 |  50.432 |  0.64 |
| library-update-into-copies         |   83.083 |  51.875 |  58.852 |  0.62 |
| main-edit-among-many-shapes        |    4.837 |   2.911 |   3.140 |  0.60 |
| main-edit-into-10-copies           |    1.79  |   1.160 |   1.245 |  0.65 |
| main-edit-into-100-copies          |   15.415 |  11.340 |  11.833 |  0.74 |
| main-edit-into-1000-copies         |  153.086 | 110.971 | 121.066 |  0.72 |
| variant-switch-into-copies         |   32.052 |  24.935 |  29.875 |  0.78 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
d4471ea9fb 🐛 Mark a pasted copy's geometry only when it changes parent
A copy duplicated in place under a stale library differs from its
updated main, and the check that keeps a pasted copy's look marked its
geometry although its source had none marked. The check now applies only
to a copy that lands under a parent other than its source's. The harness
model authors a pasted copy's geometry where it lands when its source
authored it, and when another parent gave it its orientation or size.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.980 |  22.894 |  0.62 |
| edit-through-a-chain-of-dependents |   68.931 |  43.830 |  44.755 |  0.64 |
| library-update-into-copies         |   83.083 |  53.028 |  54.143 |  0.64 |
| main-edit-among-many-shapes        |    4.837 |   2.352 |   2.487 |  0.49 |
| main-edit-into-10-copies           |    1.79  |   1.103 |   1.125 |  0.62 |
| main-edit-into-100-copies          |   15.415 |  10.851 |  11.191 |  0.70 |
| main-edit-into-1000-copies         |  153.086 | 108.036 | 112.301 |  0.71 |
| variant-switch-into-copies         |   32.052 |  22.906 |  23.847 |  0.71 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
f8f378ac74 📎 Hold a laid-out copy shape to no authored place in the harness
A copy shape that authored its place in a plain board, then taken into a
grid board by an ungroup of its main, is placed by that grid. The model
still compared the place it had authored. A shape a layout places is no
longer held to an authored place.

Harness only; the benchmark is not run.

Also in this commit:

- The harness changes that check the next commit, "Mark a pasted copy's geometry
  only when it changes parent".

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
92ab1a2486 🐛 Place a head switched back in the parent a layout moved
Switching a swapped head back to the variant its main holds syncs it from
the copy's root, which misses a move the copy's layout gave its parent:
a grid copy with its own gap moves its child boards, and the restored
head landed where the board would be without that gap. The restored head
now takes the place its main shape has in its actual parent, unless it
authors its geometry or a layout places it.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  23.030 |  27.413 |  0.65 |
| edit-through-a-chain-of-dependents |   68.931 |  42.850 |  57.976 |  0.62 |
| library-update-into-copies         |   83.083 |  60.905 |  63.778 |  0.73 |
| main-edit-among-many-shapes        |    4.837 |   3.209 |   4.225 |  0.66 |
| main-edit-into-10-copies           |    1.79  |   1.162 |   1.511 |  0.65 |
| main-edit-into-100-copies          |   15.415 |  11.296 |  12.963 |  0.73 |
| main-edit-into-1000-copies         |  153.086 | 103.929 | 116.557 |  0.68 |
| variant-switch-into-copies         |   32.052 |  22.613 |  25.676 |  0.71 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
a9cce26fe0 🐛 Keep the orientation a pasted copy showed as its own geometry
A nested copy inside a flipped or turned main shows the orientation its
parent gives it. Copied and pasted elsewhere, it kept that orientation
without marking its geometry, so the next sync turned it back to its
main's with no edit. Each new top copy of a paste or duplicate now goes
through the check a detached copy does: when it is not oriented and
sized as its main turned like its new parent, its geometry is marked as
its own. The harness model authors the same geometry.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  22.546 |  22.997 |  0.64 |
| edit-through-a-chain-of-dependents |   68.931 |  42.115 |  43.255 |  0.61 |
| library-update-into-copies         |   83.083 |  52.064 |  54.230 |  0.63 |
| main-edit-among-many-shapes        |    4.837 |   2.409 |   2.585 |  0.50 |
| main-edit-into-10-copies           |    1.79  |   1.072 |   1.139 |  0.60 |
| main-edit-into-100-copies          |   15.415 |  10.340 |  10.963 |  0.67 |
| main-edit-into-1000-copies         |  153.086 | 105.617 | 109.281 |  0.69 |
| variant-switch-into-copies         |   32.052 |  22.217 |  22.754 |  0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
4b5b391c14 🐛 Center a grid child vertically with half its margins
The CLJS grid centered a child horizontally with half its margins, as
CSS and the flex layout do, but vertically it shifted the child by the
whole top and bottom margins. Both axes now center the margin box.

Found by laying out random grid boards in a WASM workspace and reflowing
the same objects with the CLJS engine.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.021 |  21.658 |  0.60 |
| edit-through-a-chain-of-dependents |   68.931 |  41.085 |  42.996 |  0.60 |
| library-update-into-copies         |   83.083 |  51.898 |  52.585 |  0.62 |
| main-edit-among-many-shapes        |    4.837 |   2.255 |   2.395 |  0.47 |
| main-edit-into-10-copies           |    1.79  |   1.031 |   1.069 |  0.58 |
| main-edit-into-100-copies          |   15.415 |   9.877 |  10.192 |  0.64 |
| main-edit-into-1000-copies         |  153.086 | 100.151 | 105.021 |  0.65 |
| variant-switch-into-copies         |   32.052 |  22.340 |  23.371 |  0.70 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
05df95d042 🐛 Place and size WASM grid children by their margin box
The WASM grid engine laid out children differently from the CLJS engine
and from CSS. It centered a child in its cell without its margins, put a
child aligned to the end past the cell by its end margin, and sized auto
and flex tracks by a child's bounds without its margins, so a grid that
hugs its children came out narrower. A child now sits in its cell as
CSS places its margin box: after its start margin, centered with its
margins, or before its end margin. A track takes the size of its
children's margin boxes.

Found by laying out random grid boards in a WASM workspace and reflowing
the same objects with the CLJS engine.

The JVM benchmark does not run the WASM engine; it is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
a6eff8b74e ✨ Generate pastes of copies and main shapes to the page
A paste kind joins the structure programs: the clipboard's copy of a top
copy, or of a shape a main holds, pasted at the page root. Nothing in
them leaves a copy level, so no ref is advanced. The model carries the
overrides of the copied subtree to the pasted one, as for a duplicate.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
d3aea752d6 🐛 Give a grid copy its main's tracks when syncing its main's cells
Sync adds the copies of a main's new children before it removes those of
the children the main lost. Grouping two children of a full grid main
gave each grid copy one flow child more than its cells for a moment, so
it grew a column; the removals left that column empty and the next sync
dropped it. A copy that does not override its cells now takes its main's
tracks on each axis it does not override (all of them on a reset) before
it takes its main's cells.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.772 |  21.537 |  0.59 |
| edit-through-a-chain-of-dependents |   68.931 |  41.197 |  42.556 |  0.60 |
| library-update-into-copies         |   83.083 |  49.581 |  51.122 |  0.60 |
| main-edit-among-many-shapes        |    4.837 |   2.181 |   2.405 |  0.45 |
| main-edit-into-10-copies           |    1.79  |   1.108 |   1.158 |  0.62 |
| main-edit-into-100-copies          |   15.415 |  10.273 |  10.948 |  0.67 |
| main-edit-into-1000-copies         |  153.086 | 100.399 | 109.973 |  0.66 |
| variant-switch-into-copies         |   32.052 |  21.866 |  22.788 |  0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
bca17d5dac ✨ Generate moves, renames and annotations of components
Three kinds join the structure programs, and the programs built on them:

- move: a shape a main holds, or a nested copy head, moves to the page,
  into a board or group of its own main or of another. The model gives
  an override of its constraints the defaults of its new parent, as the
  move resets them.
- rename: the assets panel's rename, with names that carry a path. The
  component must take the normalized path and name, and its main root
  the whole name.
- annotate: a component's annotation is set or removed. Only that edit,
  or its undo or redo, may change an annotation.

The frontend interpreter realises the rename and the annotation through
their workspace events.

Harness only; the benchmark is not run.

Also in this commit:

- Ignore the layout-given size of a hidden layout child in the oracle. A hidden
  shape leaves its layout's flow, so it keeps the size the layout last gave it
  along its fill or auto axes, while a sync from its main can give it the
  main's. The layout gives it its size again once it is shown. The oracle
  expected the main's size, and the design snapshots of a settled and a fully
  synced world differed by it. Those sizes are now nobody's to keep, as the
  place of a hidden layout child already is.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
d862f99bb9 🐛 Mark the arrangement of a laid-out copy group a transform changes
Moving a shape of a copy group that a layout places changes the group's
bounds, and the layout moves the group back: the moved shape ends where
it was and its siblings move the other way. Nothing was marked, so the
next sync put the siblings back and the user's move was lost.

When a transform moves some copy shapes of the outermost group or bool a
layout places and leaves others, every copy shape in that group now
authors its geometry. A transform of the whole group or of its board
marks nothing more. The harness model authors the same shapes, and
transforms of copy shapes in groups inside layouts are generated again.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  23.506 |  23.987 |  0.67 |
| edit-through-a-chain-of-dependents |   68.931 |  40.749 |  42.565 |  0.59 |
| library-update-into-copies         |   83.083 |  49.609 |  50.752 |  0.60 |
| main-edit-among-many-shapes        |    4.837 |   2.344 |   2.551 |  0.48 |
| main-edit-into-10-copies           |    1.79  |   1.103 |   1.179 |  0.62 |
| main-edit-into-100-copies          |   15.415 |  10.109 |  10.492 |  0.66 |
| main-edit-into-1000-copies         |  153.086 | 103.527 | 107.994 |  0.68 |
| variant-switch-into-copies         |   32.052 |  21.691 |  22.453 |  0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
0a69ef65c2 🐛 Order a main grid copy's children by its cells when updating the main
An update main pushes a copy's grid direction into its main. When that
main is itself a grid copy with its own cells, sync orders its children
as they flow in those cells, but the update ordered them as the pushing
copy lists them. The next sync of that copy then reordered them with no
edit. The update now gives such a main the order of the copy's cell
flow.

Benchmark (lower quantile, ms):

| world                              | baseline |     now |    mean | ratio |
|------------------------------------+----------+---------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.632 |  22.076 |  0.61 |
| edit-through-a-chain-of-dependents |   68.931 |  42.236 |  44.386 |  0.61 |
| library-update-into-copies         |   83.083 |  48.557 |  51.934 |  0.58 |
| main-edit-among-many-shapes        |    4.837 |   2.443 |   2.556 |  0.51 |
| main-edit-into-10-copies           |    1.79  |   1.129 |   1.149 |  0.63 |
| main-edit-into-100-copies          |   15.415 |  10.085 |  10.387 |  0.65 |
| main-edit-into-1000-copies         |  153.086 | 101.224 | 103.687 |  0.66 |
| variant-switch-into-copies         |   32.052 |  20.846 |  21.588 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
6eff483b22 📎 Size the shapes of a group a layout sizes in the harness oracle
A copy bool set to fill in a grid cell is sized by the grid, and its
shapes scale with it. The oracle expected them at their main's size and
place. The shapes of a group or bool whose size a layout owns are now
sized and placed by that layout too.

Test: the-shapes-of-a-copy-bool-a-grid-fills-are-sized-with-it; shape
structure programs pass (seed 9008, 300).

Harness only; the benchmark is not run.

Also in this commit:

- Compare the corners of a masked group in any order on undo. A masked group
  takes the corners of its mask. When the mask is a bool, a sync that refits it
  computes them again from its children in any order, and the undo of that sync
  refits it the same way. The undo check already compares the corners of a bool
  in any order; a masked group now follows its mask.
- Read the size of a copy path from its bounds in the harness model. A path
  stores no width or height, so the model saw no change when a copy path that a
  layout places was resized: its place is the layout's and its size values stay
  nil. The model now reads a size change of a shape with no width from its
  bounds, and expects the resize to mark it.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
07384e599e 🐛 Read a bool's orientation from its turn and flips when syncing
A group keeps its transform when it fits its children but clears its
flip flags; a bool keeps its flags while fitting it resets its
transform. Sync read the orientation of both from their transform, so a
bool in a copy whose main was flipped, resized afterwards, looked
unflipped, and a full sync unflipped its shapes, apart from the settled
file.

A bool's orientation now comes from its turn and flips, a group's from
its transform. The harness generates resizes of copy bools again.

Test: a-copy-bool-and-its-shapes-are-compared-by-their-corners, now
reached; group, sync, switch, golden master and generated group and bool
tests pass (376).

Benchmark (alone):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.34 |  27.387 |   0.61 |
| edit-through-a-chain-of-dependents |    68.931 | 46.931 |  67.865 |   0.68 |
|         library-update-into-copies |    83.083 | 63.966 |  74.531 |   0.77 |
|        main-edit-among-many-shapes |     4.837 |   2.42 |   2.623 |    0.5 |
|           main-edit-into-10-copies |      1.79 |  1.122 |   1.169 |   0.63 |
|          main-edit-into-100-copies |    15.415 | 10.589 |  11.406 |   0.69 |
|         main-edit-into-1000-copies |   153.086 |  101.69 | 106.961 |   0.66 |
|         variant-switch-into-copies |    32.052 | 21.962 |  26.736 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
f924b93a82 📎 Pin the deferred F408 and F414 programs as tests
The two programs deferred during the variant runs pass on the current
branch with every step executed, after the round 4 fixes. Generated
tests keep them passing.

Tests: a-flipped-turned-copy-switches-without-losing-its-geometry,
a-turned-pushed-copy-made-a-variant-keeps-a-valid-file.

Harness only; the benchmark is not run.

Also in this commit:

- The harness changes that check the next commit, "Read a bool's orientation
  from its turn and flips when syncing".

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
9943472e86 🐛 Guard the WASM grid tracks against an empty track list
The grid layout of the WASM renderer counted the gaps between tracks as
the number of tracks less one, which underflows for an empty track list
(a panic in a debug build, a wrapped count in release), and spread the
space between tracks over that count, a division by zero for one track.
An empty list has no gap, and space between fewer than two tracks
starts them at the padding.

Tests: test_space_between_without_tracks_places_nothing,
test_space_between_with_one_track_starts_it_at_the_padding; the
render-wasm tests pass (364).

The component sync benchmark does not reach the renderer and is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
5f8eeed69e 📎 Require no share of changes from kinds only grid worlds offer
The coverage control requires each kind to supply 0.5% of a program
set's changes. Grid cell and grid direction steps exist only in grid
worlds, a share of the programs, so with 50 programs a seed with few
grid worlds left them under the share, and the swap and library
programs failed on random seeds. These kinds must still change state,
but need no share of the changes.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
e0e5966b7e 🐛 Carry no size a copy's layout gave it over a variant switch
A nested copy that fills its flex parent while its main is turned gets
its size from the layout. Switching it to a variant without that layout
carried the size as an override, as both mains agree on their size and
its copy chain authors a turn, so it kept the layout's size for good.

A dimension the layout of the copy gave it before the switch is no
override: the copy takes the new variant's.

Test: a-switch-carries-no-size-the-old-layout-gave-a-child.
Switch, swap, sync and golden master tests pass (215); variant programs
pass (seed 9007, 300).

Benchmark (alone):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.013 |  20.948 |   0.57 |
| edit-through-a-chain-of-dependents |    68.931 | 39.641 |  40.924 |   0.58 |
|         library-update-into-copies |    83.083 | 50.865 |  52.074 |   0.61 |
|        main-edit-among-many-shapes |     4.837 |  2.536 |   3.259 |   0.52 |
|           main-edit-into-10-copies |      1.79 |   1.04 |   1.067 |   0.58 |
|          main-edit-into-100-copies |    15.415 |  9.946 |  10.414 |   0.65 |
|         main-edit-into-1000-copies |   153.086 | 99.227 | 101.039 |   0.65 |
|         variant-switch-into-copies |    32.052 | 21.451 |  24.531 |   0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:49 +01:00
alonso.torres
6f7a77504f 📎 Model an authored size through its parent's later resizes
A nested copy in a main that authors its height and scales vertically
has its height scaled when an update main resizes that main. The model
kept only the size as authored, as the copy's place in a plain main is
not an override, and compared it raw. An authored size now follows its
parent's later resizes through its constraints, though its place stays
unauthored.

Test: an-authored-size-follows-a-resize-of-its-main-through-its-constraint.
Structure, swap and scale programs pass (seed 9006, 150 each).

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
782623c935 🐛 Give a grid copy's children free cells in the order of their mains
A grid copy that authors its cells gives its children without a cell
free cells at sync. It took them in the copy's order of its children,
which grid reordering changes, so a child given back by a shrunk track
and a child new from the main could take each other's cells. They now
take free cells in the order of the main shapes they refer to, as sync
adds children.

Test: a-grid-copy-gives-free-cells-to-children-in-their-main-order.
Grid, sync and golden master tests pass (399).

Benchmark (alone):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |   21.19 |   22.83 |    0.6 |
| edit-through-a-chain-of-dependents |    68.931 |  42.408 |  44.279 |   0.62 |
|         library-update-into-copies |    83.083 |  53.897 |  55.394 |   0.65 |
|        main-edit-among-many-shapes |     4.837 |   2.367 |   2.548 |   0.49 |
|           main-edit-into-10-copies |      1.79 |   1.031 |   1.103 |   0.58 |
|          main-edit-into-100-copies |    15.415 |  10.483 |  10.835 |   0.68 |
|         main-edit-into-1000-copies |   153.086 | 100.626 | 107.239 |   0.66 |
|         variant-switch-into-copies |    32.052 |  23.355 |  23.926 |   0.73 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
73b4e0795b 🐛 Grow a track for a grid copy's new child and keep it at sync
A grid copy that authors its cells and has no free cell for a child its
main gains grew a column for it at the first sync. The next sync gave
the copy its main's columns again, took the grown column for a shrunk
inherited track, and fitted the child back into the inherited tracks,
stacking it in another child's cell.

When a copy's inherited tracks shrink, its default cells past them
(automatic, single, aligned by default) give their children back, which
take a free slot or a track the grid grows for them, as when they first
came. Cells with something of their own are fitted as before, and the
overflow is no longer fitted back into the inherited tracks. The grid
model does the same, and the oracle accepts the default tracks a grid
grows along its flow past its main's.

Tests: a-grid-copy-with-its-own-cells-grows-a-column-for-a-new-child-for-good,
a-grid-copy-keeps-an-aligned-cell-its-main-takes-a-column-from,
a-grid-copy-keeps-its-aligned-cell-when-its-main-adds-a-row.
Grid, sync and golden master tests pass (315); grid programs pass
(seed 9004, 300).

Benchmark (alone; a first run under load read 1.09 for the variant
switch world, which F526 does not reach):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  23.132 |  28.537 |   0.66 |
| edit-through-a-chain-of-dependents |    68.931 |  47.053 |  57.855 |   0.68 |
|         library-update-into-copies |    83.083 |  55.445 |  64.964 |   0.67 |
|        main-edit-among-many-shapes |     4.837 |   3.117 |   3.305 |   0.64 |
|           main-edit-into-10-copies |      1.79 |   1.169 |   1.544 |   0.65 |
|          main-edit-into-100-copies |    15.415 |  13.442 |  14.626 |   0.87 |
|         main-edit-into-1000-copies |   153.086 | 119.198 | 141.449 |   0.78 |
|         variant-switch-into-copies |    32.052 |  25.091 |  29.622 |   0.78 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
65f548e437 ♻️ Reindent the harness undo check and transform op
Whitespace only, as the formatter wants it after the last changes to
same-state? and the transform op of the generator.

Harness only; the benchmark is not run.

Also in this commit:

- Record the frontend golden master of case AY again. The undo and redo checks
  compare the tokens library by its exported content, so the golden master
  writes it key by key; the JVM golden master of case AY was recorded again for
  that, and the frontend one is now too. Same values, written differently.
- The harness changes that check the next commit, "Grow a track for a grid
  copy's new child and keep it at sync".

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
33a8b09362 🐛 Propagate tokens when restoring a deleted component
A token edit sets the shapes on pages, not the main a deleted component
stores, so a restored main came back with the values its tokens had when
it was deleted, and synced them into its copies.

Restoring a component in the current file propagates the tokens, so the
restored main takes their current values.

Not covered by a test: the frontend suite compiles it in the full
validation that follows.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
e22ca8b7ce 📎 Compare groups and bools and their shapes by corners in the harness
A bool's stored flip flags and transform drift apart, so neither sync
nor the model can read its orientation. The model and the oracle now
compare a group or bool, and the shapes it holds, by their corners in
any order, without their turn and flips, whether or not the authored
values record corners. Their corners are ordered by angle around their
centre: an order by position to the hundredth of a pixel swapped the
corners of an empty bool, 0.01 px wide, with float noise.

Resizing a copy bool after its main was flipped leaves settled and
fully synced files apart (F518, deferred until a bool keeps a reliable
orientation); the generator skips resizes of copy bools until then.

Tests: a-copy-bool-and-its-shapes-are-compared-by-their-corners,
an-empty-bool-in-a-copy-keeps-its-corners-in-one-order.

Harness only; the benchmark is not run.

Also in this commit:

- Leave a group's flip flags out of the harness undo check. Undoing a text style
  edit fits the group around the text again, and fitting a group clears its flip
  flags by design, though its corners and transform still show the flip. The
  undo check now leaves the flip flags of groups and bools out and compares
  their corners.
- Round corner angles before they wrap in the harness corner order. The harness
  orders the corners of groups, bools and their shapes by angle around their
  centre. A corner level with the centre, as in a square turned 45 degrees, fell
  at 0 or just under a full turn as noise fell, and its order flipped. Angles
  are now rounded before they wrap.
- Read the size of a bool from its selrect in the update main check. The harness
  check of an update main compared the sizes of the parent of a pushed shape by
  their width and height, and crashed when that parent was a bool, which has no
  width or height of its own. Sizes are read from the selrect.
- Order the corners of groups in the harness design snapshot. The settled and
  fully synced files of a bool made in a variant main whose copies are turned
  differed only by noise: up to 5e-6 px in the bool, which computes its geometry
  in single precision. But the design snapshot ordered only a bool's corners,
  not a group's, and the angle order, to the millionth of a radian, flipped a
  corner level with the bool's centre under that noise.
- Author no size for a swapped head a layout places in the harness. Switching a
  nested head in a filling grid copy to a wider variant grows the grid. The
  model took the grown copy for a sync resize and made the untouched swapped
  head author the size the resize gives it, though the layout sizes it, not its
  constraints. Heads a layout places are left out.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
8ed42aadac 🐛 Restore a group's whole geometry when undoing the sync of it
The undo of a group's synced attributes fitted the group to its
children again, after its own undo, so a turned group would not keep
the turned size an earlier fit gave it. But fitting a group clears its
flip flags, so a flipped group came back unflipped.

The undo of a group or bool whose geometry a sync changes restores all
of it, its place, size, corners, transform, turn and flips, whatever
fits of it ran before.

Tests: a-copy-group-whose-main-turns-matches-its-corners-whatever-its-flips,
undoing-an-update-main-that-turns-a-group-gives-the-group-its-size-back.

Benchmark (alone):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.394 |  21.255 |   0.58 |
| edit-through-a-chain-of-dependents |    68.931 | 43.583 |  44.351 |   0.63 |
|         library-update-into-copies |    83.083 | 51.967 |  52.683 |   0.63 |
|        main-edit-among-many-shapes |     4.837 |  2.366 |   2.526 |   0.49 |
|           main-edit-into-10-copies |      1.79 |  1.044 |   1.132 |   0.58 |
|          main-edit-into-100-copies |    15.415 |  9.805 |  10.146 |   0.64 |
|         main-edit-into-1000-copies |   153.086 | 98.202 | 101.844 |   0.64 |
|         variant-switch-into-copies |    32.052 | 21.832 |  22.268 |   0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
fa1edc78bd 📎 Place a group's shapes from its board when the harness orients them
Flipping the mask of a mask group in a copy makes the group follow it.
The model applied the mask's change twice, as the modifier tree passes
a mask's change to its group and back, and when the group's orientation
changed it placed the mask's authored geometry in the group, whose
bounds come from that mask, halving it.

The requested geometry of a group's mask applies its change once, and
authored geometry under a group or bool follows the board around it
when its parent's orientation changes, as elsewhere in the model.

Test: flipping-the-mask-of-a-copy-group-flips-the-group-for-good;
shape structure programs pass (seed 9002, 300).

Harness only; the benchmark is not run.

Also in this commit:

- Compare a bool by its children, not its segments, when checking undo. Undoing
  an update main that pushed a flip into a main holding a bool gives the bool
  back the same rectangle with its segments drawn the other way round. A bool
  computes its segments from its children, in an order that depends on how it
  computed them.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
8c2ef98bb2 🐛 Fit a copy's masked group to its mask whenever sync changes it
A masked group takes all its geometry from its mask. When the mask of a
group in a copy authors a flip, the untouched group follows it; a later
sync gave the group its main's unflipped geometry, apart from its mask.

A masked group whose geometry sync changes in any way carries nothing
and takes its mask's geometry again, as a group a sync moves or resizes
fits its shapes again.

Test: flipping-the-mask-of-a-copy-group-flips-the-group-for-good.

The benchmark of the previous commit covers this one.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
fb24f8c19e 🐛 Count a copy bool that mirrors apart from its main as moved
A bool keeps its corners in one order whatever its flips. Sync places
the shapes of a copy shape that authors its geometry like it only when
its geometry differs from its main's, so a flipped bool in a copy
looked like its main, and sync gave its shapes their main's unflipped
geometry.

A group or bool also differs from its main when it mirrors differently,
read from its transform.

Test: syncing-the-shapes-of-a-flipped-copy-bool-keeps-them-flipped.

Benchmark (alone, shared with the next commit):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.498 |  21.134 |   0.58 |
| edit-through-a-chain-of-dependents |    68.931 | 40.257 |  42.557 |   0.58 |
|         library-update-into-copies |    83.083 | 51.433 |  52.577 |   0.62 |
|        main-edit-among-many-shapes |     4.837 |  2.145 |   2.365 |   0.44 |
|           main-edit-into-10-copies |      1.79 |  1.012 |   1.093 |   0.57 |
|          main-edit-into-100-copies |    15.415 | 10.535 |  10.754 |   0.68 |
|         main-edit-into-1000-copies |   153.086 |  99.04 | 105.491 |   0.65 |
|         variant-switch-into-copies |    32.052 | 22.662 |  23.464 |   0.71 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
c1778338e4 🐛 Take off the token of the corner a flipped shape shows
A border radius token names the corners as a flipped shape shows them:
applying and propagating it mirror each corner to the one the shape
stores. A radius edit took off the token of the corner it stores, so on
a flipped shape it took off the wrong one, and a later token edit set
the corner given by hand. The sidebar's single-corner edit mirrored the
corner too but wrote only the corner it names, so on a flipped rectangle
it changed nothing.

A radius edit takes off the token of the corner the shape shows, with
the same mirroring, and the sidebar's single-corner edit writes any
corner. The harness model does the same.

Tests: unapply-the-token-of-the-corner-a-flipped-shape-shows;
a-token-edit-sets-the-corners-of-a-flipped-copy-as-it-shows-them.

The benchmark of the previous commit covers this one.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
f6d4e5dcd5 🐛 Unmask copies without overriding them when a main loses its mask
Removing the mask shape of a masked group in a main unmasks the group.
The deletion reaches the copies through the same deletion, which
ignores touched groups, but the step that unmasks a group that lost its
mask did not, so every copy's group came out unmasked and marked as
overriding its mask.

The unmask follows the deletion's ignore-touched option.

Test: removing-the-mask-of-a-main-unmasks-its-copies-without-overriding-them.

Benchmark (alone, shared with the next commit):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.715 |  24.396 |   0.62 |
| edit-through-a-chain-of-dependents |    68.931 |  48.192 |  53.222 |    0.7 |
|         library-update-into-copies |    83.083 |  50.508 |  52.972 |   0.61 |
|        main-edit-among-many-shapes |     4.837 |   2.345 |   2.775 |   0.48 |
|           main-edit-into-10-copies |      1.79 |   1.172 |   1.479 |   0.65 |
|          main-edit-into-100-copies |    15.415 |  11.582 |  13.079 |   0.75 |
|         main-edit-into-1000-copies |   153.086 | 102.539 | 133.903 |   0.67 |
|         variant-switch-into-copies |    32.052 |  22.204 |  24.303 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
c9683d7398 🐛 Place the shapes of a copy group in its board when detaching
A detach advances the references of the nested copies and makes
authored the place of a shape its new main would put elsewhere. It
measured the shapes of a group or bool from the group, whose bounds
differ from its main's when one of its shapes authors a move, so it
authored places nothing had moved, and authored the group's own
geometry for the same reason.

The shapes of a group or bool are measured in the board around it, as
a group takes its bounds from its shapes, and a group or bool never
authors its geometry there. The harness model does the same.

Test:
detaching-keeps-a-shape-of-a-copy-bool-unauthored-where-its-main-places-it.
Shape structure programs pass (seed 9001, 150).

The benchmark of the commit before the previous one covers this one.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
97d0ed02c3 🐛 Keep the ids of the cells a copy's own grid tracks add
A copy that authors a grid column its main lacks takes its main's cells
fitted to its own tracks. The fitting gave the cell of that column a new
id at every sync, so the copies that follow it took a new id each time,
while one that authors its own cells kept the old one.

The cells a copy's own tracks add keep the ids of its cells in the same
place.

Test: syncing-a-copy-with-its-own-columns-keeps-the-ids-of-their-cells.
Focused grid, sync and golden master tests pass (315 tests).

The benchmark of the previous commit covers this one.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
f8272d89b1 🐛 Fit a group again when undoing the sync of its attributes
An update main that pushes a turn into a main holding a group turns the
group and its shapes. Its undo restores the shapes first and fits the
group around them while the group still has the turned transform, which
writes the turned bounds into its width and height; the group's own undo
then restores only the attributes the update main changed, so the group
kept the turned size.

The undo of a shape's synced attributes fits the shape itself, after its
own undo, as well as its parents; only groups and bools are fitted.

Test: undoing-an-update-main-that-turns-a-group-gives-the-group-its-size-back.
Focused sync, undo, group and golden master tests pass.

Benchmark (alone, shared with the next two commits):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |   20.59 |  22.349 |   0.58 |
| edit-through-a-chain-of-dependents |    68.931 |  41.197 |   42.87 |    0.6 |
|         library-update-into-copies |    83.083 |  50.286 |  53.679 |   0.61 |
|        main-edit-among-many-shapes |     4.837 |   2.582 |   3.885 |   0.53 |
|           main-edit-into-10-copies |      1.79 |   1.132 |    1.22 |   0.63 |
|          main-edit-into-100-copies |    15.415 |  10.634 |  11.318 |   0.69 |
|         main-edit-into-1000-copies |   153.086 | 100.406 | 125.813 |   0.66 |
|         variant-switch-into-copies |    32.052 |  21.303 |  22.718 |   0.66 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
47603c4aa9 ✨ Transform shapes in the groups and bools of copies
The random histories never transformed a copy shape inside a group or a
bool. They now do, where the board around the group has no layout.
Inside a layout, a move of a group's shape makes the layout move the
group back, and its siblings with it, with nothing authored; that stays
out until it is decided.

The oracle learns:
- the shapes of a group or bool take their place from the board around
  it, or from the nearest group or bool on the way that authors its
  geometry;
- the geometry check leaves groups and bools out, as their bounds come
  from their children, which it checks.

The frontend replay realises the token value edit as the token form
commits it, with its propagation.

Test: the-shapes-of-a-moved-copy-group-follow-it; shape structure
programs pass (seeds 8101 at 150, 8102 at 300).

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
6a5aa99f79 🐛 Keep the geometry a shape in a copy group authors through sync
When a shape in a group of a copy authors a move or a resize, the
untouched group's bounds follow it. Sync moved or resized the group
back to its main's bounds and carried its whole subtree with it, so the
shape lost the geometry it authored.

A group or bool takes its bounds from its children, which sync places
one by one: a move or resize of its bounds now carries nothing, and the
group fits its children again. A turn or flip still carries the subtree.

Tests: syncing-a-copy-group-keeps-the-place-its-shape-authors,
syncing-a-copy-group-keeps-the-size-its-shape-authors,
undoing-a-turn-of-a-copy-group-gives-the-groups-of-its-copies-their-bounds-back.
The full common suite passes.

The benchmark of the previous commit covers this one.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00