← Extensions to GPUI

Paint and shader extension. Opt in through xgpui-shader; ordinary output is sRGB, with explicit native wide-SDR programs.

GPUI 1.27.0 integration and API review

Integrated on codex/sync-gpui-1.27.0 from local commit 8ed97a3, using upstream f98d4e26ca850515c1682ae4cd6e2b8277dae6e7. Implementation is prepared for review; public API approval remains pending; the selected crate versions and exact pins are applied in this branch. No release or merge has been performed.

Breaking changes to XGPUI API

This migration changes the API exposed by XGPUI's core and Apple backend crates. Applications upgrading from the current XGPUI packages should review the changes below even if they do not use an optional extension. The table distinguishes upstream changes carried into XGPUI from adaptations to our GPUI interfaces.

OriginBreaking change in XGPUIApplication migration
Upstream GPUIKeystroke parsing, display, formatting and secondary modifiers use the runtime host OS. Static constructors require static strings; direct keystroke Display implementations are removed.Use KeyBinding::load or Keystroke::parse_with_os for dynamic input; pass the host OS or App context when formatting and resolving modifiers.
Upstream GPUIWindow::text_system() returns an Rc handle; hash-based layout methods are removed.Keep window text caches local to their window thread and use ordinary shape_line and layout_line calls.
Upstream GPUIExternal Platform implementations must provide platform_info.Return the host OS and native/web delivery target.
Upstream Apple changes adapted to XGPUIRenderer constructors now return Result; our renderer factory drops its unused native window, view and bounds arguments.Propagate initialization errors and remove the unused arguments. XGPUI retains its existing color-mode negotiation and typed resource interfaces.
Upstream Apple changesThe public thermal module is replaced by process_info; macOS 12.0 is the minimum.Update observer imports and retain the returned observer owner; update deployment requirements.

XGPUI's own GPUI changes provide the core integration points used by our font, color, drawing, media and paragraph extensions. Those maintained differences, including earlier breaking changes to font and style structs, are described in GPUI API changes. The detailed review below records each API change in this sync, its origin, compatibility impact and application migration. Final API approval remains pending.

Upstream release reference

The upstream GPUI release tracker for 1.27.0 records the Zed GPUI changes from 1.26.2 to 1.27.0, with links to the original commits and pull requests. XGPUI's integration notes below describe how those changes are combined with our maintained GPUI modifications.

Implementation

Selected crate versions

Baseline: release-2026-11-04-b35309ab9316. The published column comes from that release’s verified crate table and matches crates.io version metadata checked on November 6, 2026. Before review is the version already prepared in this development cycle before the version review. The 15 selected new versions remain unpublished; color and macros retain their published versions. The selected versions are applied to manifests, exact dependency requirements and release metadata.

Version decisions are measured from the last published API. Multiple breaking changes in an unpublished major can ship together: core stays at 3.0.0 rather than advancing to 4.0.0 merely because another change landed during development. The existing repository policy does not automatically propagate dependency major bumps; dependent crates with retained public signatures use their already prepared patch/minor versions, and consumers upgrade the exact-pinned stack together.

CrateNovember 4 publishedBefore reviewSelected releaseReview and rationale
xgpui2.0.13.0.03.0.0Keep the prepared major: font/style fields plus this sync’s keystroke, text-cache and platform contract breaks fit the same unpublished 3.0.0 release.
xgpui-apple3.0.13.1.04.0.0Raise the prepared minor to a major: renderer constructors return Result, the factory drops arguments, and thermal moves to process_info. Includes the prepared font capabilities.
xgpui-macos3.0.13.0.24.0.0Raise the prepared patch to a major: its public test/bench-support MetalHeadlessRenderer re-export now has a fallible constructor. Also adopts typed AppKit and macOS 12 minimum.
xgpui-wgpu2.0.12.1.02.1.0Keep the prepared minor: Cosmic font inspection, Linux DMA-BUF completion guards, and upstream text/layout compatibility fixes.
xgpui-windows2.0.12.1.02.1.0Keep the prepared minor: font axes/introspection, corrected fallback fixture, and upstream DirectWrite/input/power integration; no further changed public constructor signature identified.
xgpui-parley0.3.10.4.00.4.0Keep the prepared pre-1.0 minor: font axes/introspection and VariationPreview. Existing paragraph APIs are retained through the window-cache migration.
xgpui-linux2.0.12.0.22.0.2Keep the prepared patch: matching core/WGPU pins, platform identity and power-mode backend implementation. No new standalone Linux public API identified.
xgpui-platform2.0.12.0.22.0.2Keep the prepared patch: matching backend pins, propagate fallible headless creation through the existing Result API, and OHOS selection guards.
xgpui-web2.0.12.0.22.0.2Keep the prepared patch: matching core/WGPU pins, runtime host identity for correct key semantics, and existing unsupported-axis handling.
xgpui-ios1.26.31.26.41.26.4Keep the prepared patch: matching core/Apple pins and upstream UIKit initialization changes. Its downstream version need not match upstream 1.27.0.
xgpui-shader0.4.10.4.20.4.2Keep the prepared patch: matching core/Apple pins, fallible headless call sites and scramble-font recovery; the shader extension’s own public signatures are retained.
xgpui-media0.5.10.5.20.5.2Keep the prepared patch: matching core/backend/shader/helper pins and headless initialization call sites; media public signatures are retained.
xgpui-gamut0.3.10.3.20.3.2Keep the prepared patch: matching dependency pins and fallible test-renderer construction; gamut public signatures are retained.
xgpui-canvas0.3.10.3.20.3.2Keep the prepared patch: matching core/shader pins and packaged beta documentation; CPU-only canvas APIs are retained.
xgpui-svg0.3.10.3.20.3.2Keep the prepared patch: matching core dependency requirement; SVG public signatures are retained.
xgpui-color0.3.00.3.00.3.0Unchanged packaged source and dependency requirements since the release; reuse published 0.3.0.
xgpui-macros1.0.11.0.11.0.1Unchanged package since the release; reuse published 1.0.1.

The version review revised two prepared version numbers: xgpui-apple 3.1.0 → 4.0.0 and xgpui-macos 3.0.2 → 4.0.0. Their exact requirements are updated in normal, optional, target-specific and development dependencies, including the registry consumer fixture. Release metadata, tracked lockfiles and version documentation are refreshed. Version selection does not approve the pending public API changes or authorize publication.

xgpui-shell is a separate development-cycle addition at 0.1.0 with publish = false, intentionally outside the 17-crate release map. Keep it unpublished until its public interface is separately reviewed. The lab package also remains unpublished.

Concrete public API changes

Each row is an individual review item. Origin identifies upstream GPUI changes, upstream Apple changes, and adaptations to XGPUI’s existing backend API. No serialized struct shape changes were identified. Keystroke serialization here means emitted keystroke strings; host OS changes their modifier spelling and alias interpretation. Platform identity and PowerMode types do not add serde implementations. Existing package exports, including ctor, spring types, benchmark macros and typed Metal resource aliases, are retained. MetalRenderer::layer already used our CAMetalLayer alias and has no new source signature change.

Implemented API changePurpose and compatibility impactMigrationOrigin
PlatformInfo { os, target }Add runtime host identity independent of delivery target; additive type and fields.Read App::platform_info().Upstream GPUI
OperatingSystemAdd host OS enum, including unknown hosts.Match with appropriate handling of all variants.Upstream GPUI
PlatformTargetDistinguish native and web delivery.Avoid inferring host OS from build target.Upstream GPUI
PlatformInfo::is_macAdd convenience predicate.Optional use.Upstream GPUI
Platform::platform_infoRequired trait method; breaks external platform implementers.Implement host and delivery identity in every platform.Upstream GPUI
App::platform_infoExpose platform identity to clients.Replace compile-time assumptions where host semantics matter.Upstream GPUI
PowerModeAdd Unknown, LowPower, Balanced, HighPower.Handle Unknown; macOS reports LowPower or Unknown.Upstream GPUI
Platform::power_modeDefaulted trait method; additive.Override when supported.Upstream GPUI
Platform::on_power_mode_changeDefaulted callback registration; additive.Notify through safe deferred delivery.Upstream GPUI
App::power_modeRead active energy preference.Optional use.Upstream GPUI
App::write_credentials_if_not_existsmacOS-only atomic write, returns Task<Result<bool>>.Handle false as existing server/account; do not emulate with read then write.Upstream GPUI
Platform::write_credentials_if_not_existsmacOS-only defaulted hook; unsupported platforms return an error.Override with atomic insertion.Upstream GPUI
KeyBinding::newKeystroke argument becomes &'static str; source breaking.Use KeyBinding::load for dynamic input or secondary-; static bindings use explicit modifier literals.Upstream GPUI
Keystroke::parseStatic input only; secondary- needs OS-aware parsing.Use literals or parse_with_os for dynamic input.Upstream GPUI
Keystroke::parse_with_osAdd dynamic parsing with explicit host OS.Pass cx.platform_info().os.Upstream GPUI
Keystroke::unparseRequire OS argument; emitted aliases depend on host conventions.Pass intended target OS when persisting strings.Upstream GPUI
KeybindingKeystroke::unparseSame OS-aware string change.Pass intended target OS.Upstream GPUI
Keystroke::displayNew explicit OS-aware display adapter.Format the returned adapter.Upstream GPUI
KeybindingKeystroke::displaySame display adapter for bindings.Format the returned adapter.Upstream GPUI
KeystrokeDisplayNew public Display wrapper.Use instead of direct keystroke formatting.Upstream GPUI
Display for Keystroke removedDirect formatting and to_string() stop compiling.Use .display(os) or .unparse(os).Upstream GPUI
Display for KeybindingKeystroke removedSame source break.Use .display(os) or .unparse(os).Upstream GPUI
Modifiers::secondaryAdd &App argument for host semantics.Supply App context.Upstream GPUI
Modifiers::secondary_keyAdd &App argument.Supply App context.Upstream GPUI
KeyContext::new_with_defaultsAdd OperatingSystem argument.Supply runtime host OS.Upstream GPUI
Window::keystroke_text_forAdd &App argument.Supply App context.Upstream GPUI
TestAppContext::set_platform_infoAdd host-identity test override.Test native and browser host semantics.Upstream GPUI
TestWindow::simulate_closeAdd native-close simulation.Use for reentrancy regression tests.Upstream GPUI
Window::text_systemReturn &Rc<WindowTextSystem>; loses Arc ownership and thread sharing.Change explicit Arc annotations/clones; keep window-local access on its thread.Upstream GPUI
WindowTextSystem::shape_line_by_hash removedRemove unused hash cache API; source breaking.Use shape_line.Upstream GPUI
WindowTextSystem::layout_line_by_hash removedSame cache removal.Use layout_line.Upstream GPUI
WindowTextSystem::try_layout_line_by_hash removedRemove lookup-only hash API.Request layout through the regular API.Upstream GPUI
ListState::set_item_measurement_readinessAdd callback controlling when measurements become final.Optional callback; validate scroll anchoring behavior.Upstream GPUI
gpui_apple::main_thread_markerAdd cached main-thread identity helper.Use typed marker where native APIs require it.Upstream Apple
gpui_apple::keychain::write_credentials_if_not_existsAdd atomic insertion returning Result<bool, KeychainError>.Handle duplicate result and errors separately.Upstream Apple
gpui_apple::thermal removedReplace public thermal module.Move callers to process_info.Upstream Apple
thermal::ThermalObserver removedReplace observer type and its constructor.Use observe_thermal_state and retain returned owner.Upstream Apple
process_info::thermal_stateMove thermal query into new public module.Update module path.Upstream Apple
process_info::power_modeAdd power query.Handle Unknown.Upstream Apple
process_info::observe_thermal_stateAdd deferred thermal observation factory.Retain observer; drop cancels delivery.Upstream Apple
process_info::observe_power_modeAdd deferred power observation factory.Retain observer.Upstream Apple
process_info::ProcessInfoObserverNew shared observer owner.Replace ThermalObserver ownership.Upstream Apple
metal_renderer::new_rendererFactory becomes safe, returns Result<Renderer>, and drops unused native window, view, and bounds arguments.Remove unused arguments and the unsafe wrapper; propagate errors. The existing Display P3 preference still uses XGPUI color negotiation with SDR fallback.Upstream Apple, adapted to XGPUI
MetalRenderer::newConstructor returns Result<Self>; XGPUI retains its existing two arguments and separate color-mode negotiation.Use ? or explicit error handling; existing color-mode calls remain valid.Upstream Apple, adapted to XGPUI
MetalRenderer::new_headlessReturn Result<Self>.Propagate initialization failures.Upstream Apple
MetalHeadlessRenderer::newReturn Result<Self>; test-support re-exports also affected.Update tests and extension callers.Upstream Apple
MetalRenderer::from_layerReturn Result<Self> for platform-owned layer initialization.Propagate errors; the iOS window constructor now does so.Upstream Apple
KeyBinding::load behaviorExisting signature now resolves secondary- against runtime host OS.Use for dynamic keymaps; serialized alias interpretation follows the intended host.Upstream GPUI
WindowTextSystem auto traitsWindow-local interior mutability removes Sync; Rc handles are neither Send nor Sync. Shared TextSystem remains Arc-based.Do not send window text caches across threads.Upstream GPUI

The removed hash methods on the crate-private LineLayoutCache, private pasteboard UTType changes, and private subscriber-set changes are not downstream public APIs. Benchmark macros moved into a private module while retaining their exported names and availability. The shared Apple source mirror repeats core changes and is not a separate public API family.

XGPUI backend adaptations

The renderer factory drops its unused native window, view and bounds arguments, while MetalRenderer::new keeps XGPUI's existing two arguments and separate color negotiation. Both adopt upstream's fallible initialization. These changes adapt existing Apple backend entry points used to create platform windows; an extension cannot change their signatures or initialization error handling.

XGPUI's existing font, color, drawing, media and paragraph integration points are preserved. Their core-versus-extension design belongs in the maintained GPUI API changes guide. The upstream APIs in this migration retain their upstream role and are reviewed for compatibility.

Verification

All 16 suites in the macOS scripts/test_all.sh matrix passed across the full run and targeted reruns of release-sync, shader and labs after fixes. This includes the 426-test core suite, extension rendering tests, benchmark checks, native lab tests, CoreText tests, and iOS simulator test compilation.

Additional checks passed:

Linux and OHOS native execution, browser interaction, iOS interactive execution, and physical-display color acceptance were not run in this macOS session. Existing ignored GPU diagnostics remain ignored; test success does not claim these additional platform acceptance results.

Approval required

The repository's AGENTS.md requires: “Complete authorized implementation and verification, then present the concrete API changes individually for user review before finalizing or releasing them.” The items above are implemented for that review; implementation authorization does not approve their final public API.

Labs most affected by this sync

For manual regression testing on macOS, use the following order. This ranks exposure to the changed code; automated rendering tests already pass.

OrderLabWhy it is affected and what to check
1just lab-textMost direct exposure: layout caches, font fallback, paragraph reuse, native text input and shortcuts. Compare native and Parley; test scrolling, axes, selection, copy/paste and IME.
2just lab-shader --example typographyText shaping alongside custom Metal drawing. The sync exposed a scramble-text regression here, now fixed. Check selection, scramble, shadows and wide output.
3just lab-gamutOur color negotiation against the replaced AppKit window/display bindings. Check SDR/P3 switching, resize and moving between displays.
4just lab-mediaRenderer initialization, atlas uploads, texture ownership and CoreVideo surfaces. Try tiled images, float images and --video.
5just lab-colorWide-color presentation, compositing and headless capture. Check the photo and chromaticity views.
6just lab-paintBroad coverage of retained Metal rendering: gradients, paths, masks and layers.
7just lab-canvasMostly shared-backend exposure. Check pan/zoom, clipping, resize and sustained interaction.
8just lab-svgMostly shared atlas and renderer exposure. Check progressive loading, scaling and eviction/reloading.

Across every lab, test window closing, fullscreen, display changes, and animation with Low Power Mode enabled. These exercise the backend changes regardless of the lab's content.