diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 02:56:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 04:13:33 -0300 |
| commit | d1d5d3cfb18841604bba2057eeb3598f729b4475 (patch) | |
| tree | 298c29ab8767852bf74eb86ad4d15acc4348f109 /test/perf.zig | |
| parent | 33037ece5af9ae1c7048819bbbae3fc5e6fc4ade (diff) | |
| download | pardes-d1d5d3cfb18841604bba2057eeb3598f729b4475.tar.gz pardes-d1d5d3cfb18841604bba2057eeb3598f729b4475.zip | |
client #1, the views indexed: a view's share of the session is Pardes.View (the ~42 fields views.fields named: size, cell metrics, columns, rects, focus, jumps, pointer, gestures, prefixes, frontend), one of Pardes.views[4] (null when closed), the live one views[live] through Pardes.view() (index field `view` renamed `live`); going into another view is the index plus the panes' shares, which stay swapped (park and unpark now move only Pane.pv); views.zig loses fields, Part over Pardes, Parked, kept, emptied and the session half of every copy, and a pane closing leaves every view's layout at once (views.gone, at the two places a slot is freed) instead of the serials each parked view kept; drawOne and within put the drawn view's own share back whole; the views are in the digest now (tape's per-field parts name views[k].field), so a fresh view's col_x/col_w default to zeros, not undefined; the dump keeps every open view in the core and the panes' shares of the others under `shares`; an image from before (live view as the core's own fields, the rest under `views`) loads them into views[] once; the ~2,400 references rewritten mechanically from the compiler's errors (p.active is p.view().active, `const v = p.view()` hoisted in 823 places), Kind.zig (4 lines) and addon_test.zig (3) among them, macos.zig by pattern (not compiled here); tape's watched host writes read the live view's frontend and active; perf.zig's accessor lines change its harness hash, the debug baselines re-keyed to it (their numbers the base's); no golden changes; gates: core-test 956/956 both, unit-test 1487/1488 tui and 1530/1531 gui, behaviour-test 248/248 both, pane-test 171/172, snap all 105 ok, process-test 0 of 37 failed tui, replicas ok
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/perf.zig')
| -rw-r--r-- | test/perf.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/perf.zig b/test/perf.zig index 55b64a99..fbe6fa49 100644 --- a/test/perf.zig +++ b/test/perf.zig @@ -564,13 +564,13 @@ fn measure(op: Op, fx: Fixture, path: []const u8, expected_bytes: usize, reps: u pardes.look.lookAt(core, 0, path); pump(core); const id = filePane(core) orelse return error.OpenDidNotOpenFile; - core.active = id; + core.view().active = id; const pane = core.panes[id].?; _ = try frame(core); if (op == .edit_twin) { if (!core.executeBuiltinLine(id, "Zerox")) return error.ZeroxRefused; pump(core); - core.active = id; + core.view().active = id; _ = try frame(core); } if (op == .edit_char or op == .edit_twin) { @@ -589,7 +589,7 @@ fn measure(op: Op, fx: Fixture, path: []const u8, expected_bytes: usize, reps: u if (op != .deep_selection) seek(pane, fx, n); _ = try frame(core); // settle the view at the new spot, untimed const before = .{ .row = pane.body.cur_row, .col = pane.body.cur_col, .scroll = pane.scroll(), .len = pane.file.?.content.len }; - const rect = core.rects[id]; + const rect = core.view().rects[id]; const wheel_col = rect.x + pardes.config.GUTTER; const wheel_row = rect.y + pardes.BOX_H; const t0 = nowNs(); @@ -768,7 +768,7 @@ fn terminalBatch(buffer: []u8, batch: usize, cols: u16) ![]const u8 { fn checkTerminalTail(core: *pardes.Pardes, surface: *pardes.Surface, batch: usize) !void { const pane = core.panes[0] orelse return error.MissingTerminal; - const rect = core.rects[0]; + const rect = core.view().rects[0]; const x = rect.x + pardes.config.GUTTER; const y = rect.y + pardes.BOX_H + pardes.panes.terminal.gridCursor(pane).y; var expected_buffer: [32]u8 = undefined; @@ -1486,9 +1486,9 @@ fn miniMeasurement(fallback: std.mem.Allocator, probe: MiniProbe, path: []const if (core) |p| { pump(p); try pardes.panes.mini.open(p, 0, path); - for (p.panes, 0..) |slot, id| if (slot != null and id != p.active) try p.removePane(id, null); + for (p.panes, 0..) |slot, id| if (slot != null and id != p.view().active) try p.removePane(id, null); pump(p); - const file = p.panes[p.active].?.file.?; + const file = p.panes[p.view().active].?.file.?; try checkMini(.{ .content = file.content, .colors = file.mini.?.colors }, expected); } var frame_hash: ?u64 = null; |
