summaryrefslogtreecommitdiff
path: root/core/Stream.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 02:02:19 -0300
committerGabriel Schneider <[email protected]>2026-11-20 02:32:57 -0300
commitc77e5a09af27976b2375a902ecb8efa428395a0c (patch)
treecb36b7b3c691b4904d2a1c2a182cd747e7c82602 /core/Stream.zig
parent866e9ed6762f42a32907d63d783464f2c90d5b85 (diff)
downloadpardes-c77e5a09af27976b2375a902ecb8efa428395a0c.tar.gz
pardes-c77e5a09af27976b2375a902ecb8efa428395a0c.zip
tape: the wrappers deleted, step 6c (reports/pardes-handle-69-design.md): a core's host is always its own (a replica's none), the tape only says which functions it has when the core holds another than the last said (noteHost, today's comparison, so a mask lands where it did) and a replica answers by that word (the bool replica, set by its first replay or its join; Tape.has), so Wrap's arity table, hostOf, wrap, the tape's vtable, resync's and Peers.stop's unwrap and apply's three hostOf go; the 9 presence questions are p.tape.has(p, .search); keeps_stopping and forTheView are lists of the table's names, a renamed field no longer compiling there; root.zig's machine scan names host.vtable and host.ctx, which only tape.zig's noteHost line names now (40 lines of core/ named the table at the base); the tape's bytes do not move (semantics 32640d4a722b811c unmoved, cross_replay both ways)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Stream.zig')
-rw-r--r--core/Stream.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/Stream.zig b/core/Stream.zig
index dae61a8b..6f99b504 100644
--- a/core/Stream.zig
+++ b/core/Stream.zig
@@ -311,7 +311,7 @@ pub fn takeAhead(p: *Pardes, serial: u32, revision: u32, need_start: usize, need
/// workers, and only for a grammar a worker can paint (syntax.readyApart).
pub fn paintAhead(p: *Pardes, serial: u32, revision: u32, path: []const u8, content: []const u8, from: usize, to: usize) void {
const s = &p.stream;
- if (p.host.vtable.search == null or p.fs.serving or to <= from or to > content.len) return;
+ if (!p.tape.has(p, .search) or p.fs.serving or to <= from or to > content.len) return;
const a = s.ahead_for;
if (s.ahead.len != 0 and a.serial == serial and a.revision == revision and from >= a.start and to <= a.start + s.ahead.len) return;
// A stretch bigger than this (a few lines of a minified file) is not
@@ -355,7 +355,7 @@ pub fn askAhead(p: *Pardes) void {
/// one revision of a file.
pub fn paintRows(p: *Pardes, path: []const u8) void {
const s = &p.stream;
- if (s.rows_paint != null or p.host.vtable.search == null) return;
+ if (s.rows_paint != null or !p.tape.has(p, .search)) return;
// Asked while a 9P write is served (a script's Grep): not now, as no
// paint is (the write would wait for it to settle); the next step asks.
if (p.fs.serving) {
@@ -452,7 +452,7 @@ pub fn parseFor(p: *Pardes, id: usize) void {
s.parse_next = .{ .serial = pane.serial, .revision = f.revision };
return;
}
- const workers = p.host.vtable.search != null and !p.fs.serving;
+ const workers = p.tape.has(p, .search) and !p.fs.serving;
if (!workers and f.content.len > 64 << 10) return;
const job = TextJob.make(p.gpa, pane.serial, f.revision, 0, f.path, f.content) orelse return;
s.gen +%= 1;
@@ -559,7 +559,7 @@ pub fn step(p: *Pardes) void {
s.state = .searching;
// A script's write (whose answer says whether it found anything) and a
// host with no workers: done before this returns.
- if (p.host.vtable.search != null and !p.fs.serving) p.emit(.{ .search = .{ .gen = s.gen } }) else runHere(p, s.gen, false);
+ if (p.tape.has(p, .search) and !p.fs.serving) p.emit(.{ .search = .{ .gen = s.gen } }) else runHere(p, s.gen, false);
}
/// When the core next needs a tick for the stream: the end of the pause.