diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-18 07:09:32 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-18 07:09:32 -0300 |
| commit | f0e6eb0de0b5ac9f81ba2c728f3040c4a51ab284 (patch) | |
| tree | e2660cddde27b7dc03240e6c56ceefad1ffc35fe /test/session.zig | |
| parent | 3350156db428656fa8e583d1971663e1c4a215b0 (diff) | |
| download | pardes-f0e6eb0de0b5ac9f81ba2c728f3040c4a51ab284.tar.gz pardes-f0e6eb0de0b5ac9f81ba2c728f3040c4a51ab284.zip | |
kinds: a kind's job tokens are the session's on every core, a client's plain kind keeps no job's input, and a PDF render's pixels go with the document they are of: Slot.tokens is dumped and digested (a client joined later numbers its next job as the session does; a Shadow takes it from the call's outcome), api.job on a replica gives the token alone (it runs no job, so its four input slots filled and it refused the fifth while the session asked on), and a render's answer names its document, so one that lands after its pane opened its file again (changed on disk) no longer frees pixels the old document freed with it (a double free, ABRT in the new behaviour test without the fix); kitty-harness's panic placed: the base's (the harness panics before its first line when NO_COLOR is in its environment, as zig build gives it; run by hand without it, it passes on the base and on this tree); tui core-test 820/959 (139 skipped), shell-test 994/997, behaviour-test 274/274 and --replay 0 failures, pane-test 180/181, addon-test 1/1, replicas pass (checked/wrong 0)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/session.zig')
| -rw-r--r-- | test/session.zig | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/session.zig b/test/session.zig index 056966b9..06cd3a32 100644 --- a/test/session.zig +++ b/test/session.zig @@ -43,6 +43,8 @@ pub const Session = struct { /// meanwhile (a reload). hold_jobs: bool = false, held: std.ArrayList(*pardes.host_io.KindJob) = .empty, + /// Of `held`, those run already (`runJobs`), their answers still held. + ran: usize = 0, /// The files the core asked to watch, watched as a host watches them /// (file_watch.zig, inotify): `filesChanged` wakes them. watch_fd: c_int = -1, @@ -308,14 +310,22 @@ pub const Session = struct { return true; } + /// The jobs held run now, as a worker runs them, their answers held + /// still: what a test does next happens while they are under way. + pub fn runJobs(s: *Session) void { + for (s.held.items[s.ran..]) |j| j.run(); + s.ran = s.held.items.len; + } + /// The jobs held, run now and answered as the host's workers would. pub fn releaseJobs(s: *Session) void { s.hold_jobs = false; - for (s.held.items) |j| { - j.run(); + for (s.held.items, 0..) |j, i| { + if (i >= s.ran) j.run(); j.land(pardesOf(s)); } s.held.clearRetainingCapacity(); + s.ran = 0; s.drain(); } |
