summaryrefslogtreecommitdiff
path: root/src/tape.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/tape.zig')
-rw-r--r--src/tape.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tape.zig b/src/tape.zig
index 12f7fe3d..4759d598 100644
--- a/src/tape.zig
+++ b/src/tape.zig
@@ -257,6 +257,11 @@ pub const Tape = struct {
/// (src/replica.zig): its clock reads (a message's stamp, a file's
/// mtime) answer this instead of the clocks here.
guess: ?Guess = null,
+ /// The same guess, as the client sent it with its input, while the
+ /// authority steps that input: the step's clock reads are the input's
+ /// time, so the guess a speculation recorded is what the authority
+ /// records (a message's millisecond, an edit's second never miss).
+ stamp: ?Guess = null,
fn record(t: *Tape, kind: Kind, comptime T: type, v: *const T) void {
t.scratch.clearRetainingCapacity();
@@ -914,7 +919,7 @@ fn call(comptime s: Site, a: ?std.mem.Allocator, comptime f: anytype, args: anyt
t.poisoned_by = @tagName(s);
return poisonOf(R);
}
- if (comptime s == .clock or s == .mtime) if (t.speculating) if (t.guess) |g| {
+ if (comptime s == .clock or s == .mtime) if (if (t.speculating) t.guess else t.stamp) |g| {
const r = guessed(R, g);
t.record(.host, u16, &id);
t.record(.ret, R, &r);