wleird subsurfaces test fails
When running the wleird-subsurfaces test on Sway, I get the following result:

On Anvil, I get this instead:

Doing some rough poking around, it seems like the subsurface state never changes from pending to current.
WAYLAND_DEBUG logs from sway
[1869405.219] -> [email protected]_registry(new id wl_registry@2)
[1869406.675] [email protected](1, "wl_shm", 1)
[1869406.836] -> [email protected](1, "wl_shm", 1, new id [unknown]@3)
[1869406.954] [email protected](2, "wl_drm", 2)
[1869407.018] [email protected](3, "zwp_linux_dmabuf_v1", 4)
[1869407.072] [email protected](4, "wl_compositor", 5)
[1869407.133] -> [email protected](4, "wl_compositor", 4, new id [unknown]@4)
[1869407.199] [email protected](5, "wl_subcompositor", 1)
[1869407.271] [email protected](6, "wl_data_device_manager", 3)
[1869407.349] -> [email protected](6, "wl_data_device_manager", 3, new id [unknown]@5)
[1869407.417] [email protected](7, "zwlr_gamma_control_manager_v1", 1)
[1869407.474] [email protected](8, "zxdg_output_manager_v1", 3)
[1869407.530] [email protected](9, "org_kde_kwin_idle", 1)
[1869407.585] [email protected](10, "ext_idle_notifier_v1", 1)
[1869407.644] [email protected](11, "zwp_idle_inhibit_manager_v1", 1)
[1869407.700] [email protected](12, "zwlr_layer_shell_v1", 4)
[1869407.753] [email protected](13, "xdg_wm_base", 2)
[1869407.812] -> [email protected](13, "xdg_wm_base", 1, new id [unknown]@6)
[1869407.878] [email protected](14, "zwp_tablet_manager_v2", 1)
[1869407.948] [email protected](15, "org_kde_kwin_server_decoration_manager", 1)
[1869407.997] [email protected](16, "zxdg_decoration_manager_v1", 1)
[1869408.057] -> [email protected](16, "zxdg_decoration_manager_v1", 1, new id [unknown]@7)
[1869408.114] [email protected](17, "zwp_relative_pointer_manager_v1", 1)
[1869408.164] [email protected](18, "zwp_pointer_constraints_v1", 1)
[1869408.212] [email protected](19, "wp_presentation", 1)
[1869408.268] [email protected](20, "zwlr_output_manager_v1", 4)
[1869408.326] [email protected](21, "zwlr_output_power_manager_v1", 1)
[1869408.385] [email protected](22, "zwp_input_method_manager_v2", 1)
[1869408.443] [email protected](23, "zwp_text_input_manager_v3", 1)
[1869408.498] [email protected](24, "zwlr_foreign_toplevel_manager_v1", 3)
[1869408.556] [email protected](25, "ext_session_lock_manager_v1", 1)
[1869408.613] [email protected](26, "wp_drm_lease_device_v1", 1)
[1869408.672] [email protected](27, "zwlr_export_dmabuf_manager_v1", 1)
[1869408.730] [email protected](28, "zwlr_screencopy_manager_v1", 3)
[1869408.787] [email protected](29, "zwlr_data_control_manager_v1", 2)
[1869408.844] [email protected](30, "zwp_primary_selection_device_manager_v1", 1)
[1869408.901] [email protected](31, "wp_viewporter", 1)
[1869408.958] [email protected](32, "wp_single_pixel_buffer_manager_v1", 1)
[1869409.016] [email protected](33, "zxdg_exporter_v1", 1)
[1869409.073] [email protected](34, "zxdg_importer_v1", 1)
[1869409.131] [email protected](35, "zxdg_exporter_v2", 1)
[1869409.186] [email protected](36, "zxdg_importer_v2", 1)
[1869409.244] [email protected](37, "xdg_activation_v1", 1)
[1869409.300] [email protected](38, "zwp_virtual_keyboard_manager_v1", 1)
[1869409.430] [email protected](39, "zwlr_virtual_pointer_manager_v1", 2)
[1869409.498] [email protected](40, "zwlr_input_inhibit_manager_v1", 1)
[1869409.558] [email protected](41, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1869409.618] [email protected](42, "wl_seat", 8)
[1869409.689] -> [email protected](42, "wl_seat", 1, new id [unknown]@8)
[1869409.757] [email protected](43, "zwp_pointer_gestures_v1", 3)
[1869409.817] [email protected](44, "wl_output", 4)
[1869409.894] -> [email protected](new id wl_callback@9)
[1869410.581] [email protected]_id(9)
[1869410.676] [email protected](6)
[1869410.723] [email protected](14)
[1869410.776] -> [email protected]_registry(new id wl_registry@9)
[1869412.243] [email protected](1, "wl_shm", 1)
[1869412.344] [email protected](2, "wl_drm", 2)
[1869412.397] [email protected](3, "zwp_linux_dmabuf_v1", 4)
[1869412.447] [email protected](4, "wl_compositor", 5)
[1869412.525] [email protected](5, "wl_subcompositor", 1)
[1869412.589] -> [email protected](5, "wl_subcompositor", 1, new id [unknown]@10)
[1869412.668] [email protected](6, "wl_data_device_manager", 3)
[1869412.723] [email protected](7, "zwlr_gamma_control_manager_v1", 1)
[1869412.805] [email protected](8, "zxdg_output_manager_v1", 3)
[1869412.855] [email protected](9, "org_kde_kwin_idle", 1)
[1869412.913] [email protected](10, "ext_idle_notifier_v1", 1)
[1869412.963] [email protected](11, "zwp_idle_inhibit_manager_v1", 1)
[1869413.021] [email protected](12, "zwlr_layer_shell_v1", 4)
[1869413.082] [email protected](13, "xdg_wm_base", 2)
[1869413.134] [email protected](14, "zwp_tablet_manager_v2", 1)
[1869413.182] [email protected](15, "org_kde_kwin_server_decoration_manager", 1)
[1869413.243] [email protected](16, "zxdg_decoration_manager_v1", 1)
[1869413.301] [email protected](17, "zwp_relative_pointer_manager_v1", 1)
[1869413.438] [email protected](18, "zwp_pointer_constraints_v1", 1)
[1869413.505] [email protected](19, "wp_presentation", 1)
[1869413.567] [email protected](20, "zwlr_output_manager_v1", 4)
[1869413.618] [email protected](21, "zwlr_output_power_manager_v1", 1)
[1869413.667] [email protected](22, "zwp_input_method_manager_v2", 1)
[1869413.729] [email protected](23, "zwp_text_input_manager_v3", 1)
[1869413.779] [email protected](24, "zwlr_foreign_toplevel_manager_v1", 3)
[1869413.827] [email protected](25, "ext_session_lock_manager_v1", 1)
[1869413.888] [email protected](26, "wp_drm_lease_device_v1", 1)
[1869413.949] [email protected](27, "zwlr_export_dmabuf_manager_v1", 1)
[1869414.000] [email protected](28, "zwlr_screencopy_manager_v1", 3)
[1869414.049] [email protected](29, "zwlr_data_control_manager_v1", 2)
[1869414.111] [email protected](30, "zwp_primary_selection_device_manager_v1", 1)
[1869414.173] [email protected](31, "wp_viewporter", 1)
[1869414.221] [email protected](32, "wp_single_pixel_buffer_manager_v1", 1)
[1869414.269] [email protected](33, "zxdg_exporter_v1", 1)
[1869414.329] [email protected](34, "zxdg_importer_v1", 1)
[1869414.378] [email protected](35, "zxdg_exporter_v2", 1)
[1869414.426] [email protected](36, "zxdg_importer_v2", 1)
[1869414.486] [email protected](37, "xdg_activation_v1", 1)
[1869414.544] [email protected](38, "zwp_virtual_keyboard_manager_v1", 1)
[1869414.604] [email protected](39, "zwlr_virtual_pointer_manager_v1", 2)
[1869414.664] [email protected](40, "zwlr_input_inhibit_manager_v1", 1)
[1869414.714] [email protected](41, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1)
[1869414.764] [email protected](42, "wl_seat", 8)
[1869414.829] [email protected](43, "zwp_pointer_gestures_v1", 3)
[1869414.889] [email protected](44, "wl_output", 4)
[1869414.958] -> [email protected](new id wl_callback@11)
[1869415.678] [email protected]_id(11)
[1869415.756] [email protected](14)
[1869415.814] -> [email protected]_surface(new id wl_surface@11)
[1869415.883] -> [email protected]_xdg_surface(new id xdg_surface@12, wl_surface@11)
[1869415.954] -> [email protected]_toplevel(new id xdg_toplevel@13)
[1869416.010] -> [email protected]_toplevel_decoration(new id zxdg_toplevel_decoration_v1@14, xdg_toplevel@13)
[1869416.081] -> [email protected]_mode(2)
[1869416.141] -> [email protected]()
[1869416.197] -> [email protected]_surface(new id wl_surface@15)
[1869416.265] -> [email protected]_subsurface(new id wl_subsurface@16, wl_surface@15, wl_surface@11)
[1869416.867] -> [email protected]_pool(new id wl_shm_pool@17, fd 5, 480000)
[1869416.955] -> [email protected]_buffer(new id wl_buffer@18, 0, 300, 400, 1200, 0)
[1869420.605] -> [email protected](wl_buffer@18, 0, 0)
[1869420.750] -> [email protected]_buffer(0, 0, 300, 400)
[1869420.811] -> [email protected]()
[1869420.875] -> [email protected]_surface(new id wl_surface@19)
[1869420.941] -> [email protected]_subsurface(new id wl_subsurface@20, wl_surface@19, wl_surface@11)
[1869421.443] -> [email protected]_pool(new id wl_shm_pool@21, fd 7, 480000)
[1869421.533] -> [email protected]_buffer(new id wl_buffer@22, 0, 300, 400, 1200, 0)
[1869424.876] -> [email protected](wl_buffer@22, 0, 0)
[1869425.015] -> [email protected]_buffer(0, 0, 300, 400)
[1869425.076] -> [email protected]()
[1869425.126] -> [email protected]_surface(new id wl_surface@23)
[1869425.211] -> [email protected]_subsurface(new id wl_subsurface@24, wl_surface@23, wl_surface@11)
[1869425.721] -> [email protected]_pool(new id wl_shm_pool@25, fd 9, 480000)
[1869425.808] -> [email protected]_buffer(new id wl_buffer@26, 0, 300, 400, 1200, 0)
[1869428.275] -> [email protected](wl_buffer@26, 0, 0)
[1869428.389] -> [email protected]_buffer(0, 0, 300, 400)
[1869428.431] -> [email protected]()
[1869428.464] -> [email protected]_position(10, 10)
[1869428.508] -> [email protected]_position(100, 50)
[1869428.548] -> [email protected]_position(50, 100)
[1869430.337] [email protected](16)
[1869430.416] -> [email protected](16)
[1869430.454] [email protected](0, 0, array[0])
[1869430.492] [email protected](15)
[1869430.521] -> [email protected]_configure(15)
[1869430.808] -> [email protected]_pool(new id wl_shm_pool@27, fd 7, 480000)
[1869430.869] -> [email protected]_buffer(new id wl_buffer@28, 0, 300, 400, 1200, 0)
[1869433.180] -> [email protected](wl_buffer@28, 0, 0)
[1869433.299] -> [email protected]_buffer(0, 0, 300, 400)
[1869433.339] -> [email protected]()
[1869456.416] [email protected]()
[1869456.510] [email protected]()
[1869456.539] [email protected]()
[1869456.565] [email protected]()
[1869456.591] [email protected](356, 678, array[8])
[1869456.639] [email protected](17)
[1869456.678] -> [email protected]_configure(17)
[1869457.066] -> [email protected]()
[1869457.116] -> [email protected](965472)
[1869457.160] -> [email protected]_buffer(new id wl_buffer@29, 0, 356, 678, 1424, 0)
[1869460.453] -> [email protected](wl_buffer@29, 0, 0)
[1869460.552] -> [email protected]_buffer(0, 0, 356, 678)
[1869460.592] -> [email protected]()
[1869474.352] [email protected]_id(28)
[1869474.451] [email protected]()
To me it seems like the subsurface commit is handled before the SetPosition request is handled.
Some Smithay transaction debug logs for personal reference:
COMMIT FOR SURFACE ObjectId(wl_surface@11)
FINALIZING (1)
APPLYING STATES (Some("xdg_toplevel"))
------ We can see here the commit for subsurfaces is handled
COMMIT FOR SURFACE ObjectId(wl_surface@15)
COMMIT FOR SURFACE ObjectId(wl_surface@19)
COMMIT FOR SURFACE ObjectId(wl_surface@23)
------ Now the location is handled after the subsurface commit
STORING PENDING LOCATION FOR SURFACE ObjectId(wl_surface@15): 10x10
STORING PENDING LOCATION FOR SURFACE ObjectId(wl_surface@19): 100x50
STORING PENDING LOCATION FOR SURFACE ObjectId(wl_surface@23): 50x100
------ In the parent commit the child transactions are merged, but location is 0,0
COMMIT FOR SURFACE ObjectId(wl_surface@11)
MERGING CHILD (3) INTO PARENT (2)
TRANSACTION LOCATION: Point<Logical> { x: 0, y: 0 }
MERGING CHILD (4) INTO PARENT (2)
TRANSACTION LOCATION: Point<Logical> { x: 0, y: 0 }
MERGING CHILD (5) INTO PARENT (2)
TRANSACTION LOCATION: Point<Logical> { x: 0, y: 0 }
FINALIZING (2)
APPLYING STATES (Some("subsurface"))
SUBSURFACE LOCATION: Point<Logical> { x: 0, y: 0 }
APPLYING STATES (Some("subsurface"))
SUBSURFACE LOCATION: Point<Logical> { x: 0, y: 0 }
APPLYING STATES (Some("subsurface"))
SUBSURFACE LOCATION: Point<Logical> { x: 0, y: 0 }
APPLYING STATES (Some("xdg_toplevel"))
COMMIT FOR SURFACE ObjectId(wl_surface@11)
MERGING CHILD (6) INTO PARENT (9)
TRANSACTION LOCATION: Point<Logical> { x: 0, y: 0 }
MERGING CHILD (7) INTO PARENT (9)
TRANSACTION LOCATION: Point<Logical> { x: 0, y: 0 }
MERGING CHILD (8) INTO PARENT (9)
TRANSACTION LOCATION: Point<Logical> { x: 0, y: 0 }
FINALIZING (9)
APPLYING STATES (Some("xdg_toplevel"))
From the specification:
wl_subsurface:
Sub-surfaces also have another kind of state, which is managed by wl_subsurface requests, as opposed to wl_surface requests. This state includes the sub-surface position relative to the parent surface (wl_subsurface.set_position), and the stacking order of the parent and its sub-surfaces (wl_subsurface.place_above and .place_below). This state is applied when the parent surface's wl_surface state is applied, regardless of the sub-surface's mode. As the exception, set_sync and set_desync are effective immediately.
wl_subsurface::set_position:
The scheduled coordinates will take effect whenever the state of the parent surface is applied. When this happens depends on whether the parent surface is in synchronized mode or not. See wl_subsurface.set_sync and wl_subsurface.set_desync for details.