From 803f2a2678a8aa8f89b0663a84a60721d36f5831 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 02:33:14 -0300 Subject: pardes - writes the whole text through one open of the body, so a page over 8 MiB arrives whole, not as its last chunk Each 8 MiB chunk went in by its own Client.write, which opens a body with OTRUNC, so every chunk replaced the one before and a long page kept only its tail, with exit 0. The text now goes in through one open, truncated once and written at rising offsets; a long write is timed by its progress, each 9P write answered within 30 s rather than the whole transfer within 2. fs.py pages 11 MiB of numbered lines and compares the body byte for byte, and pages past the 256 MiB cap and checks the first 256 MiB and the cut note. Co-Authored-By: Claude Opus 5.5 --- src/9p_io.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/9p_io.zig') diff --git a/src/9p_io.zig b/src/9p_io.zig index 6cf75c99..d80d7b30 100644 --- a/src/9p_io.zig +++ b/src/9p_io.zig @@ -1937,6 +1937,8 @@ test "9P shell environment states being inside pardes apart from how to reach it pub const Client = struct { pub const budget_ms: i64 = 2000; + /// Each write of a long one has this long to be answered (transact). + pub const write_budget_ms: i64 = 30_000; pub const max_depth: usize = 2 * ninep.max_welem; @@ -2211,6 +2213,12 @@ pub const Client = struct { const count = (try s.ask(.{ .write = .{ .fid = cur, .offset = written, .data = chunk } }, remote)).write; if (count == 0 or count > chunk.len) return Error.Botch; written += count; + // A long write is timed by its progress: each answer gives + // the next its own budget, so a large body (`pardes -`) goes + // in through one open, whole, however long it takes. The + // budget is a write's: a server putting in tens of MiB it + // held (pane.zig batchFor) answers that one write late. + s.deadline = nowMs() +| write_budget_ms; } return; } -- cgit v1.3