summaryrefslogtreecommitdiff
path: root/src/host
Commit message (Collapse)AuthorAge
* script: a key carries the modifiers `hold` has down, as a window's doesGabriel Schneider31 hours
| | | | | | | | | | | | | A window's key event carries the modifiers held as it happened in its `value` (Host.zig, `modifiers(event.key.mod)`), and a sketch reads chords from there (examples/live: Alt-o, helix's node walk). A script's `key` (and a 9P ctl's `input key`) left `value` 0, so `hold left_alt` then `key o` was a plain o to the sketch: the chord could not be scripted. `key` now carries what `hold` has down, as `click` and the other pointer verbs already did in their `flags`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* fs: a read answered with the sketch closed says so on stderrGabriel Schneider31 hours
| | | | | | | With no instance running, fs serves the tree from the save's newest State or the declared defaults; a read then looked exactly like the running sketch's, and a script that read while the sketch was still starting took the save for it (drat-meout's scripts met this). The words the refused files already give ("<name> is not running: this is its save's newest State, frame N of ...") go to stderr before a read's answer; help, ls and complete stay quiet. test-fs checks it; the README says so. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* host: a sketch may ask for the sound device's pull, audio_pullGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | Sound a sketch makes leaves for the device about one pull after draw, and SDL opens 1024-sample pulls at 48 kHz (21 ms); 256 leaves in about 6.5 ms, but the audio server then runs every client at that size, and drops out under load. The only way to ask was SDL_AUDIO_DEVICE_SAMPLE_FRAMES in the environment. Now an app declares `pub const audio_pull = 256;` beside its name; abi.Info carries it (0, SDL's own, when it is not declared), and the host sets it as SDL's hint just before it opens the device, at normal priority, so the environment variable still wins. It is read once, at start; the web host has no device to open and ignores it. The sound overlay's header says what the device took: OUTPUT ch1 / ... / pull 256. Test: audio, on SDL's dummy driver: the device opened with nothing asked takes 1024 at once, asked 256 takes 256, and with 512 in SDL's copy of the environment takes 512 though 256 was asked. test-audio: 48/48 steps, 9/9 tests. README: the app table's row, and a paragraph in sound with the trade-off. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* console help: the verbs' names, so the sketch's help fits the log under themGabriel Schneider31 hours
| | | | | | | | | | | | | | help printed the rows with their arguments, four lines of the log's five, and drat-meout's own help pushed the first out. Now it is the names (two lines), help VERB says a verb's arguments and what it does, and the sketch's lines follow. Tests: test-timing and test-control, 49/49 steps, 30/30 tests; live in the drat-meout copy over fs, `help` leaves the sketch's two lines and its own in the log. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* README: the 9P controls rewritten around the tree; the Build API's cloud9Gabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | "Local 9P controls" was a socket path, plan9port `9p` lines and a poll of status for a screenshot. Now it says what a running sketch is: a tree that describes itself (README, commands, made from the tables), how it is found (posted as sketchbook/<name> by a run in a window, --9p NAME or a socket path), `fs VERB PATH` in every executable and the generic host, answering with the sketch closed from the save or the defaults; a table of the files; how the State maps to files (rows of numbers one file, arrays of arrays and of structs directories, drat-meout's notes as the example; a value read as it was at the open); and an agent driving drat-meout: start it, help, a console line, read state, await by reading in a loop, a live click, one read for a screenshot, a refused write in words, help of one file, quit, and a read with it closed. The ctl paragraph says the 4096-byte write, errors as their names and what each open pins; the trace examples use fs. The console bullet says help VERB and set of an array. The Build API lists sb.modules.cloud9. --help's --9p row and usage line say NAME|/SOCKET and fs. Tests: the session in the manual was run against the drat-meout copy, headless, posted under a scratch runtime directory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* state/: a value is read as it was at the openGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | A read of a State file formatted the value at each Tread and sent the window at its offset; a value that changed between two reads (a float a frame moves) could change length, and the second read sent the tail of the new text after the head of the old: `1.526633` then `5`, which a shell loop awaiting a number read as "1\n4". Now the open formats the value once into one of the connection's snapshots, as the traces and README are, and reads window it; release frees it. A write is unchanged. Found driving drat-meout from a shell loop, `until [ "$(drat-meout fs read state/street/time | cut -d. -f1)" -ge 3 ]`. Tests: test-control and test-fs, 51/51 steps, 11/11 tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* The door for sketch-owned files: sketch/ and the nodes from 2^63, reservedGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | A sketch may one day serve files of its own (an embedded editor's buffers, Round 2 §4 of the 9P survey): the host's tree now keeps the place for them and builds nothing behind it. sketch/ is an empty directory the host never fills (its README line says so); every node from 2^63 on is the sketch's, and the host answers none but sketch/ itself (2^63): a lookup under it, or any other node of the range, is UnknownFile. state/'s nodes have bit 62 set and bit 63 clear, so the two ranges never meet. Served offline too, empty. Later, one optional ABI entry can take the requests whose node is in the range or under sketch/, cloud9's engine keeping fids, permissions, readdir cursors and parking; not now. Tests: test-control, a new test: sketch/ is a directory, empty, nothing under it, and nodes of the range refused; README names it. test-control and test-fs: 51/51 steps, 11/11 tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Dial by name, and fs in every sketch's binary, answering with the sketch closedGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A run a person watches (not headless, a script or an export) posts its tree as $XDG_RUNTIME_DIR/9p/sketchbook/<name>, the sketch's Info.name; --9p NAME posts under another name, --9p /path listens at a socket path as before. A name a live run holds is refused, a stale one replaced; a default post that fails says so and the run goes on without one, an explicit --9p that fails ends it as before. (cloud9's post() takes names without a slash, so control.zig makes the sketchbook/ directory and binds there itself, with post.probe deciding live or stale.) `fs VERB [PATH [WORDS]]`, after the options, in the generic host (`sketchbook LIBRARY fs ...`) and in every executable built with sketchbook (`drat-meout fs read state/scene`), is cloud9.verbs.run on an Fsys: the running sketch's tree when one is posted (or at --9p), else the same tree served in this process over a socketpair, on a thread (Control.serveOffline, the same respond with `offline` set), from the save's newest State (--state's save, else the default one; read only: Sessions.openRead, no session started, restored into today's layout), else from the State's declared defaults (init is not run). README, commands, ctl's read and state/ answer; a write and status, log, screen.png and the traces answer in words, "drat-meout is not running: this is its save's newest State, frame 61 of <save>". No window, no SDL. sketchbook.init's modules gain cloud9, so an app's own tests can dial its executable with cloud9.Fsys. Tests: a new step, test-fs (in test): the replay fixture posted by name under a private runtime directory, driven with its own binary's fs: ls, a state write and read, a refused value in words, a live click, a screenshot read, help of state/dots and ctl, quit and the name gone; then closed: a state file read from the defaults, status refused in words. test-fs, test-control, test-paths, test-setup, test-sessions: 56/56 steps, 27/27 tests. drat-meout's copy builds unchanged and answers fs with the game closed: 94 leaves, 16,522 files, 17,608 values, 10,408 directories. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* screen.png: one read, answered when its frame has landedGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | A screenshot over 9P was a write of `screenshot` to ctl, then reads of status until screenshot_generation moved, then a read of screen.png (an open while a capture was pending failed). Now an open of screen.png asks for the next frame itself and is parked (cloud9's Status.again) until the capture lands: the service loop answers the engine's retry() each pass, so a parked open is asked again every frame, and respond (unchanged) answers it once nothing is pending, pinning that frame's PNG, or with the capture's error. So `9p read screen.png` or `fs read screen.png` is the whole recipe. A write of `screenshot` still works and status still counts, and an open after it waits for a frame of its own. The frame-thread loop carries the park cleanly: retry() and next() run on the frame thread between frames like every request, a parked open keeps its fid, a flush or a hangup drops it, and the four parking slots a connection has bound how many wait at once (a fifth open is refused "waiting"). Tests: test-control 46/46 steps, 10/10 tests (the snapshot test's CapturePending is now what answer() parks). Live, headless, the replay fixture: three reads of screen.png with no write, 24-26 ms each with the 9p process's start, 640x360 PNGs; the old write-then-read still works. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* The tree describes itself: README and commands from the tables; ctl takes ↵Gabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | input live README is made at each open from the tables (pinned per open, as the traces are): a line a file from control.zig's `files`, ctl's verbs indented under ctl (ctl's own, the script's input verbs, the console's, each with its args and doc from its row), and a line per State file under state/, from the layout (its path with <n> for an index, its type, an enum's tags, a row's length), in the shape cloud9's `help` reads: `help ctl` prints the verbs, `help state/tracker` the state/ line and every file under it. `commands` is the verb lines alone, unindented, the sketch's own words (App.commands) last. A ctl read points at both. ctl takes the script's input verbs live: click, move, down, up, wheel, wheel-x, cancel, key, hold, release, type route their events at the wall clock through script.input, the same code a script runs, with no frame of their own: the next frame feeds them to update. Order: ctl's own words, then the input verbs, then a console line (and through it the sketch's); so a sketch command named like an input verb is shadowed over ctl (none is today). Tests: test-control, a new test: ctl's click and hold reach the pending events, a short click is refused (ExpectedPoint), README and commands read the rows and the layout: 40/40 steps, 10/10 tests. Live with the replay fixture: README read over 9P, `down 5 5` written to ctl moved state/pressing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* The State as files: state/ in the 9P tree, a directory per struct and arrayGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | state/ serves the running sketch's State nested: a directory per struct and per array, a file per value, state/tracker/songs/3/bpm. A read is the value as get shows it, and a newline; a write is the console's set with the file's path (control.zig builds `set tracker.songs[3].bpm 90` and runs it through runLine, so it stops a replay, logs, marks a jump and notes the line like any set). Numbers, bools and enums are written; optionals, unions and the like read as `<N bytes>` and refuse writes. An array of scalars (a vector's lanes, talk.text) is one file of its values, blank-separated; an array of arrays is a directory of such rows (grid/1 for grid[1] of a [2][3]i16). So a file is one value or one row, the run of values one set names, and stays the size of a row however large the array; and paths keep the State's own shape. An array of structs is a directory of indices: drat-meout's patterns, 8x16x16x4 of {pitch, velocity}, are state/tracker/songs/<n>/patterns/<n>/<n>/<n>/ pitch, reached by walking, listed a dimension at a time. state_files.zig does the walking from a (Layout, bytes) alone: lookup, readdir, read, the set path and a README line per file, so the save's newest State and a sketch's defaults can be served the same way. A node is the layout's first leaf under it, its depth and the element's offset, with bit 62 set (bit 63 stays the sketch's). A node a reload made stale is refused, "StateLayoutChangedWalkAgain". fields.setRow sets a row from its words, all or none, and the console's set takes it: `set talk.text 104 105 0`. The engine keeps names up to 64 bytes (from 28), for long field names. Tests: test-control (now also "the State as files" and "a row of scalars"): 40/40 steps, 9/9 tests. Live, headless, the replay fixture over plan9port 9p: ls state, read and write dots/buffer/3/kind and the position vector, a bad value refused as InvalidValue. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* One verb table: the flags, the console's, the script's and ctl's words are rowsGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Six hand-kept lists said one vocabulary: root.zig's parser, its usage and its header; the console's completion list, its help strings and the execute chain; Host.zig's list of lines that do not move State; the script's header comment and its step chain; control.zig's names and its magic node numbers. Now each is a table, and the parser, the help, the completion and the dispatch read it. - root.zig: `Flag`, an enum, and `flags`, a row each (arg, doc): the loop looks the word up, takes its argument when the row names one, and a switch sets what it means; `usage` is made from the rows at compile time (the same text, and a line for --help). Errors say the flag and what it needs. - Console.zig: `Verb` and `verbs`, a row each (args, doc, moves_state): execute is a switch on the verb, a line whose first word is none goes to the sketch as before; Tab completes from the rows (a verb, and with each lowercase word its first argument may be: `seek start`); `help` prints the rows wrapped to the log's width, `help VERB` its line. - Host.zig: movesState asks the row; a sketch's command moves State. - script.zig: `Verb` and `verbs` (args, doc, frame, input): step is a switch, a row with `frame` is followed by one; the input verbs are `input`, which a 9P ctl will call live. - control.zig: `File` and `files` (mode, doc), a node being its number (the same numbers); `Verb` and `verbs` for ctl's own two words. Behaviour is unchanged but for help's text, completion's list (the same words, and `timing`, `play`, `seek`... alone) and errors' words. The diff adds more than it deletes (+630 -521): the rows carry a line of doc for every verb, which nothing had before. Tests: test-control, test-timing, test-setup, test-same, test-kill, test-past, test-import, test-paths: 70/70 steps, 29/29 tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
*-. Merge one State in one file, GPU sound at the host's lead, and PDF pages as ↵Gabriel Schneider31 hours
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | objects The Store's deletion with shared-page keyframes and the 64 MiB cap; f.audioBuffer and in.lead with spheres on them; the embedded-SVG image, Typst's root, part, and the manual example. No conflicts; zig build test: 179/179 steps, 140/140 tests; spheres 75/75, micscope 67/67. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * | audio: a GPU buffer streamed within the frame, at a lead the host measuresGabriel Schneider31 hours
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A compute shader's output was heard only after the sketch read it back (f.download, a frame later) and pushed it behind a lead of its own choosing; spheres kept 100 ms, and a change it made left for the device 96 ms later on average (measured, dummy driver, 60 Hz). f.audioBuffer(key, buffer, .{ .count, .offset }) streams `count` f32 a shader wrote: the host copies them back while it runs the frame's commands, waiting on the copy's fence (Executor.read: 0.2 ms on average here, 2 ms at the 99th percentile on a loaded machine), and queues them on the stream, so nothing is in flight between frames and the sketch keeps no books. Input.lead says how far ahead to make sound: the slowest of the last 64 frames' worth of samples (timed between the ends of the frames' commands, where the pushes are), plus the device's pull (what SDL takes from a stream at once, read from the device: 1024 here), plus half a pull for each underrun, a sample less each frame after; capped at 8192. A sketch pushes `in.lead -| in.stream(key).queued` a frame, and its change leaves after about what is queued ahead of it, a pull: 19 to 27 ms on average with SDL's 1024-sample pulls, 6.3 to 6.5 ms with 256 (SDL_AUDIO_DEVICE_SAMPLE_FRAMES; 17 under heavy load). Stream.underruns counts the pushes that found a stream empty though the frame before had fed it (a gap). The voices keep their 2048 samples: mixed to the lead, a one-shot longer than it is mixed over several frames, and voices.script's expect-audio and expect-no-audio, which look one frame at a time, failed. On the web, audio.buffer reads the buffer back with mapAsync and queues it on arrival, in order, counting it as queued meanwhile; in.lead stays at 100 ms there. The measurements (a probe patched into the host for the purpose, kept out of the tree) are in the 02-pardes-code scratch, .scratch/sketch/gpusynth. Tests: the lead's arithmetic (audio.zig, in test-audio's filter); spheres' play script checks its stream is fed. zig build test: 164/164 steps, 49/49 tests run (the rest cached); zig build test-audio: 48/48 steps, with the voices sketch's wasm, so web.zig compiles; voices.script passes four runs in four. web/host.js: node --check only, no browser run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | The cap: a save is at most 64 MiB, State half of it, history dropped oldest ↵Gabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | first A save grew without bound. Now Sessions.max_save is 64 MiB and layout.max_state 32 MiB, so history always has room (the compile error says so: "State is N bytes, and may be 32 MiB, half of a save, so history has room: ..."). A commit that leaves the file past the cap trims it (Sessions.trim): one transaction drops history oldest first, a keyframe by removing its pages (its frame, batch and time stay, so keyframe numbers, keyBefore and marks by index still resolve) and a batch of frames by emptying its slot, until the keyframes' written pages and the batches left count three quarters of the cap; then the file is compacted into `<path>.new` and renamed over it, and the run goes on in the new file (compact now reopens). A dropped keyframe's pages may still be shared by a later one, so a round can free less than it counted: the next round lowers the count by the overshoot, four rounds at most. Never dropped: the present (the newest keyframe and the batches from its own on), the keyframe of the newest mark of each name, the keyframe of the newest clip of each name and every batch holding one of its frames. A session left with nothing loses its keyframes, batches and stretches; its summary stays. Asked for, what was dropped is error.HistoryDropped, which the console says in words ("That part of the history is gone: a save keeps 64 MiB, the newest."). Marks are pinned under the cap: a mark of a new name needs room for a whole State, history trimmed to make it; without, it is refused, error.SaveFull, the console saying how to make room: save over a mark's name (the older one then goes with history) or start another save. A mark over an existing name is always taken. (The spec's "room" rule, refusing only after a trim failed, let one mark take the file past the cap; room for a whole State keeps the cap hard, at the price of refusing early for a big State.) Builds that do not record (`history` false, from Info.record) use the same mechanism with the history limit zero: every commit holding a keyframe drops all it may (no compaction unless past the cap), and the exit compacts, so the disk holds at most the last minute of input while it runs and the present and the marks after. The exit compaction a recording build made past twice its contents plus 64 MiB is gone: the cap's compaction does that work. Measured (Debug, unit test): a trim of a 64 MiB file to 48 MiB takes 165-187 ms (two rounds of drop and compaction, the first ending 0.5% over); a no-history trim at a keyframe, 0-5 ms. ReleaseFast not measured. The console's `marks` reads each mark's keyframe fields, not its State: an older mark of a name may have gone with history (listed "dropped" when its session went whole). Docs: record means "keep history" in App.Options, sketch.Build and abi.Info. Tests: zig build test, 168/168 steps, 137/137 tests. New, in Sessions.zig: 100 keyframes of 1 MiB each with marks at the 5th and 20th: the file never past the cap, the oldest keyframes and frames HistoryDropped, both marks and the newest keyframe whole, the present's frames readable; without history, 20 keyframes and a mark: only the mark and the present stay, the file compacted at exit under three times the State and the present reopening whole; 2 MiB marks until one is refused (SaveFull, the file under the cap), then one over an old name taken and the file under the cap, every mark whole. micscope 67/67, 10/10; spheres 75/75, 3/3; noc e2e 292/292; the drat-meout copy 87/87, 30/30. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | The present lives in the save: one file a sketch, the state file goneGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A sketch kept its live State in a mapped state file and its history in a sessions database beside it. Now the database is the save, the one file: the present is its newest keyframe and the frames logged after it, and a run starts there (Sessions.present: the newest session with a keyframe, its last keyframe loaded and the frames after it read). Host restores it (migrating across a layout change, as a seek does) and replays the frames through `update`, unlogged, `started` as it was fed (true only from a session's first frame); played by another build, they are not replayed, and the run says how many frames that was. The run's first keyframe then starts from the present's pages, so a session costs what changed since the last one. --fresh still starts from defaults, the save untouched. State is process memory (memory.State: one page-aligned allocation, its layout, and its layout header for the stretches); a reload's adopt allocates the new layout's defaults and migrates the old bytes into it, and returns null when unchanged. Gone: StateFile, its slots, used bits, resize, dropSnapshots and the adopt that rewrote a file's header; the sketch-facing `Host.state` keeps `layout`; Timeline restores into `state.live()`. `adopt` no longer runs `init`: openPresent does when there is no present. Every run saves: the database is opened in a file for every run but a scripted one from fresh state (memory, nothing on disk) and an export (none). So release builds keep their State as before, and marks and clips work there; `.record` keeps or trims history (next change). The save is `<stem>.xitdb`, `<stem>` being --state without `.xitdb` or `.state`: `--state x.state` and `--state x.xitdb` name the same save. Defaults: `.sketchbook/<name>.xitdb` under zig build run, and `$XDG_DATA_HOME/<name>/<name>.xitdb`. A sketch's appended files are `<stem>.<name>` (micscope's takes: `.sketchbook/micscope.take-3.f32`, where Phase 1 wrote `micscope.state.take-3.f32`; that naming never left this workspace, so nothing of the user's is renamed). A scripted run from fresh state or an export appends to `<stem>.<pid>.<name>` and removes those at exit; the private state file and the exit's moving of files by prefix are gone from root.zig. Old state files: in a new save, `<stem>.state` (one slot or eight, any of the three formats) is imported once: slot 0 becomes the present (in today's layout), slots 1-7 marks "1".."7" (migrated to it, as before); the file is read through a read-only mapping and left exactly as it was. It is never read again: the save then has a session. A file that is no state file is said and left. .sketchbook/'s move of an older build's `<stem>.state` from beside it stays, now by stem. sketchbook-probe is deleted (86 lines, its build step, Sketchbook's probe_exe, App.addProbe): it mapped the state file. Reading the save instead would show State as of the newest keyframe, up to a minute old, never the frames after it, which only `update` can turn into State; and it would need a read-only open the host has no other use for. The planned 9P state/ tree reads live State from the process. A kill -9 now loses what the session log always lost: the frames not yet committed (under a second: in test-kill 15 of 255 frames, the next run starting from frame 240's State), keyframes and marks queued since the last commit (a mark commits at once, synced), the session's end time and an open clip's end. The mapped file lost nothing to a kill. A power loss reopens at the last commit the disk holds whole (`mend`); commits are fsynced only for marks and at exit, so what the OS had not written back is lost (not measured); the mapped file, never synced, could tear page by page. Measured: drat-meout's State, 20 extra jump keyframes in a 2,400-frame script, 100,708 B more than the same frames without them: about 5 KB a keyframe, where the whole State (17.7-20 KiB) was written each time. Tests: zig build test, 168/168 steps. test-kill runs for a recording and a non-recording build, and the second run checks `updates` is 240 (replayed), not only the session's frame count. test-paths: the XDG directory holds `replay.xitdb` alone; .sketchbook/ holds `.gitignore` and `replay.xitdb`; the next run's State is the one the last left; an older `old.state` beside .sketchbook/ is moved in once, never over a file, and left as it was when it is no state file. test-same: a run from fresh state leaves no file at all. Rewritten: memory.zig's state file tests as State's (migrate, unchanged) and OldState's (refused untouched; drat-meout's v1 fixture imports every value, the file unchanged), Host's snapshot import as importOld (State live, two marks, the file byte for byte as it was), Host's setup test without a file, the timeline test on a State. micscope 67/67, 10/10; spheres 75/75, 3/3; noc e2e 292/292; the drat-meout copy 87/87, 30/30. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Keyframes share pages: each writes only the pages of State that changedGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A keyframe was a whole copy of State, so a 4 MiB State edited once a minute wrote 4 MiB a minute. Now a keyframe stores State as `pages`, an xitdb list of 4 KiB blobs (the last one shorter), with its `size`: it starts from the list of the keyframe before it (its slot written, and the cursor frozen, so a keyframe queued in the same commit is copied, not changed), and puts only the pages whose Wyhash differs from that keyframe's, which Sessions keeps in memory (`hashes`, one u64 a page). An all-zero page is an empty slot: no bytes. `written` records the bytes of pages a keyframe wrote, each page being written by exactly one keyframe, so the live size the exit compaction weighs is the batches plus every keyframe's `written`. A State unchanged since the last keyframe is still skipped (but before a reload), now by its page hashes. Keyframes from before pages keep their whole `state` bytes, and `load` reads both (`Loaded.paged` says which). Export and import shared pages once: `copy` remembers each blob's place in the source and the slot it was copied to, and writes that slot again for a page another keyframe already brought (xitdb takes slot writes). Measured (Debug, unit tests): a 4 MiB State, one u64 edited a minute, grows the database 144-153 KB a minute, 86 KB of it the minute's 3,600 ticks; a keyframe alone in a commit is 10,160 B with one changed page and 1,376 B with none (it was 4 MiB either way). A 1 MiB session of ten keyframes a byte apart exports to 1,133,486 B (it was over 10 MiB). The hash pass over State, best of five on a loaded machine: 2.2, 36 and 71 ms at 1, 16 and 32 MiB in Debug; 0.04, 1.3 and 2.9 ms in ReleaseFast. Not done (the spec's later fast paths, nothing needs them yet): restore copying pages without defaults and migration for an unchanged layout, the divergence check comparing pages first, formatPath skipping leaves. Tests: zig build test, 166/166 steps, 134/134 tests. New: a 4 MiB State edited each minute for ten minutes, under 230 KB a minute and every keyframe reading back with exactly the edits made before it; a lone keyframe under 12 KiB with one changed page and under 8 KiB with none; an exported ten-keyframe session under 1 MiB and an eighth, reading back. Changed: the compaction test's live size counts five 8-byte keyframes, not six (the first State is all zeros, an empty page). test-kill, test-past, test-import, test-same and test-paths unchanged. micscope 67/67 steps; spheres 75/75, 3/3 tests; noc e2e 292/292; the drat-meout copy 87/87 steps, 30/30 tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | micscope: a take starts its file empty; a deleted take's file stays, and whyGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Phase 1 left two loose ends in micscope's take files. A new take could continue an old file when its id met one already written without a jump in between (the jump is what moves next_id past written files), and a deleted take's file stayed on disk. The host gains one call beside appendFile: f.host.writeFile(name, bytes) writes a new, empty file of that name, through the same vtable entry with a `replace` flag. The old file is unlinked, so a readFile mapping of it keeps its bytes, and the host's cached mapping is retired (kept until exit, the sketch may hold it) so the next readFile maps the new file. The web host writes nothing, as for appendFile. micscope writes each take's file so when the take begins: on the frame whose transport request is newly `recording`, live, and not a jump (a jump's requests are restored State's, not a beginning; a fresh Session counts old requests as handled, so a restart mid-recording keeps its file), before the takes are read; `open` writes a file's samples so too. A deleted take's file stays: its State entry comes back with any seek or mark from before the delete, marks are kept with no end, and an exported session carries them; neither the sketch (which cannot see the history) nor the host (which cannot read State's meaning) can tell when none is left. So "never, safely": the file is kept. Tests: zig build test, 164/166 steps, 132/132 tests (the appendFile test now also replaces a file and reads back only the new bytes); the one failure was the Typst bench's 1 ms bound (1.024 ms), timing code this change does not touch, on a machine loaded by other builds; it passed in the next full run (166/166, with the change above this one). micscope's zig build test, 67/67 steps, 10/10 tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Delete the Store; State is checked against the 64 MiB a save holdsGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A sketch's data is State: flat bytes, what grows has its capacity in its type. The Store, a heap in a file mapped at 0x2000_0000_0000 with 64 GiB reserved, its power-of-two allocator, its root adopt and migration, and its test, are gone from memory.zig; so are Context.store and store_root, Info.store, Memory.store, the Store declaration's glue, Init.store, Frame.store and Console.store, the web host's store in wasm memory, the host's StoreFile wiring and `<state>.store` file, the `.store` suffix in moving an old state into .sketchbook/, the build's tests' `rm` of it, and layout.check's `pointers` flag (State is the one checked memory now). Its one real user, micscope, moved off it in the change before. Old `.state.store` files are not read, converted or deleted, and stay ignored by .gitignore. A sketch that still declares a Store gets no error for the declaration: nothing reads it, and a `*Store` parameter is a compile error (no argument of that type). layout.of(T, .state) refuses a State bigger than layout.max_state, 64 MiB, one constant: "State is N bytes, and a save holds at most 64 MiB: lower a capacity (an array, an sk.List), or keep what need not be saved in Session." The pointer-hash gap the spec found (a Store pointer's element type changing kept the old bytes) is gone with the only persisted memory that held pointers. README: no Store row, allocator row, migration paragraph, file bullet or known limits; draw and command lose their store parameter; State's row says 64 MiB at most; data that grows and is the user's work goes in a List in State or, bigger than a save, in files the sketch appends to. Tests: zig build test, 166/166 steps (the store's unit test gone; new: a 65-MiB State fails to compile with the message above, by expect_errors). micscope, spheres, noc's e2e and drat-meout's test unchanged and green. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | micscope off the Store, its takes files written through Host.appendFileGabriel Schneider31 hours
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The library could read a file and not write one, so micscope kept its takes in the Store: a tape appended every frame while recording, which a save of 64 MiB could not hold (under six minutes of 48 kHz audio, and micscope allows ten-minute takes). Now a sketch has one call that writes: f.host.appendFile(name, bytes) appends to `<state>.<name>`, beside the state file (in .sketchbook/ under `zig build run`), creating it, and returns the file's path for readFile, or "" when nothing was written. It is pointer and length in, a C-callconv entry in the vtable like newSound. Only draw and command have a host, so a write is not replayed, like sound. The web host writes nothing and returns "". readFile still maps a file once, so what is appended after is not in what it returned. A scripted --fresh run works on `<state>.<pid>`; the files it appends to are `<state>.<pid>.<name>`, and the exit now moves every file of the run (found by that prefix in the state's directory) to the given name, or removes them for an export, where it moved the state and its store by two fixed suffixes. micscope: State lists the takes (sk.List(Take, 64): id, source) and the counter, next_id; `update` adds a take when recording starts and removes one on delete. Each take's samples are `take-<id>.f32` (mono f32 at the host's rate), appended to by draw as it records and by `open`, which also puts them straight into Session (the web keeps no files). Session holds the tape (every take's samples, read from their files once a process) and a clip per take (start, len, and heard, the playhead, which a restart no longer keeps); draw makes the tape follow State: a take State lost leaves it, one it lacks is read from its file. A deleted take's file stays, so a seek back finds it again; after a jump (start, seek, load, set, reload) draw moves next_id past take files already written (--fresh keeps them, and a seek back finds the future's) with a `next-id N` command. Gone: the Store, the remove request, the `takes N` command that told State the Store's count, adoptTape. Old micscope.state.store files are not read: their takes stay in them. README: appendFile among the host calls, a paragraph on it, and the private run's appended files. Tests: zig build test, 164/164 steps, 133/133 tests (one new: appendFile appends beside the state and names the file). micscope's zig build test, 67/67 steps, 10/10 tests; transport.script reads `takes.len`, loses the miscounted-takes check with its mechanism, and gains a deleted take read back from its file after `load` and the counter moved past written files. Pictures: the four scripts' 18 screenshots before and after, compared by pixel: the differences are where two runs of one build differ by themselves (playheads, the microphone's take lengths, the live view). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Merge the audio work and the incremental reload loopGabriel Schneider31 hours
|\ | | | | | | | | | | | | The mixer's knee, newSound, sfxr, voice rate and groups, the scope's public pieces, micscope and spheres as examples; with the loader workaround for Zig 0.17.1's incremental linker and the panic-trace link. The README's hot-reload bullet takes the incremental loop's paragraph; zig build test: 164/164 steps, 132/132 tests. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * Keep a loaded sketch library's name valid, for panic tracesGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | A panic's stack trace finds a library's debug info by the name dlopen was given, and the load link was deleted right after loading: every frame in a sketch printed as ??? (a sketch that links libc; one that does not is not seen by Zig's own dl_iterate_phdr at all). Link and fd now live as long as the library is loaded, and Library.close removes them; a host that dies leaves its dangling links in $XDG_RUNTIME_DIR. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * Load libraries from Zig 0.17.1's incremental linkerGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `-fincremental` selects Zig's new ELF linker, and 0.17.1's writes DT_VERSYM without DT_VERDEF or DT_VERNEED when nothing is versioned: glibc then reads a null version table at the first relocation against an export, and dlopen faults. When a library has that shape, the host loads a copy of it in an anonymous memory file with DT_VERSYM dropped (nothing in it is versioned, so nothing is lost); the build's own file is never written, and every other library loads as before. The copy is 10 ms for the counter's 28 MB library. Fixed in Zig after 0.17.1 (6d27011edb): the check then never fires. The reload test's second build goes through the new linker. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | audio: a voice's rate (its pitch), and groups of voices under one gainGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Voice.rate is the voice's playback speed and so its pitch: 2 is an octave up and half as long, 0 holds it, and changing it does not restart the voice. The mixer keeps a fractional cursor and resamples by linear interpolation between a sample and the next (the last toward silence, or the first when looping): the least code that sounds right, a little dull far from 1; at rate 1 the samples come out exactly. An infinite or NaN rate ends the voice instead of crashing the conversion. Voice.group (0-7) puts a voice under a group's gain, which draw declares each frame with f.gain(group, value) (Command.gain); a group not given one plays at 1, so it is declared state and replays like the voices. The mixer glides each group toward its gain by 1/480 a sample (10 ms for a full swing), so a gain set in one step does not click. Music ducking under speech is then the sketch lowering one number; nothing ducks by itself. The web host ignores gains as it ignores voices. Test: half and double speed against the interpolated samples, rate 0 holding, an infinite rate ending; a looping voice in group 1 at gain 0.5 gliding there and staying while group 0's is untouched, and going back to 1 when the gain is no longer declared. test-audio also builds the voices sketch for the web, which compiles the web host's newSound and gain. The README lists rate, group and f.gain with what they do. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | host.newSound: samples a sketch made become a sound, played by voicesGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A sketch that synthesised a one-shot had to stream it (and keep a replay from re-firing it by hand) or encode a WAV for decodeSound. host.newSound (samples) copies mono samples at in.sample_rate into the host and gives an Audio like a loaded one, so the one-shot is a voice: reconciled by key and serial, mixed, faded and limited by the host. It is kept for the life of the host like every sound, and .none if a sample is not finite. The vtable entry is C callconv (pointer and length), as anything new in abi.zig is, for a second host; the web host keeps the copy for samples() (its voices are silent). Tests: a unit test that the sound is a copy and that NaN and infinity are refused; test/voices.zig makes a 1000-sample blip in setup and declares it under a serial space bumps, and test/voices.script checks it sounds once, stays silent through a recording of it played, stepped and seeked, and sounds again for a new serial. For that, expect-audio KEY also passes when voice KEY was mixed since it was last asked, and expect-no-audio KEY says it was not. zig build test-audio runs the script too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | audio: the voice mix plays at true volume below a knee and is limited only ↵Gabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | above it Every mixed sample went through x/(1 + |x|), so one voice at 0.5 played at 0.33, bent. The mix now passes through untouched up to 0.75 (-2.5 dBFS) and above it follows knee + (1 - knee)·u/(1 + u), u the excess over the room left (the old curve is its knee-0 case): same value and slope at the knee, rising, tending to 1. A clip normalised to full scale only has its peaks bent (1 plays at 0.875); two at full scale sum to 0.958. Per sample, no state, no lookahead, on the frame thread as before. A unit test checks the curve: identity to the bit below the knee (every 997th float, both signs), rising and at most 1 from the knee to infinity (every float near the knee), odd, slope 1 at the knee; `zig build test-audio` runs the mixer's tests alone. The README says what the mixer does, and that SDL clips the total of the voice mix and the streams. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Bound a scripted run's memory sessions; check a script records the same twiceGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A scripted run from fresh state records in memory, and a very long one grew without end. It stops at 256 MiB (ten hours or more of play at 60 Hz; a write the memory database cannot make, out of memory included, is the same): once, a warning, and no more frames, while what it holds still reads (marks, clips, past sessions). test-same plays test/past.script twice into two databases and compares them value by value with test/same_sessions.zig, but for a session's started and ended (the wall clock): every frame, keyframe, stretch and mark follows from the script alone. A third run from fresh state leaves its state file and no database. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Mend a sessions database a crash tore, compact one at exitGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A database whose last commit a power loss tore (its root header written, its bytes not all) was refused and renamed aside, a new one begun. Now it is opened at the last commit before the tear whose trailer verifies and whose sessions read whole, scanned back from the end, as pardes's state file is; renaming it to <path>.broken.<seconds> stays the last resort, when no commit is whole, and nothing is deleted. Every commit leaves the nodes it copied behind, about a kilobyte a second of play: a clean exit compacts the file (into <path>.new, synced, renamed over it) once it is 64 MiB and past twice what its batches and keyframes hold plus 64 MiB. Tests: a database of two sessions, cut at six places inside its last commit, opens at the commit before with every frame of both; one with no whole commit is kept aside byte for byte; a compacted one is smaller and holds every frame and keyframe. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Export a session to a file of its own, and import oneGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | export-session [S] FILE writes session S (this run's by default, committed first), with the marks and clips that point into it, as session 0 of a new database: written beside FILE, synced, renamed over it. import FILE appends each session of such a file to this database, from "import <file name>", its marks and clips renamed NAME@<file name> (cut to 32 bytes). The copy is value by value, the same few lines for both, over whatever a session holds; sessions lists where one came from. test-import records test/past.script's session, exports it, imports it into another database and replays it there: the mark it carries is the State half a second in exactly, and two seconds in is frame 120's. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Keep a sketch's files in .sketchbook/, a shipped game's in XDGGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | zig build run, probe and export pass --state .sketchbook/<name>.state. The host makes that directory with a .gitignore of * (a sessions database grows, and the jj snapshot build_info takes would commit it while under a megabyte), and moves the state and store an older build kept beside it in once, with renameat2(NOREPLACE): when both exist nothing moves and the host says so. Without --state an interactive run keeps its files in $XDG_DATA_HOME/<name>/ (~/.local/share without it), not the cwd; a script or an export still uses sketch.state. test-paths checks all three cases. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Play past sessions back, re-synced at their keyframesGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | play session S [at SECONDS] restores the session's keyframe before that time (a binary search over its keyframes' times), replays its frames up to it and leaves it paused there; without a time it plays from the start. At each later keyframe the replay reaches, the State is compared with it over the leaves migration kept: a keyframe taken of what update made (periodic, mark, before a reload, exit) that differs is reported once, "diverged before frame F: N values, first <field>", and every keyframe is restored, so a replay across a jump the log does not hold (set, load, a sketch command) goes on from the State that followed it. A session built from another source or build says so. The console's status line names the session, frame and time, the mark, the clip and where it records. test-past records a session, replays it by the same build (the mark's State exactly, frame 120's two seconds in, no divergence), then by a build with an edited fixture (one divergence, before the mark). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Make snapshots named marks and recordings named clips of sessionsGabriel Schneider31 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state file keeps live state only (SKETCH03, one slot). save NAME is a keyframe and a mark in the sessions database, synced to disk; load, diff, snapshot and expect-snapshot take mark names, through the keyframe's own layout migrated to today's, compared over the leaves migration kept. A file from before (SKETCH01/02) has its used snapshot slots imported as marks "1".."7" at open, then drops them; a run that records nothing leaves them alone. record NAME, stop and play NAME make and play clips: a frame range of a session and its start keyframe, nothing overwritten, nothing invalidated by a later save, no capacity. The 64 MiB .inputs file, its --fresh memset and Timeline's Bank are gone; numbers still work as names, so every existing script runs unchanged. Event times in a clip are the session's, not restarted at record. reload.script also checks that a field a reload drops is still in the keyframe taken before it (expect-key). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | Record every run's frames to a sessions database in xitdbGabriel Schneider31 hours
|/ | | | | | | | | | | | | | | | | | | | | Live play was recorded only after someone typed record N, into 16 fixed slots. Now every run is a session in one xitdb database per sketch, beside its state file (<name>.xitdb): an append-only log of the frames live update was fed, one commit a second of session time, and keyframes of the State at start, every minute, on jumps, before and after reloads and at exit. A kill -9 loses at most the uncommitted second (test-kill). Whether a build records travels in the sketch: App.Options.record, null meaning Debug, reaching the host as Info.record. Scripted runs from fresh state record in memory, exports not at all. Each stretch of a session keeps its build, layout and Info.source: the repository revision (one jj or git call per build, build_info), zig version, backend and mode. Sessions.zig takes plain data (bytes, events, strings, a path, an Io), so a second host can drive it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Load sketch libraries through a symlink and identify builds by statGabriel Schneider31 hours
| | | | | | | | | | A load copied the whole library to $XDG_RUNTIME_DIR (a read/write loop across filesystems) and then hashed all of it for the build id: 40 ms for a 10 MB Debug library, 200 ms for drat-meout's 58 MB. dlopen only needs a fresh name, so the host links one to an fd open on the library, which also pins the file a build may rename over meanwhile. The build id recordings carry is a hash of the file's inode, size and modification time: Zig's own linker writes no build-id note in Debug.
* Refuse a sketch library built by another compiler, backend or modeGabriel Schneider31 hours
| | | | | | | | abi.hash now covers the zig version, codegen backend and optimize mode: Zig's own calling convention (Host.VTable, every Allocator) differs between them, so a Debug host loading a ReleaseFast or LLVM library faulted on its first draw. Libraries export sketch_build, and the host's refusal says what differs and what to run instead.
* gpu: add a post-process pass with optional depth sampling, and describe the ↵Gabriel Schneider31 hours
| | | | | | | | | | executor pardes shares `f.postProcess(source, target, .{...})` records a fullscreen pass that samples a completed render into a distinct target image: colour at fragment binding 0 and, with `sample_depth`, depth at 1, which needs the source's latest pass to have depth and one sample (missing depth, multisampled depth and feedback loops are rejected). The scene format's version 4 carries it, the executor records it on the caller's command buffer and owns the sampler, the web host does the same with its texture and sampler pairs, and native profiling reports the work as `postprocess`. The README says how to use it. docs/pardes-rendering.md describes the executor as pardes uses it for addon scenes: a borrowed SDL GPU device, `record` into the caller's command buffer, `run`, `output` and `postProcess`. The working copy as it stood on 2026-11-16; message written by Claude from the diff, at the author's request.
* Add display-paced frame timing and presentation feedback in ZigGabriel Schneider47 hours
|
* Add glTF scene rendering, resource setup and 9P controlsGabriel Schneider2 days
|
* host: add optional Tracy profiling and reduce upload allocation stallsGabriel Schneider5 days
|
* Add reusable GPU backdrop filtering to the shared canvasGabriel Schneider5 days
| | | | Draw native GPU frames through the same bounded canvas used by headless capture. Backdrop commands reuse one snapshot and shader state, with an unchanged fallback on unsupported renderers. Verified through native debugger lenses, restart, and repeated font zoom checks.
* sketchbook: text rasterized at one scale and drawn at another ↵Gabriel Schneider6 days
| | | | (f.textScaled), steady under a moving camera
* sketchbook: text in six faces of the Go family, all bundled (f.textIn, ↵Gabriel Schneider6 days
| | | | host.textSizeIn, sk.Face)
* sketchbook: shapes antialiased up to 3840x2160; SDL's Vulkan backend no ↵Gabriel Schneider6 days
| | | | | | longer defragments (it lost a frame's first draws) Co-Authored-By: Claude Fable 5.2 <[email protected]>
* sketchbook: frames for ffmpeg (--export, on a clock of its own), text sizes, ↵Gabriel Schneider6 days
| | | | | | a font from the environment Co-Authored-By: Claude Fable 5.2 <[email protected]>
* sketchbook: drop a patch leftover (standalone repo: tests pass as they are)Gabriel Schneider6 days
| | | | Co-Authored-By: Claude Fable 5.2 <[email protected]>
* sketchbook: a drawing layer on top, host fixes for replay and migrationGabriel Schneider6 days
|
* sketchbook: Zig 0.17, a Store on disk, requests, a scope (waveform, ↵Gabriel Schneider6 days
| | | | spectrum, spectrogram), audio codecs and fonts, web host
* sketchbook: await in scriptsGabriel Schneider2026-09-25
| | | | | | await FIELD VALUE plays frames until a state field holds the value, for up to a minute: for waits whose length is the sketch's business, such as a line of dialogue typing out.
* sketchbook: fills blendGabriel Schneider2026-09-25
| | | | | | The renderer's draw blend mode was left at SDL's default, none, so every translucent fill (panels, labels, HUD bars) drew opaque natively while the web honored alpha. It blends now.
* sketchbook: what the game's review neededGabriel Schneider2026-09-25
| | | | | | | | | | | - input.started: true on the first update of a run, never after a reload, for a sketch to stop what should not resume from saved state. - A console line that errors fails its script. Sketch commands answer unknown, done or failed (abi.Outcome) instead of a bool that hid errors. - addScript also takes the hot-reloadable library, run through the generic host, so scripts can reload a real build. - Sounds that do not load are .none, not an empty clip. - sk_tag reads an enum field's tag name from the web build, for tests.