A nested copy pasted out of its copy advances its refs to the component
it copies and takes the touched groups of the references it skips, so it
keeps the values they gave it. The clipboard also took those of its new
reference: a pasted rect then overrode a fill its new reference itself
overrides, and stopped following that reference's later edits. A shape
with no touched group was also left an empty touched set, which an undo
then removed, so undo did not restore the state exactly (F589).
`advance-copied-objects` takes only the touched groups of the references
between the shape and its new one, and leaves no touched set when there
are none. The golden master's case AZ, which pastes such a copy, records
its states again: its pasted head no longer has an empty touched set.
Test (copying-and-duplicating-test, fails before the fix):
`a-pasted-nested-copy-takes-only-the-overrides-of-the-references-it-skips`.
Benchmark (bench-components, alone):
| :world | :baseline | :now | :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
| deepest-edit-through-three-levels | 35.215 | 22.2 | 22.701 | 0.63 |
| edit-through-a-chain-of-dependents | 68.931 | 43.557 | 45.725 | 0.63 |
| library-update-into-copies | 83.083 | 52.452 | 54.294 | 0.63 |
| main-edit-among-many-shapes | 4.837 | 2.766 | 2.895 | 0.57 |
| main-edit-into-10-copies | 1.79 | 1.142 | 1.178 | 0.64 |
| main-edit-into-100-copies | 15.415 | 11.615 | 12.834 | 0.75 |
| main-edit-into-1000-copies | 153.086 | 106.297 | 109.039 | 0.69 |
| variant-switch-into-copies | 32.052 | 23.09 | 23.778 | 0.72 |
AI-assisted-by: claude-opus-5-5