Skip to content

Add Linux X11 runtime and Studio Standalone preview - #160

Merged
SpectralDragon merged 7 commits into
mainfrom
codex/linux-studio-port
Oct 17, 2026
Merged

SpectralDragon merged 7 commits into
mainfrom
codex/linux-studio-port

Conversation

@SpectralDragon

@SpectralDragon SpectralDragon commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Linux still uses a placeholder application/window backend, and Studio has no Linux run destination or native file picker. This adds an initial X11/XWayland runtime and a relocatable Linux Studio Standalone preview.

  • Implement native windows, keyboard/text and pointer input, focus/close/resize handling, screen discovery, Vulkan Xlib surfaces, monotonic time and inotify watching.
  • Enable Linux Studio local Run, Ctrl shortcuts, Zenity dialogs and desktop file actions. Add a launcher/packager bundling resources, Swift runtime, Tint and a source BuildSDK with Linux Swan/Dawn.
  • Avoid persistent bind-group ownership of transient render attachments; Fold previously accumulated several GiB of shared graphics memory within seconds.
  • Remove a duplicated localization call that blocked Studio compilation.
  • Add production-path platform, compiler, GPU texture lifetime and Studio SDK/destination regressions, plus setup and limitation documentation.

Validation

  • Windows package manifest loads; localization checker passes (1,528 English/Russian messages); both Swan staging tests pass; diff whitespace checks pass.
  • Before rebasing onto current main: 5 Linux platform/runtime, 70 Utils/Input, 13 Studio, 23 compiler and 27 focused GPU checks passed under Ubuntu 24.04 / WSLg, Swift 6.3.2 and Mesa llvmpipe.
  • Native StarQuest/Fold windows and Fold Jump/Turn were exercised. The packaged debug Studio launched without Swift in PATH and ran UnfoldTheWorld in a separate game window. A 45-second Fold regression run held shared graphics memory near 105 MiB.
  • On the rebased branch: all 23 focused compiler checks and all 50 tests selected by the current WebGPU validation script pass. Linux compile guards exclude the 3D golden-frame cases, so this does not establish 3D parity.
  • Studio executable and full test product compiled at d08cd3a, before the final upstream rendering-only merge. All 13 focused Studio tests pass in the compiled Swift Testing runner with --testing-library swift-testing --no-parallel (distribution, Linux SDK/destination, UTF-8, localization, scene scripts, hot reload and input). The initial SwiftPM post-build test invocation stalled under WSL and was stopped; the direct serial run completed successfully. This is not a claim that the parallel or complete editor suite passes.

Preview boundaries

X11/XWayland only, primary display scale 1. Hardware Vulkan is unverified. UnfoldTheWorld's inline viewport Play stays static; the top-level Run window executes its scripts. Skeletal Garden crashes in a Mesa llvmpipe worker. Native Wayland, desktop service/export parity and Linux MCP HTTP listening remain incomplete. The full engine test suite has not been run.

Current main already contains the compiler UTF-8/CRLF fixes, bundled Gravity source and navigation enum portability fix; this change preserves those implementations. Unrelated local work is excluded.

@SpectralDragon
SpectralDragon marked this pull request as ready for review October 17, 2026 11:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T11:42:58.287922Z 03a3089 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d08cd3a1e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +22 to +24
#elseif os(Linux)
UIClipboard.setString(value)
return UIClipboard.getString() == value

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the desktop clipboard on Linux

On Linux, UIClipboard falls through to its process-local fallbackString implementation (Sources/AdaUI/CoreUI/UIClipboard.swift:70-71,96-97). Consequently, this set/get round trip always reports success without updating the X11/Wayland clipboard, so actions such as Copy Path cannot be pasted into another application and external clipboard contents cannot be read by Studio. Implement a real Linux clipboard bridge or return false rather than claiming success.

Useful? React with 👍 / 👎.

Comment on lines +266 to +267
#elseif os(Linux)
self.selectedRunDestination = selectedRunDestination.flatMap { EditorRunDestination.availableCases.contains($0) ? $0 : nil } ?? .linux

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enable project watching for the Linux editor

When this new Linux Studio path is used, EditorView calls startProjectFileWatching(), but that method's entire implementation remains compiled only under #if os(macOS) in EditorProjectFileWatcher.swift:112-138. Linux therefore never installs the newly added inotify watcher, so externally created or renamed files do not refresh the navigator, source-control state, open documents, or AdaScript hot reload. Include Linux in that platform gate.

Useful? React with 👍 / 👎.

Comment on lines +140 to +141
if event.mask & UInt32(IN_ISDIR) != 0, event.mask & UInt32(IN_CREATE | IN_MOVED_TO) != 0 {
try? add(path, options: .defaultDirectoryWatchOptions, fd: fd, watched: &state.watched)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Watch descendants of directories moved into the tree

When an existing directory tree is moved atomically into a watched root, this handler adds a watch only for the top-level moved directory; inotify watches are not recursive. Subsequent edits inside descendants that already existed at move time therefore emit no callbacks, violating FSWatch's recursive-directory contract and leaving hot reload or project refresh stale after common directory-swap operations. Enumerate and add watches for the moved directory's descendants as start() does.

Useful? React with 👍 / 👎.

@SpectralDragon
SpectralDragon merged commit 28d91c6 into main Oct 17, 2026
3 of 5 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