summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 16:00:52 -0300
committerGabriel Schneider <[email protected]>2026-10-30 20:25:56 -0300
commit6cb07327b717603be983fdd6df0e6d9009aae39a (patch)
tree7a8519b0ddb7292ac2042f2b95e49998c4c36d4d /src/gui/gui.zig
parent97431acd8e77410dbaea9fb1093d29327999cd5b (diff)
downloadpardes-6cb07327b717603be983fdd6df0e6d9009aae39a.tar.gz
pardes-6cb07327b717603be983fdd6df0e6d9009aae39a.zip
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 <[email protected]>
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig14
1 files changed, 13 insertions, 1 deletions
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) {