diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 14:29:10 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 14:55:38 -0300 |
| commit | e3d0daa9f89f41b41b7d05d510db553cbd8816d9 (patch) | |
| tree | 6602e8aca69ec3c160021d4975c43456d38801df /core/ninep/pane.zig | |
| parent | 8a8ce0a6740e9a98ea37a70d401c3ba3fffe0ee1 (diff) | |
| parent | 27837e6345b51ceb2ceaaee58fd593024feb07c8 (diff) | |
| download | pardes-e3d0daa9f89f41b41b7d05d510db553cbd8816d9.tar.gz pardes-e3d0daa9f89f41b41b7d05d510db553cbd8816d9.zip | |
integration: a client that joins a session with 9P work under way has its 9P state, on the budget as a count and the window's pair: pardes-faults-4 (the open records and each pane's 9P state in the dumps and the digest, dropped again at a revive on a new host; hand-written digests so a step's counts do not move) and pardes-merge39; two conflicts, both the wire's version: the pair's close byte and the 9P state each took 24 on their own lines: the close byte keeps 24, the 9P state is 25, abi/wire.zig's version and test/daemon.py's WIRE are 25; tui core-test 871/1028 (157 skipped), shell-test 1070/1073, term-test 17/17, both soaks diverged 0, unequal 0, unlisted 0, the window builds; the coordinator's gate in the ledger (reorg/merge40)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/ninep/pane.zig')
| -rw-r--r-- | core/ninep/pane.zig | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/ninep/pane.zig b/core/ninep/pane.zig index 1d514a3c..d47b637b 100644 --- a/core/ninep/pane.zig +++ b/core/ninep/pane.zig @@ -30,6 +30,28 @@ const Node = tree.Node; /// Filesystem state a pane carries beside its editor state. pub const State = struct { + /// What a step reads of it is digested and dumped (fs.Namespace); the + /// readers' records and the server's say of them are the session's. + pub const replica = .{ .authority = .{ "readers", "event_reader", "events", "tag_snap", "pty_reader", "pty_out", "winsize", "unannounced" } }; + + /// Its digest (core/walk.zig): nothing for a pane no script has set + /// anything of (most of them, at every unit a replica confirms); the + /// rest's fields as one run of bytes, not a hash's call a field. + pub fn digest(st: *const State, h: *pardes.walk.Hasher) void { + const untouched: State = .{}; + var touched = false; + inline for (comptime pardes.walk.fieldNames(State)) |name| touched = touched or !std.meta.eql(@field(st, name), @field(untouched, name)); + if (!touched) return; + var buf: [256]u8 = undefined; + var w: std.Io.Writer = .fixed(&buf); + // Longer than the room (a chord's text): field by field. + if (encoded(st, &w)) |_| h.update(w.buffered()) else |_| inline for (comptime pardes.walk.fieldNames(State)) |name| pardes.walk.hash(@FieldType(State, name), &@field(st, name), h); + } + + fn encoded(st: *const State, w: *std.Io.Writer) std.Io.Writer.Error!void { + inline for (comptime pardes.walk.fieldNames(State)) |name| try pardes.walk.encode(@FieldType(State, name), &@field(st, name), w); + } + /// The range `data` and `xdata` read and write through. acme clears it /// when the first client opens `addr` (editors/acme/xfid.c:105-108), /// which suits a client that holds the fid open; a shell cannot, and |
