summaryrefslogtreecommitdiff
path: root/test/replicas.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/replicas.zig')
-rw-r--r--test/replicas.zig26
1 files changed, 7 insertions, 19 deletions
diff --git a/test/replicas.zig b/test/replicas.zig
index a122ac9f..d9834209 100644
--- a/test/replicas.zig
+++ b/test/replicas.zig
@@ -407,29 +407,17 @@ fn screenHash(t: *screen_state.Terminal) u64 {
return h.hasher.final();
}
-/// A process's own globals, where the soak runs the session and every
-/// client in one: a step writes `config.tab_now` from its core's settings
-/// (exec.zig's Tab, a dump's load), which a client's process and the
-/// session's each hold apart. Shared, one core's rollback that left it
-/// stale would leave the other cores reading it too, and agree. And the
-/// kinds a client caught breaking PA_PLAIN (Addon.distrust): shared, one
-/// client's catch would leave every other without the kind's code at its
-/// next join, never to run it (and diverge) again.
+/// What a client's process holds apart from the session's, where the soak
+/// runs them all in one: the kinds it caught breaking PA_PLAIN, handed to
+/// each core it joins with (`Options.distrusted`). No process global stands
+/// in for a core's state any more (the tab's width is the core's): `enter`
+/// and `current` are left for the loops' rewrite to delete.
const Proc = struct {
- tab_now: u16 = pardes.config.tab_width,
- distrusted: @TypeOf(pardes.Addon.distrusted) = undefined,
- ndistrusted: usize = 0,
+ distrusted: pardes.Addon.Distrusted = .{},
var current: ?*Proc = null;
fn enter(p: *Proc) void {
- if (current == p) return;
- if (current) |was| {
- was.tab_now = pardes.config.tab_now;
- was.distrusted, was.ndistrusted = .{ pardes.Addon.distrusted, pardes.Addon.ndistrusted };
- }
- pardes.config.tab_now = p.tab_now;
- pardes.Addon.distrusted, pardes.Addon.ndistrusted = .{ p.distrusted, p.ndistrusted };
current = p;
}
};
@@ -1115,7 +1103,7 @@ fn run(r: Run, dir: []const u8, totals: *Totals) !void {
try totals.add(&old.stats);
old.deinit();
}
- const rp = try replica.Replica.initDump(gpa, cl.id, cl.view, m.bytes, .{ .cols = cl.cols, .rows = cl.rows });
+ const rp = try replica.Replica.initDump(gpa, cl.id, cl.view, m.bytes, .{ .cols = cl.cols, .rows = cl.rows, .distrusted = &cl.proc.distrusted });
cl.r = rp;
rp.stats.samples = true;
rp.t.local_files = true;