diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-19 08:10:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 11:40:11 -0300 |
| commit | 3f0261245d69e015d4caea0432aefa97747d02ad (patch) | |
| tree | 602c3c21858cef0c2a9c97530c7782931cc9f612 /runtime | |
| parent | d2f854de898cb84776e9f56ece0ec9e9c548e27d (diff) | |
| download | pardes-3f0261245d69e015d4caea0432aefa97747d02ad.tar.gz pardes-3f0261245d69e015d4caea0432aefa97747d02ad.zip | |
replicas: the soak runs THE client loop, the one the terminal and the window run (the reorganisation's runners, step 10b, its second part; the user's rule: replica bugs caught by a soak that does what real use does, twice hidden by a hand-written imitation): each client of test/replicas.zig is runtime/client.zig's Loop over a frontend of the soak's own (a terminal's or a window's by turns: it draws no pixels but counts its frames and keeps the facts a window reads; a window's size posted from its own pass; a terminal holds a key already one pass in four, so no copy then; its wait is the delayed link's next message, a wake it asks for one timer at a time on the soak's clock), driven as a loop woken from outside (Loop.pass up to its wait, Loop.woken after what woke it), so its mirrors of the two loops are deleted (Client.draw, own, within, pass, and the quiet check imitated on the soak's clock: the link's own quietCheck now runs, its clock the soak's through Link.now as Echo.now is); its host has every entry (replica.everyEntry, which 12b's FullHost is now too: pty_resize, watch_file, watch_theme, open_link, pipe, search and the rest do nothing unless the soak's), and an input whose stop's name replica.may_wait does not list fails the run, said with its input (replica.mayWait; the soak's random inputs cannot be named as the walk names them, so by the name alone): the soak found seven names the list did not have, all a far client's by design, now rows with why (Search's rows, a session worker's: `search`; a +Preview's file, the session's disk: `preview`; a kind whose state is its own on the session, a PDF's, its search, a place in it, its word, its open and its close: five rows on a new pane kind `addon`, which the walk does not stand in and never judges stale); the stops by name, the wakes asked and the frames drawn are a line per rtt; the leftovers go (Stats.unspeculated and its column, Proc with enter and current: the distrusted list is the client's, the stale comment about config.tab_now); and a new check, the frame corpus through a client (corpusCase): the corpus's scenes (a wheel, a click, a jump, TaglineSize, a markdown file, three columns, a dirty pane, InactiveDim, WindowOpacity, ligatures, Zerox, a resize) typed into a session's own view drawn by its own pump and, the same, through the client loop into a client's view of a second session of the same files, the session's unit back at once; after each, the two frames a frontend draws from (cells, cursor, chrome, regions, the facts beside them, the placements) are the same: 22 scenes, 25 frames own and 24 through the client, every one the same. Gate: the soak on the shared loop (--clients 5, 4 seeds) diverged 0, unequal 0, deltas wrong 0, quiet checks 489/0, 556/0, 700/0, mispredicted 32/36/43, stopped 87/43/81 of 1784/1806/1977 at rtt 30/80/207 (pty_write 54/9/47, the kinds' 20/19/20, resolve 6/8/4, search 2/4/4, the authority's own state 3/2/3, close a terminal 0/0/3, kind 1/0/0, detach 1/1/0), unlisted 0, 216 s (the base's 230 s); 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 2 of 144 failed (lspcomplete and lspcompletemoved, the base's); gui unit-test 1612/1616 with the base's BaselineHarnessMismatch; daemon.py plain, --far, --games, --window-clients, --upgrade from pardes-tree's pfx-base to this and back; the macOS library for Linux and aarch64-macos and the FreeBSD tui configure; rollback-bench runs; gate-w run3-2 against tree1: frames 77/77 byte-identical in Debug, the alternated windows' pictures identical in all 10 runs, corpus2x -0.055% (PASS), perfops 97 counts within 0.1% (largest image-frame on large +0.031%); its unit-test 1608/1616: the gate was started in the background (`&`), so SIGINT was ignored down to its test shells and the four host_io tests whose Ctrl-C must end a foreground job failed; the same unit-test run detached but not so (setsid, no terminal) 1612/1616 with the base's BaselineHarnessMismatch only
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/client.zig | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/runtime/client.zig b/runtime/client.zig index 28ed6a52..7ba9e790 100644 --- a/runtime/client.zig +++ b/runtime/client.zig @@ -142,8 +142,7 @@ pub fn Loop(comptime Frontend: type) type { var done: std.atomic.Value(bool) = .init(false); const reader = try std.Thread.spawn(.{}, read, .{ l, s, &done }); while (!link.quit) { - const ms = l.before() orelse break; - l.fe.wait(l, ms); + if (!l.pass()) break; l.after(); } if (s.env.get("PARDES_REPLICA_STATS")) |file| link.writeStats(file); @@ -182,6 +181,23 @@ pub fn Loop(comptime Frontend: type) type { l.fe.ended(); } + /// A pass up to its wait, and the wait: false when the frontend + /// ended the loop. + pub fn pass(l: *L) bool { + const ms = l.before() orelse return false; + l.fe.wait(l, ms); + return true; + } + + /// The loop of a frontend that is woken from outside (the soak's, + /// test/replicas.zig, whose clock and link are a simulation's): + /// what woke it taken already (`input`, `take`), the rest of the + /// pass and the next up to its wait, as `run` goes round. + pub fn woken(l: *L) void { + l.after(); + if (!l.link.quit) _ = l.pass(); + } + /// A pass up to its wait: the frontend's own work, its predicted /// echo judged and caught up (once a frame), its view drawn if /// anything changed (else its own motion moved on), and how long |
