From a18b99e1e0862de4b3c8fd55e0fd816fe2dca621 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 21:02:38 -0300 Subject: abi, runtime, dev/macos, test, docs: what the macOS host lends the core is `Callbacks` in runtime/macos.zig and `pardes_callbacks_s` in abi/pardes.h and the Swift, no longer `Runtime` and `pardes_runtime_s` (P18, the user's ruling on the tree step's name collisions: the type's name collided with the directory `runtime/`; the C name follows so the three sides keep one name): the header's typedef, its use in `pardes_init`'s declaration and its section banner; the Zig type, its four uses (the State field's type, `pardes_init`, `initCore`) and the ABI guard's line; the Swift's two constructors (dev/macos/Sources/AppDelegate.swift 135, test/macos_e2e.swift 171) and that file's comment naming "the runtime struct"; docs/macos.md (two lines) and docs/ghostty-macos-notes.md (two lines) naming the struct; the field and parameter named `runtime` stay (not ruled); a rename only, nothing else on any line; the macOS library is not in the tape, so the semantics hash does not move; the Swift app cannot be built here: the header and the Zig agree by the ABI guard (`unit-test -Dplatform=macos -Dtest-filter="pardes.h matches the Zig boundary"` on Linux, 1/1, which reads the header through translate-c (build/macos.zig) and compares `@sizeOf(c.pardes_callbacks_s)` with `Callbacks`), the Swift by reading (the two constructors name the typedef the header declares, with its unchanged field labels); tui core-test 848/991 (143 skipped), shell-test 1027/1030, the window builds (`install -Dplatform=gui`), the macOS library for Linux and aarch64-macos and the FreeBSD cross-build rc 0, under a load of 34 to 57 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/macos_e2e.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/macos_e2e.swift') diff --git a/test/macos_e2e.swift b/test/macos_e2e.swift index 74a03200..38d27808 100644 --- a/test/macos_e2e.swift +++ b/test/macos_e2e.swift @@ -51,7 +51,7 @@ private struct ScriptError: Error { } /// What the three C callbacks reach through `userdata`. A class, because a C -/// function pointer cannot capture: a pointer the runtime struct carries is the +/// function pointer cannot capture: a pointer the callbacks struct carries is the /// only way back into Swift state. private final class Host { /// Set by `wakeup`, which runs on a pty reader thread. Nothing else in the @@ -168,7 +168,7 @@ private final class Driver: PardesViewDelegate { message: "the view measured \(got.cols)x\(got.rows) cells, not the \(cols)x\(rows) the script asked for") } - var runtime = pardes_runtime_s( + var runtime = pardes_callbacks_s( userdata: Unmanaged.passUnretained(host).toOpaque(), wakeup: { ud in // A pty reader thread. One flag and out — see Host.woke. -- cgit v1.3