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/Editor.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/Editor.zig')
0 files changed, 0 insertions, 0 deletions
