Skip to content

renderer: add terminal-independent scene worker ABI - #125

Draft
lawrencecchen wants to merge 8 commits into
mainfrom
feat/cmux-render-scene
Draft

renderer: add terminal-independent scene worker ABI#125
lawrencecchen wants to merge 8 commits into
mainfrom
feat/cmux-render-scene

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 18, 2026

Copy link
Copy Markdown

Summary

  • split renderer capture from projection with an owned, pointer-free semantic scene
  • add bounded full/delta scene encoding and decoding for external render workers
  • add a standalone Metal scene renderer that targets IOSurface without creating a PTY, termio, Surface, or canonical terminal
  • serialize resolved Ghostty configuration for worker-local renderer setup
  • expose canonical selection and search helpers required by remote terminal interactions
  • label worker Metal command buffers, encoders, and textures for process-scoped trace proof

Dependency

cmux integration: manaflow-ai/cmux#8378

Verification

  • 4,749 lib-vt tests exercised; only the pre-existing PageList viewport-offset failures reproduced in both static and shared modes
  • focused scene codec, materialization, config serialization, sparse color, selection/search, and allocation-failure tests pass
  • real standalone Metal IOSurface smoke passes
  • universal signed cmux renderer helper exports the scene renderer ABI and completes its authenticated child handshake
  • C header syntax, Zig formatting, and diff checks pass

Draft while cmux completes leases, durable topology state, advanced Kitty/custom-shader parity, tagged restart tests, and process-scoped Metal profiling.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Adds a terminal‑independent semantic scene renderer ABI with a standalone Metal renderer targeting IOSurface, plus macOS‑only GhosttySceneRendererKit for out‑of‑process workers and an isolated GhosttyConfigKit for daemon config. Also instruments process‑lifetime counters for runtime app construction, PTY‑master opens/allocations, and surface constructors for external observability.

  • New Features

    • Completed GhosttyRenderSceneEncoder with bounded full/delta codec and C APIs in ghostty/vt/render_scene.h.
    • Exposed standalone worker C ABI in ghostty_scene.h (ghostty_scene_init, frame leases/metadata, health events); shipped GhosttySceneRendererKit.xcframework.
    • Added config‑only C ABI in ghostty_config.h (ghostty_config_init, recursive load/finalize, ghostty_config_serialize); shipped GhosttyConfigKit.xcframework.
    • Added Metal scene init without CALayer with labeled GPU trace; Kitty capture/replay (incl. animation), sparse OSC 8 hyperlink capture, selection/search helpers, and ghostty_key_from_macos_keycode.
    • Added smoke/audit tests for the scene renderer and config kits.
  • Migration

    • New build flags: emit-lib-vt-shared (native only), emit-scene-xcframework, and emit-config-xcframework.
    • Static xcframework library renamed to libghostty-internal.a.
    • Embedders should:
      • Use ghostty_scene_renderer_* from ghostty_scene.h for worker rendering (and call ghostty_scene_init).
      • Use ghostty_render_scene_* from ghostty/vt/render_scene.h to capture/encode terminal scenes for workers.
      • Use ghostty_config_* from ghostty_config.h for daemon config resolution and serialization.
      • Replace custom macOS keycode tables with ghostty_key_from_macos_keycode.

Written for commit 0e750d5. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 428f9cdd-c361-470c-8e30-7f192bc5a39c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cmux-render-scene

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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