| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The option was read into every key (default 0.08) and never used. Now
animation i of a play of n starts i * lag * each after the play does,
each = seconds / (1 + lag * (n - 1)), so the last still ends with the play
and the play keeps its length: manim's AnimationGroup run to a run_time. A
lag of 1 is one after another. An object two animations of one play change
moves with the first (Change.at); the camera with the first camera
animation. Compiled and live scenes agree: a live play shows an animation
from its own key's start, as the compiled lookup does. Default 0, so every
key of a scene without .lag is the bits it was (start + 0, seconds / 1).
What changes: examples/manual.zig, slide 1: 83, C0, 01 and add eax, 1
were written all at once over 1.5 s, now one after another (0.79 s each,
0.24 s apart); the six labels and three bytes of the flight played
together, now in order, 0.12 s apart, 0.58 s each (exported frames 22.0-
23.4 s and 25.1-26.4 s). vecanim's intro passes .lag to a play of one
write: unchanged.
Tests: anim: a lagged play (four at 0.5, then two at 1) live against
compiled at 16 instants, and its times. test-anim, test-talk, test-manual
pass; the compiled scene's export (92 frames), the talk's two (364) and
every scene screenshot are byte-identical to before, but for the player
bar's wall-clock record time; manual's exports differ in those 29 frames
only, its screenshots not at all.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
s.part(of, .{ .x, .y, .w, .h }) takes the shapes of an object whose
bounds' centre lies in the rectangle (x, y its centre, in the object's
units: the same literal s.rect would lay over it standing at the origin
at scale 1) and makes them an object, around the rectangle's centre, so
indicate, scaleTo and rotate turn it about itself. The object draws the
rest from then on (its new cut), so a part can be written in, moved
away or morphed while the page around it stays. A part stands where its
shapes stood and shows as the object does after the plays laid so far:
taken from a page that has faded in, it is there; taken first, it fades
in with nothing until played. A shape goes to the first part that takes
it; parts of parts work the same way. transformInto morphs into the
whole of its target, as if nothing were cut from it, so a morph's result
can be split into parts taken after it (which then stand where they
were and show as it does).
How: Source.part holds the object as it was (a pointer: in a compiled
scene to a comptime constant, in a live one into the frame's arena) and
the area; Object.cut lists the areas taken from it; both are in the
object's id. anim.sift makes either drawing out of the whole one, sharing
its geometry; the Painter sifts its cached whole, so a page is parsed
once however many parts it gives. In a compiled scene the part follows
its object through the plays laid before it was taken (keys copied,
moved by the area's centre at the object's scale and rotation); in a
live one it starts from the object's shown and settled poses. build now
also moves a shape's clip with its centring (it moved the shape and left
the clip behind).
Test, at the end of root.zig: a row of three squares, the right one
taken once the row has faded in, then each moved: the compiled and the
live scene agree at every instant, the part fades with the row, stands
where its square stood, and the row keeps the other two.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The Typst step ran in .zig-cache/typst with Typst's default root, the
directory of the file it compiles, so a source could name no file but
one in the cache: #image("/home/me/manual.pdf", page: 31) failed with
"would escape the project root". It now runs with --root /, which
makes an absolute path in a source the file's own path; relative paths
still resolve in the cache, as before.
Why / and not the build root: the file a scene names (a manual, a
paper) lives where its owner keeps it, outside any project, and a copy
or link under the project is one jj add away from being committed. /
is safe in that Typst only reads what a source names, and a scene's
sources are its author's code, compiled by a build that can already
read and run anything. The cache is still keyed by preamble and source
alone: a file changed in place keeps its old SVG until its cache entry
goes (typst.zig says so).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Typst places an SVG image, and a PDF page imported with image(), as an
<image> whose href is the document in base64; svg.zig skipped every
<image>, so any Typst object holding one silently lost it. The parser
now decodes such a document and walks it into the same drawing, mapped
into the image's x, y, width and height (stretched with
preserveAspectRatio="none", else fitted and centered, as SVG says),
with its own ids, gradients and percentages and nothing inherited from
around it but opacity. It is not clipped to its box (a PDF page never
draws outside itself, and a clip per shape costs the renderers a pass
over every contour). Raster images still draw nothing. The root's view
box and size come from one function both documents use.
Tests: a unit test at the end of svg.zig (ids of its own, stretched and
fitted corners, a PNG skipped); two corpus cases for zig build diff,
image.svg (two data-URI images, one stretched and turned, beside an
outer gradient that shares an id with an inner one) and typst-image.typ
(two SVGs placed by Typst): both renderers match resvg (mean 0.09-0.11).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 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, `<name>.xitdb`; the present restored and
replayed at start; keyframes as pages and what they cost, measured;
layout migration as before; an old `<name>.state` imported once and
left as it was); "Where files go" lists `<name>.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 `<stem>.<name>` 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-<id>.f32`.
Tests: zig build test, 168/168 steps.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |\
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`-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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A sketch that analyses buffers of its own (micscope's tape of takes) had
to copy the scope's shaders to run them. scope.kernels.{waveform,
spectrogram, spectrum} and scope.pipelines.{wave, spectrogram, spectrum}
are now public, documented with what each reads and writes, beside the
parameter and view blocks already in scope.layouts; Scope.gpu.tape is
documented as the history on the GPU for a kernel of the sketch's.
Views.camera, when given, makes the rects world rects: the views are made
at their size there and drawn at camera.toScreen(rect), so moving or
zooming the camera recomputes nothing (micscope's world of panels).
scope.midi(freq, a4), scope.hz(note, a4) and scope.note_names, as
micscope's tuner and spheres' chords each spell them; place() names its
argument freq so hz can be the function.
Test: notes and frequencies convert both ways (A4 at 440 and 442, E2,
middle C, a round trip at 432) and name their pitch class. The README's
scope paragraph says all of it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
02-dont-rat-me-out's synth.zig, a pure and deterministic port of
DrPetter's sfxr, moves into the library as src/sketch/sfxr.zig, exposed as
sk.sfxr: render(params, rate, out) gives a coin, blip, laser or explosion
as samples for host.newSound. Its knobs count in samples at 44.1 kHz, so
the one change is the rate: every length (envelope, arpeggio, repeat,
phaser offset, period) grows by rate/44.1 kHz and every per-sample step
(slides, duty sweep, vibrato, filter coefficients and their ramps)
shrinks by it, to first order for the slides and filters; at 44.1 kHz
each factor is 1 and the samples are the original's to the bit. Two
spellings change without changing a sample: the phaser buffer is
@splat (Zig 0.17 has no ** on arrays) and the phaser delay is clamped
before it is converted, so a long sweep cannot overflow it.
Test: four parameter sets that between them turn every knob render the
lengths and Wyhash of the samples the original rendered at 44.1 kHz (run
once, outside the repo), and at 48 kHz a sound as long within 1 %.
test/voices.zig makes its blip with sfxr in draw, at in.sample_rate, and
is the README's example: a blip in six lines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Recording (sessions, marks, clips, the reload speed-ups under them) and anim's Deck with its example talk, together; no conflicts; zig build test: 161/161 steps, 127/127 tests.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
|
| | | |
| | |
| | |
| | |
| | |
| | | |
An Event says its key (abi.Event.key), which the player and the talk example each spelled out by hand; `zig build talk` shows examples/talk.zig in a window on the generic host, its state under .zig-cache, and `zig build talk-lib --watch` beside it reloads every edit in place.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The player's State is an anim.Deck plus the viewer's settings; keys and
clicks become an Ask: click, space and page down step (space plays or
pauses a scene with no pause), page up and backspace go back a step, ] and
[ go a slide, P plays or pauses, left/right/home/end/,/. seek through
Ask.to and Ask.end. A compiled scene is a talk without gates. The HUD
shows the slide and step, and when the talk waits. Exported, each pause
holds the scene file's hold (1 s). Its frozen hold (held, stopBetween,
proceed) is gone. Scripts read deck.t and deck.playing where they read t
and playing.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
render, paint, reveal, built, stage, guides and labels move verbatim from
player.zig into src/anim/Painter.zig, with the viewer's settings and the
Typst module as parameters, so a sketch that runs a Deck itself paints its
shot the same way: a Painter in its Session and paint() once a frame. The
scene's frame size is anim.width/height and a Shot carries its t. Pixels
unchanged: the scene tests' screenshots and all 92 exported frames match
the previous build's.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
and the Deck
A talk is a live scene re-run from the top every frame, a function of its
time and of the gates opened so far. Frame.gate(open) waits while time runs
on and records the value it opened with; pause() is the presenter's click.
beside and loop are the sub-animations, slide() the second navigation
level, clear() the end of a slide. anim.Deck is the playhead and the gate
log as plain data for any sketch's State: update() takes an Ask (next,
back, next_slide, back_slide, to, end) and runs the talk with the app
mutable, shot() runs it read-only for drawing. A click during a step
finishes it; back cuts to the picture held before the last click; an edit
that moves the last opened gate moves t with it; exported, every gate
holds Deck.hold. Live takes a namespace or a tuple of them (sources) and
exposes frame. Builder.pause, Instant.clock and Frame.clock are gone: t
runs through gates. A test-anim step runs the module's tests and the
player's scenes.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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-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
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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 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
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Each comptimePrint costs about a millisecond of comptime, and a sketch's
State, Session and Store reflection makes hundreds: drat-meout's library
spent about 0.4 s of its sema on them. Numbers are spelled by a small
decimal function instead; the signatures, leaf hashes and tag strings are
byte for byte the same, so state files keep their meaning.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
The comptime walk over the shared types cost about half a second of every
sketch library's compile. abi_hash.zig runs it at build time, once per
change of the abi sources (watched like any input), and build.zig hands the
number to host and sketches as the module abi_hash; abi.hash folds in the
build as before. The value is the walk's own, computed for the build
machine in Debug.
|
| |/
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|