summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-26 09:21:04 -0300
committerGabriel Schneider <[email protected]>2026-11-26 10:27:04 -0300
commit7911c53d5f08c7d8df3eb59061841daddb1d0e83 (patch)
tree24fb17fb2fb06225c0d9e1525744b4062a5b5ee2
parent8959b031dc330b4da21c0e89e0831d6fadbcd757 (diff)
downloadpardes-7911c53d5f08c7d8df3eb59061841daddb1d0e83.tar.gz
pardes-7911c53d5f08c7d8df3eb59061841daddb1d0e83.zip
dump, replica, fuzz: a core that dump.load returns has its chrome, worked out by the load itself, so it draws as it is (the merge M2's dump fuzz at 40,000 join seeds: join seed 8324 died of a general protection fault in draw.zig's render, the debug overlay printing `p.theme().name`, a slice at 0xAAAAAAAAAAAAAAAA); THE CAUSE: the chrome (`theme_chrome`) is local, never dumped (Core.zig's replica `.local`), and dump.load left it undefined for its caller to work out: a replica's join did, right after it (replica.zig `made`, finishThemeInitialization), a restore does in reviveSession; the fuzz's `use` draws the loaded core as it comes, so it drew from an undefined chrome: before L3 only colours (0xAA bytes, drawn unseen), since L3 (tlpklysz: Pardes.theme() is the chrome's old-names view, `ChromeTheme.view`, a LegacyTheme with its `name` slice) a slice too, which the overlay prints once a damaged dump reads `debug` on; THE FIX: `load` works out the chrome before it returns (finishThemeInitialization, one Chrome.of, at a join, never a frame), and the replica's own call after it goes; RUN (TEST FIRST): fuzz.zig pins join seed 8324 beside 19224, 31554 and 6356: on the merge (ytzwsyrm 8959b031dc33) it fails at draw.zig:430 (`General protection exception` in bufPrint), passes now; a user could not hit it: every path that draws a loaded core (a replica's join, a restore) worked out the chrome before its first frame; NEW HOT PATHS: none per key or frame; a dump.load works out one Chrome.of more (the replica's, moved here), and the tape's dump round-trip check (tape.zig) one per check; GATES (tui, this change on the merge): core-test 1162/1336 (174 skipped; the merge's 1155/1329 then had the importer's 7 cached by zig), shell-test 1377/1380 (3 skipped), pane-test 184/185 (1 skipped), behaviour-test 287/287 and --replay 20 seeds of 70 steps, 0 failures, process-test 0 of 149 failed (3 skipped), term-test 17/17, kitty-test 45/45; the gui unit-test 1988/1992 (4 skipped; its one failed step the perf check's BaselineHarnessMismatch, every base's); the dump fuzz at 40,000 join seeds twice and 1,779 image seeds 11/11 (on the merge alone it died at join seed 8324); the soak `replicas -- --clients 5 --rtt 30,80,207` (the pdf addon in): diverged 0, unequal 0, quiet checks 436/0 340/0 546/0, stops not on may_wait 0, the corpus 22 of 22 scenes the same, no leak (the same soak on the merge alone died at seed 0 rtt 30 of the known MuPDF leak, Pick.showKind's documents, F1's: it comes only when a client's picker previews a PDF); load 3.5 to 9.9
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
-rw-r--r--core/dump.zig7
-rw-r--r--core/fuzz.zig4
-rw-r--r--core/replica.zig2
3 files changed, 9 insertions, 4 deletions
diff --git a/core/dump.zig b/core/dump.zig
index 0cefa157..a2b22cef 100644
--- a/core/dump.zig
+++ b/core/dump.zig
@@ -381,9 +381,12 @@ pub fn check(gpa: std.mem.Allocator, bytes: []const u8, why: *[256]u8) !void {
/// The core the dump `bytes` is, and nothing more: no shell started, no
/// file watched, nothing asked of a host (`revive` does that). What another
/// build's dump could not give is said in `notes` when given. `opts` are
-/// this process's (its allocators, paths and name), not the dump's.
+/// this process's (its allocators, paths and name), not the dump's. Its
+/// chrome is the restored theme's: the colours are local, never dumped.
pub fn load(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes: ?*std.ArrayList(u8)) !*Pardes {
- return loadKnowing(gpa, opts, bytes, notes, null);
+ const p = try loadKnowing(gpa, opts, bytes, notes, null);
+ colors.finishThemeInitialization(p);
+ return p;
}
/// `load`, with which panes' files were on disk when it was dumped.
diff --git a/core/fuzz.zig b/core/fuzz.zig
index 56ded66b..d8df1d9a 100644
--- a/core/fuzz.zig
+++ b/core/fuzz.zig
@@ -824,6 +824,10 @@ test "a dump and an image cut, flipped and grown: refused or loaded, never a pan
// `live` (the core read in place, its own `live` undefined), a live
// message's `src` length 0xAAAA when the digest walked it.
try loadSeed(bytes, .join, 6356);
+ // Join seed 8324: `debug` read on, and the overlay printed the theme's
+ // name from the chrome, which the load had never worked out (a join's
+ // caller did, after it): the old names' view's name 0xAAAA.
+ try loadSeed(bytes, .join, 8324);
for ([_][]const u8{ bytes, described, image }, [_]Road{ .join, .join, .restore }, [_]u64{ 2048, 2048, 1024 }) |whole, road, n| {
try loadSeed(whole, road, 0);
for (1..n + 1) |seed| try loadSeed(whole, road, seed);
diff --git a/core/replica.zig b/core/replica.zig
index 6c037cd2..49ccd85b 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -588,8 +588,6 @@ pub const Replica = struct {
r.view = Peers.viewFor(c, null, true) orelse return error.NoView;
break :boot c;
};
- // The chrome's colours are local, never dumped: the restored theme's.
- if (dump != null) pardes.colors.finishThemeInitialization(c);
// It runs a plain kind's code of its own (Addon.plainOps), loaded
// at its first pane, each opened here from its record; another's
// panes show a line.