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