diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 23:57:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-18 00:29:40 -0300 |
| commit | 137be286869241d19ea60ecb7737957d861162d7 (patch) | |
| tree | 854878c3a2152195b95d6b469c011db5a0d7e6a7 | |
| parent | 9b20d00ca5ffbab640b87249d65e4165414d22c1 (diff) | |
| download | pardes-137be286869241d19ea60ecb7737957d861162d7.tar.gz pardes-137be286869241d19ea60ecb7737957d861162d7.zip | |
kinds: a PA_PLAIN kind runs in the client that shows it (the games and veil): its head says its whole state is the one block its open allocates, plain bytes changed only by its calls, each a function of the block and what the call is handed (no statics, clock, randomness or file of its own; tick is not told PA_FRAMED); the core keeps the block (Kind.Slot.plain, the core's memory, a client's rollback epoch, which the copy saves) and its hash after each call is the call's taped outcome and in the digest (Slot.state), so a client whose block came out otherwise is caught at that call, joins again, and runs the session's frames of it from then (Addon.distrust); a client loads its own code for the kind by name, version, ABI and functions (Addon.plainOps; its scan only when the session has one), opens each such pane from the session's block byte for byte (dump.plainHere; the block is the dump's record, the kind's load given it at a Restore alone), speculates its keys, mouse and the tick after them, and draws it; one without the addon draws a line saying so; the session sends no Shadow for these panes; snake, life, snake_shader and veil say PA_PLAIN; test/liar.zig, a kind whose tick reads the clock; test/daemon.py --games: snake and life focused in two clients while a third types text for 30 s, keys stopped 0 and 0 of 451 and 450 (the base: 33 of 36 stopped in a tty client), rollbacks 385, 345, 366, every digest agreed, and the liar caught at its tick, its client joined again once and agreed; the GPU snake focused in a window client (offscreen) of a terminal's session and of a window's steps every 200 ms (2, 3, 4, 5, 7, 8, 9, 10, 12, 13), keys stopped 0 of 27, its digest agreed; the snake_shader's load tidying hover and timers made a client's block another than the session's at the first tick, caught so, hence the block itself in the dump; running.typ says a plain addon runs in a client; perf --only medium --reps 10 instructions:u 2,459.25M (base) -> 2,459.23M, --terminal-mib 8 3,928.50M -> 3,928.50M; tui core-test 811/950 (139 skipped), shell-test 993/996, pane-test 180/181, replicas pass (diverged 0, checked/wrong 0), behaviour-test 269/273 (the four addon ABI tests the base fails), --replay 20 seeds 0 failures, addon-test 157/157 steps 5/5, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's; winch failed once under load and passes alone), test/daemon.py, --far and --games pass; gui unit-test 1582/1590 (the base's), the frame corpus 77/77 against mbase, test/daemon.py --window-clients passes (its PDF window case skipped: no pdf.so built)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| -rw-r--r-- | addons/life/life.zig | 2 | ||||
| -rw-r--r-- | addons/snake/snake.zig | 2 | ||||
| -rw-r--r-- | addons/snake_shader/snake_shader.zig | 2 | ||||
| -rw-r--r-- | build/tests.zig | 7 | ||||
| -rw-r--r-- | docs/typ/running.typ | 10 | ||||
| -rw-r--r-- | src/Addon.zig | 33 | ||||
| -rw-r--r-- | src/Kind.zig | 98 | ||||
| -rw-r--r-- | src/dump.zig | 37 | ||||
| -rw-r--r-- | src/kinds/addon.zig | 6 | ||||
| -rw-r--r-- | src/kinds/pardes_addon.h | 14 | ||||
| -rw-r--r-- | src/replica.zig | 12 | ||||
| -rw-r--r-- | src/tape.zig | 6 | ||||
| -rw-r--r-- | test/daemon.py | 121 | ||||
| -rw-r--r-- | test/liar.zig | 45 | ||||
| -rw-r--r-- | test/panes.zig | 1 | ||||
| -rw-r--r-- | test/veil.zig | 2 |
16 files changed, 357 insertions, 41 deletions
diff --git a/addons/life/life.zig b/addons/life/life.zig index 278990f8..254f248d 100644 --- a/addons/life/life.zig +++ b/addons/life/life.zig @@ -23,7 +23,7 @@ const Life = extern struct { paused: bool, next: addon.Deadline, - pub const head: addon.Head = .{ .name = "life", .version = 1, .words = &.{.{ .name = "Life", .opens = true, .doc = "a pane of Conway's Game of Life" }} }; + pub const head: addon.Head = .{ .name = "life", .version = 1, .plain = true, .words = &.{.{ .name = "Life", .opens = true, .doc = "a pane of Conway's Game of Life" }} }; pub fn open(s: *Life, _: ?[]const u8, _: ?[]const u8) void { s.seed = addon.seed(); diff --git a/addons/snake/snake.zig b/addons/snake/snake.zig index dab5846e..5d1e06db 100644 --- a/addons/snake/snake.zig +++ b/addons/snake/snake.zig @@ -23,7 +23,7 @@ pub const Snake = extern struct { rng: u64, next: addon.Deadline, - pub const head: addon.Head = .{ .name = "snake", .version = 1, .words = &.{ + pub const head: addon.Head = .{ .name = "snake", .version = 1, .plain = true, .words = &.{ .{ .name = "Snake", .opens = true, .doc = "a game of snake: h j k l steer" }, } }; diff --git a/addons/snake_shader/snake_shader.zig b/addons/snake_shader/snake_shader.zig index d6f803d5..039e07b0 100644 --- a/addons/snake_shader/snake_shader.zig +++ b/addons/snake_shader/snake_shader.zig @@ -53,7 +53,7 @@ pub const Snake = extern struct { hover_x: i16, hover_y: i16, - pub const head: addon.Head = .{ .name = "snake_shader", .version = 2, .words = &.{ + pub const head: addon.Head = .{ .name = "snake_shader", .version = 2, .plain = true, .words = &.{ .{ .name = "SnakeShader", .opens = true, .doc = "a resizable game of snake: h j k l steer, r restarts" }, } }; diff --git a/build/tests.zig b/build/tests.zig index d88655e3..6ed97299 100644 --- a/build/tests.zig +++ b/build/tests.zig @@ -130,7 +130,12 @@ pub fn add(b: *std.Build, c: struct { const snake_lib = b.addLibrary(.{ .name = "snake", .linkage = .dynamic, .root_module = snake_mod }); const life_mod = b.createModule(.{ .root_source_file = b.path("addons/life/life.zig"), .target = c.target, .optimize = c.optimize, .imports = &.{.{ .name = "addon", .module = c.addon_mod }} }); const life_lib = b.addLibrary(.{ .name = "life", .linkage = .dynamic, .root_module = life_mod }); - for ([_]*std.Build.Module{ snake_mod, life_mod, c.parts.image }) |m| addon_test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = m })).step); + // A kind that breaks PA_PLAIN (test/liar.zig), for a client to catch; + // it and the two games into <prefix>/lib, for test/daemon.py's games. + const liar_mod = b.createModule(.{ .root_source_file = b.path("test/liar.zig"), .target = c.target, .optimize = c.optimize, .imports = &.{.{ .name = "addon", .module = c.addon_mod }} }); + const liar_lib = b.addLibrary(.{ .name = "liar", .linkage = .dynamic, .root_module = liar_mod }); + for ([_]*std.Build.Step.Compile{ snake_lib, life_lib, liar_lib }) |lib| addon_test_step.dependOn(&b.addInstallArtifact(lib, .{}).step); + for ([_]*std.Build.Module{ snake_mod, life_mod, liar_mod, c.parts.image }) |m| addon_test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = m })).step); // ...and the pdf addon's, which mupdf-check runs too (its script // opens docs/design.pdf, from the build root). const libs = [_]struct { ?*std.Build.Step.Compile, []const u8 }{ .{ fake_addon_lib.?, "addons/fake/fake" }, .{ snake_lib, "addons/snake/snake" }, .{ c.snake_shader_lib, "addons/snake_shader/snake_shader" }, .{ life_lib, "addons/life/life" }, .{ c.pdf_addon, "addons/pdf/pdf" } }; diff --git a/docs/typ/running.typ b/docs/typ/running.typ index 8177ec39..e78c8f1a 100644 --- a/docs/typ/running.typ +++ b/docs/typ/running.typ @@ -117,7 +117,8 @@ spelling of `attach work`. // same build, handed on); replica.zig:1-19 (speculation and rollback); // replica.zig:2013-2023, views.zig:31, Core.zig:1110-1153 (four views, the // session's own among them); replica.zig:2111-2133 (a client leaving); -// replica.zig:756-757 (a kind's code runs in no replica); gui.zig:2147-2161 +// replica.zig initDump, Addon.zig plainOps (a plain kind's code runs in +// the client that has it; another's in the session alone); gui.zig:2147-2161 // (a client's notch: whole rows sent), :3544 (glideFrame: the picture on // the client's clock); gui.zig:580-608 (a client's font: the session's // request, by the face's name on this machine). Measured 2026-11-17 @@ -137,8 +138,11 @@ truth, rolling back when the session ordered things differently. A session takes three clients: four views at once, its own among them. A client's #word("Detach"), or its terminal or window closing, ends that client only; the last client of a detached session leaves its layout as -the session's, for the next one to find. In a client, an addon's panes -show what the session's code drew (the code runs only in the session). A +the session's, for the next one to find. In a client, an addon whose state +is plain (`PA_PLAIN`: the games) runs in the client that shows it, from +that client's own addons, its keys applied at once; one the client lacks +shows a line saying so; any other addon's panes show what the session's +code drew. A window client's wheel glides as the session's own window does: whole rows go to the session, and the picture moves between them on the client's own clock. It takes the session's font only when the same face is installed on diff --git a/src/Addon.zig b/src/Addon.zig index 80d8fdd8..a2c46b35 100644 --- a/src/Addon.zig +++ b/src/Addon.zig @@ -174,6 +174,7 @@ var found: [Kind.max_kinds]Loaded = undefined; var found_words: [Kind.max_kinds][64]LoadedWord = undefined; var found_text: [Kind.max_kinds][2][4096]u8 = undefined; var nfound: usize = 0; +var scanned = false; /// The addons compiled in (`zig build static`, and any build off Linux): /// the image and pdf modules' `pardes_addon` declarations, which only a @@ -191,6 +192,8 @@ else /// library of the two directories, in name order each, the user's first. A /// library that crashed at its last load is listed, not loaded. pub fn scan() []const Loaded { + if (scanned) return found[0..nfound]; + scanned = true; for (compiled_in) |ops| { found[nfound] = loadedOf(ops, "builtin", @splat(0), &found_words[nfound]); if (ops.init) |init| if (init(&Kind.api) != Kind.c.PA_OK) { @@ -365,10 +368,37 @@ pub fn loadedOf(ops: *const Kind.Ops, path: []const u8, hash: [32]u8, words: *[6 .address = ops.address != null, .view = ops.view != null, .pictures = h.flags & Kind.c.PA_PICTURES != 0, + .plain = h.flags & Kind.c.PA_PLAIN != 0, }, }; } +/// This process's code for a kind a session's core lists, which a client +/// runs itself: PA_PLAIN, of the same name, version, ABI and functions (a +/// compiled-in addon's library hash is 0: never by the hash), and not +/// caught breaking its promise here (`distrust`). Null: its panes say so. +pub fn plainOps(e: *const Kind.Entry) ?*const Kind.Ops { + if (!e.caps.plain or e.refused) return null; + // A client scans for its addons only when its session has a plain kind. + _ = scan(); + for (distrusted[0..ndistrusted]) |*d| if (std.mem.eql(u8, std.mem.sliceTo(d, 0), e.nameOf())) return null; + for (found[0..nfound]) |l| if (l.why.len == 0 and std.mem.eql(u8, l.name, e.nameOf()) and l.version == e.version and + l.abi == e.abi and @as(u16, @bitCast(l.caps)) == @as(u16, @bitCast(e.caps))) return @ptrFromInt(l.ops); + return null; +} + +/// Kinds a client found breaking PA_PLAIN: shown by the session's line +/// from its next join on. +var distrusted: [Kind.max_kinds][16]u8 = undefined; +var ndistrusted: usize = 0; + +pub fn distrust(name: []const u8) void { + if (ndistrusted == distrusted.len) return; + distrusted[ndistrusted] = @splat(0); + @memcpy(distrusted[ndistrusted][0..@min(15, name.len)], name[0..@min(15, name.len)]); + ndistrusted += 1; +} + /// The kind that opens `path`, by its extension (any case). pub fn forPath(r: *const Kind.Registry, path: []const u8) ?u8 { const dot = std.mem.lastIndexOfScalar(u8, path, '.') orelse return null; @@ -411,7 +441,8 @@ pub fn take(r: *Kind.Registry, l: Loaded, except: []const u8) ?[]const u8 { return e.why.slice(); } e.why.set("loaded"); - r.ops[r.n] = if (tape.replaying()) null else @ptrFromInt(l.ops); + // A client's: its own code for a plain kind, or none (the session's). + r.ops[r.n] = if (tape.replaying()) plainOps(e) else @ptrFromInt(l.ops); for (l.words) |w| { r.words[r.nwords] = .{ .kind = r.n, .arg = w.arg, .opens = w.opens }; r.words[r.nwords].name.set(w.name); diff --git a/src/Kind.zig b/src/Kind.zig index 04db2579..14a3fc18 100644 --- a/src/Kind.zig +++ b/src/Kind.zig @@ -5,14 +5,16 @@ //! (`Registry`, what libraries brought, with their words and extensions), //! and a pane's `Slot`, the state the core keeps round the kind's own. //! -//! The core is deterministic and a kind is only the authority's: a -//! replica's core has the same registry (its words, its extensions) but no -//! code for a kind a library brought, and draws its panes from the -//! authority's frames (a Shadow, screen_state.zig). So every call into a -//! kind whose answer the core acts on is made at a place both cores reach, -//! and its `Outcome` (the answer, what it said, a Look) is taped: a replica -//! takes it off the tape. Paint and the reads (body, ctl, a dump) change -//! nothing and are not taped. +//! The core is deterministic and a kind is the authority's: a replica's +//! core has the same registry (its words, its extensions) but no code for a +//! kind a library brought, and draws its panes from the authority's frames +//! (a Shadow, screen_state.zig); but a PA_PLAIN kind, whose state is one +//! plain block the core keeps (`Slot.plain`), runs in a client that has it, +//! as the session runs it. So every call into a kind whose answer the core +//! acts on is made at a place both cores reach, and its `Outcome` (the +//! answer, what it said, a Look, a plain kind's state's hash) is taped: a +//! replica takes it off the tape. Paint and the reads (body, ctl, a dump) +//! change nothing and are not taped. const std = @import("std"); const builtin = @import("builtin"); pub const c = @import("pardes_addon"); @@ -61,7 +63,9 @@ pub const Caps = packed struct(u16) { view: bool = false, /// PA_PICTURES: its tag says how its pictures show, from the first frame. pictures: bool = false, - pad: u6 = 0, + /// PA_PLAIN: its state is its block, which the core keeps (`Slot.plain`). + plain: bool = false, + pad: u5 = 0, }; pub const Entry = struct { @@ -133,7 +137,7 @@ pub const Slot = struct { // jobs' inputs, its file's hash, a placeholder's record), and what // a frame makes (the thumb, the pointer, whether one was drawn: a // view's, never a step's). - .local = .{ "ops", "st", "gpa", "arena", "opened", "reloads", "jobs", "tokens", "record", "thumb_at", "thumb_span", "pointer", "painted", "over", "shadow", "used" }, + .local = .{ "ops", "st", "gpa", "arena", "plain", "opened", "reloads", "jobs", "tokens", "record", "thumb_at", "thumb_span", "pointer", "painted", "over", "shadow", "used" }, }; /// Its kind's code here; null in a placeholder (`live` false: its kind /// not in the registry, its record kept for the day it comes) or a @@ -141,6 +145,14 @@ pub const Slot = struct { ops: ?*const Ops = null, live: bool = false, st: ?*anyopaque = null, + /// A PA_PLAIN kind's whole state, the one block its open allocated + /// (empty until it has): the core's memory (a client's rollback copy + /// saves it), whose hash is `state`. Null for another kind. + plain: ?[]align(16) u8 = null, + /// The hash of `plain` after the kind's last call, as the session's + /// was (the call's outcome, on the tape): in the digest, so a client + /// whose block came out otherwise is caught at that call. + state: u64 = 0, /// The kind's allocations are its arena's, freed at the close. gpa: std.mem.Allocator, arena: std.heap.ArenaAllocator, @@ -223,6 +235,7 @@ pub const Slot = struct { s.gpa.free(s.selection); if (checked) s.used.deinit(std.heap.page_allocator); if (s.shadow) |sh| sh.deinit(s.gpa); + if (s.plain) |b| if (b.len > 0) s.gpa.free(b); s.arena.deinit(); s.gpa.free(s.path); if (s.record) |r| s.gpa.free(r); @@ -241,8 +254,9 @@ fn caps(p: *const Pardes, s: *const Slot) Caps { /// word opened) from `bytes`: made whatever the kind says, with what it /// refused in `slot.refused` for the caller to say. pub fn open(p: *Pardes, id: usize, k: u8, path: ?[]const u8, bytes: ?[]const u8) !*Pane { - const gpa = p.image_gpa; const e = &p.kinds.kinds[k]; + // A plain kind's slot and block are the core's (a client's epoch). + const gpa = if (e.caps.plain) p.gpa else p.image_gpa; const s = try gpa.create(Slot); s.* = .{ .ops = p.kinds.ops[k], .live = true, .gpa = gpa, .arena = .init(gpa), .version = e.version, .gen = e.gen, .name = e.name }; errdefer { @@ -279,6 +293,11 @@ pub fn reopen(p: ?*Pardes, id: usize, s: *Slot, bytes: ?[]const u8) bool { var cl: Call = .{ .p = p, .id = id, .slot = s }; const prev = cl.begin("open"); if (p) |core| if (core.kinds.byName(s.nameOf())) |k| { + // Its block made afresh by this open. + if (core.kinds.kinds[k].caps.plain) { + if (s.plain) |b| if (b.len > 0) s.gpa.free(b); + s.plain = &.{}; + } var w: std.Io.Writer = .fixed(&s.tail.bytes); w.writeAll(" Term") catch {}; for (core.kinds.words[0..core.kinds.nwords]) |*kw| if (kw.kind == k and kw.opens == 0) w.print(" {s}", .{kw.name.slice()}) catch {}; @@ -386,9 +405,14 @@ pub fn draw(p: *Pardes, s: *surface.Surface, arena: std.mem.Allocator, pane: *Pa const fg: surface.Color = if (th.fg) |f| .{ .rgb = f } else .default; const bg: surface.Color = if (th.bg) |b| .{ .rgb = b } else .default; var frame: Frame = .{ .cols = cols, .rows = rows }; - if (slot.ops == null and slot.live) { + if (slot.ops == null and slot.live and !caps(p, slot).plain) { const sh = slot.shadow orelse return; frame = .{ .cells = sh.cells, .cols = sh.cols, .rows = sh.rows, .places = sh.places.items, .n = @intCast(sh.places.items.len), .gpu = sh.gpu }; + } else if (slot.ops == null and slot.live) { + // A plain kind runs where it is shown, and this client lacks it. + var line: [160]u8 = undefined; + _ = s.print(x, y, cols, std.fmt.bufPrint(&line, "addon {s} {d} does not run in this client: it is not in its addons, or it broke its promise here", .{ slot.nameOf(), slot.version }) catch &line, .{ .fg = fg, .bg = bg }); + return; } else if (slot.ops == null) { var line: [160]u8 = undefined; const why = if (slot.refused.len > 0) slot.refused.slice() else "Addon load <path>"; @@ -530,7 +554,7 @@ fn prefixOf(p: *const Pardes, slot: *const Slot, buf: *[400]u8) []const u8 { pub fn key(p: *Pardes, id: usize, k: pardes.Key) bool { const slot = (p.panes[id] orelse return false).addon orelse return false; if (!caps(p, slot).key) return false; - if (tape.authorityOnly("a key into a kind's pane")) return true; + if (!runsHere(slot) and tape.authorityOnly("a key into a kind's pane")) return true; const pk: c.pa_key = .{ .cp = k.cp, .ctrl = @intFromBool(k.ctrl), .alt = @intFromBool(k.alt), .shift = @intFromBool(k.shift), .view = p.live + 1 }; var cl: Call = .{ .p = p, .id = id, .slot = slot }; const prev = cl.begin("key"); @@ -587,7 +611,7 @@ pub fn takesMouse(p: *const Pardes, s: *const Slot) bool { pub fn mouse(p: *Pardes, id: usize, m: pardes.Mouse, col: u16, row: u16) bool { const slot = (p.panes[id] orelse return false).addon orelse return false; if (!caps(p, slot).mouse) return false; - if (tape.authorityOnly("the mouse in a kind's pane")) return true; + if (!runsHere(slot) and tape.authorityOnly("the mouse in a kind's pane")) return true; const pm: c.pa_mouse = .{ .button = switch (m.button) { .left => c.PA_LEFT, @@ -627,13 +651,13 @@ pub fn mouse(p: *Pardes, id: usize, m: pardes.Mouse, col: u16, row: u16) bool { /// units of the session's origin, which a replica replays (17.2). pub fn step(p: *Pardes, due: bool) void { const now = p.clock.stepped_ns; - // A kind's call is the authority's alone: a speculation's tick after a - // call into the pane waits with that call's input (it stopped there). - if (tape.speculating()) { - for (p.panes) |pslot| if (pslot) |pane| if (pane.addon) |slot| if (slot.next_tick == 1) return tape.poison("a kind's tick"); - return; - } + // A kind's call is the authority's alone but a plain kind's here: a + // speculation's tick after a call into the pane waits with that call's + // input (it stopped there). + const speculating = tape.speculating(); + if (speculating) for (p.panes) |pslot| if (pslot) |pane| if (pane.addon) |slot| if (slot.next_tick == 1 and !runsHere(slot)) return tape.poison("a kind's tick"); for (p.panes, 0..) |pslot, id| if (pslot) |pane| if (pane.addon) |slot| { + if (speculating and !runsHere(slot)) continue; if (due and caps(p, slot).view) for (0..views.max) |k| { var v = viewOf(p, @intCast(k), id); if (seen(&v) == slot.views[k]) continue; @@ -655,7 +679,7 @@ pub fn step(p: *Pardes, due: bool) void { var cl: Call = .{ .p = p, .id = id, .slot = slot }; const prev = cl.begin("tick"); // A frame drawn since its last tick: a fling's frames are counted by them. - const flags = (if (focused) c.PA_FOCUSED else 0) | (if (slot.painted) c.PA_FRAMED else 0); + const flags = (if (focused) c.PA_FOCUSED else 0) | (if (slot.painted and slot.plain == null) c.PA_FRAMED else 0); slot.painted = false; // The clock's now for a tick after an event (a key, a focus): the // stepped frame lags it while the next wake is still to come. @@ -672,6 +696,12 @@ pub fn step(p: *Pardes, due: bool) void { }; } +/// A plain kind with its code here: a client runs it as the session does, +/// its calls speculated as the text's are. +fn runsHere(slot: *const Slot) bool { + return slot.plain != null and slot.ops != null; +} + /// Whether some view's facts are not what its kind was told. pub fn viewOwed(p: *const Pardes, slot: *const Slot, id: usize) bool { if (caps(p, slot).view) for (0..views.max) |k| if (seen(&viewOf(p, @intCast(k), id)) != slot.views[k]) return true; @@ -859,6 +889,8 @@ pub const Outcome = struct { rows: []const u8 = "", /// A tick's: the start of its tag (pa_tick.prefix). prefix: []const u8 = "", + /// A plain kind's block's hash after the call (Slot.state). + state: u64 = 0, /// Its `where` after the call (a key, a view, a job's answer may move /// it); null for a refused call. where: ?[]const u8 = null, @@ -913,8 +945,18 @@ const Call = struct { var place: [32]u8 = undefined; // A refused open closed its state: no `where` to ask. const at: ?[]const u8 = if (cl.refused.len == 0) where(cl.slot, &place) else null; - const o = tape.value(.addon, same, .{Outcome{ .ret = cl.ret, .text = cl.refused.slice(), .said = cl.said.slice(), .err = cl.err, .look = cl.look.slice(), .pane_name = cl.pane_name.slice(), .pane_text = cl.pane_text, .exec = cl.exec.slice(), .selected = cl.selected, .rows = cl.rows, .prefix = cl.prefix, .where = at, .jobs = cl.jobs, .cancels = cl.cancels }}); + // Hashed while it records or replays: no client, no cost. + const state: u64 = if (tape.on == null) 0 else if (cl.slot.plain) |b| std.hash.Wyhash.hash(0, b) else 0; + const o = tape.value(.addon, same, .{Outcome{ .state = state, .ret = cl.ret, .text = cl.refused.slice(), .said = cl.said.slice(), .err = cl.err, .look = cl.look.slice(), .pane_name = cl.pane_name.slice(), .pane_text = cl.pane_text, .exec = cl.exec.slice(), .selected = cl.selected, .rows = cl.rows, .prefix = cl.prefix, .where = at, .jobs = cl.jobs, .cancels = cl.cancels }}); if (o.where) |w| cl.slot.where_text.set(w); + // Run here, it came out otherwise than the session's: it broke its + // promise (PA_PLAIN), and the client joins again without it. + if (cl.slot.ops != null and cl.slot.plain != null and tape.replaying() and o.state != state) { + pardes.Addon.distrust(cl.slot.nameOf()); + var why: Buf(160) = .{}; + tape.diverged(why.print("addon {s}: its state after {s} is not the session's (it breaks PA_PLAIN): the session's alone now", .{ cl.slot.nameOf(), cl.name })); + } + cl.slot.state = o.state; if (cl.p) |p| if (p.panes[cl.id]) |pane| for (o.jobs) |token| if (token != 0) p.emit(.{ .job = .{ .pane = @intCast(cl.id), .serial = pane.serial, .token = token } }); for (o.cancels) |token| if (token != 0) { for (&cl.slot.jobs) |*j| if (j.*) |job| if (job.token == token) { @@ -1000,7 +1042,15 @@ pub const api: c.pa_api = .{ defer if (checked) { cl.began += @import("FrameStats.zig").nowNs() -| t0; }; - const mem = cl.slot.arena.allocator().alignedAlloc(u8, .@"16", @max(n, 1)) catch return null; + // A plain kind's one block, the core's; no other. + const mem = mem: { + if (cl.slot.plain) |b| { + if (b.len > 0) return null; + cl.slot.plain = cl.slot.gpa.alignedAlloc(u8, .@"16", @max(n, 1)) catch return null; + break :mem cl.slot.plain.?; + } + break :mem cl.slot.arena.allocator().alignedAlloc(u8, .@"16", @max(n, 1)) catch return null; + }; @memset(mem, 0); if (checked) cl.slot.used.append(std.heap.page_allocator, mem) catch {}; return mem.ptr; @@ -1010,6 +1060,8 @@ pub const api: c.pa_api = .{ fn f(ptr: ?*anyopaque, n: usize) callconv(.c) void { const cl = current orelse return; const at: [*]align(16) u8 = @ptrCast(@alignCast(ptr orelse return)); + // A plain kind's block goes with its pane. + if (cl.slot.plain) |b| if (b.ptr == at) return; if (checked) for (cl.slot.used.items, 0..) |m, i| if (m.ptr == at) { _ = cl.slot.used.swapRemove(i); break; diff --git a/src/dump.zig b/src/dump.zig index d1662e24..3269cc59 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -780,16 +780,19 @@ const SlotRecord = struct { /// way and its yank took nothing. tail: []const u8 = "", selection: []const u8 = "", + /// A plain kind's block's hash (Kind.Slot.state). + state: u64 = 0, }; pub fn slotWrite(s: *const Kind.Slot, gpa: std.mem.Allocator, w: *std.Io.Writer) !void { var place: [32]u8 = undefined; - var r: SlotRecord = .{ .name = s.nameOf(), .version = s.version, .gen = s.gen, .path = s.path, .art = s.art, .record = s.record, .where = s.where_text.slice(), .values = s.values.slice(), .live = s.live, .next_tick = s.next_tick, .views = s.views, .focused = s.focused, .cancelled = s.cancelled, .prefix = s.prefix.slice(), .refused = s.refused.slice(), .tail = s.tail.slice(), .selection = s.selection }; + var r: SlotRecord = .{ .name = s.nameOf(), .version = s.version, .gen = s.gen, .path = s.path, .art = s.art, .record = s.record, .where = s.where_text.slice(), .values = s.values.slice(), .live = s.live, .next_tick = s.next_tick, .views = s.views, .focused = s.focused, .cancelled = s.cancelled, .prefix = s.prefix.slice(), .refused = s.refused.slice(), .tail = s.tail.slice(), .selection = s.selection, .state = s.state }; var owned: ?[]u8 = null; defer if (owned) |o| s.gpa.free(o); if (s.ops != null) { r.where = Kind.where(@constCast(s), &place); - owned = try slotRecord(@constCast(s)); + // A plain kind's record is its block, as it is (Kind.Slot.plain). + owned = if (s.plain) |b| (if (b.len > 0) try s.gpa.dupe(u8, b) else null) else try slotRecord(@constCast(s)); r.record = owned; } const bytes = try walk.save(SlotRecord, gpa, &r); @@ -816,7 +819,7 @@ pub fn slotRead(out: *Kind.Slot, gpa: std.mem.Allocator, bytes: []const u8) !voi var arena: std.heap.ArenaAllocator = .init(gpa); defer arena.deinit(); const r = try walk.load(SlotRecord, arena.allocator(), bytes, null); - out.* = .{ .gpa = gpa, .arena = .init(gpa), .version = r.version, .gen = r.gen, .art = r.art, .live = r.live, .next_tick = r.next_tick, .views = r.views, .focused = r.focused, .cancelled = r.cancelled }; + out.* = .{ .gpa = gpa, .arena = .init(gpa), .version = r.version, .gen = r.gen, .art = r.art, .live = r.live, .next_tick = r.next_tick, .views = r.views, .focused = r.focused, .cancelled = r.cancelled, .state = r.state }; errdefer out.free(); @memcpy(out.name[0..@min(15, r.name.len)], r.name[0..@min(15, r.name.len)]); out.path = try gpa.dupe(u8, r.path); @@ -865,6 +868,34 @@ pub fn reviveSlot(p: *Pardes, id: usize, s: *Kind.Slot) void { } } +/// A replica client's pane of a plain kind it has the code of (`ops`), +/// loaded as the session dumped it: a slot of its core's own memory (the +/// rollback epoch), opened here, its block the record's bytes, its state +/// the session's. The loaded one (the C heap's) is freed. +pub fn plainHere(p: *Pardes, id: usize, old: *Kind.Slot, ops: *const Kind.Ops) !*Kind.Slot { + const s = try p.gpa.create(Kind.Slot); + s.* = .{ .ops = ops, .live = true, .gpa = p.gpa, .arena = .init(p.gpa), .name = old.name, .version = old.version, .gen = old.gen, .art = old.art, .where_text = old.where_text, .values = old.values, .prefix = old.prefix, .tail = old.tail, .opened = old.opened, .cancelled = old.cancelled, .tokens = old.tokens }; + errdefer { + s.free(); + p.gpa.destroy(s); + } + s.path = try p.gpa.dupe(u8, old.path); + s.selection = try p.gpa.dupe(u8, old.selection); + const kept = .{ old.next_tick, old.views, old.focused, old.state }; + if (!Kind.reopen(p, id, s, null)) return error.KindRefused; + // Its block the session's, byte for byte (its record), never through + // the kind's load, which may tidy it. + const block = s.plain orelse return error.KindRefused; + const record = old.record orelse return error.KindRefused; + if (block.len != record.len) return error.KindRefused; + @memcpy(block, record); + s.next_tick, s.views, s.focused, s.state = kept; + const gpa = old.gpa; + old.free(); + gpa.destroy(old); + return s; +} + /// A PDF pane of a dump from before the pdf addon: a pane of the addon's /// kind `pdf` on its file, at its page, its fit and tint given again as /// its words; a placeholder until the addon is loaded. diff --git a/src/kinds/addon.zig b/src/kinds/addon.zig index 54f26893..557547f6 100644 --- a/src/kinds/addon.zig +++ b/src/kinds/addon.zig @@ -45,7 +45,9 @@ comptime { /// `ctl`; `leader` is the keys after Space that run it ("ng": SPC n g). pub const Word = struct { name: [:0]const u8, leader: ?[:0]const u8 = null, arg: enum(u8) { none, optional, required } = .none, opens: bool = false, doc: [:0]const u8 = "" }; /// `pictures`: its panes place pictures, and their tag says how they show. -pub const Head = struct { name: []const u8, version: u32, exts: [:0]const u8 = "", words: []const Word = &.{}, pictures: bool = false }; +/// `plain`: PA_PLAIN, the kind is its extern struct and its step pure (the +/// header says what that promises): a client runs it itself. +pub const Head = struct { name: []const u8, version: u32, exts: [:0]const u8 = "", words: []const Word = &.{}, pictures: bool = false, plain: bool = false }; /// pardes's side, kept from init: about the pane of the current call. pub var api: *const c.pa_api = undefined; @@ -352,7 +354,7 @@ pub fn ops(comptime T: type) c.pa_ops { if (T.head.name.len > 15) @compileError(@typeName(T) ++ "'s name " ++ T.head.name ++ " is over 15 bytes"); var name: [16]u8 = @splat(0); @memcpy(name[0..T.head.name.len], T.head.name); - var o: c.pa_ops = .{ .init = F.init, .open = F.open, .paint = F.paint, .head = .{ .size = @sizeOf(c.pa_head), .abi = c.PA_ABI, .name = name, .version = T.head.version, .flags = if (T.head.pictures) c.PA_PICTURES else 0, .exts = T.head.exts, .words = &F.words, .nwords = F.words.len } }; + var o: c.pa_ops = .{ .init = F.init, .open = F.open, .paint = F.paint, .head = .{ .size = @sizeOf(c.pa_head), .abi = c.PA_ABI, .name = name, .version = T.head.version, .flags = (if (T.head.pictures) c.PA_PICTURES else 0) | (if (T.head.plain) c.PA_PLAIN else 0), .exts = T.head.exts, .words = &F.words, .nwords = F.words.len } }; // The kind's function, then the pa_ops field its wrapper fills. const fns = .{ .{ "close", "close" }, .{ "tick", "tick" }, .{ "prefix", "tick" }, .{ "view", "view" }, .{ "key", "key" }, diff --git a/src/kinds/pardes_addon.h b/src/kinds/pardes_addon.h index 9c101fee..586b03d3 100644 --- a/src/kinds/pardes_addon.h +++ b/src/kinds/pardes_addon.h @@ -275,6 +275,20 @@ typedef struct pa_tick { /* head.flags: its panes show pictures, and the core says how in their tag * (`petscii:on palette:commodore ascii:off`, Petscii, Palette, Ascii). */ #define PA_PICTURES 0x1u +/* head.flags: its state is plain and its step pure. The kind's whole state + * is the one block its `open` allocates with api->alloc (any other alloc + * is refused): bytes with no pointer or handle in them, changed only by its + * calls, each a function of the block and what the call is handed (no + * statics, no clock, randomness or file of its own: the time is tick's + * `now`, a seed api->seed's; tick is never told PA_FRAMED, a frame being + * one view's). pardes keeps the block where its own state is (its digest, a + * client's rollback copy) and dumps it as it is, `dump` uncalled and `load` + * given it at a Restore; so a client of the session runs the kind itself + * from the session's very bytes, its keys at once + * and its pictures its own, and a client without the addon shows a line. + * A kind that breaks the promise is caught: the client's state is not the + * session's, and it joins again without the kind. */ +#define PA_PLAIN 0x2u typedef struct pa_head { uint32_t size, abi; diff --git a/src/replica.zig b/src/replica.zig index fa888021..f84e61e8 100644 --- a/src/replica.zig +++ b/src/replica.zig @@ -425,7 +425,8 @@ pub const Screens = struct { fn each(x: Ctx, p: *Pardes) anyerror!void { var arena: std.heap.ArenaAllocator = .init(x.s.gpa); defer arena.deinit(); - for (p.panes, 0..) |slot, id| if (slot) |pane| if (pane.addon) |k| if (k.ops != null and !pane.collapsed) { + // A plain kind's is drawn where it is shown (Kind.runsHere). + for (p.panes, 0..) |slot, id| if (slot) |pane| if (pane.addon) |k| if (k.ops != null and k.plain == null and !pane.collapsed) { const pp = &x.s.peers.items[x.peer][id]; if (pp.shadow.serial != pane.serial) { pp.shadow.deinit(x.s.gpa); @@ -761,8 +762,13 @@ pub const Replica = struct { const c = try pardes.dump.load(epoch, o, bytes, null); // The chrome's colours are local, never dumped: the restored theme's. pardes.colors.finishThemeInitialization(c); - // It runs no kind's code: its panes of a kind are Shadows. - c.kinds.ops = @splat(null); + // It runs a plain kind's code of its own (Addon.plainOps), each pane + // of one opened here from its record; another's panes are Shadows. + for (c.kinds.kinds[0..c.kinds.n], c.kinds.ops[0..c.kinds.n]) |*e, *ops| ops.* = pardes.Addon.plainOps(e); + @memset(c.kinds.ops[c.kinds.n..], null); + for (c.panes, 0..) |pslot, at| if (pslot) |pane| if (pane.addon) |s| if (c.kinds.byName(s.nameOf())) |k| if (c.kinds.ops[k]) |ops| { + pane.addon = try pardes.dump.plainHere(c, at, s, ops); + }; // What loading queued (a watch, a theme asked for) is the // authority's errand, done there already: the session was dumped // between steps, with nothing queued. diff --git a/src/tape.zig b/src/tape.zig index 9dca5ee8..2875b156 100644 --- a/src/tape.zig +++ b/src/tape.zig @@ -1148,6 +1148,12 @@ pub fn poison(why: []const u8) void { }; } +/// A replica's replay came to another state than the authority's (`why`): +/// it joins again. +pub fn diverged(why: []const u8) void { + if (on) |t| if (t.replay) t.diverge("{s}", .{why}); +} + /// A replica's speculation leaves what is the authority's be (a terminal's /// emulator, a kind's state): true, and the input waits for its order. pub fn authorityOnly(comptime why: []const u8) bool { diff --git a/test/daemon.py b/test/daemon.py index c497bb19..051297a8 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -24,13 +24,17 @@ private HOME and runtime directory: python3 -B test/daemon.py --clients <pardes> the replica clients alone python3 -B test/daemon.py --far <pardes> - the far clients and their blob cache alone + the far clients and their blob cache alone, and a file by its hash + python3 -B test/daemon.py --games <pardes> <lib> [seconds] + the games in the clients that show them, from zig build + addon-test's <prefix>/lib (libsnake, liblife, libliar) python3 -B test/daemon.py --window-clients <pardes> <pardes-gui> window replica clients (hidden, offscreen) of a terminal's session, at 0/30/80/207 ms, and a window's session serving replicas """ import fcntl import os +import random import re import select import shutil @@ -1178,6 +1182,119 @@ def by_hash(binary): shutil.rmtree(root, ignore_errors=True) +def games(binary, libs, secs=10): + """The games (PA_PLAIN kinds: snake, life) run in the clients that show + them, from `libs` (zig build addon-test's <prefix>/lib): a client's keys + into one apply at once (none stopped), the snake steps under a client's + focus, and snake and life focused in two clients while a third types + text agree with the session throughout, rollbacks and all. Then a kind + that breaks its promise (test/liar.zig, its tick reads the clock): its + client finds it, joins again once, says why, and agrees from then on.""" + scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' + scratch.mkdir(parents=True, exist_ok=True) + root = Path(tempfile.mkdtemp(prefix='rg-', dir=scratch)) + env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_') and 'PAGER' not in k} + env.update(HOME=str(root), XDG_RUNTIME_DIR=str(root), XDG_CONFIG_HOME=str(root / 'config'), XDG_DATA_HOME=str(root / 'data'), + TERM='xterm-256color', SHELL=shutil.which('bash') or '/bin/bash', PARDES_NOTIME='1') + (root / 'config' / 'pardes').mkdir(parents=True) + (root / 'config' / 'pardes' / 'init').write_text('Shell bash\nMessageLinger 0\n') + (root / 'data' / 'pardes' / 'addons').mkdir(parents=True) + for name in ('snake', 'life', 'liar'): + shutil.copy(Path(libs) / f'lib{name}.so', root / 'data' / 'pardes' / 'addons' / f'{name}.so') + notes = root / 'notes.txt' + notes.write_text(''.join(f'line {i} of the notes\n' for i in range(300))) + started, terms = [], [] + + def client(name): + t = Term(30, 100) + terms.append(t) + c = t.spawn([binary, f'--attach={root / "pardes-replica.sock"}:files'], + dict(env, PARDES_REPLICA_CHECK=str(root / f'{name}.check'), PARDES_REPLICA_STATS=str(root / f'{name}.stats'))) + started.append(c.pid) + # Its frame: the notes, or what the third client typed into them. + wait_for(f'client {name}\'s first frame', lambda: b'of the notes' in t.text() or b'typed by c' in t.text(), timeout=30) + time.sleep(.3) + return t, c + + def kind_pane(word): + return next((int(r.split()[0]) for r in nine.read('/index').splitlines() if r.split()[1] == word), None) + + def steps(pane): + return int(re.search(rb'steps (\d+)', nine.read(f'/pane/{pane}/body')).group(1)) + + def opened(t, word): + # In this client's view: its key the last input, the session's + # live view is its own when the word runs. + os.write(t.master, b'j') + time.sleep(.5) + nine.write(f'/pane/{text}/exec', word.capitalize() + b'\n') + return wait_for(f'a {word} pane', lambda: kind_pane(word)) + + def leave(name, t, c): + c.send_signal(signal.SIGHUP) + c.wait(timeout=20) + line = (root / f'{name}.stats').read_text().split() + got = {line[i]: line[i + 1] for i in range(0, len(line) - 1, 2)} + assert not [l for l in checks(root / f'{name}.check') if l.startswith('differ')], name + return got + try: + sess = subprocess.Popen([binary, '--detach=files', str(notes)], env=env, cwd=root, stdin=subprocess.DEVNULL, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True) + started.append(sess.pid) + wait_for('the replica socket', (root / 'pardes-replica.sock').exists) + wait_for('the session\'s 9P socket', (root / 'pardes-9p-files.sock').exists) + nine = Client(root / 'pardes-9p-files.sock') + text = kind_pane(b'text') + (tc, c), (ta, a) = client('c'), client('a') + snake = opened(ta, b'snake') + tb, b = client('b') + life = opened(tb, b'life') + os.write(ta.master, b'r') + time.sleep(.3) + s0 = steps(snake) + time.sleep(.6) + assert steps(snake) > s0, 'the snake steps under a client\'s focus' + rnd = random.Random(7) + end, n = time.monotonic() + secs, 0 + while time.monotonic() < end: + os.write(ta.master, bytes([rnd.choice(b'hjkl')]) if n % 40 else b'r') + os.write(tb.master, bytes([rnd.choice(b'hjkl ')])) + os.write(tc.master, b'Atyped by c %d\x1b' % n) + n += 1 + time.sleep(rnd.uniform(.02, .12)) + for name in 'abc': + wait_for(f'client {name} agrees once quiet', lambda: agreed(root / f'{name}.check', 0), timeout=30) + assert not any(b'joined again' in t.text() for t in (ta, tb, tc)) + got = {name: leave(name, t, cl) for name, t, cl in (('a', ta, a), ('b', tb, b), ('c', tc, c))} + for name in 'ab': + assert got[name]['stopped'] == '0' and got[name]['mispredicted'] == '0', (name, got[name]) + # The liar: caught at a tick, its client joined again once, and agrees. + td, d = client('d') + opened(td, b'liar') + wait_for('client D caught the liar', lambda: b'joined again' in td.text(), timeout=30) + assert b'liar: its state after tick' in td.text(), td.text()[-600:] + seen = len(checks(root / 'd.check')) + os.write(td.master, b'j') + wait_for('client D agrees after it', lambda: agreed(root / 'd.check', seen), timeout=30) + assert td.text().count(b'joined again') == 1 and d.poll() is None + print(f'daemon: games in clients, {secs:.0f} s: snake and life focused in two clients, keys stopped {got["a"]["stopped"]} and ' + f'{got["b"]["stopped"]} of {got["a"]["inputs"]} and {got["b"]["inputs"]}, rollbacks {got["a"]["foreign"]}, {got["b"]["foreign"]}, ' + f'{got["c"]["foreign"]} (the third typing text), every digest agreed; a kind whose tick reads the clock was caught and its ' + f'client joined again once') + exit_session(nine, text) + sess.wait(timeout=10) + nine.socket.close() + finally: + for t in terms: + t.close() + for pid in started + processes(root): + try: + os.kill(pid, signal.SIGKILL) + except OSError: + pass + shutil.rmtree(root, ignore_errors=True) + + def far_joins(sock, session, binary, n): """`n` far joins of one session in a row, each read whole (its blobs asked for by none, its zstd frames unpacked) and answering a ping, then @@ -1944,6 +2061,8 @@ if __name__ == '__main__': clients(sys.argv[2]) elif sys.argv[1:2] == ['--manage']: manage(sys.argv[2]) + elif sys.argv[1:2] == ['--games']: + games(sys.argv[2], sys.argv[3], float(sys.argv[4]) if len(sys.argv) > 4 else 10) elif sys.argv[1:2] == ['--far']: far(sys.argv[2]) by_hash(sys.argv[2]) diff --git a/test/liar.zig b/test/liar.zig new file mode 100644 index 00000000..f564614b --- /dev/null +++ b/test/liar.zig @@ -0,0 +1,45 @@ +//! A test addon that breaks its promise: it says PA_PLAIN, and its tick +//! reads the clock, so a client that runs it comes to another state than +//! the session's. The client is to find that at the tick and join again +//! without it (Kind.zig `Call.end`), never to show a wrong picture. +const std = @import("std"); +const addon = @import("addon"); + +pub const Liar = extern struct { + ticks: u64, + noise: u64, + next: addon.Deadline, + + pub const head: addon.Head = .{ .name = "liar", .version = 1, .plain = true, .words = &.{ + .{ .name = "Liar", .opens = true, .doc = "a test addon whose step reads the clock, breaking PA_PLAIN" }, + } }; + + pub fn tick(s: *Liar, now: u64, _: addon.Flags) u64 { + var ts: std.c.timespec = undefined; + _ = std.c.clock_gettime(.MONOTONIC, &ts); + s.noise +%= @intCast(ts.nsec); + s.ticks += 1; + return s.next.every(now, 100 * std.time.ns_per_ms); + } + + pub fn paint(s: *const Liar, w: addon.Window, _: addon.Paint) void { + var line: [64]u8 = undefined; + w.put(0, 0, std.fmt.bufPrint(&line, "liar: {d} ticks, noise {x}", .{ s.ticks, s.noise }) catch "liar", .{}); + } + + pub const dump = addon.dumpBytes; + pub const load = addon.loadBytes; +}; + +pub const pardes_addon = addon.ops(Liar); +comptime { + addon.exportLib(&pardes_addon); +} + +test "two ticks at the same time come out apart: it reads the clock" { + var a = std.mem.zeroInit(Liar, .{}); + var b = a; + _ = a.tick(1, .{ .focused = false, .framed = false, ._ = 0 }); + _ = b.tick(1, .{ .focused = false, .framed = false, ._ = 0 }); + try std.testing.expect(a.noise != b.noise); +} diff --git a/test/panes.zig b/test/panes.zig index fb973ea2..2082c3ad 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -3959,6 +3959,7 @@ const PdfAddon = struct { for (a.core.panes, r.core().panes) |mine, theirs| if (mine) |pane| if (pane.addon) |s| { const t = theirs.?.addon.?; kinds += 1; + @setEvalBranchQuota(10_000); inline for (@typeInfo(pardes.Kind.Slot).@"struct".field_names) |name| { const local = comptime for (pardes.Kind.Slot.replica.local) |n| { if (std.mem.eql(u8, n, name)) break true; diff --git a/test/veil.zig b/test/veil.zig index ed49e1c3..0be5d218 100644 --- a/test/veil.zig +++ b/test/veil.zig @@ -9,7 +9,7 @@ const scene = @import("gpu_scene"); pub const Veil = extern struct { painted: u32, - pub const head: addon.Head = .{ .name = "veil", .version = 1, .words = &.{ + pub const head: addon.Head = .{ .name = "veil", .version = 1, .plain = true, .words = &.{ .{ .name = "Veil", .opens = true, .doc = "a translucent GPU picture over the pane (a test addon)" }, } }; |
