Skip to content

feat: the port — off the dead branch, onto the live one - #6

Merged
tension-atoi merged 1 commit into
mainfrom
feat/gpui-0.3-port
Oct 22, 2026
Merged

tension-atoi merged 1 commit into
mainfrom
feat/gpui-0.3-port

Conversation

@tension-atoi

Copy link
Copy Markdown
Collaborator

The port — off the dead branch, onto the live one

Draft — for review. No merge, no release.

gpui 0.2.2 was last published on 2025-10-22 and has seven versions.
The live line is gpui-pre, at 0.3.9, published nine days ago.
blade-graphics moved with it, and the platform left gpui for crates of
its own. Staying meant staying on a snapshot of a moving framework.

The order, and why it was that way

The interaction gate came first, on purpose. A port done blind would have
had no witness for the clicks, the focus and the drags. The bench is that
witness, and it became the port's arbiter: every measurement in the spatial
contract was re-measured by the same tests, on the new version.

The dependency set

before after
gpui 0.2.2 gpui-pre 0.3.9
blade-graphics =0.7.1 blade-graphics 0.6
— gpui-pre-platform 0.3.9
— gpui-pre-linux 0.3.9

The port is smaller than it looked, because the library kept its name:
the package was renamed, the library was not. None of the 44 files that
import gpui changed.

The adaptations

  • Application::new() → Application::with_platform(gpui_linux::current_platform(false)) — the platform is explicit now
  • Corner → Anchor
  • window.focus(handle) → window.focus(handle, cx); focus_next/focus_prev take the app
  • flex_grow() → flex_grow(1.0) — the factor is an argument
  • track_scroll(handle) → track_scroll(&handle) — the handle is borrowed
  • BoxShadow gained an inset field
  • gpui::Timer::after(d) → cx.background_executor().timer(d) — the timer moved to the executor
  • the text line's paint takes the alignment and its width
  • an Entity is an IntoElement, not an Element — the bench's draw closures convert

24 errors on the first compile, 21 in the tests, 0 at the end.

The finding that changed the gate

gpui 0.3 records the bounds of an element — what the visual bench measures —
only under all(debug_assertions, feature = "test-support"). A release build
has no debug assertions, so the measurements find nothing and the sixteen
measurement tests fail.

The UI tests therefore run in the debug profile, and the release build is
still made for the artefact it ships. This is the upstream's own condition,
not a preference. The cost: a second build tree in the gate — 65 s of tests
against 102 s of release build, in the runner's container, with the caches the
lockfile keys.

The layout did not move

Every measurement is unchanged, on the new version:

the measurement before after
the row's floor 495 px 495 px
the catalogue's qualified minimum 660 px 660 px
the name's cell 165 px 165 px
the bank's band 100.5 px 100.5 px
the plate's floor 96 px 96 px
the p90 name 143 px 143 px

The contract's numbers are properties of the composition, not of gpui's
version
— and the port is what proves it.

The gates

  • scripts/verify — PASSED, local-verify-20261021T234839Z: 1386
    package-manager tests, 392 CLI tests, 263 UI tests.
  • scripts/ci-replay --worktree — PASSED inside archlinux:latest,
    local-verify-20261021T235200Z: 1388 / 392 / 263.

The limits, stated

  • The port is green in the bench; the application has not been run on a
    screen since the port. The interaction gate and the measurements are the
    witnesses, but a human eye has not looked at the ported application.
  • The platform crates are new dependencies, published in lockstep with
    gpui-pre — they will move too.
  • The shipped binary keeps its debug assertions off; the debug assertions
    belong to the test build, and the price of the measurements is paid
    there.

gpui 0.2.2 was last published on 2025-10-22 and has seven versions.
The live line is gpui-pre, at 0.3.9, published nine days ago. blade-graphics
moved with it, and the platform left gpui for crates of its own. Staying
meant staying on a snapshot of a moving framework.

The port is smaller than it looked, because the *library* kept its name:
the package was renamed, the library was not, so none of the 44 files
that import gpui changed. What moved:

  gpui 0.2.2        → gpui-pre 0.3.9
  blade-graphics =0.7.1 → blade-graphics 0.6
  —                 → gpui-pre-platform 0.3.9, gpui-pre-linux 0.3.9

  Application::new() → with_platform(gpui_linux::current_platform(false))
  Corner → Anchor
  window.focus(handle) → window.focus(handle, cx)
  flex_grow() → flex_grow(1.0)
  track_scroll(handle) → track_scroll(&handle)
  BoxShadow gained `inset`
  gpui::Timer::after → cx.background_executor().timer
  an Entity is an IntoElement, not an Element

24 errors on the first compile, 21 in the tests, 0 at the end.

**The finding that changed the gate.** gpui 0.3 records the bounds of an
element — what the visual bench measures — only under
`all(debug_assertions, feature = "test-support")`. A release build has no
debug assertions, so the measurements find nothing and the sixteen
measurement tests fail. The UI tests therefore run in the *debug* profile,
and the release build is still made for the artefact it ships. That is the
upstream's own condition, not a preference.

**The layout did not move.** The measurements are unchanged: the row's
495 px floor, the catalogue's 660 px minimum, the 165 px name cell, the
bank's 100.5 px, the plate's 96 px, the 143 px p90 name. The contract's
numbers are properties of the *composition*, not of gpui's version — and
the port is what proves it.

263 UI tests, both gates green, in the runner's container.

The port is green in the bench; a human eye has not looked at the
ported application yet. That is the next thing, and it is the operator's
to do.
@tension-atoi
tension-atoi marked this pull request as ready for review October 22, 2026 00:38
@tension-atoi
tension-atoi merged commit 04afdca into main Oct 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant