diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-22 21:20:39 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-22 21:47:56 -0300 |
| commit | 0593b639b584e272518562e587f2a02cdfad8f5a (patch) | |
| tree | c34a19162ba5b8d4719564f30f57d40a1941df2d /dev/tui | |
| parent | 1017496cc9c7e95a39b93928653e7ff338069152 (diff) | |
| download | pardes-0593b639b584e272518562e587f2a02cdfad8f5a.tar.gz pardes-0593b639b584e272518562e587f2a02cdfad8f5a.zip | |
tty: a pair's client glides on the case's clock, as the session's own terminal does: its Shell was built in `runClient` with no `test_clock`, so under PARDES_TEST_CLOCK its glide (dev/glide.zig: a scroll's picture, critically damped, at whole rows: a one-row glide's first frames keep the old rows) ran on the real clock, frames 16 ms apart with the process asleep between them, longer than a case's stable probe waits (test/tty.zig `waitStable`'s fast path, 50 ms unchanged and 10 ms asleep): process-test's `themesel` as a pair snapped the list's selection moved and the list not yet scrolled, 0 of 10 first time pinned to one CPU (the runner's retry, its probes wider, waited the glide out: why the retry always passed, open since pair-8); and the clock alone was not enough (0 of 10, now at the first scroll every time): the virtual clock jumps at each wake to `wake_to`, which `Shell.waitOnce` set from the core's clock, and a client's core clock is the session's, still between units, so its glide never moved: a client's `wake_to` while it glides is its own virtual clock plus a frame (the session's own unchanged); a user cannot hit it (the clock is the tests'); themesel as a pair pinned after: 10 of 10 first time; process-test as pairs 0 of 146 failed but for `root-ctl: Exit is answered` once (a detached start's socket not there in 20 s at load 8.6; 10 of 10 alone pinned), `tty boot: ninep`'s dial refused once in the parallel batch and passed alone (the base's, pardes-raw-tty's words), own path 0 of 146 with none failing first time
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/tui')
| -rw-r--r-- | dev/tui/tui.zig | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/dev/tui/tui.zig b/dev/tui/tui.zig index ec5a3309..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,8 +1493,13 @@ 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.listen(); |
