From 6cb07327b717603be983fdd6df0e6d9009aae39a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 16:00:52 -0300 Subject: replica: what stopped each input's speculation is counted by name (PARDES_REPLICA_STATS's `stops`: a host function's, a site's, or a poison's reason, which tape.poison now takes; PARDES_REPLICA_TRACE says it with the input); a window client's PARDES_TEST_LATENCY says each input (`I seq ns at-once`) and, after each unit, the first of its own not confirmed (`U ns seq`), so a harness finds the frame that shows an input that waited Co-Authored-By: Claude Opus 5.5 --- src/gui/gui.zig | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/gui/gui.zig') diff --git a/src/gui/gui.zig b/src/gui/gui.zig index be287647..dd21680f 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -2627,7 +2627,14 @@ const Client = struct { /// What the window's input made, applied at once and sent. fn feed(cl: *Client) void { - for (cl.pending.items) |ev| cl.link.input(ev); + for (cl.pending.items) |ev| { + const r = cl.link.r; + const predicted = r.echo.stats.predicted; + cl.link.input(ev); + // PARDES_TEST_LATENCY: the input, and whether it shows at once + // (applied, or its echo predicted), for the frame that shows it. + latencyNote("I {d} {d} {d}\n", .{ r.next_seq - 1, monoNs(), @intFromBool(r.applied == r.pending.items.len or r.echo.stats.predicted > predicted) }); + } cl.pending.clearRetainingCapacity(); _ = cl.texts.reset(.retain_capacity); } @@ -2651,6 +2658,11 @@ const Client = struct { // PARDES_TEST_LATENCY: when a terminal's delta came (an echo's). if (msg == .screen) latencyNote("S {d}\n", .{monoNs()}); cl.link.take(msg); + // And after a unit, the first of its own inputs not confirmed. + if (msg == .unit) { + const r = cl.link.r; + latencyNote("U {d} {d}\n", .{ monoNs(), if (r.pending.items.len > 0) r.pending.items[0].seq else r.next_seq }); + } } cl.taken.clearRetainingCapacity(); if (ended) { -- cgit v1.3