summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 14:41:03 -0300
committerGabriel Schneider <[email protected]>2026-11-19 15:51:13 -0300
commitee2e79dea10c93c104b70cf1eedccd7ba85003fc (patch)
tree0a7796a729e1e324a09c21dead12a01b375fd541
parentf1db5eaf5a5cc5f891cc2c180aa706fefc39971d (diff)
downloadpardes-ee2e79dea10c93c104b70cf1eedccd7ba85003fc.tar.gz
pardes-ee2e79dea10c93c104b70cf1eedccd7ba85003fc.zip
the small ones: their tape calls are the handle's, `p.tape` (the handle's step 5, P20, pardes-handle-sizing section 3's fifth noun): sixteen calls in ten files, each in a function that holds the core: Output (History's dumps and Config's default dump directory asked of the authority, Fonts' listing a site), Query (Recent's rows and the closed panes asked of the authority, a preview's read a site), Store (a closed pane's record, the authority's), Plumb (a port's readers, the authority's; its `const tape = @import("tape.zig")` gone, 1 line apart from the count), Stream (a search run on the loop, a site), mouse (whether a script reads a pane's events, the authority's), File (an edit's mtime, a clock), ninep/events (the boot's event when not replaying), ninep/tree (/sessions, a site), builtins (Get's label, Mount's probe and Term's shell check: `c.p.tape`, a word's context holds the core); no function gains the parameter (row: 0); Stream.runHere, the host's search on its loop when it has no worker, holds the core and reads its field, which is the tape the global names whenever a step is under way (the safe build's check at every entry); the five numbers: (1) functions that gained the parameter 0 (row: 0); (2) the 97 per-operation counts within 0.1%, the largest image-frame on medium +0.0332%; no function on a per-row path touched; (3) nothing stopped compiling for want of an io; (4) global io uses 7 (unchanged), free calls into the tape 45 -> 29, machine_lines rows unchanged; (5) lines changed: tests 0, code +16/-16 (and the import's one line). Lines in files not this work's: none. Gate: tui core-test 840/983 (143 skipped), shell-test 1018/1021, pane-test 183/184, term-test 15/15, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds 0 failures, process-test lspcomplete and lspcompletemoved (the base's; winch failed once, passed on the runner's retry), replicas --clients 5 diverged 0, unequal 0, deltas wrong 0 (2033/0, 1978/0, 1682/0), quiet 568/0, 581/0, 748/0, stops not at may_wait 0 (its "corpus through a client" fails as on the base, steps 18 to 21), gui unit-test 1616/1620 (BaselineHarnessMismatch, the base's), daemon.py plain, --far, --games, --window-clients pass, test/cross_replay.py tui to tui: 28 digests agree in each of the three replicas, semantics 313a99190b93a8c5 (unmoved); frames (gpu/handle2-5b against tree1, run again after the machine's reboot cut handle2-5 short) 77/77 byte-identical in Debug, gui unit-test 1616/1620, perfab corpus2x +0.035% (session noise 0.089%, threshold 0.4%), pictures identical in all 10 runs, perfops PASS
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
-rw-r--r--core/File.zig2
-rw-r--r--core/Output.zig6
-rw-r--r--core/Plumb.zig3
-rw-r--r--core/Query.zig6
-rw-r--r--core/Store.zig2
-rw-r--r--core/Stream.zig2
-rw-r--r--core/builtins.zig6
-rw-r--r--core/mouse.zig2
-rw-r--r--core/ninep/events.zig2
-rw-r--r--core/ninep/tree.zig2
10 files changed, 16 insertions, 17 deletions
diff --git a/core/File.zig b/core/File.zig
index 09dc44f1..820447ac 100644
--- a/core/File.zig
+++ b/core/File.zig
@@ -779,7 +779,7 @@ fn edit(p: *Pardes, f: *State, off: usize, len: usize, bytes_in: []const u8, who
f.saved_revision = f.revision;
};
// The clock the session that recorded read (core/tape.zig).
- f.mtime = pardes.tape.value(.mtime, pardes.ctlfs.events.now, .{});
+ f.mtime = p.tape.value(.mtime, pardes.ctlfs.events.now, .{});
if (f.highlights.len > 0) p.tree_sitter_gpa.free(f.highlights);
f.highlights = &.{};
f.highlight_start = 0;
diff --git a/core/Output.zig b/core/Output.zig
index 1395b06f..750baf8f 100644
--- a/core/Output.zig
+++ b/core/Output.zig
@@ -532,7 +532,7 @@ pub fn openJumps(p: *Pardes, id: usize) !void {
/// it (exec.operandAt), and a look at the line is the same (look.zig).
/// Asked of the authority: the state file is its host's.
pub fn openHistory(p: *Pardes, id: usize) !void {
- const text = pardes.tape.authority(dumpsText, .{p}) orelse return error.NoStateFile;
+ const text = p.tape.authority(dumpsText, .{p}) orelse return error.NoStateFile;
if (text.len == 0) return error.NoDumps;
var out: std.Io.Writer.Allocating = .init(p.gpa);
errdefer out.deinit();
@@ -723,7 +723,7 @@ pub fn openFonts(p: *Pardes, id: usize) !void {
if (builtins.capabilities.font_picker) {
// The session's machine's fonts, a question to its disk: a client's
// replay takes the session's answer, never its own.
- const content = try pardes.tape.site(.fonts, p.gpa, fontsListed, .{ p.gpa, p.scratch.allocator() });
+ const content = try p.tape.site(.fonts, p.gpa, fontsListed, .{ p.gpa, p.scratch.allocator() });
try openStepped(p, id, .{ .cmd = .Fonts }, content);
}
}
@@ -854,7 +854,7 @@ pub fn openConfig(p: *Pardes, id: usize) !void {
try p.locations_config.write(&located.writer);
try config.Runtime.writeReport(&out.writer, .{
.locations = located.written(),
- .default_dump_dir = pardes.tape.authority(dumpDirectory, .{@as([]u8, &dir_buf)}),
+ .default_dump_dir = p.tape.authority(dumpDirectory, .{@as([]u8, &dir_buf)}),
.startup_config_path = p.startupPath(),
.platform = builtins.viewPlatform(p),
.theme_name = p.theme().name,
diff --git a/core/Plumb.zig b/core/Plumb.zig
index a28ba5a8..fdb7ad8c 100644
--- a/core/Plumb.zig
+++ b/core/Plumb.zig
@@ -12,7 +12,6 @@ const fs = @import("fs.zig");
const look = @import("look.zig");
const layout = @import("layout.zig");
const Kind = @import("Kind.zig");
-const tape = @import("tape.zig");
const events = @import("ninep/events.zig");
const Regex = @import("regexp.zig").Regex;
const Pardes = pardes.Pardes;
@@ -901,7 +900,7 @@ pub fn send(p: *Pardes, from: ?usize, msg: Msg, seen: ?Seen) Sent {
// whom only the authority knows (its 9P opens); with none, what the
// rule set starts.
const i = port orelse return .done;
- if (tape.authority(portRead, .{ p, i })) {
+ if (p.tape.authority(portRead, .{ p, i })) {
fanOut(p, i, &m);
return .done;
}
diff --git a/core/Query.zig b/core/Query.zig
index e8011a1f..ce83a6ac 100644
--- a/core/Query.zig
+++ b/core/Query.zig
@@ -719,7 +719,7 @@ fn startSource(p: *Pardes, id: usize, q: *Query, source: Source, owner_id: ?usiz
.recent => {
var out: std.Io.Writer.Allocating = .init(gpa);
defer out.deinit();
- var lines = std.mem.splitScalar(u8, pardes.tape.authority(recentRows, .{ p, &out }), '\n');
+ var lines = std.mem.splitScalar(u8, p.tape.authority(recentRows, .{ p, &out }), '\n');
while (lines.next()) |ln| {
if (ln.len == 0) continue;
const rel = relative(ln, dir);
@@ -742,7 +742,7 @@ fn startSource(p: *Pardes, id: usize, q: *Query, source: Source, owner_id: ?usiz
// `(closed)` and dimmer (makeNameRows): Enter brings one back
// where it was. Its name alone is matched, not the word. The
// session's, which a replica has from the authority.
- for (pardes.tape.authority(Store.closedNames, .{p})) |c| {
+ for (p.tape.authority(Store.closedNames, .{p})) |c| {
var buf: [4096 + 48]u8 = undefined;
const row = std.fmt.bufPrint(&buf, config.pane_addr ++ "{d} {s}" ++ closed_word, .{ c.serial, relative(c.name, dir) }) catch continue;
const key_at = std.mem.indexOfScalar(u8, row, ' ').? + 1;
@@ -1668,7 +1668,7 @@ fn displayPreview(p: *Pardes, qid: usize, path: []const u8, at: look.Spot) void
const f = &pane.file.?;
if (!std.mem.eql(u8, f.path, path)) {
if (exec.kindOf(p.tape, path)) |kind| if (kind != .file) return;
- const bytes = pardes.tape.site(.preview, p.gpa, filesystem.read, .{ p, path }) catch return;
+ const bytes = p.tape.site(.preview, p.gpa, filesystem.read, .{ p, path }) catch return;
if (std.mem.indexOfScalar(u8, bytes[0..@min(bytes.len, 8000)], 0) != null) {
p.gpa.free(bytes);
return;
diff --git a/core/Store.zig b/core/Store.zig
index 25b41bcb..0c46e7d9 100644
--- a/core/Store.zig
+++ b/core/Store.zig
@@ -192,7 +192,7 @@ pub fn closedBySerial(s: *const Store, serial: u32) ?*Closed {
/// load; the keyboard on it otherwise.
pub fn reopen(s: *Store, p: *Pardes, serial: u32, from: usize) bool {
// This session's: a replica has the authority's (`tape.authority`).
- const place = pardes.tape.authority(record, .{ s, serial }) orelse return false;
+ const place = p.tape.authority(record, .{ s, serial }) orelse return false;
const free = p.freeSlot() orelse {
p.reportError(from, "Panes", error.NoPaneSlots);
return false;
diff --git a/core/Stream.zig b/core/Stream.zig
index d5246211..2d7cd018 100644
--- a/core/Stream.zig
+++ b/core/Stream.zig
@@ -652,7 +652,7 @@ pub fn runHere(p: *Pardes, gen: u32) void {
// Its reads a site of the tape's (a 9P write's Grep or Find runs here):
// a replica takes the batches the session got, as it takes a worker's
// (Event.search), and reads no file.
- const batches = pardes.tape.site(.search, p.gpa, searchHere, .{ p.gpa, job });
+ const batches = p.tape.site(.search, p.gpa, searchHere, .{ p.gpa, job });
defer p.gpa.free(batches);
for (batches) |*b| {
receive(p, b);
diff --git a/core/builtins.zig b/core/builtins.zig
index a79e4b66..7add3d9c 100644
--- a/core/builtins.zig
+++ b/core/builtins.zig
@@ -494,7 +494,7 @@ pub const Restore = struct {
var full_buf: [4096]u8 = undefined;
var label_buf: [256]u8 = undefined;
const file = if (typed) |t| dump.restoreFile(c.p.tape, t, c.p.settings.dump_dir.get(), &full_buf) else null;
- const name = if (file) |path| path else pardes.tape.authority(pardes.Db.labelled, .{ &c.p.db, c.p, typed, @as([]u8, &label_buf) }) orelse {
+ const name = if (file) |path| path else c.p.tape.authority(pardes.Db.labelled, .{ &c.p.db, c.p, typed, @as([]u8, &label_buf) }) orelse {
var buf: pardes.Kind.Buf(320) = .{};
return c.p.reportFailure(c.id, if (typed) |t| buf.print("Restore: no dump labelled {s}", .{t}) else "Restore: no dump yet; name one");
};
@@ -593,7 +593,7 @@ pub const Mount = struct {
};
// A mount that cannot be reached is said now, and taken back, not
// found out by the first look through it.
- const reached = pardes.tape.site(.probe, null, @import("runtime").ninep_io.Client.probeMount, .{ c.p.gpa, dial });
+ const reached = c.p.tape.site(.probe, null, @import("runtime").ninep_io.Client.probeMount, .{ c.p.gpa, dial });
reached catch |err| {
if (c.p.fs.mounts.pop()) |gone| {
c.p.gpa.free(gone.name);
@@ -1182,7 +1182,7 @@ pub const Term = struct {
if (arg.len > 0) {
var why: [320]u8 = undefined;
// The authority's lookup, taped, as Shell's (exec.zig).
- if (pardes.tape.site(.shell, null, @import("dev").host_io.Shell.refusal, .{ arg[0..@min(arg.len, 200)], &why })) |refused| {
+ if (c.p.tape.site(.shell, null, @import("dev").host_io.Shell.refusal, .{ arg[0..@min(arg.len, 200)], &why })) |refused| {
var said: pardes.Kind.Buf(340) = .{};
return c.p.reportFailure(c.id, said.print("Term: {s}", .{refused}));
}
diff --git a/core/mouse.zig b/core/mouse.zig
index 8e761453..6fb97787 100644
--- a/core/mouse.zig
+++ b/core/mouse.zig
@@ -974,7 +974,7 @@ pub fn reportRange(
chord_arg: ?[]const u8,
) bool {
const scripted = p.panes[id] orelse return false;
- if (!pardes.tape.authority(readsEvents, .{ p, id })) return false;
+ if (!p.tape.authority(readsEvents, .{ p, id })) return false;
const is_look = cmd == config.look_cmd;
const action: ctlfs.events.Action = if (is_look)
(if (on_tag) .tag_look else .body_look)
diff --git a/core/ninep/events.zig b/core/ninep/events.zig
index 2d539cca..1e740345 100644
--- a/core/ninep/events.zig
+++ b/core/ninep/events.zig
@@ -158,7 +158,7 @@ pub fn announce(p: *Pardes) void {
/// joined from a dump, is empty, and its step must not announce (taped
/// reads, Recent's) where the session's, booted long ago, does not.
fn bootFirst(p: *Pardes) void {
- if (newest(p) == null and !pardes.tape.replaying()) announce(p);
+ if (newest(p) == null and !p.tape.replaying()) announce(p);
}
/// Records `<kind> <serial> <name>`.
diff --git a/core/ninep/tree.zig b/core/ninep/tree.zig
index 85723991..d5a6b2fe 100644
--- a/core/ninep/tree.zig
+++ b/core/ninep/tree.zig
@@ -1147,7 +1147,7 @@ fn readFile(p: *Pardes, req: Req, target: Target) Reply {
.sessions => sessions: {
if (comptime !daemon.supported) break :sessions stagedReply(p, req);
// Out of the turn: the daemon answers within 2 s, or not at all.
- const said = pardes.tape.site(.sessions, p.gpa, daemonList, .{p.gpa}) catch |err| break :sessions switch (err) {
+ const said = p.tape.site(.sessions, p.gpa, daemonList, .{p.gpa}) catch |err| break :sessions switch (err) {
error.OutOfMemory => Reply.fail(req.tag, E.NOMEM),
else => failText(req.tag, E.NOENT, "no pardes daemon answers"),
};