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/walk.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/walk.zig')
| -rw-r--r-- | core/walk.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/walk.zig b/core/walk.zig index 6d7c594d..9b760144 100644 --- a/core/walk.zig +++ b/core/walk.zig @@ -31,8 +31,9 @@ //! .blob = .{ "content" }, //! }; //! -//! None of the three kinds is in a digest or a dump. A type with a `pub fn -//! digest(*const T, *Hasher) void` of its own hashes itself; one with +//! None of the three kinds is in a digest or a dump. A type (a struct or a +//! tagged union) with a `pub fn digest(*const T, *Hasher) void` of its own +//! hashes itself; one with //! `dumpWrite`, `dumpRead` (and `dumpFree`) dumps itself as bytes. const std = @import("std"); const xitdb = @import("xitdb"); @@ -242,6 +243,7 @@ pub fn hash(comptime T: type, v: *const T, h: *Hasher) void { }, .@"union" => |u| { if (u.tag_type == null) @compileError("walk: an untagged union: " ++ @typeName(T)); + if (comptime @hasDecl(T, "digest") and @TypeOf(T.digest) == fn (*const T, *Hasher) void) return v.digest(h); const tag: u.tag_type.? = v.*; hash(u.tag_type.?, &tag, h); switch (v.*) { |
