From 62ab82af9da007a8ff04677943809cf541b1e420 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 01:32:18 -0300 Subject: README: one thing a sketch keeps, in one file; what a crash loses; the cap The manual described a mapped state file, a sessions database beside it, a probe, private files for scripted runs and exits that compact past 64 MiB. Now, in The host: "The save" replaces "State file" (one thing, State, in one file, `.xitdb`; the present restored and replayed at start; keyframes as pages and what they cost, measured; layout migration as before; an old `.state` imported once and left as it was); "Where files go" lists `.xitdb` and the files a sketch appends to, `--state x.state` and `x.xitdb` naming one save; "Sessions" says every run is one, `record` decides how much history is kept (a build that does not record keeps the present and the marks, the last minute of input at most while it runs, none after), a crash loses under a second and the next run starts from the last committed frame; a new paragraph, "The cap": 64 MiB, State half, history dropped oldest first and the file compacted to three quarters (about 170 ms in Debug), the present, marks and clips never dropped, a new mark refused with how to make room. The State row and "Data that grows" say 32 MiB; the appendFile paragraph names `.` beside the save; scripts and exports save nothing; the Build API loses `probe`, `addProbe` and `probe_exe`; Known limits gains the hash pass's cost. layout.zig's note on what State may hold says where it is saved; micscope's README names its takes `micscope.take-.f32`. Tests: zig build test, 168/168 steps. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- src/layout.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/layout.zig') diff --git a/src/layout.zig b/src/layout.zig index b3c6520..c585d71 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -13,9 +13,10 @@ //! against a leaf's pattern at lookup time. //! //! What each kind of sketch memory may hold: -//! - State is saved to disk and snapshotted: no pointers, and no host -//! handles (images, sounds, buffers), which only mean something in the -//! process that made them. +//! - State is saved, the one thing a sketch keeps, in keyframes of its +//! save: no pointers, and no host handles (images, sounds, buffers), +//! which only mean something in the process that made them; at most +//! `max_state` bytes. //! - Session lives in this process: anything, as long as pointers go into //! memory the host owns (its heaps, mapped files), never into the sketch //! library, which a reload unmaps. -- cgit v1.3