From 7367335a64473d1f5522bdba71db2657b7fb2398 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 18 Nov 2026 02:21:04 -0300 Subject: addons: a library is listed at start from the head it brought at its last load (addon-heads in the data directory, keyed by its file's device, inode, size and times; 16 heads of any prefix, by pardes's version so an installed build and one being worked on share them) and loaded at the first pane of its kind (Addon.need, from Kind.reopen; a client's plain kind at its take, Addon.plainOps) from the file the scan opened, so a start no longer reads, BLAKE3s and copies pdf.so and image.so (19 MB) to dlopen them: /addons, /commands and Help say what they said (the hash is the head's), a library renamed over while a session runs is still the one it listed, one written over in place refuses its first pane saying so until Addon reload, and an Upgrade with a PDF open restores it, loading pdf.so then; a load copies into the memfd by sendfile and hashes the memfd mapped, not a read buffer; start to the first frame, ReleaseFast, best of ten interleaved, perf stat to the kill at the first frame: tui medium.zig 195.6M -> 55.4M instructions:u, 28.7 -> 13.4 ms (load 0.8); gui offscreen, cut at the first frame: 630M -> 508M, 282 -> 258 ms (load 0.7); pardes 9p.pdf to its first page 218M -> 78M, a picture 258M -> 118M; the first PDF looked at in a running session pays the load: 1.9-7 ms -> 11-22 ms Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- src/dump.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dump.zig') diff --git a/src/dump.zig b/src/dump.zig index 3269cc59..971a4d26 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -851,7 +851,8 @@ pub fn reviveSlot(p: *Pardes, id: usize, s: *Kind.Slot) void { s.ops = p.kinds.ops[k]; s.gen = p.kinds.kinds[k].gen; // A replica has no code to read it for: the authority's outcome is taped. - const bytes: ?[]u8 = if (s.ops != null and s.path.len > 0) filesystem.read(p, s.path) catch null else null; + // The authority's code may not be loaded yet: its open loads it. + const bytes: ?[]u8 = if ((s.ops != null or !pardes.tape.replaying()) and s.path.len > 0) filesystem.read(p, s.path) catch null else null; defer if (bytes) |b| p.gpa.free(b); const kept = .{ s.next_tick, s.views, s.focused }; if (!Kind.reopen(p, id, s, bytes)) { -- cgit v1.3