mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 01:22:01 +00:00
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