summaryrefslogtreecommitdiff
path: root/runtime/macos.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 23:31:53 -0300
committerGabriel Schneider <[email protected]>2026-11-19 07:26:38 -0300
commit2d30f3781ab40c38710835806a1029359509d27b (patch)
tree282b4cee975ee2d74a53691acd99cfc03d55ef89 /runtime/macos.zig
parent5e162e2e8b208367720b8be8de3bfe51b010aa68 (diff)
downloadpardes-2d30f3781ab40c38710835806a1029359509d27b.tar.gz
pardes-2d30f3781ab40c38710835806a1029359509d27b.zip
frontends: the terminal and the window draw and turn input into events from the frame and one record beside it (the reorganisation's runners, step 10a, on the line as it is now): surface.Facts, the core's (Pardes.facts) and pointed at by the frame it is filled for (Surface.facts), filled by draw.place in the walk over the panes it makes anyway and by a runner after an input it applied (draw.facts), carries what a frontend took from the core (the view's size, cell pixels and row metrics, each open pane's rectangle, tag rows, context rows, serial, whether a terminal whose program takes the wheel or a kind's, its mode, the jumps' back and forward, the settings it draws by); the window keeps a copy (Gui.facts) with the frame it shows (Gui.frame) and its hit tests, wheel, touchpad rows, timedemo, blink, overlays and dim read only those; Host.present returns whether the frame was shown, so present_skipped leaves the core and nothing writes it; the frame statistics are the runner's (Options.frames, Pardes.frames a pointer to them), which the frontends write and the core's draw reads; Replica.draw returns the shown and keeps needs_frame itself, so the two client loops put nothing back; OwnView and Replica.within are deleted (the window client's own pass reads its facts, its inputs fed after each event as before); rollback-bench compiles again; the tape's watched fields lose present_skipped and present answers a bool, so the semantics word moves (0900e560fd6395ef, pardes-seam-b's, -> 2f615168fe07b35f). The first version (psvoxrup, on pardes-tree) kept the record by value in every Surface, and every Surface a tag line builds for a moment copied its 1.3 KB more: +1,556 instructions an image-frame, +3,763 a render (perf record: memcpy); now perfops against tree1 97 counts within 0.1%, largest image-frame +0.029%. Brought onto pardes-seam-b: the client set-up keeps the Distrusted list beside the runner's frame statistics, Options' local fields both, and the rollback test's present answers a bool. Gate: frames 77/77 byte-identical in Debug, the alternated windows' pictures identical in all 10 ReleaseFast runs, corpus2x -0.039% (PASS); tui core-test 836/979 (143 skipped), shell-test 1014/1017, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 275/275, process-test lspcomplete and lspcompletemoved (the base's) and grep (passed alone three times of three); gui unit-test 1612/1616 with the base's BaselineHarnessMismatch; replicas --clients 5 diverged 0, unequal 0, deltas wrong 0, quiet 470/0, 600/0, 764/0; daemon.py plain, --far, --games, --window-clients, --upgrade both ways (from pardes-tree's pfx-base); the macOS library for Linux and aarch64-macos and the FreeBSD tui configure; rollback-bench runs
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime/macos.zig')
-rw-r--r--runtime/macos.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/macos.zig b/runtime/macos.zig
index 9475eb78..3e9c7b9b 100644
--- a/runtime/macos.zig
+++ b/runtime/macos.zig
@@ -1251,7 +1251,7 @@ fn tagCursorCovered(core: *const pardes.Pardes) bool {
return false;
}
-fn presentFrame(ctx: ?*anyopaque, surface: *const pardes.Surface) void {
+fn presentFrame(ctx: ?*anyopaque, surface: *const pardes.Surface) bool {
const st = hostState(ctx);
const tz = tracy.zone(@src(), "presentFrame");
defer tz.end();
@@ -1266,7 +1266,7 @@ fn presentFrame(ctx: ?*anyopaque, surface: *const pardes.Surface) void {
st.gpa.alloc(Cell, count)
else
st.gpa.realloc(st.cells, count);
- st.cells = resized catch return;
+ st.cells = resized catch return true;
}
}
st.frame_len = count;
@@ -1279,6 +1279,7 @@ fn presentFrame(ctx: ?*anyopaque, surface: *const pardes.Surface) void {
}
blankTagCells(st.cells[0..count], surface.cols, surface.rows, surface.cells, &surface.tag_layers);
collectImages(st, surface);
+ return true;
}
fn collectImages(st: *State, surface: *const pardes.Surface) void {