summaryrefslogtreecommitdiff
path: root/test/session.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-18 07:22:41 -0300
committerGabriel Schneider <[email protected]>2026-11-18 09:44:10 -0300
commitb2f709d7130571658220636f33b5f89414a5101a (patch)
treed90c39668caec2fb08bc4bfc9e0ef8c18c9cbe02 /test/session.zig
parentf0e6eb0de0b5ac9f81ba2c728f3040c4a51ab284 (diff)
downloadpardes-b2f709d7130571658220636f33b5f89414a5101a.tar.gz
pardes-b2f709d7130571658220636f33b5f89414a5101a.zip
pdf: the PDF kind runs where its pane is shown (PA_PLAIN): its state is one plain block of 840 bytes with no padding (the place, each view's layout, fit, tint, the state jobs out, the search, the selection made, the press, the pointer's word, the glide and the fling, the count), changed only by its calls from the block and taped values; the document, the pages' sizes, what the state jobs answered, the strips and the pictures are each process's own, found by the block's address and made again where a client joined late lacks them; its pages are draws asked as each view is painted, never jobs on the tape; its keys, mouse and ticks read no picture (a pan, a click and a revealed hit take MuPDF's measure of the raster); the glide and the fling run on the ticks' clock, never on frames painted (.scratch/sketch/reorg/pardes-addons-3/design-glide.md); with no workers a draw done at once is painted the same frame; a client's joined pane keeps the session's place; a window client wheeling the PDF to page 2 reads 80.4 MB -> 0.18 MB and waits a round trip on 0 of 36 inputs (34 before), its join reads 7.4 -> 26.8 MB (it now maps pdf.so); tui core-test 820/959 (139 skipped), shell-test 994/997, behaviour-test 274/274 and --replay 0 failures, pane-test 180/181 (the PDF Shadow test is now the line's), addon-test 1/1 (pdf.out unchanged), replicas pass, process-test 2 of 144 failed (lspcomplete, lspcompletemoved: the base's), image-harness passes, test/daemon.py plain, --far, --games, --window-clients pass; gui unit-test 1588/1592 (its perf check's BaselineBuildMismatch, known); the frame corpus 74/77 Debug and ReleaseFast: frames 58-60 differ, InactiveDim's announcement now replaced by WindowOpacity's instead of stacked, because a PDF render's answer is no longer a core event between the two 9P writes (the PDF's own frames are identical); corpus2x -0.247%; pdf-scroll-bench 18,394M -> 19,214M instructions (its clock never advances, so its slow scroll counts as a fling)
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.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/session.zig b/test/session.zig
index 06cd3a32..cd04ecb8 100644
--- a/test/session.zig
+++ b/test/session.zig
@@ -107,6 +107,7 @@ pub const Session = struct {
pub fn deinit(s: *Session) void {
s.held.deinit(pardesOf(s).gpa);
+ if (s.hold_jobs) pardes.Kind.drawer = null;
if (s.watch_fd >= 0) {
pardes.file_watch.unwatchAll(s.watch_fd, &s.watches);
_ = std.c.close(s.watch_fd);
@@ -310,6 +311,19 @@ pub const Session = struct {
return true;
}
+ /// Kinds' jobs and draws held from now on (`hold_jobs`), until
+ /// `releaseJobs`.
+ pub fn holdJobs(s: *Session) void {
+ s.hold_jobs = true;
+ pardes.Kind.drawer = .{ .ctx = s, .go = struct {
+ fn go(ctx: ?*anyopaque, j: *pardes.host_io.KindJob) bool {
+ const ss: *Session = @ptrCast(@alignCast(ctx));
+ ss.held.append(pardesOf(ss).gpa, j) catch return false;
+ return true;
+ }
+ }.go };
+ }
+
/// 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 {
@@ -320,6 +334,7 @@ pub const Session = struct {
/// The jobs held, run now and answered as the host's workers would.
pub fn releaseJobs(s: *Session) void {
s.hold_jobs = false;
+ pardes.Kind.drawer = null;
for (s.held.items, 0..) |j, i| {
if (i >= s.ran) j.run();
j.land(pardesOf(s));