summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 21:32:26 -0300
committerGabriel Schneider <[email protected]>2026-11-19 21:52:58 -0300
commit1ce129e7415590a4979e71da683966c056fba532 (patch)
tree27bd06ca05c52e667384a81e4ba85e245f481568
parent0db34fbf28e70c8c6a3c6025c0888fc5ec75201c (diff)
downloadpardes-1ce129e7415590a4979e71da683966c056fba532.tar.gz
pardes-1ce129e7415590a4979e71da683966c056fba532.zip
replica: a client's stats line (PARDES_REPLICA_STATS) prints its rebases, copies and checks, and `rebases` counts only a rebase that puts the copy back under inputs applied on top (the kept units replayed, the inputs applied again), not the free let-go with nothing applied: the three counters that name a heavy block of the client path were kept and never printed (pardes-perf-plan section 1 repair 3); no behaviour changes
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
-rw-r--r--core/replica.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/replica.zig b/core/replica.zig
index c68848f2..3a36a06b 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -568,6 +568,8 @@ pub const Stats = struct {
/// the authority did not share), or another's unit first.
mispredicted: u32 = 0,
foreign: u32 = 0,
+ /// The copy put back at `rebase_after` kept units with inputs applied
+ /// on top: the kept units replayed, the inputs applied again.
rebases: u32 = 0,
units: u32 = 0,
/// Its digest compared with the session's (a unit's, or quiet).
@@ -1041,13 +1043,13 @@ pub const Replica = struct {
const kept = r.gpa.dupe(u8, unit) catch return r.fail("out of memory");
r.since.append(r.gpa, kept) catch return r.fail("out of memory");
if (r.since.items.len >= rebase_after) {
- r.stats.rebases += 1;
// Nothing on top: it is the confirmed state already.
if (r.applied == 0) {
r.copy.release();
rollback.Epoch.select(null);
return r.clearSince();
}
+ r.stats.rebases += 1;
r.toConfirmed();
r.dirty = true;
}
@@ -3241,13 +3243,13 @@ pub const Link = struct {
var buf: [1024]u8 = undefined;
const e = &c.r.echo.stats;
var w: std.Io.Writer = .fixed(&buf);
- w.print("inputs {d} at_once {d} stopped {d} units {d} fast {d} neutral {d} mispredicted {d} foreign {d} visible {d} rtt_us {d} spec_us {d}/{d} copy_us {d}/{d} rollback_us {d}/{d} join_ms {d} blobs {d} from_memory {d} from_disk {d} sent_kb {d} echo {d}/{d} confirmed {d} missed {d} draws {d} again {d}", .{
+ w.print("inputs {d} at_once {d} stopped {d} units {d} fast {d} neutral {d} mispredicted {d} foreign {d} visible {d} rtt_us {d} spec_us {d}/{d} copy_us {d}/{d} rollback_us {d}/{d} join_ms {d} blobs {d} from_memory {d} from_disk {d} sent_kb {d} echo {d}/{d} confirmed {d} missed {d} draws {d} again {d} rebases {d} copies {d} checks {d}", .{
st.inputs, st.speculated, st.stopped, st.units, st.fast,
c.r.neutral, st.mispredicted, st.foreign, c.visible, c.r.rtt_ns / 1000,
pctOf(st.spec_ns.items, 50) / 1000, pctOf(st.spec_ns.items, 99) / 1000, pctOf(st.copy_ns.items, 50) / 1000, pctOf(st.copy_ns.items, 99) / 1000, pctOf(st.rollback_ns.items, 50) / 1000,
pctOf(st.rollback_ns.items, 99) / 1000, c.join_ms, c.join.blobs, c.join.from_memory, c.join.from_disk,
c.join.sent_bytes >> 10, e.predicted, e.predicted + e.unpredicted, e.confirmed, e.mispredicted,
- c.draws, c.again,
+ c.draws, c.again, st.rebases, st.copies, st.checks,
}) catch return;
// What stopped its inputs, last: a word a pair before it.
w.writeAll(" stops ") catch return;