From 261a652706c11615932b090f6572aa1732bff737 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 20:55:36 -0300 Subject: test: the frame corpus's click is one write, so a loaded machine no longer keeps a 78th frame: `d.mouse("down")` and `d.mouse("up")` were two writes to the window's pty, and its test feed (dev/gui/gui.zig StdinFeed.pump) dispatches what one read gives, so a loaded window could read the press alone, draw its frame, and read the release a pass later: one more frame in the click scene, which keeps every frame, and every kept frame after it shifted (the coordinator's failure: 78 frames, 56 differ from frame 16, the click's first; made at will with 200 ms between the two writes: 78, 56 differ, the click scene 14 frames against 13; plain loaded runs 0 of 6 at load 12-44); the press and release now go in one write, one read, one pass, one step; nothing reads real time (the virtual clock was never the cause), and the window draws no extra frame a user's would not (a real click's two events are always apart); after: frames 77/77 in the quiet gate (gpu/robust-q, load ~25) and in 4 loaded runs at load 17-44, and 3 more runs after the change at load 29-41 with 16 busy loops of mine at nice 15, 77/77 each (the loaded gate itself reached no frame count: the window answered the snake's `Addon load` past the 9P client's 2 s reply deadline at load 46-50, runtime/9p_io.zig:1174, a deadline of the runtime's, said in the report) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/window.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/process') diff --git a/test/process/window.zig b/test/process/window.zig index 687b9000..00450a9b 100644 --- a/test/process/window.zig +++ b/test/process/window.zig @@ -426,8 +426,11 @@ fn corpus(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try d.mouse("wheel", -3, cell_w * 40, cell_h * 12); try k.keep(&d, from, "11 a wheel's glide, every frame", true); from = try k.mark(&d); - try d.mouse("down", 1, cell_w * 20, cell_h * 10); - try d.mouse("up", 1, cell_w * 20, cell_h * 10); + // The press and its release in one write (Detached.mouse's events), + // so the window reads them in one pass: written apart, a loaded + // machine let it read the press alone and draw a frame between, one + // more kept frame than the base's (78) and every one after shifted. + try d.typeKeys(f.at("\x1b]777;mouse;down;1;{d};{d}\x07\x1b]777;mouse;up;1;{d};{d}\x07", .{ cell_w * 20, cell_h * 10, cell_w * 20, cell_h * 10 })); try k.keep(&d, from, "11 a click moves the caret, every frame", true); from = try k.mark(&d); try d.typeKeys("gg"); -- cgit v1.3 From b92578b797e6907a355b23f52b9b5202aa5967e0 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 20:55:36 -0300 Subject: test: three of the known process-test flakes wait on what they need, and grep's golden stops pinning a count still counting: winch typed its long line once `c-b` had started the pane's shell and the screen had held still 600 ms, so a loaded bash echoed it through the kernel before readline was up and drew it again, or ran it before the pane's own `ls` (12 of 20 runs failed, load 38-54; not the 600 SIGWINCHes: the tty drops a WINCH whose size did not change): it now waits for the pane's prompt row after its `ls`; headersweep and headersweep-restored waited for the echo's line, which the command pane's one body row shows only until `exit 0` follows it (10 of 20 failed, the wait timing out on a pane already at `exit 0`): they wait for the tag's `(echo SW''EPT-COL) exit 0`, which stays and names the whole swept command; grep's golden pinned `+Search 0+`, the count while a typed Grep's 80 ms pause and its worker still run, which the quiet machine's 60 ms stable probe caught and a loaded one not (9 of 20 failed): it waits for the query typed in, then for the final `+Search 0 `, and the golden says `0`; after, 50 runs each under load 42-98: winch 0, headersweep (both) 1 (the 8 s cap on the first frame at load 90, not a race), grep 0 of 45 (5 lost to a cache wipe); hscroll, pagercolor and Lspinfo did not fail in 50 runs each (left); cmdexit failed 1 of 50, a product race left for the terminal's owner (the report) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/tty_boot.zig | 15 +++++++++++---- test/process/tty_editing.zig | 6 ++++++ test/snapshots/grep.golden | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'test/process') diff --git a/test/process/tty_boot.zig b/test/process/tty_boot.zig index a5f42074..741f6260 100644 --- a/test/process/tty_boot.zig +++ b/test/process/tty_boot.zig @@ -300,6 +300,9 @@ fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // when it comes up. Both headers used to run the word under the PRESS, on // the press, so a sweep of `echo SWEPT-COL` ran a bare `echo`. A right sweep // looks for what it swept the same way, and the other button cancels. +// What a sweep ran is waited for in its pane's tag, `(echo SW''EPT-COL) exit +// 0`, which stays: the echo's line shows in the pane's one body row only +// until `exit 0` follows it, and a loaded machine draws both in one frame. fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { var t = try Tty.init(gpa, exe, "headersweep"); defer t.deinit(); @@ -321,7 +324,7 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.style("col-sweeping"); try t.drag("middle", "@echo+16", 2); try t.release("middle", "@echo+16", 2); - try t.wait(8000, "SWEPT-COL"); + try t.wait(8000, "EPT-COL) exit 0"); try t.stable(700, 15000); try t.snap("col-swept"); // the workspace tag, the same @@ -335,7 +338,7 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.press("middle", "@echo", 1); try t.drag("middle", "@echo+15", 1); try t.release("middle", "@echo+15", 1); - try t.wait(8000, "SWEPT-WS"); + try t.wait(8000, "EPT-WS) exit 0"); try t.stable(700, 15000); try t.snap("ws-swept"); // a right sweep over part of a word looks for the part: `hay.txt` opens, @@ -399,7 +402,7 @@ fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.style("col-sweeping"); try t.drag("middle", "@echo+19", 2); try t.release("middle", "@echo+19", 2); - try t.wait(8000, "RESTORED-COL"); + try t.wait(8000, "-COL) exit 0"); try t.stable(700, 15000); try t.snap("col-swept"); try t.press("left", "118", 1); @@ -415,7 +418,7 @@ fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.style("ws-sweeping"); try t.drag("middle", "@echo+18", 1); try t.release("middle", "@echo+18", 1); - try t.wait(8000, "RESTORED-WS"); + try t.wait(8000, "-WS) exit 0"); try t.stable(700, 15000); try t.snap("ws-swept"); try t.done(); @@ -869,6 +872,10 @@ fn winch(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.start(31, 100, &.{ "-n", "3" }); try t.stable(700, 20000); try t.key("c-b"); + // Its shell at its prompt after its `ls` (a row of the 50-column pane + // holding `$` alone): typed into earlier, a loaded machine's bash echoed + // the line before its readline was up, or ran it before the `ls`. + try t.wait(20000, "\n $" ++ @as([47]u8, @splat(' '))); try t.stable(600, 8000); try t.send("for i in $(seq 600); do kill -WINCH $PPID; done; echo SUR''VIVED"); try t.key("enter"); diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig index b5f0495c..63c75512 100644 --- a/test/process/tty_editing.zig +++ b/test/process/tty_editing.zig @@ -783,6 +783,12 @@ fn grep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.key("g"); try t.stable(400, 5000); try t.send("zzqq"); + // Its count once the search is over (`0`): `0+` is while it still + // counts (its pause on the clock, then the worker), which a quiet + // machine's frame shows and a loaded one's not. The query typed in + // first: the pane's empty query counts `0` too. + try t.wait(10000, "Grep zzqq"); + try t.wait(10000, "+Search 0 "); try t.stable(700, 10000); try t.snap("nomatch"); try t.key("esc"); diff --git a/test/snapshots/grep.golden b/test/snapshots/grep.golden index 30c8612c..1d8d21ad 100644 --- a/test/snapshots/grep.golden +++ b/test/snapshots/grep.golden @@ -39,7 +39,7 @@ |9: +Search 3/3 Save Unattach Del |13: /tmp/pardes-snap/grep/cwd/sub/b.txt Save Term Collapse Follow Del == snap nomatch grid=180x31 cursor=11,15 -|14: ^ +Search 0+ Del +|14: ^ +Search 0 Del |15: Grep zzqq == snap esc grid=180x31 cursor=12,15 |14: 1 deep -- cgit v1.3