diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 06:07:10 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 06:07:21 -0300 |
| commit | 26d0581168ac4b582025ecb01b36968850344811 (patch) | |
| tree | b91cab46612fa48c55d7ec93fbe802af5da6bf23 /dev/Inbox.zig | |
| parent | 8d9f4c88072089b53c77ab7e66b01c461fbbee74 (diff) | |
| download | pardes-26d0581168ac4b582025ecb01b36968850344811.tar.gz pardes-26d0581168ac4b582025ecb01b36968850344811.zip | |
runtime, dev: the daemon's notes are the session loop's own, so `note` leaves the frontend calls (nine to eight: options, open, close, start, sent, upgradeAsked, restoring, restored): the loop's note puts an adopted shell on its queue (both frontends take it in their wait), hands a client's connection to Peers (joined at the next step boundary, its post the wake, as the window did) and wakes the queue for a new daemon's hello; the terminal's deliverNote, its adopted and replica messages and arms (in apply and in Own.close's drain) and the window's deliverNote and both Own.note are deleted, the terminal's Shell names its session loop (`session`) so that a quit before the first frame starts the daemon's reader through the loop's watch; and the test first: an Adopt's shells arriving while output fills the queue were dropped by Inbox.push, their masters closed and the shells lost with them (448 outputs in, the shell and the end of the list pushed, 448 taken), in the window today, and in the terminal once its notes came through this queue (vaxis's queue had made the daemon's thread wait); the queue now keeps room for one Adopt's shells beyond the output's (adopt_capacity, the ring 64 + 1 longer, the output's bound unchanged) and each pane's end of file beyond those; a user could have hit it: Adopt in a window while another pane floods; tui core-test 858/1009 (151 skipped), shell-test 1049/1052, term 17/17, pane 183/184, kitty 45/45, behaviour-test and --replay 275/275, process-test 0 of 144 failed (msg, pagercolor and exec-bigdrag failed once in the run, passed on their retries), soak --clients 5 diverged 0, unequal 0, checked/wrong 1874/0 1937/0 1831/0, quiet checks 597/0 673/0 779/0, unlisted 0, corpus 22 of 22, no leak; --bytes --clients 5 diverged 0, unequal 0, quiet checks 693/0 586/0 802/0, corpus 22 of 22, no leak, its one unlisted stop at `now` the base's; gui unit-test 1646/1650 with only BaselineHarnessMismatch; daemon.py plain, --far, --games (keys stopped 0 and 0), --window-clients, --upgrade both ways pass (load 8-22)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/Inbox.zig')
| -rw-r--r-- | dev/Inbox.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/dev/Inbox.zig b/dev/Inbox.zig index 234d89eb..347ad278 100644 --- a/dev/Inbox.zig +++ b/dev/Inbox.zig @@ -47,8 +47,12 @@ pub const Msg = union(enum) { } }; -pub const capacity = 512; -pub const output_capacity = capacity - pardes.MAX_PANES; +/// The ring's room: output up to `output_capacity` (a reader waits for +/// more), an Adopt's shells beyond it (one note's: never lost to a flood), +/// and each pane's end of file beyond those (lost to neither). +pub const output_capacity = 512 - pardes.MAX_PANES; +const adopt_capacity = output_capacity + pardes.MAX_PANES + 1; +pub const capacity = adopt_capacity + pardes.MAX_PANES; pub const Batch = struct { items: [capacity + 2 * selection_pipe.Tasks.capacity + 2]Msg = undefined, @@ -194,7 +198,7 @@ pub fn push(q: *Inbox, m: Msg) void { return; } std.debug.assert(q.len < q.items.len); - } else if (q.len >= output_capacity) { + } else if (q.len >= @as(usize, if (m == .adopted) adopt_capacity else output_capacity)) { q.unlock(); m.deinit(q.gpa, q.lsp_allocator); return; |
