25006 Commits

Author SHA1 Message Date
alonso.torres
f901d6974d 🐛 Keep on the copy the layout child overrides a pushed swap holds
Under a main parent with no layout, an update main leaves on the copy the
layout child attributes it authored, as no layout parent uses them. An
update main that pushes a swap adds the copy's subtree to the main
instead, with every override it holds, so a maximum width a copy shape
authored under the swapped board moved to the main. Pushing a swap now
keeps those overrides on the copy shapes and off the new main shapes, as
pushing a pair does.

Test: updating-a-main-keeps-the-max-width-override-a-switched-copy-holds
(the variant gate program of seed 175377838).

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the previous commit's change in the tree as well:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.071 |  22.737 |    0.6 |
| edit-through-a-chain-of-dependents |    68.931 |  44.394 |   45.61 |   0.64 |
|         library-update-into-copies |    83.083 |  53.752 |  54.632 |   0.65 |
|        main-edit-among-many-shapes |     4.837 |   2.372 |   2.633 |   0.49 |
|           main-edit-into-10-copies |      1.79 |   0.997 |   1.029 |   0.56 |
|          main-edit-into-100-copies |    15.415 |  10.009 |  11.143 |   0.65 |
|         main-edit-into-1000-copies |   153.086 | 109.767 | 112.342 |   0.72 |
|         variant-switch-into-copies |    32.052 |  22.182 |  23.614 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
ed1dbca6da 🐛 Keep the fill sizing of a shape an update main leaves absolute
An update main that resizes a main shape a layout fills fixes its sizing,
so the layout does not undo the pushed size; for a shape that is not a
layout, that drops the sizing. A copy child made absolute pushed its
absolute flag and its width, so its main shape came out absolute without
the fill sizing the copy keeps. No layout fills an absolute shape: a fill
axis of a shape the push leaves absolute now keeps its sizing.

Test: updating-a-main-keeps-the-fill-sizing-its-child-authors (the
library gate program of seed 175377838).

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the next commit's change in the tree as well:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.071 |  22.737 |    0.6 |
| edit-through-a-chain-of-dependents |    68.931 |  44.394 |   45.61 |   0.64 |
|         library-update-into-copies |    83.083 |  53.752 |  54.632 |   0.65 |
|        main-edit-among-many-shapes |     4.837 |   2.372 |   2.633 |   0.49 |
|           main-edit-into-10-copies |      1.79 |   0.997 |   1.029 |   0.56 |
|          main-edit-into-100-copies |    15.415 |  10.009 |  11.143 |   0.65 |
|         main-edit-into-1000-copies |   153.086 | 109.767 | 112.342 |   0.72 |
|         variant-switch-into-copies |    32.052 |  22.182 |  23.614 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
e766345cd0 🐛 End the swap of a nested swapped shape a kept swap points at its component
A switch that keeps a copy's swapped child in place of the new copy's
child makes it a plain copy of its new position when both have the same
component, and points its descendants at the position's descendants. A
swapped shape among those descendants kept its swap though its new
reference had its own component, as a plain copy of it does: a copy
switched to a variant whose nested board its main had swapped to that
same component stayed marked as swapped, while the variant's other
copies were not. Such a descendant now drops its swap as well.

Test: switching-a-copy-takes-the-swap-of-a-nested-board-from-its-main
(the variant program of the common suite's seed 1794464684740).

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |   21.57 |  22.621 |   0.61 |
| edit-through-a-chain-of-dependents |    68.931 |   43.16 |  45.931 |   0.63 |
|         library-update-into-copies |    83.083 |  53.172 |  58.967 |   0.64 |
|        main-edit-among-many-shapes |     4.837 |   2.439 |    2.93 |    0.5 |
|           main-edit-into-10-copies |      1.79 |    1.12 |    1.22 |   0.63 |
|          main-edit-into-100-copies |    15.415 |  10.261 |  11.179 |   0.67 |
|         main-edit-into-1000-copies |   153.086 | 102.918 | 110.051 |   0.67 |
|         variant-switch-into-copies |    32.052 |  23.136 |  24.466 |   0.72 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
4fba88d567 ✨ Generate ungroups of shapes a main holds
The shape structure property now ungroups groups, bools and boards a
main holds, as the ungroup changes keep the copies valid, and the
structure node passes the file's pages to them. A grouping that takes
every child out of a group, which removes it as well, stays out.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
59e8da6070 🐛 Ungroup the copies of a group a main ungroups in the same change
Ungrouping a group, bool or board inside a main removed it, while its
copies kept a shape that referred to it until the next sync, so the
file failed validation in between. The ungroup now takes the file's
pages and ungroups every shape of the file that refers to an ungrouped
one, directly or through other copies, in the same change: its children
move to its parent at its place, keeping their overrides, and it is
removed. The frontend's ungroup passes the file's pages.

Test: ungrouping-a-group-a-main-holds-leaves-no-copy-referring-to-it
(the copy's rectangle moves to the copy root with its opacity override).

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.54 |  21.937 |   0.61 |
| edit-through-a-chain-of-dependents |    68.931 | 42.565 |  43.748 |   0.62 |
|         library-update-into-copies |    83.083 | 58.686 |  78.974 |   0.71 |
|        main-edit-among-many-shapes |     4.837 |  2.503 |   3.171 |   0.52 |
|           main-edit-into-10-copies |      1.79 |  1.039 |   1.105 |   0.58 |
|          main-edit-into-100-copies |    15.415 | 10.205 |  10.895 |   0.66 |
|         main-edit-into-1000-copies |   153.086 | 102.64 | 106.511 |   0.67 |
|         variant-switch-into-copies |    32.052 | 21.481 |  22.871 |   0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
8bf641ee81 🐛 Keep the geometry of a swapped shape a pushed swap carries
An update main that pushes a copy's swap into a copy inside the main
places the pushed shapes like the shape the head takes the place of.
That placement holds every shape of the main's page, and a pushed shape
followed any entry its reference names: a swapped board inside the
pushed swap took the size of the board it replaced, and its children
the place of their own component's main children, at the page origin.
The subtree of a swapped shape now keeps its pushed geometry, as the
subtree of a shape that authors its geometry does.

Test: updating-a-main-pushes-a-swapped-shape-nested-in-a-swap-with-its-children
(the scale gate program of seed 660536824).

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the previous commit's change in the tree as well:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.827 |  22.409 |   0.62 |
| edit-through-a-chain-of-dependents |    68.931 |  45.406 |  46.777 |   0.66 |
|         library-update-into-copies |    83.083 |  56.396 |   58.29 |   0.68 |
|        main-edit-among-many-shapes |     4.837 |   2.456 |   2.809 |   0.51 |
|           main-edit-into-10-copies |      1.79 |   1.143 |   1.177 |   0.64 |
|          main-edit-into-100-copies |    15.415 |   11.12 |  11.591 |   0.72 |
|         main-edit-into-1000-copies |   153.086 | 111.472 | 118.427 |   0.73 |
|         variant-switch-into-copies |    32.052 |  22.527 |  23.487 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
1374a897b7 🐛 Keep a cell a resize splits in one piece
Resizing a grid cell over part of a cell that spans several tracks
moves that cell to the first area left of it and adds new cells for
the others, but it added one for the first area as well, so two cells
held the same place: the moved one with its shapes and an empty one
that a later assignment filled. The grid editor's cell handles and the
sidebar's cell position reach it. New cells now cover only the areas
the moved cell does not take.

Test: resizing-a-cell-over-part-of-a-span-leaves-the-rest-of-the-span-one-cell
(the grid gate program of seed 660536824).

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the next commit's change in the tree as well:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.827 |  22.409 |   0.62 |
| edit-through-a-chain-of-dependents |    68.931 |  45.406 |  46.777 |   0.66 |
|         library-update-into-copies |    83.083 |  56.396 |   58.29 |   0.68 |
|        main-edit-among-many-shapes |     4.837 |   2.456 |   2.809 |   0.51 |
|           main-edit-into-10-copies |      1.79 |   1.143 |   1.177 |   0.64 |
|          main-edit-into-100-copies |    15.415 |   11.12 |  11.591 |   0.72 |
|         main-edit-into-1000-copies |   153.086 | 111.472 | 118.427 |   0.73 |
|         variant-switch-into-copies |    32.052 |  22.527 |  23.487 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
d5cdebc478 🐛 Fit the cells a copy takes from its main within its own tracks
A copy that authors its track lists keeps them when its main adds or
removes tracks, but sync gave it its main's cells as they were: after
the main added a column, a copy with two columns of its own held a cell
in a third. A copy whose track counts differ from its main's now fits
the main's cells within its own tracks as the contract keeps cells when
tracks shrink (move, shorten or join), and the oracle expects the same.

Test: a-copy-with-its-own-columns-takes-its-main-cells-within-them (the
grid gate program of seed 175377838).
Common suite: as the previous commit.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the previous commit's change in the tree as well:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |   22.04 |   22.52 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  43.463 |   44.28 |   0.63 |
|         library-update-into-copies |    83.083 |  48.024 |  50.138 |   0.58 |
|        main-edit-among-many-shapes |     4.837 |   2.247 |   2.418 |   0.46 |
|           main-edit-into-10-copies |      1.79 |    1.06 |   1.078 |   0.59 |
|          main-edit-into-100-copies |    15.415 |  10.242 |  11.303 |   0.66 |
|         main-edit-into-1000-copies |   153.086 | 110.068 | 112.273 |   0.72 |
|         variant-switch-into-copies |    32.052 |  22.921 |  23.391 |   0.72 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
9e2a50da3c 🐛 Keep the layout's place and sizes out of a detach's kept geometry
A detach advances the references of nested copies, and marks the
geometry of one authored when its new main would place it elsewhere. For
a nested copy a layout places, that compared the place and the sizes
the layout gives it: a grid that starts its tracks at 0.01 px, or a copy
that fills its grid, made its geometry an override, while the contract
keeps the place of a layout child and the sizes it fills or hugs the
layout's. Such a copy now keeps as authored only an orientation or a
size of its own, leaving out the dimensions its layout gives it, and the
model checks the same.

Tests: detaching-after-a-main-adds-a-row-leaves-the-copy-boards-unauthored
(the grid gate program of seed 673701779) and
detaching-keeps-unauthored-a-nested-copy-a-grid-fills (a random grid
program of the common suite).
Common suite: 2466 tests; only the open red tests and a new random shape
structure case (F488 family) fail.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the next commit's change in the tree as well:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |   22.04 |   22.52 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  43.463 |   44.28 |   0.63 |
|         library-update-into-copies |    83.083 |  48.024 |  50.138 |   0.58 |
|        main-edit-among-many-shapes |     4.837 |   2.247 |   2.418 |   0.46 |
|           main-edit-into-10-copies |      1.79 |    1.06 |   1.078 |   0.59 |
|          main-edit-into-100-copies |    15.415 |  10.242 |  11.303 |   0.66 |
|         main-edit-into-1000-copies |   153.086 | 110.068 | 112.273 |   0.72 |
|         variant-switch-into-copies |    32.052 |  22.921 |  23.391 |   0.72 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
a64ea2121c ✨ Generate group, mask, bool and path edits inside mains
The random histories never changed the structure of the shapes a main
holds. The shape structure programs add a structure edit on a shape a
main holds, and its next sibling: group, mask, unmask, combine into a
bool of each type, or convert to a path, through the changes of
app.common.logic.groups and app.common.logic.bool the workspace events
commit, and the frontend's path conversion without the WASM renderer.
Ungrouping, and grouping that takes every child out of a group, stay out
until copies follow the removal of a shape their main holds.

The oracle and the model learn the shapes these edits make:
- bools and paths keep their bounds in their selrect only, which the
  geometry checks read when a shape has no box of its own;
- path segments compare within the geometry tolerance, and the design
  snapshot leaves out a bool's segments, which it computes from its
  children in an order that depends on how it was computed;
- children of groups and bools measure from, and anchor authored places
  to, the board around them, as a group's bounds come from its children;
- differing flip flags count only when the ordered corners differ too;
- undo and redo compare geometry within 1e-10, and bool and path
  geometry within 1e-4, as a group computes its geometry again from its
  children and a path stores its segments in single precision.
Transforms of copy shapes inside groups and bools stay out until the
oracle places them.

Test: random-shape-structure-compositions.
Focused only; the full common suite runs at the end of this series.

Harness only; the benchmark is not run.

Also in this commit:

- Count differing flip flags unless they decompose the same corners. The shape
  structure gates ignored differing flip flags whenever the ordered corners
  matched, so a shape whose flags disagree with its own transform passed as well
  (both-flags-and-a-half-turn-equal-neither). Flags count now unless the corners
  match and the shape's flags and rotation decompose its transform, so they
  store the same transform otherwise.
- Resize the groups around a shape the harness transforms. The frontend's
  transform resizes the groups around the shapes it changes (reg-objects,
  pcb/resize-parents); the harness transform did not, so a main's group kept the
  bounds of a child it moved while sync gave its copies' groups bounds from
  their children, and the oracle found them apart. The harness transform resizes
  the parents too.
- Reflow layouts only after the structure edits whose events do. The structure
  node reflowed the layouts of the parents after every edit, but the workspace
  events update layouts only after grouping, masking and ungrouping; unmasking,
  creating a bool and converting to a path do not. The extra reflow left an undo
  that did not give back the place of the children of a mask unmasked in a flex
  main. The node reflows as the events do.
- Compare the corners of a bool in any order. A bool computes its points from
  its segments, so their order follows the path, not the transform: a flipped
  main gave its copies' bools the same corners in another order, which the
  geometry check and the design snapshot read as another place. Both compare a
  bool's corners in a sorted order.
- Check only the first corner of a place whose size a layout gives. The model
  checks an authored place by the corners of the shape placed in its parent, but
  leaves out the dimensions a layout gives it. A moved copy whose main came to
  hug its grid took the hugged width from its layout and kept its first corner,
  yet the corner check compared all four corners with the authored width. With a
  size the layout gives, only the first corner is checked, which a layout resize
  keeps.
- Sort the corners of a bool by their rounded position. Sorting a bool's corners
  by their raw coordinates swapped two corners whose x differed only by noise,
  so two equal bools compared apart. The corners sort by position rounded to the
  hundredth of a pixel.
- The harness changes that check the next commit, "Keep the layout's place and
  sizes out of a detach's kept geometry".

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
61b52860e5 🐛 Give a bool created in a grid the cell of the shape it replaces
Creating a bool from shapes in a grid board left the bool without a grid
cell: the JVM layout read the cell of a missing row and threw, and the
frontend laid the bool out in no cell. A group takes the cell of its
last shape and reassigns its grid's cells; the bool now takes the cell
of the shape whose place it takes in the parent, and the grid parents of
its shapes reassign their cells.

Test: a-bool-in-a-grid-takes-the-cell-of-its-last-shape (found by the new
shape structure gate).
Focused: groups-test, 6 tests, 0 failures; the full common suite runs at
the end of this series.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the other production changes of this series in the tree; none of
them is on a measured path:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  22.167 |  22.682 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  43.218 |  44.696 |   0.63 |
|         library-update-into-copies |    83.083 |  47.824 |  50.506 |   0.58 |
|        main-edit-among-many-shapes |     4.837 |   2.216 |    2.34 |   0.46 |
|           main-edit-into-10-copies |      1.79 |   1.067 |   1.133 |    0.6 |
|          main-edit-into-100-copies |    15.415 |  10.604 |  10.813 |   0.69 |
|         main-edit-into-1000-copies |   153.086 | 106.085 | 108.631 |   0.69 |
|         variant-switch-into-copies |    32.052 |  22.556 |  23.137 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
a9357626ac ♻️ Move the group, mask and bool actions to common
The changes of grouping, ungrouping, masking, unmasking and creating
bools were built in the workspace events, which the JVM tests and the
component gates cannot run. They move to app.common.logic.groups and
app.common.logic.bool with the same behavior: the events keep their
selection and stream handling and call the common builders, and the
other callers of shapes-for-grouping and prepare-create-group use the
common namespace.

Tests: groups-test (grouping, ungrouping, copy heads left whole, mask and
unmask, bools without boards). Frontend suite: 2080 tests, 2 failures,
both the intermittent persistence-rollback-test timeout.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the other production changes of this series in the tree; none of
them is on a measured path:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  22.167 |  22.682 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  43.218 |  44.696 |   0.63 |
|         library-update-into-copies |    83.083 |  47.824 |  50.506 |   0.58 |
|        main-edit-among-many-shapes |     4.837 |   2.216 |    2.34 |   0.46 |
|           main-edit-into-10-copies |      1.79 |   1.067 |   1.133 |    0.6 |
|          main-edit-into-100-copies |    15.415 |  10.604 |  10.813 |   0.69 |
|         main-edit-into-1000-copies |   153.086 | 106.085 | 108.631 |   0.69 |
|         variant-switch-into-copies |    32.052 |  22.556 |  23.137 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
ecea59761f ✨ Generate edits of grid tracks in component histories
The random histories edited a grid's direction and its cells, but never
its rows and columns. The grid programs build worlds whose first
component is a grid, with copies in grids, and add a track edit: add,
remove, resize or reorder a row or column, or merge a cell into an area,
through the production grid functions the frontend's track editor calls.
A main edits all of them; a copy only resizes its tracks, so the edits
that move cells reach copies through sync from their main.

The model takes the tracks an edit asks for and the default tracks a grid
grows after them to hold children that lose their cells. When a copy's
inherited tracks shrink, the cells it authors move, shorten or join as
the contract keeps them (move into a free slot, else into one track,
else into the cell where they would start).

Test: random-grid-compositions; 200 programs pass.
Focused only; the full common suite runs at the end of this series.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
88ac0cbe3b 🐛 Lay out a grid auto track that has no value on the JVM
The track editor stores an auto track as {:type :auto :value nil}. The
grid layout summed the flex fractions with (max 1 value) over every track,
which throws on the JVM for a nil value; JavaScript's Math.max(1, null) is
1, so only the frontend laid such a grid out. Only a flex track counts its
value now, at least one fraction.

Test: grid-layout-data-takes-an-auto-track-without-a-value (found by the
new grid gate, which adds an auto row).
Focused: geom-grid-layout-test, 21 tests, 0 failures; the full common
suite runs at the end of this series.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the other production changes of this series in the tree; none of
them is on a measured path:
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  22.167 |  22.682 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  43.218 |  44.696 |   0.63 |
|         library-update-into-copies |    83.083 |  47.824 |  50.506 |   0.58 |
|        main-edit-among-many-shapes |     4.837 |   2.216 |    2.34 |   0.46 |
|           main-edit-into-10-copies |      1.79 |   1.067 |   1.133 |    0.6 |
|          main-edit-into-100-copies |    15.415 |  10.604 |  10.813 |   0.69 |
|         main-edit-into-1000-copies |   153.086 | 106.085 | 108.631 |   0.69 |
|         variant-switch-into-copies |    32.052 |  22.556 |  23.137 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
a871ea42a0 ✨ Generate component histories in deeper and wider worlds
The random histories ran in worlds of two or three components nested at
most two levels, each with two copies, where ordering and propagation
bugs that need deeper nesting or many copies of one main cannot show.
The scale programs build three or four components nested three or four
levels, with three to six copies of each, a larger shape budget, and
every variant operation. A world takes its number of copies per main
(two by default). Scale programs run several times longer than the
others, so the suite draws twelve; the gates draw more.

Test: random-scale-compositions.
Common suite: 2444 tests, 0 failures.

Harness only; the benchmark is not run.

Also in this commit:

- Model a head size as authored only when a sync resizes its copy. The model
  took any resized copy parent of an untouched swapped head as a sync resize and
  expected the head to author the size it was given. A user resize of a nested
  copy authors that copy's geometry and scales a swapped head under it through
  constraints, which production leaves untouched. The model now finds the
  topmost ancestor the step resized and authors the head's size only when that
  ancestor is a copy shape without authored geometry, the only shape a sync
  resizes.
- Keep the layout item overrides of a swapped head in the model. A swap restores
  the swap-keep-attrs of the old head on the new one with the touched groups
  they belong to, on every swap. The model kept the old head's layout item
  groups only on a variant switch, so after a plain swap of a head that authors
  a margin it expected the new head without that override. It now keeps them on
  every swap.
- Align the arguments of the combine test fixtures. The same-name combine
  fixtures in the variant workspace tests call their helper through the `ctho`
  alias, one character longer than develop's `tho`, so their continuation lines
  sat one column left of the first argument and the frontend format check
  failed.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
230dc0b4c2 🐛 Author the size a sync resize gives a swapped head
When sync resizes a copy parent, sync-descendant-orientation places its
subtree through constraints, which scales an untouched swapped head with
a scale constraint. Update-swapped-placement then only moves the head, so
a later sync of every component gave it back the size of its own main:
the result depended on the order of the syncs. Sync cannot tell a main
change from a reset of a copy sized apart from its main, which must scale
the head back (#12716), as it never sees the main's earlier size. The
resize now marks the geometry group of an untouched swapped head it gives
another size, so later syncs keep that size. The composable model records
the same: a swapped head without authored geometry whose copy parent and
own size both change in a step authors its new geometry in that parent.

Test: syncing-a-resized-copy-parent-authors-the-size-it-gives-a-swapped-
head (the variant gate program of round 16, seed 212451915).
Common suite: 2441 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.568 |   22.51 |   0.61 |
| edit-through-a-chain-of-dependents |    68.931 |  42.762 |  46.833 |   0.62 |
|         library-update-into-copies |    83.083 |  52.439 |  55.324 |   0.63 |
|        main-edit-among-many-shapes |     4.837 |   2.443 |   2.762 |   0.51 |
|           main-edit-into-10-copies |      1.79 |   1.124 |   1.217 |   0.63 |
|          main-edit-into-100-copies |    15.415 |  10.254 |  11.046 |   0.67 |
|         main-edit-into-1000-copies |   153.086 | 103.629 | 107.266 |   0.68 |
|         variant-switch-into-copies |    32.052 |  22.861 |  23.944 |   0.71 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
67484aff60 📎 Judge the turns of two mirrored mains by their axes in the model
A switch carries a copy's turn only where the old and the new main agree
on it. Two mirrors can store the same rotation while their placed axes
point 180 degrees apart, and the model let them agree by that number, so
it expected a carried geometry override the editor rightly drops. The
turns of two mirrored mains now agree only where their placed axes do.

Harness only; the benchmark is not run.

Also in this commit:

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

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
b9a62f23ea 🐛 Keep on the copy a layout child override no layout parent pushes
A copy can author a layout child attribute, such as a margin, on a shape
whose main has no layout parent. Update-main pushed it into the main,
where it does nothing, and sync, which sends layout child attributes only
through layout parents, left the main's other copies without it. A later
switch could turn one of them into a swapped head, which takes its
placement from the main, with the stale value. Update-main now pushes
neither the value nor the touched group of such a layout child group;
the copy keeps its override. The composable model keeps those groups on
the copy too, and the update-main check takes layout child groups as
pushed only under a layout parent in the main.

Tests: switching-to-a-head-under-a-plain-parent-keeps-the-margin-its-
main-never-took (the variant gate program of round 15, seed 371855618);
updating-a-main-keeps-on-the-copy-a-margin-a-switch-carried-out-of-a-
layout, renamed from the test of the push it replaces.
Common suite: 2439 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.015 |   21.76 |    0.6 |
| edit-through-a-chain-of-dependents |    68.931 |  39.553 |  41.298 |   0.57 |
|         library-update-into-copies |    83.083 |  51.286 |  55.732 |   0.62 |
|        main-edit-among-many-shapes |     4.837 |   2.221 |   2.392 |   0.46 |
|           main-edit-into-10-copies |      1.79 |   1.034 |   1.069 |   0.58 |
|          main-edit-into-100-copies |    15.415 |  10.101 |   10.67 |   0.66 |
|         main-edit-into-1000-copies |   153.086 | 100.646 | 103.375 |   0.66 |
|         variant-switch-into-copies |    32.052 |  22.132 |  22.822 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
35f4b5ef91 📎 Judge the turns of two mirrored children by their axes in the model
A mirror stores one turn as two rotations, such as 315 and 45, with the
same transform. On a switch, the old copy child stored 315 and its new
copy 45, so the editor rightly carried nothing, while the composable
model compared the rotations by number and expected the turn to carry.
The turns of two mirrored child shapes now differ in the model only
where their placed axes do.

Test: switching-a-copy-carries-no-mirrored-turn-stored-the-other-way-in-
the-model (the variant gate program of round 15, seed 164135730).
Common suite: 2438 tests, 0 failures (with the next commit).

Harness only; the benchmark is not run.

Also in this commit:

- Model only the turn a resized top root shows against its parent. A top copy
  root that authors its geometry inherits its parent's turn, and update-main
  pushes only the turn it shows against that parent. In a turned parent, a
  resized root then leaves the main root and a swapped head pushed with it
  unturned. The composable model took the whole turn of such a root as pushed
  and expected the new head turned with it. It now takes a root that authors its
  geometry as inheriting its parent's turn, as a nested root does; only a top
  root that authors none inherits all of its turn.
- The harness changes that check the next commit, "Keep on the copy a layout
  child override no layout parent pushes".

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:48 +01:00
alonso.torres
f7627ec5e0 🐛 Push the layout child attributes a copy authored outside a layout
A copy can set the margin of a nested copy in a flex, and a switch can
carry that override under a parent that is no layout. Update-main moved
the touched layout item group to the main, but not its value: only a
layout parent pushes the layout child attributes of its children. The
main took the override without the copy's margin. Update-main now pushes
the layout child attributes the copy authored when the main's parent is
no layout, except at the copy root.

Test: updating-a-main-pushes-a-margin-a-switch-carried-out-of-a-layout
(the variant gate program of round 14, seed 371855618).
Common suite: 2436 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  24.588 |  26.788 |    0.7 |
| edit-through-a-chain-of-dependents |    68.931 |   45.07 |  48.822 |   0.65 |
|         library-update-into-copies |    83.083 |  53.351 |  60.769 |   0.64 |
|        main-edit-among-many-shapes |     4.837 |   2.871 |    3.13 |   0.59 |
|           main-edit-into-10-copies |      1.79 |   1.153 |   1.216 |   0.64 |
|          main-edit-into-100-copies |    15.415 |  10.844 |  11.122 |    0.7 |
|         main-edit-into-1000-copies |   153.086 | 108.081 | 112.553 |   0.71 |
|         variant-switch-into-copies |    32.052 |  23.078 |  29.003 |   0.72 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
ed24eaa1b6 🐛 Move a child that sits on the start of its squeezed parent
A flex layout can squeeze a fill frame to almost no width and move it onto
its child at the frame's right edge. The left constraint keeps the vector
from the child to its parent's left side, but after the move the child
sits on that side, so the vector has no length and no direction. The
displacement scaled a zero unit vector and the child did not move. The
displacement now takes the direction from the parent's side, pointing as
the vector did before.

Tests: start-constraint-moves-a-child-onto-the-start-of-its-squeezed-
parent and nesting-a-copy-that-squeezes-a-fill-frame-moves-the-child-at-
its-end (the variant gate program of round 11, seed 212451915).
Common suite: 2435 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |  :mean | :ratio |
|------------------------------------+-----------+--------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.995 | 22.097 |    0.6 |
| edit-through-a-chain-of-dependents |    68.931 | 46.757 | 48.547 |   0.68 |
|         library-update-into-copies |    83.083 | 47.501 | 55.402 |   0.57 |
|        main-edit-among-many-shapes |     4.837 |  2.493 |  2.793 |   0.52 |
|           main-edit-into-10-copies |      1.79 |  1.051 |  1.177 |   0.59 |
|          main-edit-into-100-copies |    15.415 | 10.322 | 11.091 |   0.67 |
|         main-edit-into-1000-copies |   153.086 | 91.123 | 97.288 |    0.6 |
|         variant-switch-into-copies |    32.052 | 20.829 | 21.942 |   0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
160bb17f76 📎 Turn a main shape that update-main adds with its parent in the model
A turned copy can push its root's turn and a swapped nested head at once.
The push replaces the head in the main with a new shape. The composable
model wrote that head's turn in the frame its main parent had before the
push and left the root's turn to the parent orientation step, which only
turns shapes that existed before. The model then expected the head
without the root's turn, while the editor rightly gives it the copy's
turn in its parent. A main shape the push adds now takes its parent's
turn after the push.

Test: updating-a-turned-main-from-a-swapped-head-turns-the-new-head-with-
its-parent (the variant gate program of round 13, seed 371855618).
Common suite: 2432 tests, 0 failures.

Harness only; the benchmark is not run.

Also in this commit:

- Carry a mirrored turn that shares the new copy's rotation in the model. A copy
  can turn a mirrored child so that it stores the same rotation and flip as the
  new copy of a switch, but with the other mirror transform. The editor carries
  the copy's turn with its transform, since the old main and the new copy point
  their axes alike. The composable model compared only the rotations, found them
  equal and carried nothing. The same turn of two mirrored child shapes now
  differs in the model where their placed axes do.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
487514d897 🐛 Carry no turn a mirrored copy child only stores the other way
A mirror can store one turn as two rotations, such as 315 and 45, with
the same transform. On a switch, the old copy child stored 315 and its
new copy 45, so the values looked different and the switch took them for
an override. The agreement check for mirrors then let the turn carry,
marking the child's geometry touched for no change. The check for values
already equal now uses the same comparison as the agreement, so the two
turns of one mirror count as equal and nothing carries.

Test: switching-a-copy-carries-no-turn-a-mirrored-child-only-stores-the-
other-way (the variant gate program of round 13, seed 164135730).
Common suite: 2431 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |  :mean | :ratio |
|------------------------------------+-----------+---------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 |  22.408 | 22.761 |   0.64 |
| edit-through-a-chain-of-dependents |    68.931 |  40.015 | 41.455 |   0.58 |
|         library-update-into-copies |    83.083 |  47.581 | 50.082 |   0.57 |
|        main-edit-among-many-shapes |     4.837 |     2.3 |  2.431 |   0.48 |
|           main-edit-into-10-copies |      1.79 |   1.059 |  1.116 |   0.59 |
|          main-edit-into-100-copies |    15.415 |   9.513 |  9.981 |   0.62 |
|         main-edit-into-1000-copies |   153.086 | 107.092 | 108.68 |    0.7 |
|         variant-switch-into-copies |    32.052 |  20.943 | 21.854 |   0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
c17ea582b0 🐛 Take no size from a copy that its own layout sizes on update-main
A detach can leave a nested copy child with its geometry touched. When
the main then makes that child fill, the copy's own flex gives it its
width. Update-main pushed that width, and the sizing rule, seeing the
touched geometry, fixed the main child's sizing, though the copy never
sized the child itself. The copy and its main lost the fill.
pushed-size-sizing now takes no size from a copy whose own layout fills
or hugs it on that axis.

Test: updating-a-main-whose-copy-fills-a-child-of-touched-geometry-keeps-
its-fill (the variant gate program of round 13, seed 333977410).
Common suite: 2430 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.778 |  23.308 |   0.62 |
| edit-through-a-chain-of-dependents |    68.931 |  44.155 |  44.668 |   0.64 |
|         library-update-into-copies |    83.083 |   52.14 |   54.92 |   0.63 |
|        main-edit-among-many-shapes |     4.837 |   2.324 |   2.463 |   0.48 |
|           main-edit-into-10-copies |      1.79 |   0.979 |   1.028 |   0.55 |
|          main-edit-into-100-copies |    15.415 |   9.396 |   9.878 |   0.61 |
|         main-edit-into-1000-copies |   153.086 | 110.162 | 113.117 |   0.72 |
|         variant-switch-into-copies |    32.052 |  22.141 |  22.813 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
3105afa9ae 🐛 Sync the copies of a main whose children a reorder moves
A copy turned its grid from rows to columns and update main pushed the
direction; the layout reflow then reordered the main's children for the
new flow with a reorder-children change. components-changed did not count
that change, so the copies were never synced and kept the old order. A
reorder that changes a parent's order now marks the components whose main
holds that parent; one that keeps the order still marks none, since the
reflow writes those on every pass.

Tests: reordering-the-children-of-a-main-changes-its-component and
pushing-a-grid-direction-orders-the-copies-like-the-reflowed-main (the
variant gate program of round 12, seed 252148030). Common suite: 2429
tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 19.581 |  20.465 |   0.56 |
| edit-through-a-chain-of-dependents |    68.931 |  44.23 |  45.224 |   0.64 |
|         library-update-into-copies |    83.083 | 55.313 |  56.272 |   0.67 |
|        main-edit-among-many-shapes |     4.837 |  2.379 |   2.555 |   0.49 |
|           main-edit-into-10-copies |      1.79 |  0.984 |   1.026 |   0.55 |
|          main-edit-into-100-copies |    15.415 |  9.856 |    10.1 |   0.64 |
|         main-edit-into-1000-copies |   153.086 | 97.071 | 101.457 |   0.63 |
|         variant-switch-into-copies |    32.052 | 22.287 |  22.916 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
83156ea5f7 🐛 Carry a mirrored child's turn with its transform on a switch
A mirror stores its turn either way, so two variants can hold a flipped
child with one transform and the rotations 315 and 45. A switch compared
the attributes one by one: it carried the copy's transform and corners,
whose values both variants share, but not its rotation, leaving a shape
whose rotation its transform does not hold. The turns of two mirrors now
also agree where they point their axes alike, so the turn carries with
the transform.

Test (the variant gate program of round 12, seed 164135730):
switching-a-copy-carries-the-turn-of-a-mirrored-child-with-its-transform
Composable generated, swap group and variant tests: 533 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.684 |  22.254 |   0.62 |
| edit-through-a-chain-of-dependents |    68.931 |  40.146 |  43.327 |   0.58 |
|         library-update-into-copies |    83.083 |  50.403 |  52.479 |   0.61 |
|        main-edit-among-many-shapes |     4.837 |   2.045 |    2.23 |   0.42 |
|           main-edit-into-10-copies |      1.79 |   1.098 |   1.131 |   0.61 |
|          main-edit-into-100-copies |    15.415 |  10.462 |  10.578 |   0.68 |
|         main-edit-into-1000-copies |   153.086 | 103.929 | 107.681 |   0.68 |
|         variant-switch-into-copies |    32.052 |  21.622 |  22.386 |   0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
5ed9771864 📎 Judge a switched child's turn by its axes in the composable model
A mirror stores its turn either way, so two variants can hold a flipped
child with one transform and the rotations 315 and 45. The switch model
compared the rotation numbers, saw the variants disagree, and expected the
switch to drop the copy's turn. The turns of a child whose old and new
mains are both mirrors, as the copy places them, now also agree where they
point their axes alike.

Test (the variant gate program of round 12, seed 164135730):
switching-a-copy-carries-the-turn-of-a-mirrored-child-stored-as-the-other-turn

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
5b223cb8f5 🐛 Restore the inherited sizing of a reset child of a swapped head
A nested head whose parent is a swapped layout head kept its authored
layout sizing after a reset: the reset pairs the parent with the ref's
parent through the parent's shape-ref, and a swapped head refers to its
position, not to the main of its own component. A later sync of that head
then gave the child its main's sizing. The reset now also pairs a parent
that is a copy of the component whose main root holds the ref.

Test: resetting-a-nested-copy-of-a-swapped-layout-head-restores-its-sizing
(the variant gate program of round 12, seed 371855618). Composable
generated, reset and swap group tests: 433 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |   20.1 |  20.737 |   0.57 |
| edit-through-a-chain-of-dependents |    68.931 | 40.911 |  41.855 |   0.59 |
|         library-update-into-copies |    83.083 | 47.542 |  52.797 |   0.57 |
|        main-edit-among-many-shapes |     4.837 |  2.495 |   2.627 |   0.52 |
|           main-edit-into-10-copies |      1.79 |   0.99 |   1.045 |   0.55 |
|          main-edit-into-100-copies |    15.415 |  9.458 |   9.877 |   0.61 |
|         main-edit-into-1000-copies |   153.086 | 97.254 | 101.408 |   0.64 |
|         variant-switch-into-copies |    32.052 | 20.235 |  21.101 |   0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
5f20d4c8cd 🐛 Fix the layout sizing of a main that update-main resizes or turns
When a copy resizes or turns a main that fills or hugs in a layout, the
update main pushed the size, the layout gave the main its own size back,
and the copy followed and lost its size. When the copy shape authors its
geometry, the push now fixes each fill or auto axis it changes, on both
axes when it turns the shape in its parent, as a resize of a fill child
does in the editor. The main and the copy take the same sizing; a shape
that is not a layout drops it, which leaves it fixed like its copies. A
sizing the copy authors is pushed as it is. A shape the copy does not
resize, such as a fill child that a copy's grid padding resizes, keeps
its sizing: the main's layout gives it the same size.

Tests: updating-a-fill-main-from-a-resized-copy-fixes-the-main-size,
updating-a-turned-fill-main-from-its-copy-fixes-the-main-size (the
variant gate programs of round 11, seeds 252148030 and 333977410),
updating-a-main-with-a-turned-copy-keeps-the-fill-of-its-laid-out-children
and updating-a-main-whose-copy-padding-resized-a-fill-child-keeps-its-fill
(round 12, seed 333977410).

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.989 |  21.843 |    0.6 |
| edit-through-a-chain-of-dependents |    68.931 | 42.083 |   43.11 |   0.61 |
|         library-update-into-copies |    83.083 | 54.201 |  55.537 |   0.65 |
|        main-edit-among-many-shapes |     4.837 |   2.43 |   2.533 |    0.5 |
|           main-edit-into-10-copies |      1.79 |  1.047 |   1.117 |   0.58 |
|          main-edit-into-100-copies |    15.415 | 11.084 |  11.219 |   0.72 |
|         main-edit-into-1000-copies |   153.086 |  101.1 | 110.921 |   0.66 |
|         variant-switch-into-copies |    32.052 | 22.903 |  23.542 |   0.71 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
e8ab93d6fb 🐛 Mark a pushed swap's geometry only when its axes differ from its main
When update-main pushes a swap into the main as a plain nested copy, the
copy authors its geometry when its orientation differs from its main's in
the parent's orientation. A mirrored shape can store rotation 90 or 270 for
the same axes, so comparing the stored rotations found a turn where the
transforms matched, and marked a geometry override for no visible
difference. The override now follows the axes, mirror included.

Test: updating-a-main-from-a-mirrored-copy-pushes-its-swap-without-a-
geometry-override, the variant gate program of round 11 (seed 164135730).
Common suite: 2420 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |  :mean | :ratio |
|------------------------------------+-----------+--------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 |  19.46 | 20.414 |   0.55 |
| edit-through-a-chain-of-dependents |    68.931 |  38.28 | 40.467 |   0.56 |
|         library-update-into-copies |    83.083 | 52.248 | 53.668 |   0.63 |
|        main-edit-among-many-shapes |     4.837 |  2.193 |  2.315 |   0.45 |
|           main-edit-into-10-copies |      1.79 |   1.06 |  1.077 |   0.59 |
|          main-edit-into-100-copies |    15.415 |  9.551 |  10.18 |   0.62 |
|         main-edit-into-1000-copies |   153.086 |  96.62 | 99.326 |   0.63 |
|         variant-switch-into-copies |    32.052 | 22.138 |  22.88 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
6970d5c935 🐛 Give a pushed swap that copies its position the position's size
When update-main pushes a swap into a nested copy in the main, and the
position there holds the same component, the pushed head becomes a plain
copy of that position, and its children already follow the position. The
head itself kept the size of the pushed copy with no geometry override, so
a later sync would resize it. It now takes the position's size about its
first corner, unless the child it replaces authored its geometry, as a
switch back to the position already does.

Test: updating-a-main-with-a-swap-to-its-position-component-gives-the-head-
the-positions-size, the variant gate program of round 11 (seed 371855618).
Common suite: 2419 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |  :mean | :ratio |
|------------------------------------+-----------+---------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.869 | 23.349 |   0.62 |
| edit-through-a-chain-of-dependents |    68.931 |  43.052 | 43.454 |   0.62 |
|         library-update-into-copies |    83.083 |  50.967 | 52.007 |   0.61 |
|        main-edit-among-many-shapes |     4.837 |   2.149 |  2.267 |   0.44 |
|           main-edit-into-10-copies |      1.79 |   1.067 |  1.097 |    0.6 |
|          main-edit-into-100-copies |    15.415 |  10.265 | 10.455 |   0.67 |
|         main-edit-into-1000-copies |   153.086 | 102.631 | 107.51 |   0.67 |
|         variant-switch-into-copies |    32.052 |  22.374 | 23.098 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
1c83d8123f 🐛 Sync only the restored copy when a switch swaps it back
When a swap or variant switch puts back the component of a nested copy's
position, the copy syncs from that position through the head that owns its
ref. That synced the whole head, so a library update the file had not
accepted yet reached the head and its other shapes. The sync now walks
from the head down to the restored copy without syncing the shapes above
it, and syncs that copy and its children only.

Test: swapping-back-leaves-the-pending-changes-of-the-enclosing-copy. The
stale-library gate program of round 11 (seed 333977410) now passes.
Common suite: 2418 tests, 0 failures.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |  :mean | :ratio |
|------------------------------------+-----------+--------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 | 19.325 | 20.569 |   0.55 |
| edit-through-a-chain-of-dependents |    68.931 | 38.847 | 42.534 |   0.56 |
|         library-update-into-copies |    83.083 | 49.953 | 52.408 |    0.6 |
|        main-edit-among-many-shapes |     4.837 |  2.199 |  2.399 |   0.45 |
|           main-edit-into-10-copies |      1.79 |  0.991 |  1.026 |   0.55 |
|          main-edit-into-100-copies |    15.415 |  9.382 |  9.919 |   0.61 |
|         main-edit-into-1000-copies |   153.086 | 95.894 | 97.773 |   0.63 |
|         variant-switch-into-copies |    32.052 | 20.747 | 21.216 |   0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
488ee13f08 📎 Use this branch's compositions alias in develop's combine tests
The same-name combine tests that develop added build their file with the
`tho` alias, which this branch's variant workspace tests name `ctho`, so
the frontend test run stopped with a ReferenceError there.

Harness only; the benchmark is not run.

Also in this commit:

- Re-record the combine golden master for unique variant values. Combining two
  components whose names leave no value gives the second variant "Value 2" where
  it had an empty value, since develop's fix for same-name combines (#12881).
  Case au records that combine, so its two variants are recorded again on
  purpose; no other case changes.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
312a3ce6f0 🐛 Move combined mains into the variant one at a time in combine order
Combining same-name components as variants gives each one the first
unused "Value N", in the order the mains enter the variant container.
`generate-combine-as-variants` moved all the remaining mains in one
relocation, which takes them in layer order, so the values followed the
layers and not the combine order. It now moves them one at a time, in
the order of the ids, as the frontend combine on develop does.

Test: `test-combine-as-variants-same-name-values-follow-combine-order`.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |   :now |  :mean | :ratio |
|------------------------------------+-----------+--------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.749 | 21.213 |   0.59 |
| edit-through-a-chain-of-dependents |    68.931 | 40.771 | 41.457 |   0.59 |
|         library-update-into-copies |    83.083 | 50.674 | 51.835 |   0.61 |
|        main-edit-among-many-shapes |     4.837 |  1.967 |  2.133 |   0.41 |
|           main-edit-into-10-copies |      1.79 |  1.039 |  1.059 |   0.58 |
|          main-edit-into-100-copies |    15.415 |  9.153 |  9.626 |   0.59 |
|         main-edit-into-1000-copies |   153.086 | 93.347 | 99.626 |   0.61 |
|         variant-switch-into-copies |    32.052 |  21.86 |  22.36 |   0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
c544a9445d 📎 Reflow the layouts a swap or switch changes in the harness
The frontend's component swap, which a variant switch uses too, sends a
layout update for the parents the swap returns and for the new subtree.
The harness swap and switch nodes reflowed nothing, so a switch in a page
copy of a flex main left a sibling of the switched head in its old place,
and the next move of that sibling took the layout's correction as its own
geometry override.

The swap and switch nodes now reflow the layouts among those parents and the
new subtree. They do not mark the changes for the runner's pass over every
layout after sync, which the frontend does not do for a swap.

Generated regression: a four-step nest, switch, duplicate and move program
that failed I2 (seed 159775967, round 9) now passes.

Golden masters af and ak recorded again on purpose: they start with a swap
in a grid copy, whose two children now take their cells instead of the
stale place they had; the main a later update-main pushes them into
follows. Only geometry changes.

Harness only; the benchmark is not run.

Also in this commit:

- Draw 50 programs in each random composition coverage test. The seven random
  composition tests check that every operation kind supplies its share of
  meaningful changes. With 20 programs some seeds draw too few steps whose
  precondition holds (a redo with an undone library change, a grid direction on
  a grid, a resize that changes anything), so the suite failed now and then
  although every program passed. The four seeds that failed pass with 50
  programs.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
2311841cf5 🐛 Place a pushed swap's children like the position it now copies
When update-main pushes a swap into a nested copy in the main, and the
position there holds the same component, the pushed head becomes a plain
copy of that position. Its content differences become overrides while its
placement follows the position, but its descendants kept the places of the
pushed copy with no geometry override, so a later sync would move them.
They now take the places the position gives them, except the subtrees that
author their own geometry.

Generated regression: an eleven-step add-variant, switch and update-main
program that failed I4 (seed 256567394, round 8) now passes, as does the
original program.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  23.622 |  27.685 |   0.67 |
| edit-through-a-chain-of-dependents |    68.931 |  48.952 |  50.286 |   0.71 |
|         library-update-into-copies |    83.083 |  54.647 |  59.195 |   0.66 |
|        main-edit-among-many-shapes |     4.837 |    3.23 |   3.376 |   0.67 |
|           main-edit-into-10-copies |      1.79 |   1.152 |   1.196 |   0.64 |
|          main-edit-into-100-copies |    15.415 |  11.605 |  11.945 |   0.75 |
|         main-edit-into-1000-copies |   153.086 | 110.919 | 114.366 |   0.72 |
|         variant-switch-into-copies |    32.052 |  24.905 |   26.59 |   0.78 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
8161f15015 📎 Reorient a pushed geometry by the turn its rotation stores
The model of an update main turns the pushed geometry of a copy shape
out of the orientation its copy root or parent inherits. A mirrored
shape can store the opposite of its transform's turn as its rotation,
and the model turned that stored value as if it were the turn: a Board
storing 315 with a vertical flip, inside a copy root turned 45, was
expected at 270 in the main, where its transform is unturned.

The pushed geometry is now reoriented with the turn sign of the copy
shape, as the model already does for a parent's orientation.

Harness only; the benchmark is not run.

Also in this commit:

- Leave shapes below an authored swap out of a switch's old copy map. The switch
  model matches each old copy shape with its path in the old main by its ref
  chain. A swapped Board whose component holds a copy of the switched copy's own
  component reaches the old main's root through that nested copy, so the nested
  copy took the root's path and its turn override replaced the root's. The
  shapes below an authored swap belong to the swapped component and are left out
  of the map.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
58ee5519d3 🐛 Carry no switched text content that shows what the new copy shows
A copy text can hold a typography file without a typography id, which
the reference rule counts as a typography override. A switch carried it,
and merging the overrides then dropped the reference, since no unit the
typography sets was carried. The merged content showed the letters and
styles of the new copy and differed from it only by nil typography keys,
yet the switch wrote it and marked the content group touched with no
text group behind it.

A text content the switch would carry is now compared with the new
copy's by its letters and styles, and one that differs in none is not
carried.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |  :mean | :ratio |
|------------------------------------+-----------+--------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 | 19.246 | 20.089 |   0.55 |
| edit-through-a-chain-of-dependents |    68.931 | 38.107 | 39.639 |   0.55 |
|         library-update-into-copies |    83.083 | 46.922 | 48.603 |   0.56 |
|        main-edit-among-many-shapes |     4.837 |  1.958 |  2.141 |    0.4 |
|           main-edit-into-10-copies |      1.79 |   0.99 |  1.079 |   0.55 |
|          main-edit-into-100-copies |    15.415 |  9.335 |  9.733 |   0.61 |
|         main-edit-into-1000-copies |   153.086 | 92.647 |  96.02 |   0.61 |
|         variant-switch-into-copies |    32.052 | 20.358 | 20.802 |   0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
8e53d5f782 🐛 Rebuild a switched child's transform from the turn and flips it carries
A variant switch carries a copy child's rotation, with the old copy's
transform, and each of its flips as separate attributes, each only where
both variants agree on it. When the variants agreed on a flip but not on
the turn, the flip flag carried while the transform and the corners stayed
the new copy's; when they agreed on the turn but not on a flip, the old
transform replaced the new variant's flip. Either way the stored rotation
and flips no longer described the transform.

When the switch carries a turn or a flip, it now gives the child the
transform and the corners that the resulting turn and flips compose, the
turn before or after the flips as is nearer the old copy's axes.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  22.732 |  23.882 |   0.65 |
| edit-through-a-chain-of-dependents |    68.931 |    46.7 |  49.116 |   0.68 |
|         library-update-into-copies |    83.083 |  53.926 |  57.074 |   0.65 |
|        main-edit-among-many-shapes |     4.837 |   3.051 |   3.358 |   0.63 |
|           main-edit-into-10-copies |      1.79 |   1.147 |   1.188 |   0.64 |
|          main-edit-into-100-copies |    15.415 |  11.482 |  12.261 |   0.74 |
|         main-edit-into-1000-copies |   153.086 | 114.523 | 124.586 |   0.75 |
|         variant-switch-into-copies |    32.052 |  24.252 |  25.701 |   0.76 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
24e389b763 🐛 Give a synced grid parent cells for the children a sync left
A sync places a resized copy's subtree under the synced parent with its
old placement. When the sync has just given that parent the grid of a
new main, as after a swap, its children are still the old ones and the
grid has no cells for them, so the layout of the placement failed on an
in-flow child without a cell.

The parent used for that placement now assigns cells to the children
the sync left.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  20.154 |  21.936 |   0.57 |
| edit-through-a-chain-of-dependents |    68.931 |  39.517 |  41.605 |   0.57 |
|         library-update-into-copies |    83.083 |  49.772 |  51.257 |    0.6 |
|        main-edit-among-many-shapes |     4.837 |   2.167 |   2.466 |   0.45 |
|           main-edit-into-10-copies |      1.79 |   1.008 |   1.062 |   0.56 |
|          main-edit-into-100-copies |    15.415 |  10.197 |  11.064 |   0.66 |
|         main-edit-into-1000-copies |   153.086 | 102.045 | 108.458 |   0.67 |
|         variant-switch-into-copies |    32.052 |  21.435 |  22.715 |   0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
7176c13cb8 🐛 Compare a switched child with its old main in the old copy's frame
A switch carries a child's override only where the old and the new
variant agree on the attribute. It compared them after turning the old
main's shapes by the turn from the new main to the new copy. When the
variants' mains are turned or flipped differently, the old main's child
took that foreign turn: it could agree with the new copy child where the
variants differ, carrying a flip or turn without its transform and
marking an override, and could disagree where they share a value.

The old main's shapes now turn by the turn from the old main to the old
copy, the frame the new copy keeps.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |  :mean | :ratio |
|------------------------------------+-----------+--------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 | 19.875 | 21.479 |   0.56 |
| edit-through-a-chain-of-dependents |    68.931 | 38.173 | 40.003 |   0.55 |
|         library-update-into-copies |    83.083 | 48.724 | 51.431 |   0.59 |
|        main-edit-among-many-shapes |     4.837 |  2.134 |  2.372 |   0.44 |
|           main-edit-into-10-copies |      1.79 |  0.936 |  0.978 |   0.52 |
|          main-edit-into-100-copies |    15.415 |  8.966 |  9.425 |   0.58 |
|         main-edit-into-1000-copies |   153.086 | 91.951 | 97.661 |    0.6 |
|         variant-switch-into-copies |    32.052 | 21.553 | 22.054 |   0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
16689df2e9 📎 Push a copy child's geometry in its new main's frame in the model
Pushing a swap into a main adds main shapes for the swap's children.
The model kept a child's authored geometry in the frame of its copy, so
a flip the child shows only through a flipped copy stayed in the
expected main shape, which production places unflipped. The model now
turns and flips that geometry from the copy parent's frame to the new
main parent's, as it does for main shapes the push keeps.

Harness only; the benchmark is not run.

Also in this commit:

- Drop the main's typography a pushed text style mixes in the model. A copy text
  that overrides some styles of a typography, but not the typography, has no
  typography. Pushing it into a main text that applies a typography drops that
  typography in production, as the main then takes those styles from both sides.
  The model kept the main's typography; it now records the pushed content for
  the typography group in that case.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
a5ebdb9e8c 🐛 Give a cell to a copy child that a sync brings back into the flow
A grid copy took one of its children out of the flow (absolute
position) and changed its own width. Resetting it gave the child back
its main's position, which puts it in the flow, while the copy's cells
had no room for it, and placing the resized copy's subtree failed in
the grid layout. The layout child attributes a sync copies onto the
children did not assign the grid's cells again, and that placement read
the grid as it was before the sync, with its old cells.

The grid now assigns its cells again when a synced child enters or
leaves its flow, and the placement takes the synced parent with only
its old placement.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 18.907 |  19.891 |   0.54 |
| edit-through-a-chain-of-dependents |    68.931 | 42.713 |  43.599 |   0.62 |
|         library-update-into-copies |    83.083 | 51.226 |   52.74 |   0.62 |
|        main-edit-among-many-shapes |     4.837 |  2.266 |   2.385 |   0.47 |
|           main-edit-into-10-copies |      1.79 |  0.954 |   0.986 |   0.53 |
|          main-edit-into-100-copies |    15.415 |  9.427 |   9.984 |   0.61 |
|         main-edit-into-1000-copies |   153.086 | 94.804 | 102.222 |   0.62 |
|         variant-switch-into-copies |    32.052 | 22.513 |  22.828 |    0.7 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
b27745246c 🐛 Give a switched head a grid cell when it joins the grid's flow
A copy of a hidden variant sits in a grid without a cell, as a hidden
child takes no part in the grid's flow. Switching it to a shown variant
put the parent's cells back as they were, so the shown head had no cell
and the next reflow of the grid failed.

The switch now assigns the parent grid's cells again when the new head
enters or leaves the flow, as a sync of the head does.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  19.977 |  21.701 |   0.57 |
| edit-through-a-chain-of-dependents |    68.931 |   39.77 |  41.277 |   0.58 |
|         library-update-into-copies |    83.083 |   52.24 |  53.439 |   0.63 |
|        main-edit-among-many-shapes |     4.837 |   2.095 |   2.487 |   0.43 |
|           main-edit-into-10-copies |      1.79 |   0.962 |   1.002 |   0.54 |
|          main-edit-into-100-copies |    15.415 |   9.465 |  10.586 |   0.61 |
|         main-edit-into-1000-copies |   153.086 | 104.614 | 107.085 |   0.68 |
|         variant-switch-into-copies |    32.052 |  22.023 |  22.427 |   0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
88b8a3c697 🐛 Restore the main children an update main deleted in their order
A copy swapped two adjacent children of its main, and update-main
deleted both main children and added their replacements. Undoing it
put the main's children back out of order. Each restore was recorded at
the shape's position in the original state, as the update-main builder
does not apply its changes locally; the undo restores in reverse order,
so the second deleted sibling came back at a position counted with the
first still in place.

Without the builder's local objects, a restore now takes the position
the shape had when the batch deleted it, as the earlier changes leave
its parent.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  22.018 |   22.34 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  42.507 |    43.3 |   0.62 |
|         library-update-into-copies |    83.083 |  47.544 |  49.173 |   0.57 |
|        main-edit-among-many-shapes |     4.837 |   2.058 |   2.319 |   0.43 |
|           main-edit-into-10-copies |      1.79 |   0.977 |   1.075 |   0.55 |
|          main-edit-into-100-copies |    15.415 |   9.676 |  10.209 |   0.63 |
|         main-edit-into-1000-copies |   153.086 | 104.546 | 108.771 |   0.68 |
|         variant-switch-into-copies |    32.052 |  19.974 |  22.679 |   0.62 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
c56c4cd4e7 📎 Push a swap's authored geometry in its main's frame in the model
A copy root turned with its parent held a swapped child that authored
its geometry, and update-main pushed the swap into the main. The child
showed no turn against its root, so the main's new shape took none.
The update-main model moved a pushed swap's geometry into the main's
frame only when its turn differed from the one the main would give it;
when the turns agreed it kept the copy's authored geometry, turned with
the copy root, and expected that turn in the main.

A pushed swap that authors its geometry now pushes it in the frame of
its main.

Harness only; the benchmark is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
ceb142f7a7 🐛 Order a switched grid copy's children by the cells it keeps
A nested grid copy with its own cells, switched to a variant with an
identical grid, carries those cells onto the new copy. Its children
kept the new main's order, so they no longer followed the flow of the
carried cells, as the children of a grid copy with its own cells do.

After carrying the cells, the switch reorders the new copy's children
by them, as the sync does for a copy with its own cells.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.163 |  20.973 |   0.57 |
| edit-through-a-chain-of-dependents |    68.931 | 39.635 |  41.769 |   0.57 |
|         library-update-into-copies |    83.083 | 49.886 |  50.993 |    0.6 |
|        main-edit-among-many-shapes |     4.837 |   2.05 |   2.334 |   0.42 |
|           main-edit-into-10-copies |      1.79 |   0.95 |   1.003 |   0.53 |
|          main-edit-into-100-copies |    15.415 |  9.468 |  10.043 |   0.61 |
|         main-edit-into-1000-copies |   153.086 | 98.029 | 103.338 |   0.64 |
|         variant-switch-into-copies |    32.052 | 21.263 |  22.422 |   0.66 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
777b489381 🐛 Sync a swapped head that its layout skews like the shape it replaces
A layout skews a turned child that fills along its parent's axes. A
swapped copy head keeps the lengths of its own component and turned them
to the skewed axes of the main shape it replaces, so the layout squashed
it into another shape than that main; each later sync started from the
squashed head and moved it again. A 100px square turned 45 degrees in a
100px high row gave a 141x100 rhombus for the main and an ordinary copy,
and 163x100, then 156x100, for the swapped copy.

A swapped head that its layout skews now takes the turn its rotation and
flips give, without the skew: its content main is oriented with that
turn, and its placement resets it from its own component and turns it
like the replaced shape's unskewed turn. The layout then skews it as it
skews the main.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  21.39 |   22.34 |   0.61 |
| edit-through-a-chain-of-dependents |    68.931 | 42.155 |  43.846 |   0.61 |
|         library-update-into-copies |    83.083 | 47.467 |   51.34 |   0.57 |
|        main-edit-among-many-shapes |     4.837 |  2.026 |   2.265 |   0.42 |
|           main-edit-into-10-copies |      1.79 |  1.025 |   1.065 |   0.57 |
|          main-edit-into-100-copies |    15.415 |  9.538 |  10.051 |   0.62 |
|         main-edit-into-1000-copies |   153.086 | 96.813 | 102.667 |   0.63 |
|         variant-switch-into-copies |    32.052 | 21.011 |  22.247 |   0.66 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
72304d023b 🐛 Give a switched swap the grid cell of the child it replaces
A switch keeps a copy's swapped child: it moves the swap into the new
copy in place of the new child at its path and deletes that child. In a
grid copy whose cells were its main's, nothing carries the cells, so the
deleted child's cell stayed empty and the swap had no cell; the next
layout of the grid failed on the uncelled child.

`keep-swapped-item` gives the swap the cell of the child it replaces.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 22.929 |  23.421 |   0.65 |
| edit-through-a-chain-of-dependents |    68.931 | 41.595 |  45.427 |    0.6 |
|         library-update-into-copies |    83.083 | 47.657 |  49.963 |   0.57 |
|        main-edit-among-many-shapes |     4.837 |  2.118 |    2.33 |   0.44 |
|           main-edit-into-10-copies |      1.79 |  1.126 |   1.158 |   0.63 |
|          main-edit-into-100-copies |    15.415 | 10.291 |  11.027 |   0.67 |
|         main-edit-into-1000-copies |   153.086 | 101.89 | 104.528 |   0.67 |
|         variant-switch-into-copies |    32.052 | 21.203 |  22.033 |   0.66 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
alonso.torres
4674812f62 🐛 Compare a switched child with its ref in its parent's frame
A copy that turns a nested copy turns the children of that nested copy
with it. When a resize deeper in a child's chain marks it with the
geometry group, the variant switch compares the old child with its ref
to tell whether the copy authored its geometry. It turned the ref only
into the frame of the copy root, so the turn the child inherits from its
nested parent looked authored: the switch placed the child at its main's
unturned offset and marked it touched.

`generate-keep-touched` also turns the ref into the frame of the old
child's parent, so only a turn the child authors itself carries.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |  :mean | :ratio |
|------------------------------------+-----------+--------+--------+--------|
|  deepest-edit-through-three-levels |    35.215 | 20.988 | 21.212 |    0.6 |
| edit-through-a-chain-of-dependents |    68.931 | 41.108 | 42.793 |    0.6 |
|         library-update-into-copies |    83.083 |  45.86 | 47.865 |   0.55 |
|        main-edit-among-many-shapes |     4.837 |  2.114 |  2.268 |   0.44 |
|           main-edit-into-10-copies |      1.79 |  1.004 |  1.024 |   0.56 |
|          main-edit-into-100-copies |    15.415 |  9.828 |  9.983 |   0.64 |
|         main-edit-into-1000-copies |   153.086 | 98.452 | 99.954 |   0.64 |
|         variant-switch-into-copies |    32.052 | 20.156 | 21.317 |   0.63 |

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