summaryrefslogtreecommitdiff
path: root/src/dump.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 02:21:04 -0300
committerGabriel Schneider <[email protected]>2026-11-18 03:43:34 -0300
commit7367335a64473d1f5522bdba71db2657b7fb2398 (patch)
treed9264d70684e18ea5f5ceaed8074e862e694b969 /src/dump.zig
parent137be286869241d19ea60ecb7737957d861162d7 (diff)
downloadpardes-7367335a64473d1f5522bdba71db2657b7fb2398.tar.gz
pardes-7367335a64473d1f5522bdba71db2657b7fb2398.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/dump.zig')
-rw-r--r--src/dump.zig3
1 files changed, 2 insertions, 1 deletions
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)) {