summaryrefslogtreecommitdiff
path: root/src/Addon.zig
Commit message (Collapse)AuthorAge
* kinds #50, macOS by pattern: off Linux every core module has the addons ↵Gabriel Schneider11 days
| | | | | | | compiled in (Addon.zig's loader is a Linux memfd, now refused elsewhere at compile time), the native shell registers them at start as the tui and gui do, and `-Dmacos-sdk=<path>` hands SDL's build the SDK's paths, so `-Dplatform=gui -Dtarget=aarch64-macos` configures (and `zig build core-test -Dtarget=aarch64-macos` compiles its test binary, MuPDF and both kinds in, without running it) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #49, the static builds: `zig build static -Dplatform=tui ↵Gabriel Schneider11 days
| | | | | | | -Dtarget=x86_64-linux-musl` and `zig build static -Dplatform=gui` (dynamic, both addons in) build and open a PNG and a PDF over 9P with `/addons` saying builtin; `Addon load` in a pardes with its addons compiled in is refused in words (`not on this platform: its addons are compiled in`) rather than by a failed dlopen, and building.typ and shared-libs.md name the gui's static step Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #48, the export rule finished: every Zig kind declares `pub const ↵Gabriel Schneider11 days
| | | | | | | pardes_addon = addon.ops(T)` and calls `addon.exportLib(&pardes_addon)` in a comptime block, which exports it only when the output is a library (Zig 0.17 analyses no `pub const` of a library's root and no comptime block of a type made in a generic function, so the export cannot live in `ops` alone: one comptime line in the kind is the spelling that works), and a pardes with kinds compiled in reads the declarations; image.zig's `pub export`, snake's and life's `export` go, no rename anywhere, and fake.c stays the loader's test, never compiled in Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #43, the PDF kind in Zig: addons/pdf/pdf.zig replaces pdf.c over the ↵Gabriel Schneider11 days
| | | | | | | same pdf_bridge.c (its header translated by build.zig, Zig 0.17 having no @cImport), one place a pane (a page and how far down it, which where says and address takes) laid out by each view its own way (a view with pictures its own strip, rasters and thumb by its id, a view of glyphs the page's text layer), the view of the last input the one whose window's top the place follows; the pages' sizes, the page's text and its hits, and the search over every page on the lanes as jobs (rows streamed through found, a stale search cancelled, its first hit gone to as a Look of its first row went), the tick asking and laying out only, open's one parse and close kept on the loop (0.4 and 0.8 ms; a truncated file stays a refused Look); a band at most PA_RASTER_MAX; the static build reads the module's pardes_addon, exported only from the library Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #35, the core's seam for ABI 3 (Kind.zig): each pane of a kind with ↵Gabriel Schneider11 days
| | | | | | | view told each open view's facts by id when they change (the slot's view table, a hash a view, a stopped view told cols 0, and a step woken for a view a frame's layout changed) and ticked after, the tick's pa_tick and its prefix (placed and retag gone: the art words go on every pane of a PA_PICTURES kind from the first frame, the same bytes whichever view's step lays the tag out, by the session's first view, which was the 30 ms soak's rollbacks), found's rows the search's or appended to its +Search after, cancel's tokens dropped on every core (on the tape), a picture over PA_RASTER_MAX dropped and said once, a record of at most PA_RECORD_MAX, a Debug call over 16 ms of the kind's own (its allocations and job copies the core's) said once a site and failing --addon-test (which gains view N on|off and prints the tag the core makes), and the record §17.5's: a Restore, an Addon load and a reload read the pane's file as a Look does, a file not there a placeholder saying <path> is not here, record kept, opened by the next Look or watch of it Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #26, one static pardes: `zig build static -Dplatform=tui ↵Gabriel Schneider11 days
| | | | | | | -Dtarget=x86_64-linux-musl` (musl's, as glibc links only dynamically; never the default, and -Dstatic gone) links the terminal binary statically with both addons compiled in, image.zig as a module and pdf.c with MuPDF, its export renamed by a -D, which Addon.zig registers at start as if loaded (/addons says builtin, Addon reload refuses one, no library is scanned), and execveat and close_range go by their syscalls, which musl has no wrappers for; macOS's way to image and PDF panes too, say a comment, building.typ, shared-libs.md and the changelog Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* kinds #18, ABI 2.2: pa_api says the core's ABI, pa_mouse grows a wheel's ↵Gabriel Schneider11 days
| | | | | | | amount (a window passes a touchpad's fraction of a turn over a kind's pane, a terminal whole notches), pa_view says glyphs (no graphics), pa_paint's tail padding holds the pointer the kind asks for (the window shows a hand for PA_POINTER_LINK over its pane, a Shadow's frame carries it), and tick is told PA_FRAMED when a frame was drawn since its last; addon-test gains graphics on|off Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* 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 Schneider12 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 Schneider12 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 Schneider12 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