summaryrefslogtreecommitdiff
path: root/src/Addon.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 05:48:27 -0300
committerGabriel Schneider <[email protected]>2026-11-18 06:38:02 -0300
commit3350156db428656fa8e583d1971663e1c4a215b0 (patch)
tree0fe6d925149acd4644c5d543fbffb356b43c1697 /src/Addon.zig
parent3f8f66643a1e4840e1cbf0d7a4c5aa8580360ac7 (diff)
downloadpardes-3350156db428656fa8e583d1971663e1c4a215b0.tar.gz
pardes-3350156db428656fa8e583d1971663e1c4a215b0.zip
image: the image kind runs where its pane is shown (PA_PLAIN): its block is the file's size as it says, the same bytes in every process, and each process decodes the file on a draw of its own and keeps the RGBA beside the block (by its address) for its paint alone, so a client draws the picture itself and the session sends nothing for the pane (no Shadow, no decoded pixels in a job's answer on the tape); a plain kind's code is loaded in a client at its first pane, not at the join (Addon.need; a client with no picture or game maps no addon library); a client that joins late opens a plain kind's pane from its file, which the join's dump carries, read from the disk then (SlotRecord.file: paid only at a join), and one it cannot open shows the line; a client's join with a picture and a PDF open reads 10.70 MB -> 7.36 MB, its picture the session's pixel for pixel, its memory 269.1 -> 272.5 MB RSS (184.2 -> 187.6 PSS); with no client perf --only medium 2,279.68M -> 2,279.60M instructions:u, pdf-scroll-bench 18,392-18,399M -> 18,397-18,402M (its visual hashes the same), start to the first frame 53.6M (terminal) and 392-411M (window) as before; tui core-test 819/958 (139 skipped), shell-test 993/996, behaviour-test 273/273, --replay 20 seeds 0 failures, pane-test 180/181 (the picture's tag test steps the core, as no job's event does now), replicas pass, addon-test 1/1, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's), image-harness passes, test/daemon.py, --far, --games (keys stopped 0 and 0 of 453 and 452) and --window-clients pass; gui unit-test 1586/1590 (4 skipped; the perf check's BaselineBuildMismatch, the base's), the frame corpus 77/77 against mbase, pdf-harness CaptureColorMissing as on the base
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/Addon.zig')
-rw-r--r--src/Addon.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Addon.zig b/src/Addon.zig
index 16c38758..398ec415 100644
--- a/src/Addon.zig
+++ b/src/Addon.zig
@@ -343,7 +343,12 @@ fn listed(data: []const u8, path: []const u8, n: usize, why: *Why) Loaded {
/// library loaded at the first pane of its kind, from the file the start
/// listed it from (`listed`); null, and why, when it will not load.
pub fn need(r: *Kind.Registry, k: u8, why: *Why) ?*const Kind.Ops {
- if (r.ops[k] != null or tape.replaying()) return r.ops[k];
+ if (r.ops[k] != null) return r.ops[k];
+ // A client's: its own code for a plain kind, loaded at its first pane.
+ if (tape.replaying()) {
+ r.ops[k] = plainOps(&r.kinds[k]);
+ return r.ops[k];
+ }
const e = &r.kinds[k];
for (found[0..nfound], 0..) |*l, i| if (l.why.len == 0 and std.mem.eql(u8, &l.hash, &e.hash) and std.mem.eql(u8, l.path, e.path.slice())) {
if (l.ops == 0) l.ops = loadListed(i, why) orelse return null;
@@ -617,7 +622,8 @@ pub fn take(r: *Kind.Registry, l: Loaded, except: []const u8) ?[]const u8 {
}
e.why.set("loaded");
// A client's: its own code for a plain kind, or none (the session's).
- r.ops[r.n] = if (tape.replaying()) plainOps(e) else @ptrFromInt(l.ops);
+ // A client's code for a plain kind is loaded at its first pane (`need`).
+ r.ops[r.n] = if (tape.replaying()) null else @ptrFromInt(l.ops);
for (l.words) |w| {
r.words[r.nwords] = .{ .kind = r.n, .arg = w.arg, .opens = w.opens };
r.words[r.nwords].name.set(w.name);