Repository navigation
Desktop: run the AppImage on the host's WebKitGTK 2.54+ when available - #15503
Merged
shimmyshimmer merged 6 commits intoOct 30, 2026
Merged
shimmyshimmer merged 6 commits into
shimmyshimmer merged 6 commits into
Conversation
…ck is complete The AppImage bundles WebKitGTK 2.50.4 from its Ubuntu 22.04 build base, which saturates the web process at fractional Wayland scales; WebKitGTK 2.54 does not, but no distribution package of it builds on a base that keeps the glibc 2.35 floor. AppRun now probes the host: an unbundled, byte-identical copy of the executable (usr/bin/host/unsloth-studio, whose $ORIGIN/../lib reaches nothing) runs with --unsloth-webkit-probe under a 5 s timeout. It loads only because every linked host library and symbol resolved (the binary is BIND_NOW), dlopens the tray library setup_tray needs, and prints the WebKitGTK that loaded. When that is 2.54 or newer, AppRun undoes the gtk/gstreamer hook exports that pin GTK, GIO, GSettings and GStreamer to the bundle and execs the host copy, so the whole stack comes from the host; otherwise it keeps today's bundled launch. UNSLOTH_APPIMAGE_WEBKIT=auto|host|bundled overrides the choice. The mode is logged by AppRun and the app, shown in diagnostics, and a host-mode AppImage gets the native rendering plan. The finalizer adds the copy, the verifier checks it whenever a launcher refers to it (so the shipped release still verifies), and the clean-machine AppImage CI asserts the mode and the mapped libraries, with new Fedora 44 and Debian 13 lanes (host) and an Ubuntu 24.04 lane (2.52.6, bundled unless forced).
…ard job It reads desktop-app-clean-machine-ci.yml, so a PR that edits only that workflow has to collect it (test_workflow_guards_run_unfiltered).
fedora:44 ships no diffutils, so the clean-machine audit failed with "cmp: command not found" and reported the identical host copy as different. Fall back to sha256sum, failing closed.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
|
Reached Codex review convergence at oobabooga#430. |
1 of 5 tasks
oobabooga
approved these changes
Oct 29, 2026
This was referenced Nov 1, 2026
danielhanchen
added a commit
to NilayYadav/unsloth
that referenced
this pull request
Nov 1, 2026
…) (unslothai#16322) Fixes unslothai#16318. Same cause as the flicker in unslothai#16028. On NVIDIA X11 the app turns WebKit compositing off below driver 610, which avoids the 580 driver's `sync_file` leak (unslothai#10795). The plan it uses (`WEBKIT_DMABUF_RENDERER_FORCE_SHM` + `WEBKIT_FORCE_DMABUF_RENDERER` + `WEBKIT_DISABLE_COMPOSITING_MODE`) works up to WebKitGTK 2.52, but on 2.54 the window stops presenting what WebKit draws. The report's video alternates between the UI and a blank off-white window 82 times in 11 seconds. `WEBKIT_DISABLE_COMPOSITING_MODE=1` alone is enough to trigger it on 2.54 with NVIDIA's libraries; with Mesa it renders. Who gets it: NVIDIA X11 hosts below driver 610 with a system WebKitGTK 2.54 (Debian 13, Fedora 43/44, Arch). Deb users there have had it since their distribution moved to 2.54. AppImage users there got it in v0.1.913, when the AppImage started running on the host's WebKitGTK 2.54 (unslothai#15503); v0.1.912's bundled 2.50.4 renders. The "Off" setting, "On" below driver 610 and `UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1` all reached the same plan, so none of them helped. ## Fix Every NVIDIA X11 path that turns compositing off now turns the DMA-BUF renderer off instead on WebKitGTK 2.54 and newer: Auto below driver 610, Off, On below 610, and `UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1`. This is the `WEBKIT_DISABLE_DMABUF_RENDERER=1` workaround the report confirmed. Below 2.54 those paths keep the shared-memory plan, which renders there and is what unslothai#10964 chose because disabling DMA-BUF could leave Debian and Ubuntu's patched WebKit without a transport. Wayland, non-NVIDIA hosts and NVIDIA X11 at driver 610 or newer are unchanged. ## A/B results v0.1.912 and v0.1.913 release builds, and this branch before and after the follow-up commit, built with the Linux x64 steps of `release-desktop.yml`, ran in Debian 13, Fedora 44 and Ubuntu 24.04 containers with NVIDIA's userspace on an Xvfb display, with a fake driver 595 version file for the below-610 paths. Without a compositor, the broken presentation shows as a window that stays blank rather than flickering. | WebKitGTK | Auto, driver 595 | On, driver 595 | Off | `UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1` | | --- | --- | --- | --- | --- | | 2.54.0 (Debian 13), v0.1.913 | Blank | Blank | Blank | Blank | | 2.54.0 (Debian 13), this PR | Renders | Renders | Renders | Renders | | 2.54.2 (Fedora 44), this PR | Renders | Renders | Renders | Renders | | 2.52.6 (Ubuntu 24.04), this PR | Renders, unchanged plan | Renders, unchanged plan | Renders, unchanged plan | Renders, unchanged plan | | 2.50.4 (bundled), this PR | Renders, unchanged plan | Renders, unchanged plan | Renders, unchanged plan | Renders, unchanged plan | The first commit alone left On below 610 and `UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1` blank on 2.54.0 and 2.54.2. The v0.1.912 deb is blank on Debian 13's 2.54.0 as well. Disabling DMA-BUF also stays clear of the 580 leak. On a GeForce MX150 with driver 580.178.04, the same continuous-scroll workload grew the web process to 367 `sync_file` descriptors in about 2 minutes with compositing on, and stayed at 0 for 5 minutes with `WEBKIT_DISABLE_DMABUF_RENDERER=1`, at 59 fps. ## Validation - **Rust tests:** all 837 `studio/src-tauri` binary tests pass, including a new case for each of the four paths on 2.50.4, 2.52.6, 2.54.0 and 2.54.2. - **Builds:** `verify-complete-appimage.sh` passed on both A/B builds. - **Not tested:** the flicker itself on an NVIDIA X server below driver 610 with WebKitGTK 2.54 (the test machine has driver 615), and Debian or Ubuntu's NVIDIA DMA-BUF patch on real NVIDIA hardware with WebKitGTK 2.52 or older. --------- Co-authored-by: oobabooga <[email protected]> Co-authored-by: Daniel Han <[email protected]>
danielhanchen
added a commit
to debojyoti-dev/unsloth
that referenced
this pull request
Nov 13, 2026
…de it on relaunch Host-WebKitGTK launches (unslothai#15503) load the host atk-bridge, so they keep the bridge. A relaunch inherits the AppRun's own default and now drops it before deciding again. Managed Python children get the bridge back like host launchers. [skip ci]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The AppImage bundles WebKitGTK 2.50.4 from its Ubuntu 22.04 build base. That version saturates the web process at fractional Wayland scales. WebKitGTK 2.54 does not, but no distribution package of it builds on a base that keeps the glibc 2.35 floor.
AppRun now probes the host. It runs an unbundled, byte-identical copy of the executable (
usr/bin/host/unsloth-studio, whose$ORIGIN/../libreaches nothing) with--unsloth-webkit-probeunder a 5 s timeout. The copy only loads if every linked host library and symbol resolves (the binary isBIND_NOW). It also dlopens the tray librarysetup_trayneeds and prints the WebKitGTK version that loaded.UNSLOTH_APPIMAGE_WEBKIT=auto|host|bundledoverrides the choice.linux_webkit.rs.The finalizer adds the host copy. The verifier checks it whenever a launcher refers to it, so the already shipped release still verifies. The clean-machine AppImage CI asserts the mode and the mapped libraries, with new Fedora 44 and Debian 13 lanes (expect host) and an Ubuntu 24.04 lane (WebKitGTK 2.52.6, bundled unless forced).
Draft #15482 (GPU rendering setting) also touches
linux_webkit.rs, so whichever lands second will need a rebase.Testing
Run locally:
cargo testinstudio/src-tauri: 775 of 777 pass. The 2 failures aredebian_updatedpkg tests that also fail onmain.webkit=2.54.2in 72 ms.mainAppRun (bundled mode differs only byUNSLOTH_APPIMAGE_WEBKIT_MODE=bundledand one stderr line), verifier and finalizer fixtures, and contract tests.Not run yet: