summaryrefslogtreecommitdiff
path: root/src/Stream.zig
Commit message (Collapse)AuthorAge
* idioms #12, Query and Stream: Stream.query returns OutOfMemory for Query to ↵Gabriel Schneider11 days
| | | | | | | report, walkDir's anyerror is the three errors it has, Query's rows say their counts through buffers proven big enough, its open, produce, noteRows, fillList and land report an allocation that failed (reportError) instead of returning quietly, tagPrefix names its set, and std.fs.path is std.Io.Dir.path 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
* fields #38, the jump list, the language servers' question and the core's ↵Gabriel Schneider11 days
| | | | | | | clock are fields of their nouns: Jump.zig is the jump list's type (list, n, cur, force, its own len annotation) and the session's jumps a Jump where it was jumps, njumps, jcur and jump_force; lsp/Ask.zig is the question's (seq, last, wait) and the session's lsp_ask an Ask where it was lsp_seq, lsp_last and lsp_wait; the clock is the session's clock, a Clock (now_ns, stepped_ns, started) where it was now_ns, stepped_ns and clock_started; a view opened still starts with no query's mark on its jumps and one closed leaves the staying view's (views.zig), as when the mark was a field of its own; callers in 26 files read p.jumps.n, p.lsp_ask.wait, p.clock.now_ns (macos.zig's lsp_wait tests by text, built nowhere here; dump.zig, the persistence agent's, only where it names lsp_seq); a dump written before this change loads these as their defaults once: an Upgrade or Restore from it comes back with no jumps, no language question awaited and its clock unstarted (jumps' kind changed, so the decoder says so), and the wire's semantics change; gates on tui: core-test 960/960, behaviour-test 238/238, pane-test 171/172 (1 skipped), snap all 108 scripts ok; gui unit-test 1518/1519 (1 skipped) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses ↵Gabriel Schneider12 days
| | | | | | | web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* targets: the ESP32-P4 board port goes (src/esp32p4*.zig and src/esp32p4/, ↵Gabriel Schneider12 days
| | | | | | | -Dplatform=esp32p4 with its pinned riscv32 target, -Desp32p4-cols and -rows, the Peek, Poke, Hexdump and Gpio words and the Board behind them, the board's 9P engine options, the gpio_toggle host slot), and with it every guard and limit only the board needed: terminal_panes and terminal.enabled (ghostty is in every build), memory.limits' board branching (the desktop values stay), MAX_PANES 64 and MAX_COLS 16 fixed, the board's boot buffer and its embedded boot, the pager's and the terminal's emulator-less paths; tests: the board's GPIO, ring and Board ones go, the boot-OOM and transition-grid ones stay under their own names; the perf harness loses the board's fixture, so the Debug baselines of both frontends are recorded again (--only medium --reps 10) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* File, edit: dropped marks go: an edit frees the location rows and pager ↵Gabriel Schneider12 days
| | | | | | | colours it drops, and an undo back to the same text no longer brings them back (visible: a +Pager or a results buffer undone to its text is shown plain); the pager test in ninep/ctl says so and Stream's no longer asks for the field; File.State's walked shape changes (wire semantics) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* Query, Stream, Places: the benchmarks inside unit tests are deleted, as no ↵Gabriel Schneider12 days
| | | | | | | bench step takes them without a rewrite (they reach into Query's and Stream's own helpers, busy, queryPane and TestShell, read a stress file named in the environment, and perf's gate would need baselines for a new op): "zz query timings on the 1.2 MB stress file (QUERY_TIMES=<path>)", "zz stream timings on the stress file with a worker (QUERY_TIMES=<path>)" and "zz grep rows timings: a Grep of about 2000 rows on the stress file, a worker (GREP_TIMES=<path>)" go, and the big-file places test keeps its asserts without its clocks and PLACES_TIMES print; the docs' numbers stay as they are Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* Find, Grep: their output traits, Output's sort of a Find's whole filenames ↵Gabriel Schneider12 days
| | | | | | | above its walk notes, and fs.WalkNotes go, as both search on the disk engine (Stream.zig, which keeps the walk's depth as max_walk_depth) and nothing makes a .cmd = .Find or .Grep pane; the tests that filled one fill a .search or query pane (ctl.zig's is now "workspace symbols, Symbols and Diagnostics share their directory's one +Search"), and the Find sort test keeps its half on next location ("next location uses numeric columns") Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* Stream: the counters and clocks nothing read go (hits, files, scanned, ↵Gabriel Schneider12 days
| | | | | | | started_ns, first_ns, finished_ns, worker_ns, the batch's and the worker's copies, rg's summary parse), and PARDES_STREAM_ENGINE, which nothing set: the tests force the engine through the field Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* Stream: one TextJob for a parse and a paint and one join for every worker: ↵Gabriel Schneider12 days
| | | | | | | ParseJob and PaintJob were one type twice, each made by hand at three sites, and seven places joined a worker in five lines each Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* Query: a +Search's rows recoloured are made again (locations.cloneRows, ↵Gabriel Schneider2026-10-30
| | | | | | Query.save's copy), never written in place: the rows are a blob (File.State location_rows), whose word a digest keeps by address and a replica's rollback copy pins, so a release session kept the word of their colours before a paint landed (recolor's @memcpy); an edit moved them into dropped_marks with the stale word, a replica that hashed them at another time diverged there (fixer 1's soak: `pane 5.file.dropped_marks`), and a client loading the session's dump hashed the colours it carried and loaded "as another session"; dropped_marks stays in the digest, as an undo back to its text reads it; Stream's test, which a Debug build fails before (`the 82-byte blob ... is not what its kept word was: written in place`) Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Stream: a search run on the loop (a 9P write's Grep or Find, which answers ↵Gabriel Schneider2026-10-30
| | | | | | whether it found anything) is a tape site, `search`, its batches what the replay takes, as it takes a worker's (Event.search): its file reads were no site, so a replica of a session a script greps in read no file and joined again (`a syscall that is no tape site, made replaying`, a terminal client live, 2 of 2 before, none after); test/cross_replay.py's session greps and finds again Co-Authored-By: Claude Opus 5.5 <[email protected]>
* web: the browser shell builds again and loads a dump of a native build: a ↵Gabriel Schneider2026-10-29
| | | | | | | | | | theme by its name, a field compiled out passed over, no disk asked; touch.dump replaces the hand-written ZON fixture Fixed for wasm32-freestanding: counts as usize, no threads, stb_image, tape or host stat there. touch.mjs follows the renderer's 13 tag-layer fields, helix's retuned colours and the tag column. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* tape: every input the core consumes recorded in turn order, replayed into ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | | | replicas that must reach the same digests; the core's leaks of render, clock and host closed The recorder (src/tape.zig) is null unless PARDES_RECORD=<prefix> names a tape (<prefix><pid>.tape); the local path pays a null check a call. It records a tree at the host boundary, both ways: each call the host makes into the core (`Input`: update, serveFs, pump, perform, the shell's acknowledgements and failures, a Restore, ...) with its arguments, and each call the core makes out -- a Host function (the vtable wrapped generically while recording) or a syscall of its own (`tape.site` for every old `turn.yield()`, `tape.value` for a clock or environment read) -- with its result; `done`/`ret` close each, a 9P request served while a step is out lands inside that step's syscall, and fields a host writes between calls (native_images, present_skipped, ...) are found by a diff at every crossing. After each call the host made at the top, the session's digest (src/walk.zig), one per field of the core, its stream and each pane, file and places. `PARDES_REPLAY=<tape> pardes` (main.zig) replays it with the same build into three replicas: two at different addresses (the first's memory held while the second runs) and one that never draws. A host call answers what it answered, a site returns what it returned, nothing is performed and no syscall is made; `turn.yield` panics in a replica, so a syscall no site covers is a stack trace; a call the recording did not make, or a digest that differs, is a divergence that names the fields. The headless replica steps over the presents it does not make, applying what the host told the core inside them. What the replicas found, fixed: - Render wrote core state. The view's geometry (wrap map, context rows, body layer rows) is File.geometry, a lazy cache keyed by a hash of what it is made of (revision, scroll, size, tags, tables read, context declarations, the session's view: wrap, layered context, row metrics, rect); the render makes it afresh, a step reading it makes it on demand (wrapAt, wrapRow, ensureCursorVisible). Context declarations, notice bands and the header's reveal are the step's (sync), the tables' reading the tick's (a first look of 4096 lines, a count, wherever it is asked; the rest a frame's clock budget a tick), and a view's paint-ahead is asked of the host as the frame is drawn rather than queued as an effect. - The clock: advance's wakes are the recording session's (a picture decoding or a fade adds no tick to a replica), as are the budgets of Places, Names and Tables (`tape.over`), a message's time of day (the stamp; msg_said_ms and the unattended expiry use the session clock), File.mtime, and the pump reads its clock whether or not it waits. - The host: the session directory (getcwd, asked once at init), $SHELL and its existence, $HOME for `~`, `Shell` naming one that is not there, a missing interpreter, a directory refused above, a deleted file, a pointer seen through a sliding pane (Pardes.pointerCell). - Worker handles (futures, the Io), the 9P server's state, the store file every window shares (a replica keeps its own in memory) and Recent read from it are authority-only; frames, animations and the render's caches local. Query rows' paints count apart from a view's. Terminals replay from their taped pty bytes and are digested as their active screen, cursor and scroll; kitty images are left out until phase 5's screen-state terminals. tagnav.golden: the header's caret reveal now runs every step, as a pane's does, not once per frame drawn, so after `g l B B` typed in one burst the bar stays scrolled as a human typing it sees it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* query: a row is its place as text, `path:line:col` then its code, the path ↵Gabriel Schneider2026-10-25
| | | | | | | the shortest a Look from the query pane resolves (Query.lookPath: relative, `../` included, when shorter, else absolute, never `@pN` but for a text with no file), aligned per group, the declaration headers `path:line`; its code coloured as its file's language colours it, the file painted whole on the worker (Stream.paintRows, highlightApart, kept in the locations cache, Query.Shades a walk a refill, Query.recolor in place as each lands) with the match tinted over it; the +Preview's places are the query's hits in its file (a Grep searched, a list fed), tinted and ticked, the row's one current and selected, as in a pane that already shows it; tests for B3 on an address, a saved list's Looks, the shortest path, the preview's places and colours, the worker's colours; fsearch, grep, lookrange, lsp-client, lsprelpath (now `../shade.zig`), stepgrain, tagbottom goldens: the address rows; docs/next-searchrows.md: the design and the numbers Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016u3hBPFfja5pK4EBRC1UVD
* anim 7: what the probe found: the paced wait spins (asleep, the CPU's clock ↵Gabriel Schneider2026-10-24
| | | | fell and an input's frame took 2-5x as long), a glide measures the core's line count first and emits only the rows it shows, a far jump paints only its view, a long line 16 KB round the caret, the caret's sideways scroll measured from the view's edge, a paint never joined on the loop nor asked while the view stands still, rewritten generated panes do not glide, pictures decode off the loop
* anim 5: a scroll's colours are painted ahead on a worker ↵Gabriel Schneider2026-10-24
| | | | (Stream.paintAhead), two views on the way it goes, so a page after a page parses nothing on the frame
* Search converge 4/6: the disk engine, Grep and Find's listing on a worker ↵Gabriel Schneider2026-10-24
(rg when there, else a sorted walk), generation-numbered batches, a debounce, a 2000-line cap and More, and the declarations parse off the loop