From f0f2a5125fd4b034ebcd424afd4a55c3185191ab Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 02:44:13 -0300 Subject: layout: a view's geometry (`rects`, `col_x`, `col_w`) is the layout pass's, never dumped: every load lays each open view out again (dump.zig `afterLoad`: `layout.compute` per open view, as a resize lays it out), and `cols` is held to `ncol` (`View.replica.len`): RUN FIRST on pardes-merge67 (core/fuzz.zig's dump fuzz, the restore road's seed 589): an image's pane 0 rect read back as 534 rows on a 24-row screen (`View.rects`, dumped as it was), drawn: draw.zig:448 `clearRect`, then surface.zig:322's `at` asserted; walk.zig `pastHeld` passes over a pair whose buffer is derived; TEST FIRST: dump.zig "a view's geometry is laid out again at a load, never read: a pane's rect past its screen in a dump is the layout's after it" (merge67: expected 22, found 534); not whole alone: the dump's layout moved, and the fuzz's seeds then reach the indexes the next change holds (`live` past the views, a file's top past its text) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/walk.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/walk.zig') diff --git a/core/walk.zig b/core/walk.zig index 5e91490c..f6a9c088 100644 --- a/core/walk.zig +++ b/core/walk.zig @@ -249,6 +249,8 @@ const Past = struct { name: []const u8, says: usize, holds: usize }; /// its own. fn pastHeld(comptime T: type, v: *const T, held: ?*const [pairs(T)]usize) ?Past { inline for (0..comptime pairs(T)) |i| { + // A buffer no dump carries (derived) is made again, not read. + if (comptime excluded(T, T.replica.len[i][0])) continue; const buffer = @field(v, T.replica.len[i][0]); const holds = if (comptime @typeInfo(@TypeOf(buffer)) == .array) (if (held) |h| @min(h[i], buffer.len) else buffer.len) else buffer.len; const says = lengthIn(v, T.replica.len[i][1]); -- cgit v1.3