🐛 Queue moved component copies before syncing their new dependents

A copy moved from a rotated parent can need its own component's sync even
when that main did not change. Include the moved heads among the sync
inputs so the new parent's copies receive the settled geometry. Fix F135.

The minimal regression failed before the fix. Geometry suite: 6 tests,
55 assertions, green; the shrunk seed 712 case also passes.
Benchmark ratios against Phase 1e: main 10/100/1000 0.46/0.52/0.53;
three levels 0.47; chain 0.51; library 0.51; many shapes 0.49;
variant switch 0.61. No regression flag.

AI-assisted-by: GPT-6
This commit is contained in:
alonso.torres 2026-10-23 14:53:20 +02:00
parent 3ff24dc190
commit 84affc15c0
2 changed files with 13 additions and 1 deletions

View File

@ -1200,7 +1200,8 @@
(into #{} xform all-parents)))]
(reduce #(set/union %1 (check-shape %2 []))
(check-shape parent-id [parent-id])
(into (check-shape parent-id [parent-id])
(keep #(get-in page [:objects % :component-id])) shapes)
shapes))
(when component-id #{component-id})))

View File

@ -189,3 +189,14 @@
(t/is (gsh/close-attrs? :points (:points text) (:points synced) 0.01))
(t/is (mth/close? (:x text) (:x synced) 0.01))
(t/is (mth/close? (:y text) (:y synced) 0.01)))))
(t/deftest nesting-a-copy-settles-its-derived-orientation-before-its-new-main
(let [initial (-> (setup/nested-component-with-copy)
(r/step (n/rotate :main2-root 45)) r/settle
(r/step (n/detach :copy-root)) r/settle
(as-> s (tm/apply-to (n/create-component "destination" setup/labeled-fill :size 100) s)))
moved (-> initial
(r/step (n/nest-copy :copy-instance (n/main-head-of "destination"))) r/settle)
file (tm/file moved)
full (:file (r/sync-cascade file {} (keys (get-in file [:data :components]))))]
(t/is (= (thn/normalize-file file) (thn/normalize-file full)))))