Commit 85f7497
Ralph Kuepper
fix(ui): align Win64 perry-ui ABI with dispatch table (v0.5.345)
Two doc-tests crashed on Windows CI (`ui/layout/snippets.ts` and
`ui/menus/snippets.ts`) with ACCESS_VIOLATION. Root cause: three
perry-ui runtime extern signatures didn't match the arg shapes
declared in `perry-dispatch::PERRY_UI_TABLE`. On Win64 ABI, integer
and float positional args share the same positional slot indices
(RDX/XMM1, R8/XMM2, ...) so a mismatched signature reads garbage
from uninitialized registers. SysV (macOS/Linux) uses separate
int/float register pools and happened to land valid bits in the
right physical registers, so the bugs were Windows-only.
- `perry_ui_navstack_create` now takes 0 args (was `(title_ptr,
body_handle)`); dispatch row is `args: &[]`. The previous signature
read RCX as `*const u8` and dereferenced it in `str_from_header`.
- `perry_ui_menu_add_item_with_shortcut` reorders to `(menu, title,
shortcut: i64, callback: f64)` matching dispatch
`[Widget, Str, Str, Closure]`. The previous order put the closure
pointer into the runtime's `shortcut_ptr: i64` slot.
- `perry_ui_app_set_timer` now takes the leading App handle the
dispatch row passes — was missing, causing the f64 args to land
in the wrong XMM slots.
- `perry_ui_stack_set_distribution` on Windows changed from `i64` to
`f64` (already `f64` on every other platform) so the dispatched
float arg lands in XMM1 instead of being read as garbage from RDX.
- `perry-ui-windows::toolbar::create()` now parents under the
parking HWND. The old code passed `None` for a `WS_CHILD` parent,
which Windows refuses with HRESULT 0x8007057E "Cannot create a
top-level child window."
All 8 perry-ui-* platform crates updated for the first three so
the dispatch ABI is consistent everywhere, not just Windows.
Verified locally on Windows: `./scripts/run_doc_tests.ps1
--skip-xcompile --filter-exclude ui/gallery.ts` reports 76/81
passed, 0 failed, 5 skipped (matches CI shape; previously the same
sweep was 74/81 with `ui/layout/snippets.ts` and
`ui/menus/snippets.ts` reporting RUN_FAIL).1 parent 0cfcc64 commit 85f7497
12 files changed
Lines changed: 100 additions & 67 deletions
File tree
- crates
- perry-ui-android/src
- perry-ui-gtk4/src
- perry-ui-ios/src
- perry-ui-macos/src
- perry-ui-tvos/src
- perry-ui-visionos/src
- perry-ui-watchos/src
- perry-ui-windows/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
| 495 | + | |
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | | - | |
| 576 | + | |
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
766 | | - | |
767 | | - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
768 | 769 | | |
769 | 770 | | |
770 | 771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
| 756 | + | |
756 | 757 | | |
757 | 758 | | |
758 | 759 | | |
| |||
1062 | 1063 | | |
1063 | 1064 | | |
1064 | 1065 | | |
1065 | | - | |
1066 | | - | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
1067 | 1069 | | |
1068 | 1070 | | |
1069 | 1071 | | |
| |||
0 commit comments