diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-19 11:52:31 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 12:41:12 -0300 |
| commit | ea833164aa83d02119301a204b91ff9a8eeff27a (patch) | |
| tree | 267ff49280d88c8807926c1c09d615ba4d0c5782 /core/Core.zig | |
| parent | 71d8744b41dec56d835e30f531b96fede5d610a1 (diff) | |
| download | pardes-ea833164aa83d02119301a204b91ff9a8eeff27a.tar.gz pardes-ea833164aa83d02119301a204b91ff9a8eeff27a.zip | |
tape: the core's entries are written once (P22, pardes-entries part 2, its first half; the owner's mechanism C and names): each of 36 entries is its public name made by `pardes.tape.taped` from the private body directly under it (`pub const setCwd = pardes.tape.taped(setCwdInner);` then `fn setCwdInner(p: *Pardes, id: usize, cwd: []const u8) void { body }`, the doc comment on the public line), so the entry no longer opens with `tape.enter` and a deferred `tape.leave` and has no replay arm of its own: `taped` makes a function of the inner's own parameters (one per arity, 1 to 4, `tape.Taped((function 'setCwdInner')).f3` in a profile) that records the variant of `tape.Input` whose line names the entry (`set_cwd: Args(Pardes.setCwd)`, a type of that entry's own, found by the function itself in the wrapper's body: at the declaration it would be a dependency loop between the union and the entries), defers the leave and calls the inner with `@call(.always_inline)`, so an entry compiles to what one written with its own pair did; the replay's `apply` keeps its hand-written arms (init, init_from_dump, restore, deinit, pump, render, to_view) and calls every other entry from its variant in ONE `inline else`; the six kept by hand say why in one line each (init and initFromDump: no core yet; deinit: what it records is no argument and it leaves on no core; pump: the host is set before the enter and is no input; render: the arena is no input; toView: the live view asked again records nothing, and a frontend asks before every input), and restore is taped with an arm of its own (it swaps the replay's core); an entry in 36 places went from 4 lines in 3 places (variant, enter, leave, arm) to 2 in 2 (the public line beside its body, the variant's line), and an argument left out or passed in another order can no longer be written: a variant naming the wrong entry or an entry with no variant does not compile, the error naming the inner ("tape: two variants of Input name the entry tape.Taped((function 'setStatusInner')): set_message and set_status", "tape: no variant of Input names the entry tape.Taped((function 'rejoinViewInner'))"); the payloads are now the entry's arguments in order (`args[0]`), read so in the tape's three readers (a screen-state output's bytes stripped, the input's name for a divergence, `describe`), `Input.Font` gone; the bytes a tape holds are the same (walk writes no field names) but its shape is not, so the semantics word moves, 2f615168fe07b35f -> 313a99190b93a8c5; `update`, `presented` and `dumpFailed` read `p.view()` before their enter and now after it (the enter writes only the tape's own state and the host it wraps, nothing a view holds); no call site changed, no line outside core/; core/ 203 lines added, 187 deleted (tape.zig 204 of them: the helper 58 code lines, 36 arms gone). Gate: tui core-test 838/981 (143 skipped), shell-test 1016/1019, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds of 70 steps, 0 failures, process-test lspcomplete and lspcompletemoved (the base's), replicas --clients 5 diverged 0, unequal 0, deltas wrong 0 (1705/0, 1722/0, 1714/0), quiet 526/0, 652/0, 811/0, stops not at may_wait 0; a session recorded and replayed by itself (test/cross_replay.py: 28 digests agree in each of the three replicas); gui unit-test 1614/1618 (the perf check's BaselineHarnessMismatch, the base's); daemon.py plain, --far, --games, --window-clients pass; the macOS library for Linux and aarch64-macos and the FreeBSD cross-build configure and build; frames (gpu/entries-1 against tree1) 77/77 byte-identical in Debug, gui unit-test 1614/1618 there too, perfab corpus2x +0.100% (session noise 0.031%, threshold 0.4%), pictures identical in all 10 runs, perfops 97 counts within 0.1% (largest image-frame on medium +0.0246%); every entry is one function in the ReleaseFast pardes-perf (36 symbols `tape.Taped((function '<inner>')).f<n>`); update's count, key-down on medium per operation, 10,040,394 at pardes-handle-1's step 2 -> 10,040,439 (+0.0004%; 10,040,102 at tree1), render's, render on medium per operation, 11,456,076 -> 11,456,085 (+0.0001%; 11,455,763 at tree1)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Core.zig')
| -rw-r--r-- | core/Core.zig | 149 |
1 files changed, 62 insertions, 87 deletions
diff --git a/core/Core.zig b/core/Core.zig index 3876b3e8..b4745b24 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -548,6 +548,7 @@ pub fn create(gpa: std.mem.Allocator, opts: Options) !*Pardes { /// A new session, its tape written from here when PARDES_RECORD asks. pub fn init(gpa: std.mem.Allocator, opts: Options) !*Pardes { + // By hand, not `taped`: no core yet to enter on; the tape adopts the one made. pardes.tape.startFromEnv(); const taped = pardes.tape.enter(null, .{ .init = opts }); // The tape adopts the core made, none on a failure. @@ -804,6 +805,7 @@ fn recentFound(p: *Pardes, hash: u64) ?recent_files.Entry { } pub fn deinit(p: *Pardes) void { + // By hand, not `taped`: what it records is no argument (`current`), and it leaves on no core. const taped = pardes.tape.enter(p, .{ .deinit = pardes.tape.current(p) }); pardes.tape.forget(p); defer pardes.tape.leave(null, taped); @@ -871,9 +873,8 @@ pub fn endSession(p: *Pardes) void { /// shell feedback after write_dump: remember where the dump landed (the /// topbar grows a `Restore <path>` word pointing at it) -pub fn setLastDump(p: *Pardes, path: []const u8) void { - const taped = pardes.tape.enter(p, .{ .set_last_dump = path }); - defer pardes.tape.leave(p, taped); +pub const setLastDump = pardes.tape.taped(setLastDumpInner); +fn setLastDumpInner(p: *Pardes, path: []const u8) void { p.pointRestoreAt(path); ctlfs.events.notePath(p, "dump", path); } @@ -900,9 +901,8 @@ pub fn pointRestoreAt(p: *Pardes, path: []const u8) void { } /// the shell polls this each frame: a pending Restore's dump path, or null -pub fn takeRestore(p: *Pardes) ?[]const u8 { - const taped = pardes.tape.enter(p, .take_restore); - defer pardes.tape.leave(p, taped); +pub const takeRestore = pardes.tape.taped(takeRestoreInner); +fn takeRestoreInner(p: *Pardes) ?[]const u8 { const r = p.restore_req; p.restore_req = null; return r; @@ -977,9 +977,8 @@ pub fn parkPendingWrite(p: *Pardes, id: usize, bytes: []const u8) void { /// The shell reports the spawned pane's working directory (and later cwd /// changes it observes, e.g. via /proc/<pid>/cwd before each frame). -pub fn setCwd(p: *Pardes, id: usize, cwd: []const u8) void { - const taped = pardes.tape.enter(p, .{ .set_cwd = .{ .id = id, .cwd = cwd } }); - defer pardes.tape.leave(p, taped); +pub const setCwd = pardes.tape.taped(setCwdInner); +fn setCwdInner(p: *Pardes, id: usize, cwd: []const u8) void { const pane = p.panes[id] orelse return; // A command pane stays the directory's it was run for (newCommand). if (pane.command != null) return; @@ -1013,9 +1012,8 @@ pub fn shellBin(p: *const Pardes) []const u8 { /// already), whose spawn the host answers with that shell's pty. Its id, /// or null with no room. An input, as every host write into the core /// is: a replica of the session makes the same pane. -pub fn adoptShell(p: *Pardes) ?u8 { - const taped = pardes.tape.enter(p, .adopt_shell); - defer pardes.tape.leave(p, taped); +pub const adoptShell = pardes.tape.taped(adoptShellInner); +fn adoptShellInner(p: *Pardes) ?u8 { var newest: u32 = 0; for (p.panes) |slot| if (slot) |pn| { newest = @max(newest, pn.serial); @@ -1030,17 +1028,15 @@ pub fn adoptShell(p: *Pardes) ?u8 { /// A terminal's reader failed (no end of file: the host closed its pty): /// its pane takes keys again, and why is said. -pub fn readerFailed(p: *Pardes, id: u8, err: anyerror) void { - const taped = pardes.tape.enter(p, .{ .reader_failed = .{ .id = id, .err = err } }); - defer pardes.tape.leave(p, taped); +pub const readerFailed = pardes.tape.taped(readerFailedInner); +fn readerFailedInner(p: *Pardes, id: u8, err: anyerror) void { const pane = p.panes[id] orelse return; pane.body.mode = .normal; p.reportError(id, "terminal reader", err); } -pub fn acknowledgeShell(p: *Pardes, id: usize, executable: []const u8, prompt_marks: bool) void { - const taped = pardes.tape.enter(p, .{ .acknowledge_shell = .{ .id = id, .executable = executable, .prompt_marks = prompt_marks } }); - defer pardes.tape.leave(p, taped); +pub const acknowledgeShell = pardes.tape.taped(acknowledgeShellInner); +fn acknowledgeShellInner(p: *Pardes, id: usize, executable: []const u8, prompt_marks: bool) void { if (id < MAX_PANES) if (p.panes[id]) |pane| { ctlfs.pty.shellGone(p, pane, true); // a respawn replaced whatever ran pane.shell_failed = false; @@ -1076,9 +1072,8 @@ pub fn acknowledgeShell(p: *Pardes, id: usize, executable: []const u8, prompt_ma /// build, not only a window's, as only a window's host calls /// them and a terminal's replica of a window's session must step as /// the window does. -pub fn takeFontRequest(p: *Pardes) ?[]const u8 { - const taped = pardes.tape.enter(p, .take_font_request); - defer pardes.tape.leave(p, taped); +pub const takeFontRequest = pardes.tape.taped(takeFontRequestInner); +fn takeFontRequestInner(p: *Pardes) ?[]const u8 { if (!p.settings.font.pending or p.font_request_taken) return null; const path = p.settings.font.requested_path.get(); if (path.len == 0) return null; @@ -1086,14 +1081,13 @@ pub fn takeFontRequest(p: *Pardes) ?[]const u8 { return path; } -pub fn observeFont( +pub const observeFont = pardes.tape.taped(observeFontInner); +fn observeFontInner( p: *Pardes, effective_name: []const u8, effective_size_hundredths: u16, unit: config.Runtime.FontSizeUnit, ) bool { - const taped = pardes.tape.enter(p, .{ .observe_font = .{ .name = effective_name, .size = effective_size_hundredths, .unit = unit } }); - defer pardes.tape.leave(p, taped); if (!p.settings.font.effective_name.set(effective_name)) return false; p.settings.font.effective_size_hundredths = effective_size_hundredths; p.settings.font.effective_size_unit = unit; @@ -1102,14 +1096,13 @@ pub fn observeFont( /// Resolve the request already handed to the GUI host. Requested and /// effective tuples deliberately remain separate so DumpConfig can show both. -pub fn acknowledgeFont( +pub const acknowledgeFont = pardes.tape.taped(acknowledgeFontInner); +fn acknowledgeFontInner( p: *Pardes, effective_name: []const u8, effective_size_hundredths: u16, unit: config.Runtime.FontSizeUnit, ) bool { - const taped = pardes.tape.enter(p, .{ .acknowledge_font = .{ .name = effective_name, .size = effective_size_hundredths, .unit = unit } }); - defer pardes.tape.leave(p, taped); if (!p.settings.font.pending or !p.font_request_taken) return false; const changed = !std.mem.eql( u8, @@ -1124,9 +1117,8 @@ pub fn acknowledgeFont( return true; } -pub fn rejectFont(p: *Pardes) void { - const taped = pardes.tape.enter(p, .reject_font); - defer pardes.tape.leave(p, taped); +pub const rejectFont = pardes.tape.taped(rejectFontInner); +fn rejectFontInner(p: *Pardes) void { if (!p.settings.font.pending or !p.font_request_taken) return; p.settings.font.pending = false; p.font_request_taken = false; @@ -1152,9 +1144,8 @@ pub inline fn view(p: anytype) if (@typeInfo(@TypeOf(p)).pointer.attrs.@"const") /// A view of its own for a new client (a second window, a terminal /// `pardes --attach`ed), as the live one is laid out; null at /// Views.max. Not live until `toView`. -pub fn openView(p: *Pardes) ?u8 { - const taped = pardes.tape.enter(p, .open_view); - defer pardes.tape.leave(p, taped); +pub const openView = pardes.tape.taped(openViewInner); +fn openViewInner(p: *Pardes) ?u8 { // Every view taken: one kept for a client that has not come back // for it (Views.away) goes first. ponytail: no timer lets one go; // until its place is wanted it costs a parked slot, and a terminal @@ -1174,9 +1165,8 @@ pub fn openView(p: *Pardes) ?u8 { /// The client of view `k` gone: its view goes, the others stay. The /// last one stays the session's own. -pub fn closeView(p: *Pardes, k: u8) void { - const taped = pardes.tape.enter(p, .{ .close_view = k }); - defer pardes.tape.leave(p, taped); +pub const closeView = pardes.tape.taped(closeViewInner); +fn closeViewInner(p: *Pardes, k: u8) void { Views.close(p, k); p.sync(); // What its sync queued (a terminal it sized, sized again) done here, @@ -1189,9 +1179,8 @@ pub fn closeView(p: *Pardes, k: u8) void { /// The last client of a session no one else watches gone: its view /// goes, and the session's own is laid out as it was (Views.closeKeeping), /// which the client's rejoin copies. Settled as `closeView` is. -pub fn leaveView(p: *Pardes, k: u8) void { - const taped = pardes.tape.enter(p, .{ .leave_view = k }); - defer pardes.tape.leave(p, taped); +pub const leaveView = pardes.tape.taped(leaveViewInner); +fn leaveViewInner(p: *Pardes, k: u8) void { Views.closeKeeping(p, k); p.sync(); p.settle(); @@ -1199,18 +1188,16 @@ pub fn leaveView(p: *Pardes, k: u8) void { /// The client of view `k` gone, to join again for it (an Upgrade's /// rejoin, a divergence's): its view kept as it is (Views.away). -pub fn awayView(p: *Pardes, k: u8) void { - const taped = pardes.tape.enter(p, .{ .away_view = k }); - defer pardes.tape.leave(p, taped); +pub const awayView = pardes.tape.taped(awayViewInner); +fn awayViewInner(p: *Pardes, k: u8) void { Views.away(p, k); } /// A client back for view `k`, kept for it (`awayView`): its own again, /// as it left it; false when it was let go meanwhile. Settled as /// `openView` is, for the join's dump next. -pub fn rejoinView(p: *Pardes, k: u8) bool { - const taped = pardes.tape.enter(p, .{ .rejoin_view = k }); - defer pardes.tape.leave(p, taped); +pub const rejoinView = pardes.tape.taped(rejoinViewInner); +fn rejoinViewInner(p: *Pardes, k: u8) bool { if (!Views.isAway(p, k)) return false; p.views_away &= ~(@as(u8, 1) << @intCast(k)); p.settle(); @@ -1220,6 +1207,7 @@ pub fn rejoinView(p: *Pardes, k: u8) bool { /// Into view `k`, before the input its client sent. pub fn toView(p: *Pardes, k: u8) void { + // By hand, not `taped`: the live view asked again records nothing (a frontend asks before every input). if (k == p.live) return; const taped = pardes.tape.enter(p, .{ .to_view = k }); defer pardes.tape.leave(p, taped); @@ -1229,15 +1217,13 @@ pub fn toView(p: *Pardes, k: u8) void { /// Something changed the core without going through `update` -- a watched /// file reloading under it, a theme file rewritten on disk. `pump` draws /// only when it has a reason to, and this is the reason. -pub fn invalidate(p: *Pardes) void { - const taped = pardes.tape.enter(p, .invalidate); - defer pardes.tape.leave(p, taped); +pub const invalidate = pardes.tape.taped(invalidateInner); +fn invalidateInner(p: *Pardes) void { p.needs_frame = true; } -pub fn reloadWatchedFile(p: *Pardes, id: u8, bytes: []const u8) bool { - const taped = pardes.tape.enter(p, .{ .reload_watched_file = .{ .id = id, .bytes = bytes } }); - defer pardes.tape.leave(p, taped); +pub const reloadWatchedFile = pardes.tape.taped(reloadWatchedFileInner); +fn reloadWatchedFileInner(p: *Pardes, id: u8, bytes: []const u8) bool { p.invalidate(); look.invalidateLookHover(p, id); const applied = p.applyWatchedFileChanged(id, bytes); @@ -1253,9 +1239,8 @@ pub fn emit(p: *Pardes, e: Effect) void { p.effects_len += 1; } -pub fn nextEffect(p: *Pardes) ?Effect { - const taped = pardes.tape.enter(p, .next_effect); - defer pardes.tape.leave(p, taped); +pub const nextEffect = pardes.tape.taped(nextEffectInner); +fn nextEffectInner(p: *Pardes) ?Effect { p.refillPendingWrites(); if (p.effects_len == 0) { p.effects_head = 0; @@ -1339,9 +1324,8 @@ pub fn hostKillJob(p: *const Pardes, id: usize) bool { /// A terminal whose shell could not be started: said, and a run waiting /// on it, or written to it from now on, hears `error shell gone` /// rather than wait for a prompt that never comes. -pub fn shellFailed(p: *Pardes, id: u8, err: anyerror) void { - const taped = pardes.tape.enter(p, .{ .shell_failed = .{ .id = id, .err = err } }); - defer pardes.tape.leave(p, taped); +pub const shellFailed = pardes.tape.taped(shellFailedInner); +fn shellFailedInner(p: *Pardes, id: u8, err: anyerror) void { const pane = p.panes[id] orelse return; pane.shell_failed = true; ctlfs.pty.shellGone(p, pane, false); @@ -1362,9 +1346,8 @@ pub fn shellFailed(p: *Pardes, id: u8, err: anyerror) void { /// A shell started again in a terminal whose shell runs (pty/ctl's /// exec) did not start: the host kept the running one, so only said. -pub fn restartFailed(p: *Pardes, id: u8, err: anyerror) void { - const taped = pardes.tape.enter(p, .{ .restart_failed = .{ .id = id, .err = err } }); - defer pardes.tape.leave(p, taped); +pub const restartFailed = pardes.tape.taped(restartFailedInner); +fn restartFailedInner(p: *Pardes, id: u8, err: anyerror) void { if (p.panes[id] == null) return; p.sayShellFailure(id, err); } @@ -1406,9 +1389,8 @@ fn parentTrouble(tape: *pardes.tape.Tape, path: []const u8, err: anyerror) struc return .{ .dir = dir, .kind = kind, .missing = missing, .denied = denied }; } -pub fn saveFailed(p: *Pardes, id: u8, path: []const u8, err: anyerror) void { - const taped = pardes.tape.enter(p, .{ .save_failed = .{ .id = id, .path = path, .err = err } }); - defer pardes.tape.leave(p, taped); +pub const saveFailed = pardes.tape.taped(saveFailedInner); +fn saveFailedInner(p: *Pardes, id: u8, path: []const u8, err: anyerror) void { if (p.panes[id]) |pane| if (pane.file) |*f| { // The `-%` spelling fs.zig already uses for "make this dirty". f.saved_revision = f.revision -% 1; @@ -1429,10 +1411,9 @@ pub fn saveFailed(p: *Pardes, id: u8, path: []const u8, err: anyerror) void { /// A Dump the host could not write: said on the message row and in the /// log, and the 9P write that asked for it fails with it, as a failed /// Save's does. -pub fn dumpFailed(p: *Pardes, path: []const u8, err: anyerror) void { +pub const dumpFailed = pardes.tape.taped(dumpFailedInner); +fn dumpFailedInner(p: *Pardes, path: []const u8, err: anyerror) void { const v = p.view(); - const taped = pardes.tape.enter(p, .{ .dump_failed = .{ .path = path, .err = err } }); - defer pardes.tape.leave(p, taped); var what: [limits.host_path_cap + 8]u8 = undefined; const operation = std.fmt.bufPrint(&what, "Dump {s}", .{path[0..@min(path.len, limits.host_path_cap)]}) catch unreachable; // cap + 5 fits cap + 8 // Into a DumpDir that is not there: said so, ENOENT, as a Save is; @@ -1473,6 +1454,7 @@ pub fn animationActive(p: *const Pardes) bool { } pub fn pump(p: *Pardes, host: Host) !void { + // By hand, not `taped`: the host is set before the enter, which wraps it, and is no input. p.host = host; const taped = pardes.tape.enter(p, .pump); defer pardes.tape.leave(p, taped); @@ -1558,9 +1540,8 @@ pub fn settle(p: *Pardes) void { /// the client's own core can apply the same at once and expect the /// authority's tape of it to read the same. The session's own pump /// draws it after. -pub fn step(p: *Pardes) void { - const taped = pardes.tape.enter(p, .step); - defer pardes.tape.leave(p, taped); +pub const step = pardes.tape.taped(stepInner); +fn stepInner(p: *Pardes) void { p.settle(); } @@ -1570,9 +1551,8 @@ pub fn step(p: *Pardes) void { /// can be answered while that step is out in a syscall. Only a request /// that changes a pane costs a frame, which is why a round trip on a /// local socket costs microseconds and not a vsync. -pub fn serveFs(p: *Pardes, req: ctlfs.Req) ctlfs.Reply { - const taped = pardes.tape.enter(p, .{ .serve_fs = req }); - defer pardes.tape.leave(p, taped); +pub const serveFs = pardes.tape.taped(serveFsInner); +fn serveFsInner(p: *Pardes, req: ctlfs.Req) ctlfs.Reply { // The held write of an Edit whose commands run, asked again by a // retry of its park: still waiting, or its answer, never run twice. if (p.fs.edit_hold) |*h| if (h.names(req)) { @@ -1611,10 +1591,9 @@ pub fn serveFs(p: *Pardes, req: ctlfs.Req) ctlfs.Reply { return reply; } -pub fn update(p: *Pardes, ev: Event) void { +pub const update = pardes.tape.taped(updateInner); +fn updateInner(p: *Pardes, ev: Event) void { const v = p.view(); - const taped = pardes.tape.enter(p, .{ .update = ev }); - defer pardes.tape.leave(p, taped); defer pardes.panes.File.syncTwins(p); defer p.reportFocus(); // A tick with no deadline due is the one event that cannot change @@ -1816,9 +1795,8 @@ pub const SavePath = Effect.Buf(effect_path_cap); /// What was said of a failure just now on pane `id` is also the waiting /// 9P write's (9p_io, `fs.late_failure`). -pub fn noteLateFailure(p: *Pardes, id: usize) void { - const taped = pardes.tape.enter(p, .{ .note_late_failure = id }); - defer pardes.tape.leave(p, taped); +pub const noteLateFailure = pardes.tape.taped(noteLateFailureInner); +fn noteLateFailureInner(p: *Pardes, id: usize) void { // Said by reportFailure just now: its words fitted whole, the // reason kept; else what the message row has. const said = if (p.fs.said_at == p.fs.failures and p.fs.said_len > 0) @@ -1831,10 +1809,9 @@ pub fn noteLateFailure(p: *Pardes, id: usize) void { /// The frontend drew a frame: a pointer resting on it follows what is /// under it now, a drag's moving end and a look-hover's word. -pub fn presented(p: *Pardes) void { +pub const presented = pardes.tape.taped(presentedInner); +fn presentedInner(p: *Pardes) void { const v = p.view(); - const taped = pardes.tape.enter(p, .presented); - defer pardes.tape.leave(p, taped); if (v.pointer_inside and v.drag != .none) { v.hover_col = v.pointer_raw_col; v.hover_row = v.pointer_raw_row; @@ -1845,9 +1822,8 @@ pub fn presented(p: *Pardes) void { /// The window's answer to a WindowOpacity: done, or `failure` says why /// not, `applied` the opacity it keeps. -pub fn windowOpacityDone(p: *Pardes, applied: u8, failure: ?[]const u8) void { - const taped = pardes.tape.enter(p, .{ .window_opacity_done = .{ .applied = applied, .failure = failure } }); - defer pardes.tape.leave(p, taped); +pub const windowOpacityDone = pardes.tape.taped(windowOpacityDoneInner); +fn windowOpacityDoneInner(p: *Pardes, applied: u8, failure: ?[]const u8) void { p.settings.window_opacity_pending = false; const reason = failure orelse return; // Do not claim a value the compositor refused; an explicit retry of @@ -2115,9 +2091,8 @@ pub fn nextWake(p: *const Pardes) ?u64 { /// after a slow frame as it does anywhere. A wait (a message lingering, /// the look-hover delay) is jumped to its end in one step and drawn /// once. Idle, time is not banked: the next wait starts from now. -pub fn advance(p: *Pardes, now_ns: u64) void { - const taped = pardes.tape.enter(p, .{ .advance = now_ns }); - defer pardes.tape.leave(p, taped); +pub const advance = pardes.tape.taped(advanceInner); +fn advanceInner(p: *Pardes, now_ns: u64) void { // The first time a shell's clock is seen, core time starts there. const started = p.clock.started; p.clock.started = true; |
