A swap gives the new head the orientation of the head it replaces and,
when that turns it, puts it at the old head's first corner. A head that
already had that orientation, like a flipped copy of a flipped variant,
kept the untransformed top-left of the old one instead, so a wider
flipped variant grew to the other side; sync and the expected placement
keep a turned or flipped head's first corner.
A turned or flipped head takes the place of the old one at its first
corner also when its orientation does not change.
Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
| world | baseline | now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels | 35.215 | 19.42 | 0.55 |
| edit-through-a-chain-of-dependents | 68.931 | 40.335 | 0.59 |
| library-update-into-copies | 83.083 | 50.62 | 0.61 |
| main-edit-among-many-shapes | 4.837 | 2.306 | 0.48 |
| main-edit-into-10-copies | 1.79 | 0.963 | 0.54 |
| main-edit-into-100-copies | 15.415 | 10.159 | 0.66 |
| main-edit-into-1000-copies | 153.086 | 93.147 | 0.61 |
| variant-switch-into-copies | 32.052 | 21.501 | 0.67 |
AI-assisted-by: claude-opus-5-5