summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 23:20:38 -0300
committerGabriel Schneider <[email protected]>2026-11-22 23:20:38 -0300
commite6dd9c5c3a60e3609e99ab2076b5a2509a014a66 (patch)
tree59e10d535fbb5ddf1a971c391e0e6b0981a6d409 /dev
parent6270f531cd89130a26ee3d5423a740db707f8888 (diff)
parent9e5b54cfdf73728745d2aeaafac00d823114543e (diff)
downloadpardes-e6dd9c5c3a60e3609e99ab2076b5a2509a014a66.tar.gz
pardes-e6dd9c5c3a60e3609e99ab2076b5a2509a014a66.zip
integration (a base for the next rounds, not yet the gathered line): the pair's round 12 on the viewport's line with a client's way back: pardes-m60-base (`pyquvrsv`: pardes-viewport + pardes-upgrade-back) and pardes-pair-12 (`mlutslkp` on `ntlpyokw` on `zsquynqy` on `wowqsyxt`, on pardes-raw-tty: a 9P request that changes the core waits for the pty output read before it (`Turn.awaitOutput`: pagercolor's cause on both paths); a pair's client takes the tests' clock; the pair rows name the side that went; the soak with a pair among its sides); no conflict; core-test 918/1078 (160 skipped), shell-test 1120/1123 (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev')
-rw-r--r--dev/Inbox.zig8
-rw-r--r--dev/gui/gui.zig2
-rw-r--r--dev/tui/tui.zig14
3 files changed, 18 insertions, 6 deletions
diff --git a/dev/Inbox.zig b/dev/Inbox.zig
index d733b971..1df516cb 100644
--- a/dev/Inbox.zig
+++ b/dev/Inbox.zig
@@ -118,7 +118,9 @@ pub fn acceptReader(q: *Inbox, pane: pardes.Pane.Id, gen: u32) void {
/// One of `pane`'s reads applied, or dropped unapplied.
pub fn applied(q: *Inbox, pane: pardes.Pane.Id) void {
const n = &q.unapplied[pane.index()];
- if (n.load(.acquire) > 0) _ = n.fetchSub(1, .acq_rel);
+ if (n.load(.acquire) == 0) return;
+ _ = n.fetchSub(1, .acq_rel);
+ pardes.turn.outputApplied();
}
pub fn cancelReader(q: *Inbox, pane: pardes.Pane.Id, gen: u32) void {
@@ -316,8 +318,10 @@ fn readPty(q: *Inbox, pty: std.Io.File, pane: pardes.Pane.Id, gen: u32) void {
},
};
if (n == 0) continue;
- // Counted at once: out of the pty, the poll no longer sees it.
+ // Counted at once: out of the pty, the poll no longer sees it,
+ // nor a write after it (Turn.awaitOutput).
_ = q.unapplied[pane.index()].fetchAdd(1, .acq_rel);
+ _ = pardes.turn.reads.fetchAdd(1, .acq_rel);
const bytes = q.gpa.dupe(u8, buf[0..n]) catch |err| {
q.applied(pane);
failure = err;
diff --git a/dev/gui/gui.zig b/dev/gui/gui.zig
index 3193d966..b00073fa 100644
--- a/dev/gui/gui.zig
+++ b/dev/gui/gui.zig
@@ -2696,7 +2696,7 @@ fn waitInput(ctx: ?*anyopaque, timeout_ms: u32) void {
s.held = null;
if (held) |h| sev = h;
// The wait is the 9P connections' turn with the core.
- pardes.turn.rest();
+ pardes.turn.listen();
const got = held != null or c.SDL_WaitEventTimeout(&sev, ms);
pardes.turn.wake();
// A virtual clock: while a render-time animation moves, each loop
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig
index 5d75722f..d1bbe140 100644
--- a/dev/tui/tui.zig
+++ b/dev/tui/tui.zig
@@ -791,6 +791,9 @@ pub fn runClient(init: std.process.Init, opts: pardes.Options, path: []const u8,
.client = &c,
.peers = &no_peers,
.ptys = &no_ptys,
+ // Its own motions (the glide) on the case's clock, as a session's
+ // own terminal's (`Own.open`).
+ .test_clock = host_io.testClock(),
};
tty = .{ .sh = &sh, .screen = &screen, .loop = &loop, .joins = &start };
no_inbox.wake_fn = Shell.wakeForQueue;
@@ -1490,11 +1493,16 @@ const Shell = struct {
} else next: {
if (wait != 0) {
// A virtual clock moves a frame a wake while the tty's own
- // motions move (the glide), as the real one would.
- s.wake_to = s.core.nextWake() orelse if (s.moving()) s.core.clock.now_ns + pardes.frame_ns else 0;
+ // motions move (the glide), as the real one would: a
+ // client's from where it is, its core's clock and wakes
+ // the session's, still between units.
+ s.wake_to = if (s.client != null)
+ (if (s.moving()) (s.test_clock orelse 0) + pardes.frame_ns else 0)
+ else
+ s.core.nextWake() orelse if (s.moving()) s.core.clock.now_ns + pardes.frame_ns else 0;
requestWake(s.io, wait);
}
- pardes.turn.rest();
+ pardes.turn.listen();
const got = s.loop.nextEvent() catch {
pardes.turn.wake();
if (s.client) |c| c.link.quit = true;