summaryrefslogtreecommitdiff
path: root/src/Addon.zig
Commit message (Collapse)AuthorAge
* kinds #12, ABI 2.1: pardes_addon.h grows at the ends of its records ↵Gabriel Schneider11 days
| | | | | | | (pa_api's heap, view, exec and select, pa_paint's rail thumb, pa_ops's search, PA_WHEEL_LEFT and RIGHT) and the core reads them only from a 2.1 head: Esc goes to a 2.1 kind first, a press's drag and release stay its own and the pointer leaving is told, tick comes again on a view change, a kind's search rows, place, Exec and selection are taped, the jobs a call asks are emitted on every core from its taped outcome, a Shadow lays its tag out from the authority's prefix and keeps its tick state when it joins, a view's raster is its frontend's, and fake.c and snake.c leave Esc to the core Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #9, the core's image code gone: src/image.zig (558 lines) and the ↵Gabriel Schneider11 days
| | | | | | | static table go, so no kind is compiled in (Registry.init, Kind.image, compiledIn, `static` in /addons and "is compiled in" with them) and a test of the core's side of a kind's pane opens Kind.test_kind (a picture of one pixel, no library); a placement's fit (NativeGeometry, containGeometry) moves to surface.zig and a PDF's fit modes to pdf_view.zig; a terminal's kitty PNG decodes in TerminalImages.zig through wuffs as before, its downscale through stb_image_resize, the one part of zstbi the core keeps (stb_image patched out of it, the wuffs_images option, tag_image and image_exts gone); the image cases load the built image.so by path: test/panes.zig's and fs_namespace's through Addon.perform, T1 through Addon load (a new behaviour case: PNG, JPEG and PPM through 9P, the art words, a refused corrupt PNG, a dump's placeholder and its picture back, which replaces the decode unit test and ctl.zig's corrupt-image case), the snapshot, process and image harnesses by linking it into each session's data directory; images.snap unchanged Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* client #1, the views indexed: a view's share of the session is Pardes.View ↵Gabriel Schneider11 days
| | | | | | | (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
* kinds #5, ABI 2 and the seam: src/kinds/pardes_addon.h is ABI 2 as ↵Gabriel Schneider11 days
| | | | | | | architecture §16.9 has it (pa_window 24 bytes and no art bytes, pa_placement 80 with at, from and dirty_y/dirty_h and no stride, pa_word 32 with no size and PA_WORD, tick(st, now_ns, flags) with PA_FOCUSED, PA_OK and the conventions, the dump and load rules, pa_put with attrs, pa_copy and PA_POD, whose fragment gcc -Werror refused as written and is ternaries here) and fake.c and image's table speak it; tick is called at its deadline and once after open, a taken key or click, a word, a job's answer, a load and a change of PA_FOCUSED (the pane has the keyboard in some view, its window focused), nextWake folds the deadlines, and a Debug build hashes the kind's allocations across paint and panics naming it; paint runs once a frame, the slot keeps its prefix and whether it placed a picture, the tag is that prefix, the core's art words when it did and the path, and a frame that changes it owes a step to lay the tag out again; Addon load and reload are an addon effect the host performs (memfd, BLAKE3, dlopen, the head checks and init, the bytes a process holds shared and counted) answered by an addon event carrying what the library brings as data, whose update does the collisions, the reload's validate-then-swap at a new generation and the waiting panes deterministically, while unload is the update's alone and lets the library go by effect; a kind's job is Effect.job run on the host's workers (host_io.KindJob: tui and gui on Io.concurrent, macOS and tests on the loop) answered by Event.job, stale generations dropped and a library closed after its last job; each core has its own Registry (16 kinds, their words, leaders and extensions, digested and dumped; their code a local side array a replica has none of), so a test session no longer unloads the world and Restore and -l keep the process's kinds; every call into a kind whose answer the core acts on is taped as an Outcome (its answer, refusal, message, Look, text pane) and the prefix a step reads is taped too, so a replica's core, which runs no kind's code, steps alike; a pane of a kind on a replica is a Shadow drawn from the authority's frames, painted for the peer's view and sent by Screens as row hashes with the rows that changed and each raster once a key (screen_state.Shadow), its keys going to the authority; the tail, reload and the Addon word and event are Addon.zig's, the slot's record dump.zig's, a tail word's run exec.zig's; --addon-test gains focus, blur, dump, body, ctl and the window line, its jobs done as a host does them; fake.out gains its window line, loses a body row once the tag carries the art words and lands FakeJob at once; tests rewritten: the image dump test (the replica-style load keeps the record), the Petscii/Palette/Ascii tag test in ctl.zig and test/panes.zig's image tag test (a picture decoded and shown first), fs_namespace's decode test (the job performed as a host would), Kind.zig's registry test and Addon.zig's crash-mark test, the addons suite's ABI numbers; new: a job under way across a reload (T1), a Shadow's frame codec, and a replica with no code for a kind showing its pane and passing its keys; gates: core-test 958/958 and behaviour-test 249/249 on both, unit-test 1490/1491 tui and 1533/1534 gui, pane-test 171/172, snap all 105 ok, process-test 0 of 37 failed on both, addon-test ok, hxdiff 19 and hxparity 6 mismatches by the base's names, hxgolf 0, replicas, gui-golden, monkey-gui, daemon.py main and window-clients, soak local pass, perf medium within 1% of the base Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #3, addons: src/Addon.zig loads a library that brings a kind (each ↵Gabriel Schneider11 days
*.so of $XDG_DATA_HOME/pardes/addons, then <prefix>/lib/pardes/addons at start; `Addon load <path>`, `Addon unload <name>` refused while a pane of the kind is open, `Addon reload <name>`; bare, the kinds here), from a copy of its bytes in a memfd so a reload is the file as it is now, its BLAKE3 kept; a load is marked on disk while it runs and a start that finds the mark skips that library until `Addon load` asks again; the crash record says `in addon <file>, <call>`; Kind.zig checks a head before taking it (size, ABI major, a paint, a name, words, leader paths and extensions none else has, the core's or another addon's: refused whole, in words; ctl with words; jobs paired), and a reload checks the new library beside the old (the old kind's own names looked past), opens every pane of the kind again in a fresh arena from the old state's dump and the new load (or its place and its words' last values), and only then swaps, dropping the old library's jobs; any failure says why and leaves the old one running; /addons lists `<kind> <version> <abi> <panes open> <path> <blake3> static|loaded|refused: why`; the tail: an addon's words join /commands and Help marked `(addon <name>)`, run from exec, a ctl and a leader path after the core's, a word that opens its kind opens a pane of it from anywhere and any other goes to a pane of its kind, its ctl read ends with the kind's fields, its body is the kind's text over 9P, its keys (all but Esc, as a raw terminal's) and clicks go to it, a 9P request steps its ticks and jobs as an event does; the dump record keeps the words' last values; the size of every record is asserted in the header and seen again from Kind.zig; pa_api gains `seed` (a number the same for a pane on every machine, for a game's board), and a zero cell is an unpainted one (PA_PAINTED, which pa_put sets), so a window is cleared by one memset; the hook in the settings agent's files is one arm each: exec.zig executeBuiltinLine's miss goes to Kind.runLine, builtins.zig gains the Addon word, config.zig its leader path (none); the tree gains /addons (README and reference.typ's tree, and an Addons section), builtins-<tui|gui>.json the Addon row; no golden changes; tests: a crash mark skipped at two starts and cleared by a load (Addon.zig), the tree listing tests (tree.zig and the process suite's) with /addons; the README keeps its 45 lines Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge