diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 23:28:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 23:42:48 -0300 |
| commit | 9b20d00ca5ffbab640b87249d65e4165414d22c1 (patch) | |
| tree | e62644195d40b5a41ed92a5e19548fa84cff4821 /src/wire.zig | |
| parent | 6c61169832d6f396ee7a6e9e0b09d9c055d08f8d (diff) | |
| download | pardes-9b20d00ca5ffbab640b87249d65e4165414d22c1.tar.gz pardes-9b20d00ca5ffbab640b87249d65e4165414d22c1.zip | |
replica: a record of a MiB or more crosses to a client by its hash, beside its unit (tape.zig by_hash_min, Big; wire blob): a file over the wire's 16 MiB bound opened while a client was attached was one unit, past the bound, so a Debug session panicked and a release one dropped it, its client diverging at the next unit and joining again to be sent the whole file in the dump; now the read's answer is recorded as the file's BLAKE3, a client on the session's machine reads the path itself and checks it, a far one is sent it in 1 MiB pieces before the unit and keeps it in its cache.xitdb (XDG_CACHE_HOME/pardes), so a far client that joins after is sent none of it; any other record that long (a reload's text, a paste) goes to every client so; test/daemon.py by_hash: a 17 MiB file under a near and a far client, both agree, neither joins again, the near one reads it itself, the far one is sent 8848 KB of zstd and a far client after it none of its 2 blobs; the slot's own BLAKE3 the brief asked for was built and taken out (a hash a kind's open, 7 instructions a byte on the perf build's CPU, for no reader until a client renders kinds); perf --only medium --reps 10 instructions:u 2,459.25M -> 2,459.36M, --terminal-mib 8 3,928.50M -> 3,928.51M; tui core-test 811/950 (139 skipped), shell-test passes, replicas pass (diverged 0, checked/wrong 0), behaviour-test 269/273 (the four addon ABI tests the base fails), --replay 20 seeds 0 failures, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's; headersweep and headersweep-restored failed once at load 14 and pass alone), test/daemon.py passes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/wire.zig')
| -rw-r--r-- | src/wire.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wire.zig b/src/wire.zig index 9773d222..864c2fd8 100644 --- a/src/wire.zig +++ b/src/wire.zig @@ -183,6 +183,10 @@ pub const ServerTag = enum(u8) { /// A piece of a far client's stream from here on, zstd-compressed: the /// messages in it are framed as these are. Opaque here. zstd = 0x09, + /// A piece of a record's bytes by hash (tape.zig `Big`), before the + /// unit naming it: the hash, the whole's length and this piece's place + /// (u64le each), then at most 1 MiB of it (src/replica.zig). + blob = 0x0a, }; pub const ServerMsg = union(ServerTag) { @@ -199,6 +203,7 @@ pub const ServerMsg = union(ServerTag) { check: u64, blobs: []const u8, zstd: []const u8, + blob: []const u8, }; /// A message's header, for a payload sent on its own (a unit, a dump's @@ -233,6 +238,7 @@ pub fn decodeServer(tag: u8, payload: []const u8) Error!ServerMsg { .check => .{ .check = try r.takeInt(u64, .little) }, .blobs => return .{ .blobs = payload }, .zstd => return .{ .zstd = payload }, + .blob => return .{ .blob = payload }, }; try end(&r); return msg; @@ -255,7 +261,7 @@ pub fn encodeServer(out: []u8, msg: ServerMsg) Error![]const u8 { }, .refused => |words| try putSlice16(&w, words), .pong => |v| try w.writeInt(u64, v, .little), - .dump, .unit, .screen, .blobs, .zstd => |bytes| try w.writeAll(bytes), + .dump, .unit, .screen, .blobs, .zstd, .blob => |bytes| try w.writeAll(bytes), .check => |v| try w.writeInt(u64, v, .little), } try finishMessage(&w, at); |
