alonso.torres a7e39ae8cb 🐛 Find the main of a copy's child through every parent head
The remote shape of a copy's child was looked up in the component of its
outermost copy, then in the component of its nearest head. A copy nested
in a swapped copy refers to the main of the swapped copy's component,
which is neither: a switch of that nested copy found no remote shape for
it, paired a touched child with the new root and crashed comparing their
geometry.

The fallback tries the component of each parent head, from the nearest
one up.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.863 |  0.62 |
| edit-through-a-chain-of-dependents |   68.931 |  39.725 |  0.58 |
| library-update-into-copies         |   83.083 |  48.505 |  0.58 |
| main-edit-among-many-shapes        |    4.837 |   2.747 |  0.57 |
| main-edit-into-10-copies           |     1.79 |   1.019 |  0.57 |
| main-edit-into-100-copies          |   15.415 |   9.565 |  0.62 |
| main-edit-into-1000-copies         |  153.086 | 100.188 |  0.65 |
| variant-switch-into-copies         |   32.052 |  21.229 |  0.66 |

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