diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-19 19:55:02 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 19:55:02 -0300 |
| commit | 2ab05b536bc3b063666b5aaab497157adc2a9120 (patch) | |
| tree | 4b796e6abaf7658294d2b6cbb5d35e0210b88b40 /core/root.zig | |
| parent | e4f99d2370c8b44e76b541826d91356d86090f53 (diff) | |
| parent | 786cddd24e2be36d30847300075cec8c45d1b0ca (diff) | |
| download | pardes-2ab05b536bc3b063666b5aaab497157adc2a9120.tar.gz pardes-2ab05b536bc3b063666b5aaab497157adc2a9120.zip | |
integration: the regular-expression fixes with the fixes the real loops asked for: pardes-regex-2 (mvzr's reads past a pattern cut short patched as it is fetched; the leak of a pattern that does not compile; the soak's corpus check comparing what is visible) and pardes-draw-2 (a step's notice bands and a markdown text's tables made from the step's own state, never from the last frame; a load under way in another live process no crash; an idle pair silent), merged without a conflict; gates in the coordinator's ledger
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/root.zig')
| -rw-r--r-- | core/root.zig | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/core/root.zig b/core/root.zig index 706c833d..2e8fe1dc 100644 --- a/core/root.zig +++ b/core/root.zig @@ -605,7 +605,7 @@ test "nothing of a core is a process global: every container-level var in core/ /// The count is a file's, so it cannot tell a step's read from its host /// half's; the reason says which the file's are. const machine_lines = [_]struct { []const u8, usize, []const u8 }{ - .{ "Addon.zig", 48, "the process's addon libraries: the start's scan of their directories, dlopen, the crash mark; the host's, never a step's" }, + .{ "Addon.zig", 54, "the process's addon libraries: the start's scan of their directories, dlopen, the crash mark (whose: the pid alive); the host's, never a step's" }, .{ "Core.zig", 5, "the session's directory read once at its start (taped), a frame log (PARDES_FRAMES), a host_io type" }, .{ "Db.zig", 18, "the state file every session of the user shares: the authority's (`db`), off in every replica" }, .{ "Dir.zig", 1, "a directory's listing, the function under tape.site(.dir_listing), its io the tape's" }, @@ -721,3 +721,87 @@ test "what core/ asks of the machine is where the list says, with why: a new lin }; try std.testing.expectEqual(@as(usize, 0), wrong); } + +/// Every field kept out of the digest and the dump as a process's own +/// (`.local`) or as made again from the rest (`.derived`): who writes it, +/// and why what a step reads of it is what that step's own state makes, so +/// a core that drew a frame and one that did not, or one joined since, step +/// alike (a frame writes several; a step that read one a frame left as its +/// state did not make it diverged a client: Pane.notices, then Tables' +/// reading, 2026-11-19). A file, its names, the reason. +const kept_out = [_]struct { []const u8, []const u8, []const u8 }{ + .{ "Core.zig", "surface facts frames own_frames chrome frame_arena scratch echo undrawn", "the frame's own and the views drawn here: written by frames (and chrome by a theme's step), read by frames and the runner; no step reads them" }, + .{ "Core.zig", "needs_frame", "whether to draw: steps set it, the loop reads it; no step's outcome reads it" }, + .{ "Core.zig", "effects effects_head effects_len in_q in_head in_len opts dump_out dump_export tape", "this process's queues, options and tape, drained or set by its host" }, + .{ "Core.zig", "shell_rows", "a terminal's rows as read here, swept at every update; a terminal is in no digest (Term.zig)" }, + .{ "Core.zig", "diff_output locations_cache tty_filter_palette body_chrome", "caches of pure functions of their key (a text, a theme): a step finds what it would make; a query row's colours from them are out of its digest (locations.Row.digest)" }, + .{ "Core.zig", "retired_panes", "panes torn down this step, freed at its end" }, + .{ "Core.zig", "distrusted frames tape", "Options: the client's own list, its runner's statistics, its tape" }, + .{ "Event.zig", "native_image_patches", "what this process's shell can take" }, + .{ "panes.zig", "pv pv_known", "the views' shares as this process parks them (views.zig)" }, + .{ "panes.zig", "wrap_line wrap_col wrap_pad wrap_n body_wrapped context_rows body_rows body_visible_rows context_row_limit geometry_key geometry_len", "File.geometry's, made by whoever asks first (a frame or a step) from everything its key hashes of the step's state; a tab change resets the key" }, + .{ "panes.zig views.zig", "notices", "made again from the step's state at the top of update and presented, and at sync (Messages.collectNotices); a frame's are its own" }, + .{ "panes.zig views.zig", "pan", "written by steps only (sync, a view unparked) from the pane and its terminal" }, + .{ "File.zig", "cap line_starts line_cap", "the text's line index, of its bytes" }, + .{ "File.zig", "highlights highlight_start syntax_dirty", "how a text looks, painted by frames: read by frames, and by a query's rows for colours only (out of their digest)" }, + .{ "File.zig", "context", "the declarations of the text at a revision: found in sync (refreshContext), by a parse's answer (a step) or a dump's load" }, + .{ "File.zig", "node_tree node_tree_revision node_tree_edits node_history", "the parse of the text at its revision, made by the first key that walks it" }, + .{ "File.zig", "tables", "the whole text's, read at once by whoever asks first (Tables.ensure): no reading under way that a frame could move" }, + .{ "Text.zig", "room", "a buffer's capacity" }, + .{ "Kind.zig", "ops st gpa arena plain file opened reloads jobs record", "the kind's code and memory here: a plain kind's block is in the copy, and its state hash is checked at every call (Kind.Call.end)" }, + .{ "Kind.zig", "thumb_at thumb_span pointer painted over used draws", "a frame's: written by a paint; `painted` is read by a tick of a kind that is not plain, whose calls are the authority's alone" }, + .{ "Places.zig", "ticks ticks_gen re", "the rail's ticks, made again when the places move (`gen`), and the compiled pattern, of the pattern" }, + .{ "Plumb.zig", "parsed parsed_arena", "the rules parsed, of their text" }, + .{ "Stream.zig", "parse_ns paint paint_retired paint_count ahead ahead_for painted_ahead painted_on_loop ahead_seen ahead_ask", "the workers' paints and timings: how a text looks, and numbers" }, + .{ "walk.zig", "cache", "a test's own type" }, +}; + +test "every field kept out of the digest and the dump is one the list names, with who writes it and why a step's read of it is the step's" { + const gpa = std.testing.allocator; + const io = std.testing.io; + var dir = try std.Io.Dir.cwd().openDir(io, "core", .{ .iterate = true }); + defer dir.close(io); + var walker = try dir.walk(gpa); + defer walker.deinit(); + var unlisted: usize = 0; + var seen: usize = 0; + while (try walker.next(io)) |e| { + if (e.kind != .file or !std.mem.endsWith(u8, e.basename, ".zig")) continue; + const src = try e.dir.readFileAlloc(io, e.basename, gpa, .limited(16 << 20)); + defer gpa.free(src); + for ([_][]const u8{ ".local = .{", ".derived = .{" }) |head| { + var at: usize = 0; + while (std.mem.indexOfPos(u8, src, at, head)) |start| { + const end = std.mem.indexOfScalarPos(u8, src, start, '}') orelse break; + at = end; + // Not in a comment or a string (walk.zig's example, this test). + const before = src[(std.mem.lastIndexOfScalar(u8, src[0..start], '\n') orelse 0)..start]; + if (std.mem.indexOf(u8, before, "//") != null or std.mem.indexOfScalar(u8, before, '"') != null) continue; + var lines = std.mem.splitScalar(u8, src[start + head.len .. end], '\n'); + while (lines.next()) |whole| { + const line = whole[0 .. std.mem.indexOf(u8, whole, "//") orelse whole.len]; + var quoted = std.mem.splitScalar(u8, line, '"'); + _ = quoted.next(); + while (quoted.next()) |name| { + _ = quoted.next(); + seen += 1; + const listed = listed: for (kept_out) |k| { + var files = std.mem.tokenizeScalar(u8, k[0], ' '); + const here = while (files.next()) |f| { + if (std.mem.eql(u8, f, e.path)) break true; + } else false; + if (!here) continue; + var names = std.mem.tokenizeScalar(u8, k[1], ' '); + while (names.next()) |n| if (std.mem.eql(u8, n, name)) break :listed true; + } else false; + if (listed) continue; + std.debug.print("core/{s}: `{s}` is kept out of the digest and the dump: on root.zig's kept_out, with who writes it and why a step reads only what its own state makes\n", .{ e.path, name }); + unlisted += 1; + } + } + } + } + } + try std.testing.expect(seen > 60); + try std.testing.expectEqual(@as(usize, 0), unlisted); +} |
