diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-21 01:00:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-21 01:08:24 -0300 |
| commit | 76565c605defb03ab6aa8300b93f306054a67efd (patch) | |
| tree | 706cc64e23ae33ec6be1d6b9164750ba42da712b /core/Stream.zig | |
| parent | 6d937cd125ca04a2edb92b2d014014ee6c2eb45d (diff) | |
| parent | dac87eaa1d57acfc5b2dd8427e7fbacfe065e613 (diff) | |
| download | pardes-76565c605defb03ab6aa8300b93f306054a67efd.tar.gz pardes-76565c605defb03ab6aa8300b93f306054a67efd.zip | |
integration: the terminals' side line on the landed main: pardes-term-join-4 (terminals by the pty's bytes: a client's emulator fed the session's bytes, reload at a join, the lag bound; the query rows' paint decided on replicated state; views.park's leak; a view kept for its client's rejoin; C and Alt-C on a long text walking on from the row last tried: 306 G instructions to 194 M; the soak's witness and watchdog) and main (pardes-new-upgrade); seven conflicts: the wire's version (the side line's 24 is 26 here: 24 is the bye's close byte, 25 the 9P state), Peers' join (the view typed, the lag limit a field's default), a peer's end (the view's index; cut joins again), the client's and the soak's bye (the struct, again or lagged), daemon.py's WIRE; three more the compiler found (a test's view typed: its index where a u8 is asked)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Stream.zig')
| -rw-r--r-- | core/Stream.zig | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/core/Stream.zig b/core/Stream.zig index a04cad46..f65d0683 100644 --- a/core/Stream.zig +++ b/core/Stream.zig @@ -245,10 +245,10 @@ ahead_seen: struct { serial: u32 = 0, scroll: usize = 0, dir: i2 = 1 } = .{}, /// the next asked when it lands (Query.recolor); a worker per file if a /// Grep of hundreds of files colours too slowly. rows_paint: ?TextTask = null, -/// The files (a hash of path and revision) asked since the last Grep -/// began: each asked once, so a file whose colours never fit its rows -/// (changed on disk since) is not painted again and again. ponytail: a -/// ring of 256; the oldest forgotten. +/// The files (a hash of the path) asked since the last Grep began: each +/// asked once, so a file whose colours never fit its rows (changed on +/// disk since, an edit) is not painted again and again. ponytail: a ring +/// of 256; the oldest forgotten. rows_asked: [256]u64 = @splat(0), rows_asked_at: u8 = 0, /// Rows asked for their colours while a 9P write was served: asked again @@ -352,17 +352,13 @@ pub fn askAhead(p: *Pardes) void { /// from disk there. Kept in the locations cache when it lands, where the /// rows find them (Query.Shades). Not without workers (the rows stay /// plain), nor for a file bigger than `max_rows_paint_bytes`, nor twice for -/// one revision of a file. +/// a file between two Greps. Asked after every file's rows, whatever +/// colours they have here: those are this process's own (what its frames +/// painted of the text, what its locations cache kept: in no digest), and +/// what a step asks of a worker must not hang on them. pub fn paintRows(p: *Pardes, path: []const u8) void { const s = &p.stream; 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) { - s.rows_later = true; - return; - } - if (!syntax.readyApart(path)) return; var content: ?[]const u8 = null; var revision: u32 = 0; for (p.panes) |slot| if (slot) |pane| if (pane.file) |f| if (f.output == null and std.mem.eql(u8, f.path, path)) { @@ -371,8 +367,15 @@ pub fn paintRows(p: *Pardes, path: []const u8) void { break; }; if (content) |c| if (c.len > max_rows_paint_bytes) return; - const key = std.hash.Wyhash.hash(revision, path) | 1; + const key = std.hash.Wyhash.hash(0, path) | 1; if (std.mem.indexOfScalar(u64, &s.rows_asked, key) != null) return; + if (!syntax.readyApart(path)) 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) { + s.rows_later = true; + return; + } const job = TextJob.make(p.gpa, 0, revision, 0, path, content orelse "") orelse return; s.rows_asked[s.rows_asked_at] = key; s.rows_asked_at +%= 1; |
