alonso.torres bce9ab99cd 🐛 Turn before the flips when neither order is nearer the old axes
A variant switch that carries a turn onto a flipped child gives it the
turn before or after its flips, whichever lies nearer the axes the child
had (`unskewed`). For an unflipped 45-degree turn given a horizontal flip
both lie equally far, and the tie went to the order the engines'
rounding favoured: with the WASM engine the switched child stored
`flipX·R45`, the same shape turned the other way, while its rotation and
flips say `R45·flipX`.

A tie within 1e-9 now takes the turn before the flips, as the function
already intends for axes that tell neither apart.

Found by the WASM replay of the pinned generated programs (program 87, a
switch onto a flipped variant), which passes with it.

Test (comp-expected-geometry-test, fails before the fix with the WASM
engine's axes): `an-unskewed-turn-that-tells-no-flip-apart-turns-before-it`.

Benchmark (bench-components, alone):

|                             :world | :baseline |    :now |   :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 |  22.123 |  22.948 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  41.395 |  43.459 |    0.6 |
|         library-update-into-copies |    83.083 |  51.144 |  55.732 |   0.62 |
|        main-edit-among-many-shapes |     4.837 |   2.373 |   2.539 |   0.49 |
|           main-edit-into-10-copies |      1.79 |   1.047 |   1.091 |   0.58 |
|          main-edit-into-100-copies |    15.415 |  10.442 |   10.86 |   0.68 |
|         main-edit-into-1000-copies |   153.086 | 105.735 | 109.461 |   0.69 |
|         variant-switch-into-copies |    32.052 |  21.661 |  23.984 |   0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:50 +01:00
..
2026-11-10 20:21:16 +01:00
2026-09-29 09:07:34 +02:00
2026-03-11 15:24:40 +01:00